MADARA
3.1.8
|
A collection of MADARA containers that can be used for aggregate operations on all containers in the collection. More...
#include <Collection.h>
Public Member Functions | |
Collection () | |
Constructor. More... | |
Collection (const Collection &rhs) | |
Copy constructor. More... | |
virtual | ~Collection () |
Destructor. More... | |
void | add (const BaseContainer &container) |
Adds a class implementing BaseContainer to the collection. More... | |
void | clear (void) |
Clears the collection of all containers. More... | |
virtual BaseContainer * | clone (void) const |
Clones this container. More... | |
std::string | get_debug_info (void) |
Returns the type of the containers along with name and any other useful information. 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... | |
bool | is_false (void) const |
Determines if the value of the collection is false. More... | |
bool | is_true (void) const |
Determines if all values in the collection are true. More... | |
void | modify (void) |
Mark all values in the container as modified. 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 all containers. More... | |
size_t | size (void) const |
Returns the size of the collection. More... | |
Protected Member Functions | |
virtual std::string | get_debug_info_ (void) |
Returns the type of the container along with name and any other useful information. More... | |
virtual bool | is_false_ (void) const |
Polymorphic is false method which can be used to determine if at least one value in the container is false. More... | |
virtual bool | is_true_ (void) const |
Polymorphic is true method which can be used to determine if all values in the container are true. More... | |
virtual void | modify_ (void) |
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... | |
std::vector< BaseContainer * > | vector_ |
The underlying collection of containers. More... | |
A collection of MADARA containers that can be used for aggregate operations on all containers in the collection.
Definition at line 43 of file Collection.h.
madara::knowledge::containers::Collection::Collection | ( | ) |
Constructor.
Definition at line 3 of file Collection.cpp.
madara::knowledge::containers::Collection::Collection | ( | const Collection & | rhs | ) |
Copy constructor.
rhs | the source object to copy |
Definition at line 9 of file Collection.cpp.
|
virtual |
Destructor.
Definition at line 21 of file Collection.cpp.
|
inline |
Adds a class implementing BaseContainer to the collection.
container | the container to add |
Definition at line 8 of file Collection.inl.
|
inline |
Clears the collection of all containers.
Definition at line 16 of file Collection.inl.
|
virtual |
Clones this container.
Implements madara::knowledge::containers::BaseContainer.
Definition at line 65 of file Collection.cpp.
std::string madara::knowledge::containers::Collection::get_debug_info | ( | void | ) |
Returns the type of the containers along with name and any other useful information.
Definition at line 38 of file Collection.cpp.
|
protectedvirtual |
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)
Implements madara::knowledge::containers::BaseContainer.
Definition at line 59 of file Collection.cpp.
|
inlineinherited |
Returns the name of the container.
Definition at line 5 of file BaseContainer.inl.
|
inherited |
Gets the update settings for the container.
Definition at line 37 of file BaseContainer.cpp.
bool madara::knowledge::containers::Collection::is_false | ( | void | ) | const |
Determines if the value of the collection is false.
Definition at line 100 of file Collection.cpp.
|
protectedvirtual |
Polymorphic is false method which can be used to determine if at least one value in the container is false.
Implements madara::knowledge::containers::BaseContainer.
Definition at line 113 of file Collection.cpp.
bool madara::knowledge::containers::Collection::is_true | ( | void | ) | const |
Determines if all values in the collection are true.
Definition at line 71 of file Collection.cpp.
|
protectedvirtual |
Polymorphic is true method which can be used to determine if all values in the container are true.
Implements madara::knowledge::containers::BaseContainer.
Definition at line 107 of file Collection.cpp.
void madara::knowledge::containers::Collection::modify | ( | void | ) |
Mark all values in the container as modified.
Definition at line 27 of file Collection.cpp.
|
protectedvirtual |
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)
Implements madara::knowledge::containers::BaseContainer.
Definition at line 53 of file Collection.cpp.
|
virtualinherited |
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.
|
virtualinherited |
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.
|
inline |
Sets the update settings for all containers.
settings | the new settings to use |
Definition at line 29 of file Collection.inl.
|
inline |
Returns the size of the collection.
Definition at line 41 of file Collection.inl.
|
protectedinherited |
Variable context that we are modifying.
Definition at line 146 of file BaseContainer.h.
|
mutableprotectedinherited |
guard for access and changes
Mutex for local changes
Definition at line 141 of file BaseContainer.h.
|
protectedinherited |
Prefix of variable.
Definition at line 151 of file BaseContainer.h.
|
protectedinherited |
Settings for modifications.
Definition at line 156 of file BaseContainer.h.
|
protected |
The underlying collection of containers.
Definition at line 156 of file Collection.h.