Infinispan HotRod C++ Client 9.2.0.Final
Loading...
Searching...
No Matches
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
15namespace infinispan {
16namespace hotrod {
17
18class Counter {
19public:
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
57class StrongCounter: public virtual Counter {
58public:
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
116class WeakCounter: public virtual Counter {
117public:
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: CounterConfiguration.h:28
Definition: Counters.h:18
virtual std::string getName()=0
virtual const void * addListener(const event::CounterListener *listener)=0
virtual CounterConfiguration getConfiguration()=0
virtual void removeListener(const void *handler)=0
Definition: Counters.h:57
virtual ~StrongCounter()
Definition: Counters.h:112
virtual bool compareAndSet(long expect, long update)=0
virtual long addAndGet(long delta)=0
virtual long compareAndSwap(long expect, long update)=0
Definition: Counters.h:116
virtual ~WeakCounter()
Definition: Counters.h:144
virtual void add(long delta)=0
Definition: CounterEvent.h:64
Definition: AuthenticationConfiguration.h:10