Infinispan HotRod C++ Client  9.1.0.Final
Public Member Functions | List of all members
infinispan::hotrod::StrongCounter Class Referenceabstract

#include <Counters.h>

Inheritance diagram for infinispan::hotrod::StrongCounter:
infinispan::hotrod::Counter

Public Member Functions

virtual long getValue ()=0
 
virtual long addAndGet (long delta)=0
 
virtual long incrementAndGet ()=0
 
virtual long decrementAndGet ()=0
 
virtual long compareAndSwap (long expect, long update)=0
 
virtual bool compareAndSet (long expect, long update)=0
 
virtual ~StrongCounter ()
 
- Public Member Functions inherited from infinispan::hotrod::Counter
virtual std::string getName ()=0
 
virtual CounterConfiguration getConfiguration ()=0
 
virtual void reset ()=0
 
virtual void remove ()=0
 
virtual const void * addListener (const event::CounterListener *listener)=0
 
virtual void removeListener (const void *handler)=0
 

Constructor & Destructor Documentation

◆ ~StrongCounter()

virtual infinispan::hotrod::StrongCounter::~StrongCounter ( )
inlinevirtual

Member Function Documentation

◆ addAndGet()

virtual long infinispan::hotrod::StrongCounter::addAndGet ( long  delta)
pure virtual

Atomically adds the given value and return the new value.

Parameters
deltaThe non-zero value to add. It can be negative.
Returns
The new value.

◆ compareAndSet()

virtual bool infinispan::hotrod::StrongCounter::compareAndSet ( long  expect,
long  update 
)
pure virtual

Atomically sets the value to the given updated value if the current value

==

the expected value.

It is the same as

return compareAndSwap(expect, update).thenApply(value -> value == expect);
Parameters
expectthe expected value
updatethe new value
Returns
true
if successful,
false
otherwise.

◆ compareAndSwap()

virtual long infinispan::hotrod::StrongCounter::compareAndSwap ( long  expect,
long  update 
)
pure virtual

Atomically sets the value to the given updated value if the current value

==

the expected value.

The operation is successful if the return value is equals to the expected value.

Parameters
expectthe expected value.
updatethe new value.
Returns
the previous counter's value.

◆ decrementAndGet()

virtual long infinispan::hotrod::StrongCounter::decrementAndGet ( )
pure virtual

Atomically decrements the counter and returns the new value

Returns
The new value.

◆ getValue()

virtual long infinispan::hotrod::StrongCounter::getValue ( )
pure virtual

It fetches the current value.

It may go remotely to fetch the current value.

Returns
The current value.

◆ incrementAndGet()

virtual long infinispan::hotrod::StrongCounter::incrementAndGet ( )
pure virtual

Atomically increments the counter and returns the new value.

Returns
The new value.

The documentation for this class was generated from the following file: