Infinispan HotRod C++ Client 9.2.0.Final
Loading...
Searching...
No Matches
CounterEvent.h
Go to the documentation of this file.
1/*
2 * CounterEvent.h
3 *
4 * Created on: May 9, 2018
5 * Author: rigazilla
6 */
7
8#ifndef INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_
9#define INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_
10
11#include <string>
12
13namespace infinispan {
14namespace hotrod {
15namespace event {
16
30};
31
33public:
34 CounterEvent(std::string counterName, const long oldValue, const CounterState oldState, const long newValue,
35 const CounterState newState) :
37 }
38
42 const std::string counterName;
46 const long oldValue;
47
52
56 const long newValue;
57
62};
63
65public:
66 CounterListener(const std::string counterName, std::function<void(const CounterEvent)> action) :
67 counterName(counterName), action(action) {
68 }
69 CounterListener(const std::string counterName) :
70 counterName(counterName) {
71 }
72 virtual void onUpdate(const CounterEvent entry) const {
73 action(entry);
74 }
75 virtual ~CounterListener() {}
76private:
77 const std::string counterName;
78 const std::function<void(const CounterEvent)> action;
79};
80
81}
82}
83}
84#endif /* INCLUDE_INFINISPAN_HOTROD_COUNTEREVENT_H_ */
Definition: CounterEvent.h:32
const long oldValue
Definition: CounterEvent.h:46
const std::string counterName
Definition: CounterEvent.h:42
const long newValue
Definition: CounterEvent.h:56
CounterEvent(std::string counterName, const long oldValue, const CounterState oldState, const long newValue, const CounterState newState)
Definition: CounterEvent.h:34
const CounterState oldState
Definition: CounterEvent.h:51
const CounterState newState
Definition: CounterEvent.h:61
Definition: CounterEvent.h:64
CounterListener(const std::string counterName)
Definition: CounterEvent.h:69
virtual ~CounterListener()
Definition: CounterEvent.h:75
virtual void onUpdate(const CounterEvent entry) const
Definition: CounterEvent.h:72
CounterListener(const std::string counterName, std::function< void(const CounterEvent)> action)
Definition: CounterEvent.h:66
CounterState
Definition: CounterEvent.h:17
@ VALID
Definition: CounterEvent.h:21
@ LOWER_BOUND_REACHED
Definition: CounterEvent.h:25
@ UPPER_BOUND_REACHED
Definition: CounterEvent.h:29
Definition: AuthenticationConfiguration.h:10