Ditto 3.0.9
Loading...
Searching...
No Matches
Counter.hpp
1
2#ifndef _DITTO_COUNTER_
3#define _DITTO_COUNTER_
4
5#include "dittoffi.hpp"
6#include "json.hpp"
7
8namespace ditto {
9class Counter {
10 friend class AbstractDocumentPath;
11 friend class MutableCounter;
12
13public:
14 explicit Counter();
20 double get_value() const;
21 DittoCrdtType get_type() const;
22
23protected:
24 explicit Counter(const nlohmann::json &info);
25 double value;
26};
27
28void to_json(nlohmann::json &j, const Counter &a);
29} // namespace ditto
30
31#endif
Provides an interface to specify a path to a key in a document that you can then call various update ...
Definition AbstractDocumentPath.hpp:21
Definition Counter.hpp:9
double get_value() const
Get the value of the counter in the current view of the document.
Definition Counter.cpp:13
Definition MutableCounter.hpp:10
basic_json<> json
default JSON class
Definition json.hpp:2933