MADARA  3.4.1
Integer.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_INTEGER_H_
3 #define _MADARA_INTEGER_H_
4 
5 #include <vector>
6 #include <string>
7 #include "madara/LockType.h"
11 #include "BaseContainer.h"
12 
21 namespace madara
22 {
23 namespace knowledge
24 {
25 namespace containers
26 {
31 class MADARA_EXPORT Integer : public BaseContainer
32 {
33 public:
36 
42 
51 
58  Integer(const std::string& name, Variables& knowledge,
60 
68  Integer(const std::string& name, KnowledgeBase& knowledge, type value,
70 
78  Integer(const std::string& name, Variables& knowledge, type value,
80 
84  Integer(const Integer& rhs);
85 
89  virtual ~Integer();
90 
95  void modify(void);
96 
101  void operator=(const Integer& rhs);
102 
108  void set_name(const std::string& var_name, KnowledgeBase& knowledge);
109 
115  void set_name(const std::string& var_name, Variables& knowledge);
116 
122  void set_name(const std::string& var_name, ThreadSafeContext& knowledge);
123 
129  void exchange(containers::Integer& other);
130 
136  type operator=(type value);
137 
143  bool operator==(const Integer& value) const;
144 
150  bool operator!=(const Integer& value) const;
151 
157  bool operator==(type value) const;
158 
164  bool operator!=(type value) const;
165 
171  bool operator<(type value) const;
172 
178  bool operator<=(type value) const;
179 
185  bool operator>(type value) const;
186 
192  bool operator>=(type value) const;
193 
198  type operator*(void)const;
199 
205  bool exists(void) const;
206 
212  type operator+=(type value);
213 
219  type operator-=(type value);
220 
226  type operator++(void);
227 
233  type operator--(void);
234 
240  knowledge::KnowledgeRecord to_record(void) const;
241 
246  double to_double(void) const;
247 
252  knowledge::KnowledgeRecord::Integer to_integer(void) const;
253 
258  std::string to_string(void) const;
259 
266  void set_quality(uint32_t quality,
268  false));
269 
279  std::string get_debug_info(void);
280 
286  virtual BaseContainer* clone(void) const;
287 
292  bool is_true(void) const;
293 
298  bool is_false(void) const;
299 
300 private:
305  virtual bool is_true_(void) const;
306 
311  virtual bool is_false_(void) const;
312 
321  virtual void modify_(void);
322 
332  virtual std::string get_debug_info_(void);
333 
338 
343 };
344 }
345 }
346 }
347 
348 #include "Integer.inl"
349 
350 #endif // _MADARA_INTEGER_H_
madara::knowledge::KnowledgeRecord::Integer Integer
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
This class encapsulates an entry in a KnowledgeBase.
Settings for applying knowledge updates.
Settings for applying knowledge updates.
This class stores variables and their values for use by any entity needing state information in a thr...
Optimized reference to a variable within the knowledge base.
Provides an interface for external functions into the MADARA KaRL variable settings.
Definition: Variables.h:53
This class is an abstract base class for all containers.
Definition: BaseContainer.h:34
This class stores an integer within a variable context.
Definition: Integer.h:32
knowledge::KnowledgeRecord::Integer type
trait that describes the value type
Definition: Integer.h:35
ThreadSafeContext * context_
Variable context that we are modifying.
Definition: Integer.h:337
VariableReference variable_
Variable reference.
Definition: Integer.h:342
Provides container classes for fast knowledge base access and mutation.
Definition: Barrier.h:27
constexpr string_t string
Provides functions and classes for the distributed knowledge base.
auto operator==(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)==r)
auto operator-=(KnowledgeRecord &l, const T &r) -> decltype(l -=knowledge_cast(r))
auto operator*(const KnowledgeRecord &l, const T &r) -> decltype(l *knowledge_cast(r))
auto operator>=(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l) >=r)
auto operator<(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)< r)
auto operator!=(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l) !=r)
auto operator+=(KnowledgeRecord &l, const T &r) -> decltype(l+=knowledge_cast(r))
auto operator<=(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)<=r)
auto operator>(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l) > r)
MADARA_EXPORT bool exists(const char *originator, uint64_t clock, uint32_t update_number, OriginatorFragmentMap &map)
Checks if a fragment already exists within a fragment map.
Copyright(c) 2020 Galois.