16 #ifndef HAZELCAST_CLIENT_MIXEDTYPE_RINGBUFFER_H_
17 #define HAZELCAST_CLIENT_MIXEDTYPE_RINGBUFFER_H_
21 #include "hazelcast/client/TypedData.h"
22 #include "hazelcast/client/proxy/ProxyImpl.h"
23 #include "hazelcast/client/protocol/codec/RingbufferAddCodec.h"
60 class HAZELCAST_API
Ringbuffer :
public proxy::ProxyImpl {
90 int64_t tailSequence();
102 int64_t headSequence();
113 int64_t remainingCapacity();
132 template <
typename E>
133 int64_t
add(
const E &item) {
134 serialization::pimpl::Data itemData = toData<E>(item);
135 std::auto_ptr<protocol::ClientMessage> msg = protocol::codec::RingbufferAddCodec::RequestParameters::encode(
136 getName(), OVERWRITE, itemData);
137 return invokeAndGetResult<int64_t, protocol::codec::RingbufferAddCodec::ResponseParameters>(msg, partitionId);
176 Ringbuffer(
const std::string &objectName, spi::ClientContext *context);
187 enum OverflowPolicy {
201 util::Atomic<int64_t> bufferCapacity;
207 #endif //HAZELCAST_CLIENT_MIXEDTYPE_RINGBUFFER_H_
int64_t add(const E &item)
Adds an item to the tail of the Ringbuffer.
Definition: Ringbuffer.h:133
Definition: MapEntryView.h:32
A Ringbuffer is a data-structure where the content is stored in a ring like structure.
Definition: Ringbuffer.h:60
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