Infinispan HotRod C++ Client  8.3.1.Final
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Counters.h
Go to the documentation of this file.
1 /*
2  * Counters.h
3  *
4  * Created on: May 3, 2018
5  * Author: rigazilla
6  */
7 
8 #ifndef INCLUDE_INFINISPAN_HOTROD_COUNTERS_H_
9 #define INCLUDE_INFINISPAN_HOTROD_COUNTERS_H_
10 
11 #include <string>
14 
15 namespace infinispan {
16 namespace hotrod {
17 
18 class Counter {
19 public:
23  virtual std::string getName() = 0;
24 
29 
33  virtual void reset() = 0;
34 
41  virtual void remove() = 0;
42 
47  virtual const void* addListener(const event::CounterListener* listener) = 0;
53  virtual void removeListener(const void* handler) = 0;
54 
55 };
56 
57 class StrongCounter: public virtual Counter {
58 public:
66  virtual long getValue() = 0;
67 
74  virtual long addAndGet(long delta) = 0;
75 
81  virtual long incrementAndGet() = 0;
82 
88  virtual long decrementAndGet() = 0;
89 
99  virtual long compareAndSwap(long expect, long update) = 0;
100 
110  virtual bool compareAndSet(long expect, long update) = 0;
111 
112  virtual ~StrongCounter() {
113  }
114 };
115 
116 class WeakCounter: public virtual Counter {
117 public:
125  virtual long getValue() = 0;
126 
130  virtual void increment() = 0;
131 
135  virtual void decrement() = 0;
136 
142  virtual void add(long delta) = 0;
143 
144  virtual ~WeakCounter() {
145  }
146 };
147 }
148 }
149 
150 #endif /* INCLUDE_INFINISPAN_HOTROD_COUNTERS_H_ */
Definition: CounterEvent.h:62
virtual ~StrongCounter()
Definition: Counters.h:112
virtual void removeListener(const void *handler)=0
Definition: Counters.h:18
virtual const void * addListener(const event::CounterListener *listener)=0
virtual CounterConfiguration getConfiguration()=0
virtual long addAndGet(long delta)=0
virtual void add(long delta)=0
Definition: Counters.h:116
virtual std::string getName()=0
virtual ~WeakCounter()
Definition: Counters.h:144
virtual bool compareAndSet(long expect, long update)=0
Definition: Counters.h:57
Definition: CounterConfiguration.h:28
virtual long compareAndSwap(long expect, long update)=0