MADARA
3.1.8
|
This class is an abstract base class for all containers. More...
#include <BaseContainer.h>
Public Member Functions | |
BaseContainer (const std::string &name="", const KnowledgeUpdateSettings &settings=KnowledgeUpdateSettings()) | |
Constructor. More... | |
BaseContainer (const BaseContainer &rhs) | |
Copy constructor. More... | |
virtual | ~BaseContainer () |
Destructor. More... | |
virtual BaseContainer * | clone (void) const =0 |
Clones this container. More... | |
std::string | get_name (void) const |
Returns the name of the container. More... | |
KnowledgeUpdateSettings | get_settings (void) |
Gets the update settings for the container. More... | |
virtual bool | modify_if_false (BaseContainer &conditional) |
Modifies the container if the argument is false. More... | |
virtual bool | modify_if_true (BaseContainer &conditional) |
Modifies the container if the argument is true. More... | |
void | set_settings (const KnowledgeUpdateSettings &settings) |
Sets the update settings for the container. More... | |
Protected Member Functions | |
virtual std::string | get_debug_info_ (void)=0 |
Returns the type of the container along with name and any other useful information. More... | |
virtual bool | is_false_ (void) const =0 |
Polymorphic is false method which can be used to determine if all values in a container are false. More... | |
virtual bool | is_true_ (void) const =0 |
Polymorphic is true method which can be used to determine if all values in a container are true. More... | |
virtual void | modify_ (void)=0 |
Polymorphic modify method used by collection containers. More... | |
Protected Attributes | |
ThreadSafeContext * | context_ |
Variable context that we are modifying. More... | |
MADARA_LOCK_TYPE | mutex_ |
guard for access and changes More... | |
std::string | name_ |
Prefix of variable. More... | |
KnowledgeUpdateSettings | settings_ |
Settings for modifications. More... | |
Friends | |
class | Collection |
Allow Collection class to access protected/private areas. More... | |
This class is an abstract base class for all containers.
Definition at line 33 of file BaseContainer.h.
madara::knowledge::containers::BaseContainer::BaseContainer | ( | const std::string & | name = "" , |
const KnowledgeUpdateSettings & | settings = KnowledgeUpdateSettings () |
||
) |
Constructor.
name | prefix of the variable in the knowledge base |
settings | settings for updating knowledge |
Definition at line 6 of file BaseContainer.cpp.
madara::knowledge::containers::BaseContainer::BaseContainer | ( | const BaseContainer & | rhs | ) |
Copy constructor.
rhs | the source object to copy |
Definition at line 13 of file BaseContainer.cpp.
|
virtual |
Destructor.
Definition at line 22 of file BaseContainer.cpp.
|
pure virtual |
Clones this container.
Implemented in madara::knowledge::containers::FlexMap, madara::knowledge::containers::Vector, madara::knowledge::containers::Map, madara::knowledge::containers::BufferVector, madara::knowledge::containers::DoubleStaged, madara::knowledge::containers::IntegerStaged, madara::knowledge::containers::IntegerVector, madara::knowledge::containers::DoubleVectorVector, madara::knowledge::containers::IntegerVectorVector, madara::knowledge::containers::StringVector, madara::knowledge::containers::DoubleVector, madara::knowledge::containers::StringStaged, madara::knowledge::containers::Counter, madara::knowledge::containers::Double, madara::knowledge::containers::Integer, madara::knowledge::containers::DoubleVector3D, madara::knowledge::containers::IntegerVector3D, madara::knowledge::containers::String, madara::knowledge::containers::IntegerVector2D, madara::knowledge::containers::DoubleVector2D, madara::knowledge::containers::Barrier, madara::knowledge::containers::NativeDoubleVector, madara::knowledge::containers::NativeIntegerVector, madara::knowledge::containers::NativeDoubleVectorStaged, madara::knowledge::containers::NativeIntegerVectorStaged, and madara::knowledge::containers::Collection.
|
protectedpure virtual |
Returns the type of the container along with name and any other useful information.
The provided information should be useful for developers wishing to debug container operations, especially as it pertains to pending network operations (i.e., when used in conjunction with modify)
Implemented in madara::knowledge::containers::FlexMap, madara::knowledge::containers::Vector, madara::knowledge::containers::Map, madara::knowledge::containers::BufferVector, madara::knowledge::containers::DoubleStaged, madara::knowledge::containers::IntegerStaged, madara::knowledge::containers::IntegerVector, madara::knowledge::containers::DoubleVectorVector, madara::knowledge::containers::IntegerVectorVector, madara::knowledge::containers::StringVector, madara::knowledge::containers::DoubleVector, madara::knowledge::containers::StringStaged, madara::knowledge::containers::Counter, madara::knowledge::containers::Double, madara::knowledge::containers::Integer, madara::knowledge::containers::DoubleVector3D, madara::knowledge::containers::IntegerVector3D, madara::knowledge::containers::String, madara::knowledge::containers::IntegerVector2D, madara::knowledge::containers::DoubleVector2D, madara::knowledge::containers::Barrier, madara::knowledge::containers::NativeDoubleVector, madara::knowledge::containers::NativeDoubleVectorStaged, madara::knowledge::containers::NativeIntegerVector, madara::knowledge::containers::NativeIntegerVectorStaged, and madara::knowledge::containers::Collection.
|
inline |
Returns the name of the container.
Definition at line 5 of file BaseContainer.inl.
madara::knowledge::KnowledgeUpdateSettings madara::knowledge::containers::BaseContainer::get_settings | ( | void | ) |
Gets the update settings for the container.
Definition at line 37 of file BaseContainer.cpp.
|
protectedpure virtual |
Polymorphic is false method which can be used to determine if all values in a container are false.
Implemented in madara::knowledge::containers::FlexMap, madara::knowledge::containers::Vector, madara::knowledge::containers::Map, madara::knowledge::containers::BufferVector, madara::knowledge::containers::DoubleStaged, madara::knowledge::containers::IntegerStaged, madara::knowledge::containers::IntegerVector, madara::knowledge::containers::DoubleVectorVector, madara::knowledge::containers::IntegerVectorVector, madara::knowledge::containers::StringVector, madara::knowledge::containers::DoubleVector, madara::knowledge::containers::StringStaged, madara::knowledge::containers::Counter, madara::knowledge::containers::Double, madara::knowledge::containers::Integer, madara::knowledge::containers::DoubleVector3D, madara::knowledge::containers::IntegerVector3D, madara::knowledge::containers::String, madara::knowledge::containers::IntegerVector2D, madara::knowledge::containers::DoubleVector2D, madara::knowledge::containers::Barrier, madara::knowledge::containers::NativeDoubleVector, madara::knowledge::containers::NativeDoubleVectorStaged, madara::knowledge::containers::NativeIntegerVector, madara::knowledge::containers::NativeIntegerVectorStaged, and madara::knowledge::containers::Collection.
|
protectedpure virtual |
Polymorphic is true method which can be used to determine if all values in a container are true.
Implemented in madara::knowledge::containers::FlexMap, madara::knowledge::containers::Vector, madara::knowledge::containers::Map, madara::knowledge::containers::BufferVector, madara::knowledge::containers::DoubleStaged, madara::knowledge::containers::IntegerStaged, madara::knowledge::containers::IntegerVector, madara::knowledge::containers::DoubleVectorVector, madara::knowledge::containers::IntegerVectorVector, madara::knowledge::containers::StringVector, madara::knowledge::containers::DoubleVector, madara::knowledge::containers::StringStaged, madara::knowledge::containers::Counter, madara::knowledge::containers::Double, madara::knowledge::containers::Integer, madara::knowledge::containers::DoubleVector3D, madara::knowledge::containers::IntegerVector3D, madara::knowledge::containers::String, madara::knowledge::containers::IntegerVector2D, madara::knowledge::containers::DoubleVector2D, madara::knowledge::containers::Barrier, madara::knowledge::containers::NativeDoubleVector, madara::knowledge::containers::NativeDoubleVectorStaged, madara::knowledge::containers::NativeIntegerVector, madara::knowledge::containers::NativeIntegerVectorStaged, and madara::knowledge::containers::Collection.
|
protectedpure virtual |
Polymorphic modify method used by collection containers.
This method calls the modify method for this class. We separate the faster version (modify) from this version (modify_) to allow users the opportunity to have a fastery version that does not use polymorphic functions (generally virtual functions are half as efficient as normal function calls)
Implemented in madara::knowledge::containers::FlexMap, madara::knowledge::containers::Vector, madara::knowledge::containers::Map, madara::knowledge::containers::BufferVector, madara::knowledge::containers::DoubleStaged, madara::knowledge::containers::IntegerStaged, madara::knowledge::containers::IntegerVector, madara::knowledge::containers::DoubleVectorVector, madara::knowledge::containers::IntegerVectorVector, madara::knowledge::containers::StringVector, madara::knowledge::containers::DoubleVector, madara::knowledge::containers::StringStaged, madara::knowledge::containers::Counter, madara::knowledge::containers::Double, madara::knowledge::containers::Integer, madara::knowledge::containers::DoubleVector3D, madara::knowledge::containers::IntegerVector3D, madara::knowledge::containers::String, madara::knowledge::containers::IntegerVector2D, madara::knowledge::containers::DoubleVector2D, madara::knowledge::containers::Barrier, madara::knowledge::containers::NativeDoubleVector, madara::knowledge::containers::NativeDoubleVectorStaged, madara::knowledge::containers::NativeIntegerVector, madara::knowledge::containers::NativeIntegerVectorStaged, and madara::knowledge::containers::Collection.
|
virtual |
Modifies the container if the argument is false.
conditional | the container that must be false to modify |
Definition at line 64 of file BaseContainer.cpp.
|
virtual |
Modifies the container if the argument is true.
conditional | the container that must be true to modify |
Definition at line 44 of file BaseContainer.cpp.
void madara::knowledge::containers::BaseContainer::set_settings | ( | const KnowledgeUpdateSettings & | settings | ) |
Sets the update settings for the container.
settings | the new settings to use |
Definition at line 28 of file BaseContainer.cpp.
|
friend |
Allow Collection class to access protected/private areas.
Definition at line 37 of file BaseContainer.h.
|
protected |
Variable context that we are modifying.
Definition at line 146 of file BaseContainer.h.
|
mutableprotected |
guard for access and changes
Mutex for local changes
Definition at line 141 of file BaseContainer.h.
|
protected |
Prefix of variable.
Definition at line 151 of file BaseContainer.h.
|
protected |
Settings for modifications.
Definition at line 156 of file BaseContainer.h.