Concurrent, blocking, distributed, observable, client queue.
More...
#include <IQueue.h>
|
std::string | addItemListener (MixedItemListener &listener, bool includeValue) |
| Adds an item listener for this collection. More...
|
|
bool | removeItemListener (const std::string ®istrationId) |
| Removes the specified item listener. More...
|
|
template<typename E > |
bool | offer (const E &element) |
| Inserts the specified element into this queue. More...
|
|
template<typename E > |
void | put (const E &element) |
| Puts the element into queue. More...
|
|
template<typename E > |
bool | offer (const E &element, long timeoutInMillis) |
| Inserts the specified element into this queue. More...
|
|
TypedData | take () |
|
TypedData | poll (long timeoutInMillis) |
|
int | remainingCapacity () |
|
template<typename E > |
bool | remove (const E &element) |
|
template<typename E > |
bool | contains (const E &element) |
|
size_t | drainTo (std::vector< TypedData > &elements) |
| Note that elements will be pushed_back to vector. More...
|
|
size_t | drainTo (std::vector< TypedData > &elements, int64_t maxElements) |
| Note that elements will be pushed_back to vector. More...
|
|
TypedData | poll () |
| Returns immediately without waiting. More...
|
|
TypedData | peek () |
| Returns immediately without waiting. More...
|
|
int | size () |
|
bool | isEmpty () |
|
std::vector< TypedData > | toArray () |
|
template<typename E > |
bool | containsAll (const std::vector< E > &elements) |
|
template<typename E > |
bool | addAll (const std::vector< E > &elements) |
|
template<typename E > |
bool | removeAll (const std::vector< E > &elements) |
|
template<typename E > |
bool | retainAll (const std::vector< E > &elements) |
| Removes the elements from this queue that are not available in given "elements" vector. More...
|
|
void | clear () |
| Removes all elements from queue.
|
|
|
class | client::HazelcastClient |
|
Concurrent, blocking, distributed, observable, client queue.
template<typename E >
bool hazelcast::client::mixedtype::IQueue::addAll |
( |
const std::vector< E > & |
elements | ) |
|
|
inline |
- Parameters
-
- Returns
- true if all elements given in vector can be added to queue.
- Exceptions
-
IClassCastException | if the type of the specified element is incompatible with the server side. |
std::string hazelcast::client::mixedtype::IQueue::addItemListener |
( |
MixedItemListener & |
listener, |
|
|
bool |
includeValue |
|
) |
| |
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
-
listener | item listener |
includeValue | true updated item should be passed to the item listener, false otherwise. |
- Returns
- returns registration id.
template<typename E >
bool hazelcast::client::mixedtype::IQueue::contains |
( |
const E & |
element | ) |
|
|
inline |
- Parameters
-
- Returns
- true if queue contains the element.
template<typename E >
bool hazelcast::client::mixedtype::IQueue::containsAll |
( |
const std::vector< E > & |
elements | ) |
|
|
inline |
- Parameters
-
- Returns
- true if this queue contains all elements given in vector.
- Exceptions
-
IClassCastException | if the type of the specified element is incompatible with the server side. |
size_t hazelcast::client::mixedtype::IQueue::drainTo |
( |
std::vector< TypedData > & |
elements | ) |
|
Note that elements will be pushed_back to vector.
- Parameters
-
elements | the vector that elements will be drained to. |
- Returns
- number of elements drained.
size_t hazelcast::client::mixedtype::IQueue::drainTo |
( |
std::vector< TypedData > & |
elements, |
|
|
int64_t |
maxElements |
|
) |
| |
Note that elements will be pushed_back to vector.
- Parameters
-
maxElements | upper limit to be filled to vector. |
elements | vector that elements will be drained to. |
- Returns
- number of elements drained.
bool hazelcast::client::mixedtype::IQueue::isEmpty |
( |
| ) |
|
- Returns
- true if queue is empty
template<typename E >
bool hazelcast::client::mixedtype::IQueue::offer |
( |
const E & |
element | ) |
|
|
inline |
Inserts the specified element into this queue.
- Parameters
-
- Returns
true
if the element was added to this queue, else false
- Exceptions
-
IClassCastException | if the type of the specified element is incompatible with the server side. |
template<typename E >
bool hazelcast::client::mixedtype::IQueue::offer |
( |
const E & |
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
-
element | to add |
timeoutInMillis | how 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
TypedData hazelcast::client::mixedtype::IQueue::peek |
( |
| ) |
|
Returns immediately without waiting.
- Returns
- head of queue without removing it. If not available returns empty constructed shared_ptr.
TypedData hazelcast::client::mixedtype::IQueue::poll |
( |
long |
timeoutInMillis | ) |
|
- Parameters
-
timeoutInMillis | time to wait if item is not available. |
- Returns
- the head of the queue. If queue is empty waits for specified time.
TypedData hazelcast::client::mixedtype::IQueue::poll |
( |
| ) |
|
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 E >
void hazelcast::client::mixedtype::IQueue::put |
( |
const E & |
element | ) |
|
|
inline |
Puts the element into queue.
If queue is full waits for space to became available.
int hazelcast::client::mixedtype::IQueue::remainingCapacity |
( |
| ) |
|
- Returns
- remaining capacity
template<typename E >
bool hazelcast::client::mixedtype::IQueue::remove |
( |
const E & |
element | ) |
|
|
inline |
- Parameters
-
- Returns
- true if element removed successfully.
template<typename E >
bool hazelcast::client::mixedtype::IQueue::removeAll |
( |
const std::vector< E > & |
elements | ) |
|
|
inline |
- Parameters
-
- Returns
- true if all elements are removed successfully.
- Exceptions
-
IClassCastException | if the type of the specified element is incompatible with the server side. |
bool hazelcast::client::mixedtype::IQueue::removeItemListener |
( |
const std::string & |
registrationId | ) |
|
Removes the specified item listener.
Returns silently if the specified listener is not added before.
- Parameters
-
registrationId | Id of listener registration. |
- Returns
- true if registration is removed, false otherwise
template<typename E >
bool hazelcast::client::mixedtype::IQueue::retainAll |
( |
const std::vector< E > & |
elements | ) |
|
|
inline |
Removes the elements from this queue that are not available in given "elements" vector.
- Parameters
-
- Returns
- true if operation is successful.
- Exceptions
-
IClassCastException | if the type of the specified element is incompatible with the server side. |
int hazelcast::client::mixedtype::IQueue::size |
( |
| ) |
|
- Returns
- size of this distributed queue
TypedData hazelcast::client::mixedtype::IQueue::take |
( |
| ) |
|
- Returns
- the head of the queue. If queue is empty waits for an item to be added.
std::vector< TypedData > hazelcast::client::mixedtype::IQueue::toArray |
( |
| ) |
|
- Returns
- all elements as std::vector
The documentation for this class was generated from the following files:
- hazelcast/include/hazelcast/client/mixedtype/IQueue.h
- hazelcast/src/hazelcast/client/mixedtype/IQueue.cpp