MADARA  3.4.1
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 
41 
50 
59  const std::string& value,
61 
68  String(const std::string& name, Variables& knowledge,
70 
78  String(const std::string& name, Variables& knowledge,
79  const std::string& value,
81 
85  String(const String& rhs);
86 
90  virtual ~String();
91 
96  void modify(void);
97 
102  void operator=(const String& rhs);
103 
109  void exchange(String& other);
110 
116  void set_name(const std::string& var_name, KnowledgeBase& knowledge);
117 
123  void set_name(const std::string& var_name, Variables& knowledge);
124 
130  void set_name(const std::string& var_name, ThreadSafeContext& knowledge);
131 
137  type operator=(const type& value);
138 
144  type operator+=(const type& value);
145 
151  bool operator==(const type& value) const;
152 
158  bool operator!=(const type& value) const;
159 
165  bool operator==(const String& value) const;
166 
172  bool operator!=(const String& value) const;
173 
179  bool operator<(const type& value) const;
180 
186  bool operator<=(const type& value) const;
187 
193  bool operator>(const type& value) const;
194 
200  bool operator>=(const type& value) const;
201 
206  type operator*(void)const;
207 
213  bool exists(void) const;
214 
220  knowledge::KnowledgeRecord to_record(void) const;
221 
226  madara::knowledge::KnowledgeRecord::Integer to_integer(void) const;
227 
232  double to_double(void) const;
233 
238  std::string to_string(void) const;
239 
246  void set_quality(uint32_t quality,
248  false));
249 
259  std::string get_debug_info(void);
260 
266  virtual BaseContainer* clone(void) const;
267 
272  bool is_true(void) const;
273 
278  bool is_false(void) const;
279 
280 private:
285  virtual bool is_true_(void) const;
286 
291  virtual bool is_false_(void) const;
292 
301  virtual void modify_(void);
302 
312  virtual std::string get_debug_info_(void);
313 
318 
323 };
324 }
325 }
326 }
327 
328 #endif // _MADARA_STRING_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 string within a variable context.
Definition: String.h:32
std::string type
trait that describes the value type
Definition: String.h:35
ThreadSafeContext * context_
Variable context that we are modifying.
Definition: String.h:317
VariableReference variable_
Variable reference.
Definition: String.h:322
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*(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.