16 #ifndef HAZELCAST_ISET
17 #define HAZELCAST_ISET
19 #include "hazelcast/client/proxy/ISetImpl.h"
20 #include "hazelcast/client/impl/ItemEventHandler.h"
21 #include "hazelcast/client/protocol/codec/SetAddListenerCodec.h"
32 class ISet :
public proxy::ISetImpl {
47 impl::ItemEventHandler<E, protocol::codec::SetAddListenerCodec::AbstractEventHandler> *itemEventHandler =
48 new impl::ItemEventHandler<E, protocol::codec::SetAddListenerCodec::AbstractEventHandler>(
49 getName(), context->getClusterService(), context->getSerializationService(), listener,
51 return proxy::ISetImpl::addItemListener(itemEventHandler, includeValue);
63 return proxy::ISetImpl::removeItemListener(registrationId);
71 return proxy::ISetImpl::size();
89 return proxy::ISetImpl::contains(toData(element));
97 return toObjectCollection<E>(proxy::ISetImpl::toArray());
106 bool add(
const E &element) {
107 return proxy::ISetImpl::add(toData(element));
116 bool remove(
const E &element) {
117 return proxy::ISetImpl::remove(toData(element));
127 return proxy::ISetImpl::containsAll(toDataCollection(elements));
136 bool addAll(
const std::vector<E> &elements) {
137 std::vector<serialization::pimpl::Data> dataCollection = toDataCollection(elements);
138 return proxy::ISetImpl::addAll(toDataCollection(elements));
148 std::vector<serialization::pimpl::Data> dataCollection = toDataCollection(elements);
149 return proxy::ISetImpl::removeAll(dataCollection);
160 return proxy::ISetImpl::retainAll(toDataCollection(elements));
168 proxy::ISetImpl::clear();
172 ISet(
const std::string &instanceName, spi::ClientContext *context)
173 : proxy::ISetImpl(instanceName, context) {
bool removeAll(const std::vector< E > &elements)
Definition: ISet.h:147
std::vector< E > toArray()
Definition: ISet.h:96
bool containsAll(const std::vector< E > &elements)
Definition: ISet.h:126
int size()
Definition: ISet.h:70
void clear()
Removes all elements from set.
Definition: ISet.h:167
bool add(const E &element)
Definition: ISet.h:106
Concurrent, distributed client implementation of std::unordered_set.
Definition: ISet.h:32
bool addAll(const std::vector< E > &elements)
Definition: ISet.h:136
std::string addItemListener(ItemListener< E > &listener, bool includeValue)
Warning 1: If listener should do a time consuming operation, off-load the operation to another thread...
Definition: ISet.h:46
Item listener for IQueue, ISet and IList.
Definition: ItemListener.h:40
bool removeItemListener(const std::string ®istrationId)
Removes the specified item listener.
Definition: ISet.h:62
bool contains(const E &element)
Definition: ISet.h:88
bool retainAll(const std::vector< E > &elements)
Removes the elements from this set that are not available in given "elements" vector.
Definition: ISet.h:159
bool isEmpty()
Definition: ISet.h:78
Hazelcast Client enables you to do all Hazelcast operations without being a member of the cluster...
Definition: HazelcastClient.h:410