16 #ifndef HAZELCAST_CLIENT_MIXEDTYPE_IQUEUE_H_
17 #define HAZELCAST_CLIENT_MIXEDTYPE_IQUEUE_H_
19 #include "hazelcast/client/proxy/IQueueImpl.h"
20 #include "hazelcast/client/ItemListener.h"
22 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
24 #pragma warning(disable: 4251) //for dll export
35 class HAZELCAST_API
IQueue :
public proxy::IQueueImpl {
63 bool removeItemListener(
const std::string& registrationId);
75 return offer(element, 0);
83 void put(
const E& element) {
84 proxy::IQueueImpl::put(toData(element));
97 bool offer(
const E& element,
long timeoutInMillis) {
98 return proxy::IQueueImpl::offer(toData(element), timeoutInMillis);
118 int remainingCapacity();
125 template <
typename E>
126 bool remove(
const E& element) {
127 return proxy::IQueueImpl::remove(toData(element));
135 template <
typename E>
137 return proxy::IQueueImpl::contains(toData(element));
146 size_t drainTo(std::vector<TypedData> &elements);
155 size_t drainTo(std::vector<TypedData> &elements, int64_t maxElements);
187 std::vector<TypedData> toArray();
195 template <
typename E>
197 std::vector<serialization::pimpl::Data> list = toDataCollection(elements);
198 return proxy::IQueueImpl::containsAll(list);
207 template <
typename E>
208 bool addAll(
const std::vector<E>& elements) {
209 std::vector<serialization::pimpl::Data> dataList = toDataCollection(elements);
210 return proxy::IQueueImpl::addAll(dataList);
219 template <
typename E>
221 std::vector<serialization::pimpl::Data> dataList = toDataCollection(elements);
222 return proxy::IQueueImpl::removeAll(dataList);
232 template <
typename E>
234 std::vector<serialization::pimpl::Data> dataList = toDataCollection(elements);
235 return proxy::IQueueImpl::retainAll(dataList);
243 IQueue(
const std::string& instanceName, spi::ClientContext *context);
249 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
bool containsAll(const std::vector< E > &elements)
Definition: IQueue.h:196
bool contains(const E &element)
Definition: IQueue.h:136
void put(const E &element)
Puts the element into queue.
Definition: IQueue.h:83
bool offer(const E &element, long timeoutInMillis)
Inserts the specified element into this queue.
Definition: IQueue.h:97
bool offer(const E &element)
Inserts the specified element into this queue.
Definition: IQueue.h:74
bool retainAll(const std::vector< E > &elements)
Removes the elements from this queue that are not available in given "elements" vector.
Definition: IQueue.h:233
bool addAll(const std::vector< E > &elements)
Definition: IQueue.h:208
Item listener for IQueue, ISet and IList.
Definition: ItemListener.h:40
Concurrent, blocking, distributed, observable, client queue.
Definition: IQueue.h:35
Definition: MapEntryView.h:32
bool removeAll(const std::vector< E > &elements)
Definition: IQueue.h:220
TypedData class is a wrapper class for the serialized binary data.
Definition: TypedData.h:40
Hazelcast Client enables you to do all Hazelcast operations without being a member of the cluster...
Definition: HazelcastClient.h:459