presage
0.9.2~beta
|
#include <profile.h>
Classes | |
class | ProfileException |
Public Member Functions | |
Profile (const std::string &filename) | |
virtual | ~Profile () |
void | read_into_configuration (Configuration *configuration) |
void | read_from_configuration (Configuration *configuration) |
bool | file_read_ok () const |
bool | write_to_file () const |
Protected Member Functions | |
void | init_configuration (Configuration *config, TiXmlDocument *node) |
void | visit_node (Configuration *config, TiXmlNode *node, std::vector< std::string > variable) |
Protected Attributes | |
TiXmlDocument * | xmlProfileDoc |
std::string | xml_filename |
bool | xml_profile_read_ok |
Profile provides access to the active profile configuration variables.
Profile only provides an accessor method to read configuration values. The class is immutable. It is not possible to modify configuration values. Configuration values are set when the Profile is constructed.
Profile acts as an interface to ProfileManager. It converts simple requests for configuration variable values from client objects (such as Plugin objects) into requests to ProfileManager. There is no need to have a map containing the variable, value pairs. It is sufficient to keep a reference to ProfileManager and have ProfileManager expose an interface that Profile can use to query variable values.
Profile::Profile | ( | const std::string & | filename | ) |
Profile constructor.
filename | where profile is saved to |
Definition at line 30 of file profile.cpp.
References xml_filename, xml_profile_read_ok, and xmlProfileDoc.
|
virtual |
Profile destructor.
Destructor deallocates the Configuration object passed in costructor.
Definition at line 40 of file profile.cpp.
References xmlProfileDoc.
bool Profile::file_read_ok | ( | ) | const |
Definition at line 45 of file profile.cpp.
References xml_profile_read_ok.
Referenced by ProfileManager::create_profile_from_xml(), and ProfileManager::init_profiles().
|
protected |
Definition at line 55 of file profile.cpp.
References config, and visit_node().
Referenced by read_into_configuration().
void Profile::read_from_configuration | ( | Configuration * | configuration | ) |
Definition at line 102 of file profile.cpp.
References Configuration::begin(), Configuration::end(), Variable::string_to_vector(), and xmlProfileDoc.
Referenced by ProfileManager::save_profile().
void Profile::read_into_configuration | ( | Configuration * | configuration | ) |
Writes configuration from XML DOM document into configuration.
Definition at line 50 of file profile.cpp.
References config, init_configuration(), and xmlProfileDoc.
Referenced by ProfileManager::init_profiles().
|
protected |
Definition at line 62 of file profile.cpp.
References Configuration::insert(), and Variable::vector_to_string().
Referenced by init_configuration().
bool Profile::write_to_file | ( | ) | const |
Definition at line 96 of file profile.cpp.
References xml_filename, and xmlProfileDoc.
Referenced by ProfileManager::save_profile().
|
protected |
Definition at line 100 of file profile.h.
Referenced by Profile(), and write_to_file().
|
protected |
Definition at line 101 of file profile.h.
Referenced by file_read_ok(), and Profile().
|
protected |
Definition at line 99 of file profile.h.
Referenced by DefaultProfile::build_xml_document(), Profile(), read_from_configuration(), read_into_configuration(), write_to_file(), and ~Profile().