MachineIntelligenceCore:Toolchain
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mic::configuration::PropertyTree Class Referenceabstract

Parent class for all classes possessing properties. Contains methods useful for their management, configuration, displaying etc. More...

#include <PropertyTree.hpp>

Inheritance diagram for mic::configuration::PropertyTree:

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 ()
 
PropertyInterfacegetProperty (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...
 

Detailed Description

Parent class for all classes possessing properties. Contains methods useful for their management, configuration, displaying etc.

Author
tkornuta

Definition at line 37 of file PropertyTree.hpp.

Constructor & Destructor Documentation

mic::configuration::PropertyTree::PropertyTree ( std::string  node_name_)

Constructor. Sets the node name.

Parameters
node_name_Name of the node (in configuration file).

Definition at line 34 of file PropertyTree.cpp.

References PARAM_SERVER.

mic::configuration::PropertyTree::~PropertyTree ( )
virtual

Virtual destructor. Empty now.

Definition at line 39 of file PropertyTree.cpp.

Member Function Documentation

std::string mic::configuration::PropertyTree::getNodeName ( ) const

Returns node name.

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.

Parameters
nameProperty name.
Returns
Pointer to a property with specified name or NULL if no such a property is registered.

Definition at line 79 of file PropertyTree.cpp.

References properties.

Referenced by loadPropertiesFromConfigNode().

virtual void mic::configuration::PropertyTree::initializePropertyDependentVariables ( )
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().

Here is the call graph for this function:

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).

Parameters
propRegistered 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().

Here is the call graph for this function:

Member Data Documentation

std::string mic::configuration::PropertyTree::node_name
private

Name of the node in configuration file.

Definition at line 94 of file PropertyTree.hpp.

Referenced by getNodeName(), loadPropertiesFromConfigNode(), printProperties(), and printPropertiesWithValues().

std::map<std::string, mic::configuration::PropertyInterface*> mic::configuration::PropertyTree::properties
private

Map of all registered properties.

Definition at line 91 of file PropertyTree.hpp.

Referenced by getProperty(), printProperties(), printPropertiesWithValues(), and registerProperty().


The documentation for this class was generated from the following files: