Ditto 4.13.1
 
Loading...
Searching...
No Matches
Counter.hpp
1
2#ifndef DITTO_COUNTER_H
3#define DITTO_COUNTER_H
4
5#include "Helpers.hpp"
6#include "dittoffi.hpp"
7#include "json.hpp"
8
9namespace ditto {
10
15class DITTO_DEPRECATED_BECAUSE(
16 "Use DQL (Ditto Query Language) instead. For more information "
17 "see: https://ditto.com/link/legacy-to-dql-guide") Counter {
18 friend class AbstractDocumentPath;
19 friend class MutableCounter;
20
21public:
22 explicit Counter();
28 double get_value() const;
29 DittoCrdtType get_type() const;
30
31protected:
32 explicit Counter(const nlohmann::json &info);
33 double value; // NOLINT
34};
35
36DITTO_DISABLE_DEPRECATED_WARNINGS("Counter is deprecated")
37void to_json(nlohmann::json &j, const Counter &a);
38DITTO_REENABLE_WARNINGS
39
40} // namespace ditto
41
42#endif
Definition Counter.hpp:17
double get_value() const
Get the value of the counter in the current view of the document.
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19