MADARA  3.2.3
NativeDoubleVector.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NATIVE_DOUBLE_VECTOR_H_
3 #define _MADARA_NATIVE_DOUBLE_VECTOR_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 NativeDoubleVector : public BaseContainer
32  {
33  public:
35  typedef double type;
36 
43 
51  NativeDoubleVector (const std::string & name,
53  int size = -1,
54  const KnowledgeUpdateSettings & settings =
56 
64  NativeDoubleVector (const std::string & name,
65  Variables & knowledge,
66  int size = -1,
67  const KnowledgeUpdateSettings & settings =
69 
74 
78  virtual ~NativeDoubleVector ();
79 
84  void modify (void);
85 
90  void operator= (const NativeDoubleVector & rhs);
91 
97  void push_back (type value);
98 
103  void resize (size_t size);
104 
110  void exchange (NativeDoubleVector & other);
111 
116  void transfer_to (NativeDoubleVector & other);
117 
122  void copy_to (KnowledgeVector & target) const;
123 
128  size_t size (void) const;
129 
136  void set_name (const std::string & var_name,
137  KnowledgeBase & knowledge, int size = -1);
138 
145  void set_name (const std::string & var_name,
146  Variables & knowledge, int size = -1);
147 
154  void set_name (const std::string & var_name,
155  ThreadSafeContext & knowledge, int size = -1);
156 
163  type operator[] (size_t index) const;
164 
173  int set (size_t index,
174  type value);
175 
185  int set (size_t index,
186  type value,
187  const KnowledgeUpdateSettings & settings);
188 
196  int set (
197  const std::vector <type> & value);
198 
207  int set (
208  const std::vector <type> & value,
209  const KnowledgeUpdateSettings & settings);
210 
219  int set (
220  const type * values,
221  uint32_t size);
222 
232  int set (
233  const type * values,
234  uint32_t size,
235  const KnowledgeUpdateSettings & settings);
236 
244  void set_quality (size_t index, uint32_t quality,
245  const KnowledgeReferenceSettings & settings =
247 
254  knowledge::KnowledgeRecord to_record (size_t index) const;
255 
260  knowledge::KnowledgeRecord to_record (void) const;
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 
340  }
341  }
342 }
343 
344 #endif // _MADARA_NATIVE_DOUBLE_VECTOR_H_
This class encapsulates an entry in a KnowledgeBase.
double type
trait that describes the value type
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
::std::vector< KnowledgeRecord > KnowledgeVector
ThreadSafeContext * context_
Variable context that we are modifying.
VariableReference vector_
Reference to the size field of the vector space.
static struct madara::knowledge::tags::string_t string
This class provides a distributed knowledge base to users.
Definition: KnowledgeBase.h:45
NativeDoubleVector NativeDoubleArray
provide the Array alias for the NativeDoubleVector class
This class stores a vector of doubles inside of KaRL.
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