MADARA  3.4.1
Double.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_DOUBLE_H_
3 #define _MADARA_DOUBLE_H_
4 
5 #include <vector>
6 #include <string>
7 #include "madara/LockType.h"
11 
12 #include "BaseContainer.h"
13 
22 namespace madara
23 {
24 namespace knowledge
25 {
26 namespace containers
27 {
32 class MADARA_EXPORT Double : public BaseContainer
33 {
34 public:
36  typedef double type;
37 
43 
52 
59  Double(const std::string& name, Variables& knowledge,
61 
69  Double(const std::string& name, KnowledgeBase& knowledge, type value,
71 
79  Double(const std::string& name, Variables& knowledge, type value,
81 
85  Double(const Double& rhs);
86 
90  virtual ~Double();
91 
96  void modify(void);
97 
102  void operator=(const Double& rhs);
103 
109  void set_name(const std::string& var_name, KnowledgeBase& knowledge);
110 
116  void set_name(const std::string& var_name, Variables& knowledge);
117 
123  void set_name(const std::string& var_name, ThreadSafeContext& knowledge);
124 
130  void exchange(containers::Double& other);
131 
137  type operator=(type value);
138 
143  type operator*(void)const;
144 
150  type operator+=(type value);
151 
157  type operator-=(type value);
158 
164  type operator++(void);
165 
171  type operator--(void);
172 
178  bool exists(void) const;
179 
185  bool operator==(type value) const;
186 
192  bool operator==(const Double& value) const;
193 
199  bool operator!=(type value) const;
200 
206  bool operator!=(const Double& value) const;
207 
213  bool operator<(type value) const;
214 
220  bool operator<=(type value) const;
221 
227  bool operator>(type value) const;
228 
234  bool operator>=(type value) const;
235 
240  knowledge::KnowledgeRecord::Integer to_integer(void) const;
241 
247  knowledge::KnowledgeRecord to_record(void) const;
248 
253  double to_double(void) const;
254 
259  std::string to_string(void) const;
260 
267  void set_quality(uint32_t quality,
269  false));
270 
280  std::string get_debug_info(void);
281 
287  virtual BaseContainer* clone(void) const;
288 
293  bool is_true(void) const;
294 
299  bool is_false(void) const;
300 
301 private:
306  virtual bool is_true_(void) const;
307 
312  virtual bool is_false_(void) const;
313 
322  virtual void modify_(void);
323 
333  virtual std::string get_debug_info_(void);
334 
339 
344 };
345 }
346 }
347 }
348 
349 #endif // _MADARA_DOUBLE_H_
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 a double within a variable context.
Definition: Double.h:33
double type
trait that describes the value type
Definition: Double.h:36
VariableReference variable_
Variable reference.
Definition: Double.h:343
ThreadSafeContext * context_
Variable context that we are modifying.
Definition: Double.h:338
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.