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" 25 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 27 #pragma warning(disable: 4251) //for dll export 65 class HAZELCAST_API
Ringbuffer :
public proxy::ProxyImpl {
66 friend class client::impl::HazelcastClientInstanceImpl;
97 int64_t tailSequence();
109 int64_t headSequence();
120 int64_t remainingCapacity();
139 template <
typename E>
140 int64_t
add(
const E &item) {
141 serialization::pimpl::Data itemData = toData<E>(item);
142 std::auto_ptr<protocol::ClientMessage> msg = protocol::codec::RingbufferAddCodec::encodeRequest(
143 getName(), OVERWRITE, itemData);
144 return invokeAndGetResult<int64_t, protocol::codec::RingbufferAddCodec::ResponseParameters>(msg, partitionId);
183 Ringbuffer(
const std::string &objectName, spi::ClientContext *context);
194 enum OverflowPolicy {
208 util::Atomic<int64_t> bufferCapacity;
214 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 218 #endif //HAZELCAST_CLIENT_MIXEDTYPE_RINGBUFFER_H_ int64_t add(const E &item)
Adds an item to the tail of the Ringbuffer.
Definition: Ringbuffer.h:140
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
A Ringbuffer is a data-structure where the content is stored in a ring like structure.
Definition: Ringbuffer.h:65
TypedData class is a wrapper class for the serialized binary data.
Definition: TypedData.h:40