MADARA  3.2.3
BaseContainer.h
Go to the documentation of this file.
1 
2 #ifndef _MADARA_CONTAINERS_BASE_CONTAINER_H_
3 #define _MADARA_CONTAINERS_BASE_CONTAINER_H_
4 
5 #include <vector>
6 #include <string>
7 #include "madara/LockType.h"
11 
20 namespace madara
21 {
22  namespace knowledge
23  {
24  namespace containers
25  {
27  class Collection;
28 
33  class MADARA_EXPORT BaseContainer
34  {
35  public:
37  friend class Collection;
38 
39 
45  BaseContainer (const std::string & name = "",
46  const KnowledgeUpdateSettings & settings =
48 
53  BaseContainer (const BaseContainer & rhs);
54 
58  virtual ~BaseContainer ();
59 
64  std::string get_name (void) const;
65 
70  KnowledgeUpdateSettings get_settings (void);
71 
76  void set_settings (
77  const KnowledgeUpdateSettings & settings);
78 
84  virtual BaseContainer * clone (void) const = 0;
85 
91  virtual bool modify_if_true (BaseContainer & conditional);
92 
98  virtual bool modify_if_false (BaseContainer & conditional);
99 
100  protected:
101 
106  virtual bool is_true_ (void) const = 0;
107 
112  virtual bool is_false_ (void) const = 0;
113 
122  virtual void modify_ (void) = 0;
123 
133  virtual std::string get_debug_info_ (void) = 0;
134 
136 
137 
141  mutable MADARA_LOCK_TYPE mutex_;
142 
147 
152 
157  };
158  }
159  }
160 }
161 
162 #include "BaseContainer.inl"
163 
164 
165 #endif // _MADARA_CONTAINERS_BASE_CONTAINER_H_
std::string name_
Prefix of variable.
This class stores variables and their values for use by any entity needing state information in a thr...
A collection of MADARA containers that can be used for aggregate operations on all containers in the ...
Definition: Collection.h:43
MADARA_LOCK_TYPE mutex_
guard for access and changes
Provides container classes for fast knowledge base access and mutation.
Definition: Barrier.h:27
static struct madara::knowledge::tags::string_t string
Provides functions and classes for the distributed knowledge base.
KnowledgeUpdateSettings settings_
Settings for modifications.
Settings for applying knowledge updates.
ThreadSafeContext * context_
Variable context that we are modifying.
Copyright (c) 2015 Carnegie Mellon University.
This class is an abstract base class for all containers.
Definition: BaseContainer.h:33