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 {
29 friend class spi::ProxyManager;
31 static constexpr
const char *SERVICE_NAME =
"hz:impl:setService";
44 std::unique_ptr<impl::item_event_handler<protocol::codec::set_addlistener_handler>> itemEventHandler(
45 new impl::item_event_handler<protocol::codec::set_addlistener_handler>(
46 get_name(), get_context().get_client_cluster_service(),
47 get_context().get_serialization_service(),
51 return proxy::ISetImpl::add_item_listener(std::move(itemEventHandler), include_value);
60 boost::future<bool>
contains(
const E &element) {
61 return proxy::ISetImpl::contains(to_data(element));
70 return to_object_vector<E>(proxy::ISetImpl::to_array_data());
79 boost::future<bool>
add(
const E &element) {
80 return proxy::ISetImpl::add(to_data(element));
89 boost::future<bool>
remove(
const E &element) {
90 return proxy::ISetImpl::remove(to_data(element));
100 return proxy::ISetImpl::contains_all(to_data_collection(elements));
109 boost::future<bool>
add_all(
const std::vector<E> &elements) {
110 std::vector<serialization::pimpl::data> dataCollection = to_data_collection(elements);
111 return proxy::ISetImpl::add_all(to_data_collection(elements));
120 boost::future<bool>
remove_all(
const std::vector<E> &elements) {
121 return proxy::ISetImpl::remove_all(to_data_collection(elements));
131 boost::future<bool>
retain_all(
const std::vector<E> &elements) {
132 return proxy::ISetImpl::retain_all(to_data_collection(elements));
136 iset(
const std::string &instance_name, spi::ClientContext *context)
137 : 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.