16 #ifndef HAZELCAST_CLIENT_ADAPTOR_RAWPOINTERQUEUE_H_
17 #define HAZELCAST_CLIENT_ADAPTOR_RAWPOINTERQUEUE_H_
21 #include "hazelcast/client/IQueue.h"
22 #include "hazelcast/client/impl/DataArrayImpl.h"
77 return queue.
offer(element, 0);
84 void put(
const T &e) {
97 bool offer(
const T &element,
long timeoutInMillis) {
98 return queue.
offer(element, timeoutInMillis);
106 return serializationService.toObject<T>(queue.pollData(-1).get());
114 std::auto_ptr<T>
poll(
long timeoutInMillis) {
115 return serializationService.toObject<T>(queue.pollData(timeoutInMillis).get());
131 bool remove(
const T &element) {
132 return queue.
remove(element);
149 return std::auto_ptr<DataArray<T> >(
new impl::DataArrayImpl<T>(queue.drainToData(-1), serializationService));
157 std::auto_ptr<DataArray<T> >
drainTo(
size_t maxElements) {
158 return std::auto_ptr<DataArray<T> >(
new impl::DataArrayImpl<T>(queue.drainToData(maxElements), serializationService));
167 return serializationService.toObject<T>(queue.pollData(0).get());
176 return serializationService.toObject<T>(queue.peekData().get());
200 return std::auto_ptr<DataArray<T> >(
new impl::DataArrayImpl<T>(queue.toArrayData(), serializationService));
219 bool addAll(
const std::vector<T> &elements) {
220 return queue.
addAll(elements);
253 serialization::pimpl::SerializationService &serializationService;
void clear()
Removes all elements from queue.
Definition: IQueue.h:270
bool removeItemListener(const std::string ®istrationId)
Removes the specified item listener.
Definition: RawPointerQueue.h:64
bool offer(const E &element)
Inserts the specified element into this queue.
Definition: IQueue.h:85
Concurrent, blocking, distributed, observable, client queue.
Definition: RawPointerQueue.h:33
bool isEmpty()
Definition: RawPointerQueue.h:191
bool contains(const E &element)
Definition: IQueue.h:150
std::string addItemListener(ItemListener< T > &listener, bool includeValue)
Adds an item listener for this collection.
Definition: RawPointerQueue.h:52
bool removeAll(const std::vector< E > &elements)
Definition: IQueue.h:250
std::auto_ptr< T > poll(long timeoutInMillis)
Definition: RawPointerQueue.h:114
int remainingCapacity()
Definition: RawPointerQueue.h:122
int remainingCapacity()
Definition: IQueue.h:132
std::auto_ptr< T > peek()
Returns immediately without waiting.
Definition: RawPointerQueue.h:175
bool removeItemListener(const std::string ®istrationId)
Removes the specified item listener.
Definition: IQueue.h:73
std::auto_ptr< DataArray< T > > toArray()
Definition: RawPointerQueue.h:199
std::string addItemListener(ItemListener< E > &listener, bool includeValue)
Adds an item listener for this collection.
Definition: IQueue.h:57
bool retainAll(const std::vector< T > &elements)
Removes the elements from this queue that are not available in given "elements" vector.
Definition: RawPointerQueue.h:240
std::auto_ptr< DataArray< T > > drainTo()
Definition: RawPointerQueue.h:148
bool contains(const T &element)
Definition: RawPointerQueue.h:140
int size()
Definition: IQueue.h:202
bool offer(const T &element)
Inserts the specified element into this queue.
Definition: RawPointerQueue.h:76
int size()
Definition: RawPointerQueue.h:183
bool isEmpty()
Definition: IQueue.h:210
bool retainAll(const std::vector< E > &elements)
Removes the elements from this queue that are not available in given "elements" vector.
Definition: IQueue.h:262
std::auto_ptr< T > take()
Definition: RawPointerQueue.h:105
Item listener for IQueue, ISet and IList.
Definition: ItemListener.h:40
void put(const T &e)
Puts the element into queue.
Definition: RawPointerQueue.h:84
std::auto_ptr< T > poll()
Returns immediately without waiting.
Definition: RawPointerQueue.h:166
bool containsAll(const std::vector< E > &elements)
Definition: IQueue.h:228
bool containsAll(const std::vector< T > &elements)
Definition: RawPointerQueue.h:209
bool addAll(const std::vector< E > &elements)
Definition: IQueue.h:239
bool offer(const T &element, long timeoutInMillis)
Inserts the specified element into this queue.
Definition: RawPointerQueue.h:97
bool removeAll(const std::vector< T > &elements)
Definition: RawPointerQueue.h:229
std::auto_ptr< DataArray< T > > drainTo(size_t maxElements)
Definition: RawPointerQueue.h:157
bool remove(const E &element)
Definition: IQueue.h:141
void clear()
Removes all elements from queue.
Definition: RawPointerQueue.h:247
bool addAll(const std::vector< T > &elements)
Definition: RawPointerQueue.h:219