MADARA  3.2.3
NativeIntegerVectorStaged.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NATIVE_INTEGER_VECTOR_STAGED_H_
3 #define _MADARA_NATIVE_INTEGER_VECTOR_STAGED_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 NativeIntegerVectorStaged : public BaseContainer
32  {
33  public:
36 
43 
53  int size = -1,
54  const KnowledgeUpdateSettings & settings =
56 
65  Variables & knowledge,
66  int size = -1,
67  const KnowledgeUpdateSettings & settings =
69 
74 
78  virtual ~NativeIntegerVectorStaged ();
79 
84  void modify (void);
85 
90  void operator= (const NativeIntegerVectorStaged & rhs);
91 
96  void operator= (const std::vector <type> & rhs);
97 
103  void push_back (type value);
104 
109  void resize (size_t size);
110 
116  void exchange (NativeIntegerVectorStaged & other);
117 
122  void transfer_to (NativeIntegerVectorStaged & other);
123 
128  void copy_to (KnowledgeVector & target) const;
129 
134  size_t size (void) const;
135 
143  void set_name (const std::string & var_name,
144  KnowledgeBase & knowledge, int size = -1,
145  bool sync = true);
146 
154  void set_name (const std::string & var_name,
155  Variables & knowledge, int size = -1,
156  bool sync = true);
157 
165  void set_name (const std::string & var_name,
166  ThreadSafeContext & knowledge, int size = -1,
167  bool sync = true);
168 
175  type operator[] (size_t index) const;
176 
183  void set (size_t index,
184  type value);
185 
191  void set (
192  const std::vector <type> & value);
193 
201  void set_quality (size_t index, uint32_t quality,
202  const KnowledgeReferenceSettings & settings =
204 
211  knowledge::KnowledgeRecord to_record (size_t index) const;
212 
217  knowledge::KnowledgeRecord to_record (void) const;
218 
228  std::string get_debug_info (void);
229 
235  virtual BaseContainer * clone (void) const;
236 
241  bool is_true (void) const;
242 
247  bool is_false (void) const;
248 
252  void read (void);
253 
257  void write (void);
258 
259  private:
260 
265  virtual bool is_true_ (void) const;
266 
271  virtual bool is_false_ (void) const;
272 
281  virtual void modify_ (void);
282 
292  virtual std::string get_debug_info_ (void);
293 
298 
303 
308 
313  };
314 
317  }
318  }
319 }
320 
322 
323 #endif // _MADARA_NATIVE_INTEGER_VECTOR_STAGED_H_
This class encapsulates an entry in a KnowledgeBase.
This class stores a vector of doubles inside of KaRL.
ThreadSafeContext * context_
Variable context that we are modifying.
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.
KnowledgeRecord value_
The staged value of the vector.
Provides container classes for fast knowledge base access and mutation.
Definition: Barrier.h:27
::std::vector< KnowledgeRecord > KnowledgeVector
static struct madara::knowledge::tags::string_t string
VariableReference vector_
Reference to the size field of the vector space.
bool has_changed_
Tracks if value_ has changed since last read.
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
knowledge::KnowledgeRecord::Integer type
trait that describes the value type
Provides functions and classes for the distributed knowledge base.
Settings for applying knowledge updates.
Copyright (c) 2015 Carnegie Mellon University.
NativeIntegerVectorStaged NativeIntegerArrayStaged
provide the Array alias for the NativeIntegerVectorStaged class
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