18 #include "hazelcast/client/proxy/ISetImpl.h"
19 #include "hazelcast/client/impl/ItemEventHandler.h"
20 #include "hazelcast/client/protocol/codec/codecs.h"
28 class HAZELCAST_API
iset :
public proxy::ISetImpl
30 friend class spi::ProxyManager;
33 static constexpr
const char* SERVICE_NAME =
"hz:impl:setService";
51 impl::item_event_handler<protocol::codec::set_addlistener_handler>>
52 itemEventHandler(
new impl::item_event_handler<
53 protocol::codec::set_addlistener_handler>(
55 get_context().get_client_cluster_service(),
56 get_context().get_serialization_service(),
60 return proxy::ISetImpl::add_item_listener(std::move(itemEventHandler),
72 return proxy::ISetImpl::contains(to_data(element));
82 return to_object_vector<E>(proxy::ISetImpl::to_array_data());
92 boost::future<bool>
add(
const E& element)
94 return proxy::ISetImpl::add(to_data(element));
103 boost::future<bool>
remove(
const E& element)
105 return proxy::ISetImpl::remove(to_data(element));
116 return proxy::ISetImpl::contains_all(to_data_collection(elements));
125 boost::future<bool>
add_all(
const std::vector<E>& elements)
127 std::vector<serialization::pimpl::data> dataCollection =
128 to_data_collection(elements);
129 return proxy::ISetImpl::add_all(to_data_collection(elements));
138 boost::future<bool>
remove_all(
const std::vector<E>& elements)
140 return proxy::ISetImpl::remove_all(to_data_collection(elements));
151 boost::future<bool>
retain_all(
const std::vector<E>& elements)
153 return proxy::ISetImpl::retain_all(to_data_collection(elements));
157 iset(
const std::string& instance_name, spi::ClientContext* context)
158 : proxy::ISetImpl(instance_name, context)
Concurrent, distributed client implementation of std::unordered_set.
boost::future< std::vector< E > > to_array()
boost::future< bool > retain_all(const std::vector< E > &elements)
Removes the elements from this set that are not available in given "elements" vector.
boost::future< bool > add(const E &element)
boost::future< boost::uuids::uuid > add_item_listener(item_listener &&listener, bool include_value)
Warning 1: If listener should do a time consuming operation, off-load the operation to another thread...
boost::future< bool > contains_all(const std::vector< E > &elements)
boost::future< bool > remove(const E &element)
boost::future< bool > contains(const E &element)
boost::future< bool > remove_all(const std::vector< E > &elements)
boost::future< bool > add_all(const std::vector< E > &elements)
Item listener for IQueue, ISet and IList.