Hazelcast C++ Client
Public Member Functions | List of all members
hazelcast::client::adaptor::RawPointerQueue< T > Class Template Reference

Concurrent, blocking, distributed, observable, client queue. More...

#include <RawPointerQueue.h>

Public Member Functions

 RawPointerQueue (IQueue< T > &q)
 
std::string addItemListener (ItemListener< T > &listener, bool includeValue)
 Adds an item listener for this collection. More...
 
bool removeItemListener (const std::string &registrationId)
 Removes the specified item listener. More...
 
bool offer (const T &element)
 Inserts the specified element into this queue. More...
 
void put (const T &e)
 Puts the element into queue. More...
 
bool offer (const T &element, long timeoutInMillis)
 Inserts the specified element into this queue. More...
 
std::auto_ptr< T > take ()
 
std::auto_ptr< T > poll (long timeoutInMillis)
 
int remainingCapacity ()
 
bool remove (const T &element)
 
bool contains (const T &element)
 
std::auto_ptr< DataArray< T > > drainTo ()
 
std::auto_ptr< DataArray< T > > drainTo (size_t maxElements)
 
std::auto_ptr< T > poll ()
 Returns immediately without waiting. More...
 
std::auto_ptr< T > peek ()
 Returns immediately without waiting. More...
 
int size ()
 
bool isEmpty ()
 
std::auto_ptr< DataArray< T > > toArray ()
 
bool containsAll (const std::vector< T > &elements)
 
bool addAll (const std::vector< T > &elements)
 
bool removeAll (const std::vector< T > &elements)
 
bool retainAll (const std::vector< T > &elements)
 Removes the elements from this queue that are not available in given "elements" vector. More...
 
void clear ()
 Removes all elements from queue.
 

Detailed Description

template<typename T>
class hazelcast::client::adaptor::RawPointerQueue< T >

Concurrent, blocking, distributed, observable, client queue.

Template Parameters
Titem type

Member Function Documentation

template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::addAll ( const std::vector< T > &  elements)
inline
Parameters
elementshe items to be inserted into the queue.
Returns
true if all elements given in vector can be added to queue.
Exceptions
IClassCastExceptionif the type of the specified element is incompatible with the server side.
template<typename T >
std::string hazelcast::client::adaptor::RawPointerQueue< T >::addItemListener ( ItemListener< T > &  listener,
bool  includeValue 
)
inline

Adds an item listener for this collection.

Listener will get notified for all collection add/remove events.

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
listeneritem listener
includeValuetrue updated item should be passed to the item listener, false otherwise.
Returns
returns registration id.
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::contains ( const T &  element)
inline
Parameters
elementto be checked.
Returns
true if queue contains the element.
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::containsAll ( const std::vector< T > &  elements)
inline
Parameters
elementsThe items to be searched for in the queue.
Returns
true if this queue contains all item given in elements.
Exceptions
IClassCastExceptionif the type of the specified element is incompatible with the server side.
template<typename T >
std::auto_ptr<DataArray<T> > hazelcast::client::adaptor::RawPointerQueue< T >::drainTo ( )
inline
Returns
The elements in the queue.
template<typename T >
std::auto_ptr<DataArray<T> > hazelcast::client::adaptor::RawPointerQueue< T >::drainTo ( size_t  maxElements)
inline
Parameters
maxElementsupper limit to be filled.
Returns
The elements in the queue.
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::isEmpty ( )
inline
Returns
true if queue is empty
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::offer ( const T &  element)
inline

Inserts the specified element into this queue.

Parameters
elementto add
Returns
true if the element was added to this queue, else false
Exceptions
IClassCastExceptionif the type of the specified element is incompatible with the server side.
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::offer ( const T &  element,
long  timeoutInMillis 
)
inline

Inserts the specified element into this queue.

If queue is full waits for space to became available for specified time.

Parameters
elementto add
timeoutInMillishow long to wait before giving up, in units of
Returns
true if successful, or false if the specified waiting time elapses before space is available
template<typename T >
std::auto_ptr<T> hazelcast::client::adaptor::RawPointerQueue< T >::peek ( )
inline

Returns immediately without waiting.

Returns
head of queue without removing it. If not available returns empty constructed shared_ptr.
template<typename T >
std::auto_ptr<T> hazelcast::client::adaptor::RawPointerQueue< T >::poll ( long  timeoutInMillis)
inline
Parameters
timeoutInMillistime to wait if item is not available.
Returns
the head of the queue. If queue is empty waits for specified time.
template<typename T >
std::auto_ptr<T> hazelcast::client::adaptor::RawPointerQueue< T >::poll ( )
inline

Returns immediately without waiting.

Returns
removes head of the queue and returns it to user . If not available returns empty constructed shared_ptr.
template<typename T >
void hazelcast::client::adaptor::RawPointerQueue< T >::put ( const T &  e)
inline

Puts the element into queue.

If queue is full waits for space to became available.

template<typename T >
int hazelcast::client::adaptor::RawPointerQueue< T >::remainingCapacity ( )
inline
Returns
remaining capacity
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::remove ( const T &  element)
inline
Parameters
elementto be removed.
Returns
true if element removed successfully.
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::removeAll ( const std::vector< T > &  elements)
inline
Parameters
elementsThe items to be removed from the queue
Returns
true if all elements are removed successfully.
Exceptions
IClassCastExceptionif the type of the specified element is incompatible with the server side.
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::removeItemListener ( const std::string &  registrationId)
inline

Removes the specified item listener.

Returns silently if the specified listener is not added before.

Parameters
registrationIdId of listener registration.
Returns
true if registration is removed, false otherwise
template<typename T >
bool hazelcast::client::adaptor::RawPointerQueue< T >::retainAll ( const std::vector< T > &  elements)
inline

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

Parameters
elementsThe items to be retained in the queue
Returns
true if operation is successful.
Exceptions
IClassCastExceptionif the type of the specified element is incompatible with the server side.
template<typename T >
int hazelcast::client::adaptor::RawPointerQueue< T >::size ( )
inline
Returns
size of this distributed queue
template<typename T >
std::auto_ptr<T> hazelcast::client::adaptor::RawPointerQueue< T >::take ( )
inline
Returns
the head of the queue. If queue is empty waits for an item to be added.
template<typename T >
std::auto_ptr<DataArray<T> > hazelcast::client::adaptor::RawPointerQueue< T >::toArray ( )
inline
Returns
all elements

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