MADARA  3.2.3
String.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_STRING_H_
3 #define _MADARA_STRING_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 String : public BaseContainer
32  {
33  public:
35  typedef std::string type;
36 
40  String (const KnowledgeUpdateSettings & settings =
42 
49  String (const std::string & name,
51  const KnowledgeUpdateSettings & settings =
53 
61  String (const std::string & name,
62  KnowledgeBase & knowledge,
63  const std::string & value,
64  const KnowledgeUpdateSettings & settings =
66 
73  String (const std::string & name,
74  Variables & knowledge,
75  const KnowledgeUpdateSettings & settings =
77 
85  String (const std::string & name,
86  Variables & knowledge,
87  const std::string & value,
88  const KnowledgeUpdateSettings & settings =
90 
94  String (const String & rhs);
95 
99  virtual ~String ();
100 
105  void modify (void);
106 
111  void operator= (const String & rhs);
112 
118  void exchange (String & other);
119 
125  void set_name (const std::string & var_name,
126  KnowledgeBase & knowledge);
127 
133  void set_name (const std::string & var_name,
134  Variables & knowledge);
135 
141  void set_name (const std::string & var_name,
142  ThreadSafeContext & knowledge);
143 
149  type operator= (const type & value);
150 
156  type operator+= (type value);
157 
163  bool operator== (type value) const;
164 
170  bool operator!= (type value) const;
171 
177  bool operator== (const String & value) const;
178 
184  bool operator!= (const String & value) const;
185 
191  bool operator< (type value) const;
192 
198  bool operator<= (type value) const;
199 
205  bool operator> (type value) const;
206 
212  bool operator>= (type value) const;
213 
218  type operator* (void) const;
219 
225  bool exists (void) const;
226 
232  knowledge::KnowledgeRecord to_record (void) const;
233 
238  madara::knowledge::KnowledgeRecord::Integer to_integer (void) const;
239 
244  double to_double (void) const;
245 
250  std::string to_string (void) const;
251 
258  void set_quality (uint32_t quality,
259  const KnowledgeReferenceSettings & settings =
261 
271  std::string get_debug_info (void);
272 
278  virtual BaseContainer * clone (void) const;
279 
284  bool is_true (void) const;
285 
290  bool is_false (void) const;
291 
292  private:
293 
298  virtual bool is_true_ (void) const;
299 
304  virtual bool is_false_ (void) const;
305 
314  virtual void modify_ (void);
315 
325  virtual std::string get_debug_info_ (void);
326 
331 
336  };
337  }
338  }
339 }
340 
341 
342 
343 
344 #endif // _MADARA_STRING_H_
This class encapsulates an entry in a KnowledgeBase.
auto operator+=(KnowledgeRecord &l, const T &r) -> decltype(l+=knowledge_cast(r))
VariableReference variable_
Variable reference.
Definition: String.h:335
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)
This class stores a string within a variable context.
Definition: String.h:31
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.
std::string type
trait that describes the value type
Definition: String.h:35
Provides container classes for fast knowledge base access and mutation.
Definition: Barrier.h:27
static struct madara::knowledge::tags::string_t string
ThreadSafeContext * context_
Variable context that we are modifying.
Definition: String.h:330
auto operator<(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)< r)
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
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)
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.
auto operator!=(const KnowledgeRecord &l, const T &r) -> decltype(knowledge_cast< T >(l)!=r)
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