18 #ifndef HZELCAST_CLIENT_RINGBUFFER_H_ 19 #define HZELCAST_CLIENT_RINGBUFFER_H_ 24 #include "hazelcast/client/DistributedObject.h" 25 #include "hazelcast/client/ringbuffer/ReadResultSet.h" 26 #include "hazelcast/client/ICompletableFuture.h" 28 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 30 #pragma warning(disable: 4251) //for dll export 124 virtual int64_t
size() = 0;
175 virtual int64_t
add(
const E &item) = 0;
210 virtual std::auto_ptr<E>
readOne(int64_t sequence) = 0;
244 virtual boost::shared_ptr<ICompletableFuture<int64_t> >
271 virtual boost::shared_ptr<ICompletableFuture<int64_t> >
313 template<
typename IFUNCTION>
314 boost::shared_ptr<ICompletableFuture<ringbuffer::ReadResultSet<E> > >
315 readManyAsync(int64_t startSequence, int32_t minCount, int32_t maxCount,
const IFUNCTION *filter) {
316 return readManyAsyncInternal(startSequence, minCount, maxCount,
317 getSerializationService().
template toData<IFUNCTION>(filter));
321 virtual boost::shared_ptr<ICompletableFuture<ringbuffer::ReadResultSet<E> > >
322 readManyAsyncInternal(int64_t startSequence, int32_t minCount, int32_t maxCount,
323 const serialization::pimpl::Data &filterData) = 0;
325 virtual serialization::pimpl::SerializationService &getSerializationService() = 0;
330 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 334 #endif //HZELCAST_CLIENT_RINGBUFFER_H_ virtual int64_t capacity()=0
Returns the capacity of this Ringbuffer.
Using this policy the oldest item is overwritten no matter it is not old enough to retire...
Definition: Ringbuffer.h:90
Using this policy the call will fail immediately and the oldest item will not be overwritten before i...
Definition: Ringbuffer.h:102
virtual boost::shared_ptr< ICompletableFuture< int64_t > > addAsync(const E &item, OverflowPolicy overflowPolicy)=0
Asynchronously writes an item with a configurable OverflowPolicy.
OverflowPolicy
Using this policy one can control the behavior what should to be done when an item is about to be add...
Definition: Ringbuffer.h:80
virtual int64_t tailSequence()=0
Returns the sequence of the tail.
virtual std::auto_ptr< E > readOne(int64_t sequence)=0
Reads one item from the Ringbuffer.
Base class for all distributed objects.
Definition: DistributedObject.h:58
A Ringbuffer is a data-structure where the content is stored in a ring like structure.
Definition: Ringbuffer.h:69
virtual int64_t headSequence()=0
Returns the sequence of the head.
virtual int64_t size()=0
Returns number of items in the ringbuffer.
virtual int64_t add(const E &item)=0
Adds an item to the tail of the Ringbuffer.
virtual boost::shared_ptr< ICompletableFuture< int64_t > > addAllAsync(const std::vector< E > &items, OverflowPolicy overflowPolicy)=0
Adds all the items of a collection to the tail of the Ringbuffer.
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32
virtual int64_t remainingCapacity()=0
Returns the remaining capacity of the ringbuffer.
boost::shared_ptr< ICompletableFuture< ringbuffer::ReadResultSet< E > > > readManyAsync(int64_t startSequence, int32_t minCount, int32_t maxCount, const IFUNCTION *filter)
Reads a batch of items from the Ringbuffer.
Definition: Ringbuffer.h:315