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" 36 class ISet :
public proxy::ISetImpl {
37 friend class impl::HazelcastClientInstanceImpl;
52 impl::ItemEventHandler<E, protocol::codec::SetAddListenerCodec::AbstractEventHandler> *itemEventHandler =
53 new impl::ItemEventHandler<E, protocol::codec::SetAddListenerCodec::AbstractEventHandler>(
54 getName(), context->getClientClusterService(), context->getSerializationService(), listener,
56 return proxy::ISetImpl::addItemListener(itemEventHandler, includeValue);
68 return proxy::ISetImpl::removeItemListener(registrationId);
76 return proxy::ISetImpl::size();
84 return proxy::ISetImpl::isEmpty();
94 return proxy::ISetImpl::contains(toData(element));
102 return toObjectCollection<E>(proxy::ISetImpl::toArrayData());
111 bool add(
const E &element) {
112 return proxy::ISetImpl::add(toData(element));
121 bool remove(
const E &element) {
122 return proxy::ISetImpl::remove(toData(element));
132 return proxy::ISetImpl::containsAll(toDataCollection(elements));
141 bool addAll(
const std::vector<E> &elements) {
142 std::vector<serialization::pimpl::Data> dataCollection = toDataCollection(elements);
143 return proxy::ISetImpl::addAll(toDataCollection(elements));
153 std::vector<serialization::pimpl::Data> dataCollection = toDataCollection(elements);
154 return proxy::ISetImpl::removeAll(dataCollection);
165 return proxy::ISetImpl::retainAll(toDataCollection(elements));
173 proxy::ISetImpl::clear();
177 ISet(
const std::string &instanceName, spi::ClientContext *context)
178 : proxy::ISetImpl(instanceName, context) {
bool removeAll(const std::vector< E > &elements)
Definition: ISet.h:152
std::vector< E > toArray()
Definition: ISet.h:101
bool containsAll(const std::vector< E > &elements)
Definition: ISet.h:131
int size()
Definition: ISet.h:75
Concurrent, distributed client implementation of std::unordered_set.
Definition: RawPointerSet.h:31
void clear()
Removes all elements from set.
Definition: ISet.h:172
bool add(const E &element)
Definition: ISet.h:111
Concurrent, distributed client implementation of std::unordered_set.
Definition: ISet.h:36
bool addAll(const std::vector< E > &elements)
Definition: ISet.h:141
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:51
Item listener for IQueue, ISet and IList.
Definition: ItemListener.h:41
bool removeItemListener(const std::string ®istrationId)
Removes the specified item listener.
Definition: ISet.h:67
bool contains(const E &element)
Definition: ISet.h:93
Definition: MapEntryView.h:32
bool retainAll(const std::vector< E > &elements)
Removes the elements from this set that are not available in given "elements" vector.
Definition: ISet.h:164
bool isEmpty()
Definition: ISet.h:83