MachineIntelligenceCore:Toolchain
|
Parent class for all classes possessing properties. Contains methods useful for their management, configuration, displaying etc. More...
#include <PropertyTree.hpp>
Public Member Functions | |
PropertyTree (std::string node_name_) | |
virtual | ~PropertyTree () |
void | registerProperty (PropertyInterface &prop) |
std::string | getNodeName () const |
void | loadPropertiesFromConfigNode (boost::property_tree::ptree const &pt_) |
void | printProperties () |
void | printPropertiesWithValues () |
PropertyInterface * | getProperty (const std::string &name) |
virtual void | initializePropertyDependentVariables ()=0 |
Private Attributes | |
std::map< std::string, mic::configuration::PropertyInterface * > | properties |
Map of all registered properties. More... | |
std::string | node_name |
Name of the node in configuration file. More... | |
Parent class for all classes possessing properties. Contains methods useful for their management, configuration, displaying etc.
Definition at line 37 of file PropertyTree.hpp.
mic::configuration::PropertyTree::PropertyTree | ( | std::string | node_name_ | ) |
Constructor. Sets the node name.
node_name_ | Name of the node (in configuration file). |
Definition at line 34 of file PropertyTree.cpp.
References PARAM_SERVER.
|
virtual |
Virtual destructor. Empty now.
Definition at line 39 of file PropertyTree.cpp.
std::string mic::configuration::PropertyTree::getNodeName | ( | ) | const |
Returns node name.
Definition at line 43 of file PropertyTree.cpp.
References node_name.
Referenced by mic::configuration::ParameterServer::registerPropertyTree().
PropertyInterface * mic::configuration::PropertyTree::getProperty | ( | const std::string & | name | ) |
Returns property with specified name if registered or NULL otherwise.
name | Property name. |
Definition at line 79 of file PropertyTree.cpp.
References properties.
Referenced by loadPropertiesFromConfigNode().
|
pure virtual |
Method responsible for initialization of all variables that are property-dependent - to make sure that one i.e. allocates memory for a block of adequate size (that is loaded from the configuration file).
Implemented in mic::application::ApplicationState.
void mic::configuration::PropertyTree::loadPropertiesFromConfigNode | ( | boost::property_tree::ptree const & | pt_ | ) |
Reads the values of its properties from config node.
Definition at line 88 of file PropertyTree.cpp.
References getProperty(), mic::configuration::PropertyInterface::getValue(), LDEBUG, LINFO, LOG, LTRACE, LWARNING, mic::configuration::PropertyInterface::name(), node_name, and mic::configuration::PropertyInterface::setValue().
void mic::configuration::PropertyTree::printProperties | ( | ) |
Prints the list of all registered properties.
Definition at line 53 of file PropertyTree.cpp.
References LDEBUG, LOG, node_name, and properties.
void mic::configuration::PropertyTree::printPropertiesWithValues | ( | ) |
Prints the list of all registered properties along with their values.
Definition at line 66 of file PropertyTree.cpp.
References LINFO, LOG, node_name, and properties.
void mic::configuration::PropertyTree::registerProperty | ( | PropertyInterface & | prop | ) |
Registers property - so its values can be externally overridden (e.g. read from the configuration file).
prop | Registered property. |
Definition at line 48 of file PropertyTree.cpp.
References mic::configuration::PropertyInterface::name(), and properties.
Referenced by mic::application::Application::Application(), mic::application::ApplicationState::ApplicationState(), mic::application::ContinuousLearningApplication::ContinuousLearningApplication(), and mic::application::EpisodicTrainAndTestApplication::EpisodicTrainAndTestApplication().
|
private |
Name of the node in configuration file.
Definition at line 94 of file PropertyTree.hpp.
Referenced by getNodeName(), loadPropertiesFromConfigNode(), printProperties(), and printPropertiesWithValues().
|
private |
Map of all registered properties.
Definition at line 91 of file PropertyTree.hpp.
Referenced by getProperty(), printProperties(), printPropertiesWithValues(), and registerProperty().