MADARA  3.4.1
NativeIntegerVector.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_NATIVE_INTEGER_VECTOR_H_
3 #define _MADARA_NATIVE_INTEGER_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 NativeIntegerVector : public BaseContainer
32 {
33 public:
36 
43 
52  int size = -1,
54 
63  int size = -1,
65 
70 
74  virtual ~NativeIntegerVector();
75 
80  void modify(void);
81 
86  void operator=(const NativeIntegerVector& rhs);
87 
93  void push_back(type value);
94 
99  void resize(size_t size);
100 
106  void exchange(NativeIntegerVector& other);
107 
112  void transfer_to(NativeIntegerVector& other);
113 
118  void copy_to(KnowledgeVector& target) const;
119 
125  bool exists(void) const;
126 
131  size_t size(void) const;
132 
139  void set_name(
140  const std::string& var_name, KnowledgeBase& knowledge, int size = -1);
141 
148  void set_name(
149  const std::string& var_name, Variables& knowledge, int size = -1);
150 
157  void set_name(
158  const std::string& var_name, ThreadSafeContext& knowledge, int size = -1);
159 
166  type operator[](size_t index) const;
167 
176  int set(size_t index, type value);
177 
187  int set(size_t index, type value, const KnowledgeUpdateSettings& settings);
188 
196  int set(const std::vector<type>& value);
197 
206  int set(
207  const std::vector<type>& value, const KnowledgeUpdateSettings& settings);
208 
216  void set_quality(size_t index, uint32_t quality,
218  false));
219 
224  std::vector<KnowledgeRecord::Integer> to_integers(void) const;
225 
232  knowledge::KnowledgeRecord to_record(size_t index) const;
233 
238  knowledge::KnowledgeRecord to_record(void) const;
239 
249  std::string get_debug_info(void);
250 
256  virtual BaseContainer* clone(void) const;
257 
262  bool is_true(void) const;
263 
268  bool is_false(void) const;
269 
270 private:
275  virtual bool is_true_(void) const;
276 
281  virtual bool is_false_(void) const;
282 
291  virtual void modify_(void);
292 
302  virtual std::string get_debug_info_(void);
303 
308 
313 };
314 
317 }
318 }
319 }
320 
321 #endif // _MADARA_NATIVE_INTEGER_VECTOR_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 vector of doubles inside of KaRL.
VariableReference vector_
Reference to the size field of the vector space.
ThreadSafeContext * context_
Variable context that we are modifying.
knowledge::KnowledgeRecord::Integer type
trait that describes the value type
Provides container classes for fast knowledge base access and mutation.
Definition: Barrier.h:27
NativeIntegerVector NativeIntegerArray
provide the Array alias for the NativeIntegerVector class
constexpr string_t string
Provides functions and classes for the distributed knowledge base.
::std::vector< KnowledgeRecord > KnowledgeVector
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.