Exemple #1
0
int main() {
    hazelcast::client::ClientConfig config;
    hazelcast::client::SerializationConfig serializationConfig;
    serializationConfig.registerSerializer(boost::shared_ptr<hazelcast::client::serialization::SerializerBase>(new CustomSerializer()));
    config.setSerializationConfig(serializationConfig);
    hazelcast::client::HazelcastClient hz(config);

    hazelcast::client::IMap<std::string, Person> map = hz.getMap<std::string, Person>("map");
    Person testPerson("bar");
    map.put("foo", testPerson);
    std::cout << *(map.get("foo")) << std::endl;
    std::cout << "Finished" << std::endl;

    return 0;
}
int main() {
    hazelcast::client::ClientConfig config;
    hazelcast::client::HazelcastClient hz(config);

    hazelcast::client::IMap<std::string, Person> map = hz.getMap<std::string, Person>("map");
    Person testPerson("foo");
    map.put("foo", testPerson);
    std::cout << "Finished writing" << std::endl;
    std::cout << map.get("foo");
    std::cout << "Finished reading" << std::endl;


    std::cout << "Finished" << std::endl;

    return 0;
}