MADARA  3.1.8
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 
42  Double (const KnowledgeUpdateSettings & settings =
44 
51  Double (const std::string & name,
53  const KnowledgeUpdateSettings & settings =
55 
62  Double (const std::string & name,
63  Variables & knowledge,
64  const KnowledgeUpdateSettings & settings =
66 
74  Double (const std::string & name,
75  KnowledgeBase & knowledge,
76  type value,
77  const KnowledgeUpdateSettings & settings =
79 
87  Double (const std::string & name,
88  Variables & knowledge,
89  type value,
90  const KnowledgeUpdateSettings & settings =
92 
96  Double (const Double & rhs);
97 
101  virtual ~Double ();
102 
107  void modify (void);
108 
113  void operator= (const Double & rhs);
114 
120  void set_name (const std::string & var_name,
121  KnowledgeBase & knowledge);
122 
128  void set_name (const std::string & var_name,
129  Variables & knowledge);
130 
136  void set_name (const std::string & var_name,
137  ThreadSafeContext & knowledge);
138 
144  void exchange (containers::Double & other);
145 
151  type operator= (type value);
152 
157  type operator* (void) const;
158 
164  type operator+= (type value);
165 
171  type operator-= (type value);
172 
178  type operator++ (void);
179 
185  type operator-- (void);
186 
192  bool exists (void) 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!= (const Double & value) const;
221 
227  bool operator< (type value) const;
228 
234  bool operator<= (type value) const;
235 
241  bool operator> (type value) const;
242 
248  bool operator>= (type value) const;
249 
254  knowledge::KnowledgeRecord::Integer to_integer (void) const;
255 
261  knowledge::KnowledgeRecord to_record (void) const;
262 
267  double to_double (void) const;
268 
273  std::string to_string (void) const;
274 
281  void set_quality (uint32_t quality,
282  const KnowledgeReferenceSettings & settings =
284 
285 
295  std::string get_debug_info (void);
296 
302  virtual BaseContainer * clone (void) const;
303 
308  bool is_true (void) const;
309 
314  bool is_false (void) const;
315 
316  private:
317 
322  virtual bool is_true_ (void) const;
323 
328  virtual bool is_false_ (void) const;
329 
338  virtual void modify_ (void);
339 
349  virtual std::string get_debug_info_ (void);
350 
355 
360  };
361  }
362  }
363 }
364 
365 
366 
367 
368 #endif // _MADARA_DOUBLE_H_
This class encapsulates an entry in a KnowledgeBase.
This class stores a double within a variable context.
Definition: Double.h:32
auto operator>=(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get() >=rhs.get())
Definition: Tracked.h:247
auto operator>(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get() >rhs.get())
Definition: Tracked.h:249
auto operator<=(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()<=rhs.get())
Definition: Tracked.h:246
auto operator<(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()< rhs.get())
Definition: Tracked.h:248
auto operator--(Tracked< T > &lhs) -> decltype(--lhs.get_mut())
Definition: Tracked.h:302
auto operator+=(Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get_mut()+=rhs.get())
Definition: Tracked.h:274
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 container classes for fast knowledge base access and mutation.
Definition: Barrier.h:27
auto operator*(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()*rhs.get())
Definition: Tracked.h:276
ThreadSafeContext * context_
Variable context that we are modifying.
Definition: Double.h:354
double type
trait that describes the value type
Definition: Double.h:36
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:44
VariableReference variable_
Variable reference.
Definition: Double.h:359
auto operator-=(Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get_mut()-=rhs.get())
Definition: Tracked.h:275
static constexpr struct madara::knowledge::tags::string_t string
auto operator==(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()==rhs.get())
Definition: Tracked.h:244
auto operator!=(const Tracked< T > &lhs, const Tracked< U > &rhs) -> decltype(lhs.get()!=rhs.get())
Definition: Tracked.h:245
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.
Provides functions and classes for the distributed knowledge base.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.
Settings for applying knowledge updates.
Provides an interface for external functions into the MADARA KaRL variable settings.
This class is an abstract base class for all containers.
Definition: BaseContainer.h:33
auto operator++(Tracked< T > &lhs) -> decltype(++lhs.get_mut())
Definition: Tracked.h:301