Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::iset Class Reference

Concurrent, distributed client implementation of std::unordered_set. More...

#include <iset.h>

+ Inheritance diagram for hazelcast::client::iset:

Public Member Functions

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. More...
 
template<typename E >
boost::future< bool > contains (const E &element)
 
template<typename E >
boost::future< std::vector< E > > to_array ()
 
template<typename E >
boost::future< bool > add (const E &element)
 
template<typename E >
boost::future< bool > remove (const E &element)
 
template<typename E >
boost::future< bool > contains_all (const std::vector< E > &elements)
 
template<typename E >
boost::future< bool > add_all (const std::vector< E > &elements)
 
template<typename E >
boost::future< bool > remove_all (const std::vector< E > &elements)
 
template<typename E >
boost::future< bool > retain_all (const std::vector< E > &elements)
 Removes the elements from this set that are not available in given "elements" vector. More...
 

Static Public Attributes

static constexpr const char * SERVICE_NAME = "hz:impl:setService"
 

Friends

class spi::ProxyManager
 

Detailed Description

Concurrent, distributed client implementation of std::unordered_set.

Definition at line 28 of file iset.h.

Member Function Documentation

◆ add()

template<typename E >
boost::future<bool> hazelcast::client::iset::add ( const E &  element)
inline
Parameters
elementto be added
Returns
true if element is added successfully. If elements was already there returns false.

Definition at line 79 of file iset.h.

79  {
80  return proxy::ISetImpl::add(to_data(element));
81  }

◆ add_all()

template<typename E >
boost::future<bool> hazelcast::client::iset::add_all ( const std::vector< E > &  elements)
inline
Parameters
elementsstd::vector<E>
Returns
true if all elements given in vector can be added to set.

Definition at line 109 of file iset.h.

109  {
110  std::vector<serialization::pimpl::data> dataCollection = to_data_collection(elements);
111  return proxy::ISetImpl::add_all(to_data_collection(elements));
112  }

◆ add_item_listener()

boost::future<boost::uuids::uuid> hazelcast::client::iset::add_item_listener ( item_listener &&  listener,
bool  include_value 
)
inline

Warning 1: If listener should do a time consuming operation, off-load the operation to another thread.

otherwise it will slow down the system.

Warning 2: Do not make a call to hazelcast. It can cause deadlock.

Parameters
listenerto be added
includeValueboolean value representing value should be included in incoming ItemEvent or not.
Returns
registrationId that can be used to remove item listener

Definition at line 43 of file iset.h.

43  {
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(),
48  std::move(listener),
49  include_value));
50 
51  return proxy::ISetImpl::add_item_listener(std::move(itemEventHandler), include_value);
52  }

◆ contains()

template<typename E >
boost::future<bool> hazelcast::client::iset::contains ( const E &  element)
inline
Parameters
elementto be searched
Returns
true if set contains element

Definition at line 60 of file iset.h.

60  {
61  return proxy::ISetImpl::contains(to_data(element));
62  }

◆ contains_all()

template<typename E >
boost::future<bool> hazelcast::client::iset::contains_all ( const std::vector< E > &  elements)
inline
Parameters
elementsstd::vector<E>
Returns
true if this set contains all elements given in vector.

Definition at line 99 of file iset.h.

99  {
100  return proxy::ISetImpl::contains_all(to_data_collection(elements));
101  }

◆ remove()

template<typename E >
boost::future<bool> hazelcast::client::iset::remove ( const E &  element)
inline
Parameters
elementto be removed
Returns
true if element is removed successfully.

Definition at line 89 of file iset.h.

89  {
90  return proxy::ISetImpl::remove(to_data(element));
91  }

◆ remove_all()

template<typename E >
boost::future<bool> hazelcast::client::iset::remove_all ( const std::vector< E > &  elements)
inline
Parameters
elementsstd::vector<E>
Returns
true if all elements are removed successfully.

Definition at line 120 of file iset.h.

120  {
121  return proxy::ISetImpl::remove_all(to_data_collection(elements));
122  }

◆ retain_all()

template<typename E >
boost::future<bool> hazelcast::client::iset::retain_all ( const std::vector< E > &  elements)
inline

Removes the elements from this set that are not available in given "elements" vector.

Parameters
elementsstd::vector<E>
Returns
true if operation is successful.

Definition at line 131 of file iset.h.

131  {
132  return proxy::ISetImpl::retain_all(to_data_collection(elements));
133  }

◆ to_array()

template<typename E >
boost::future<std::vector<E> > hazelcast::client::iset::to_array ( )
inline
Returns
all elements as std::vector

Definition at line 69 of file iset.h.

69  {
70  return to_object_vector<E>(proxy::ISetImpl::to_array_data());
71  }

The documentation for this class was generated from the following file: