config_variable Class Template Reference

#include <config.hpp>

Inheritance diagram for config_variable:

Inheritance graph
[legend]
Collaboration diagram for config_variable:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<typename T>
class gsgl::data::config_variable< T >

Definition at line 187 of file config.hpp.


Public Member Functions

template<>
void assign_from_string (const gsgl::string &s)
 Change the value of the config variable based on a given string.
template<>
void assign_from_string (const gsgl::string &s)
 Change the value of the config variable based on a given string.
template<>
void assign_from_string (const gsgl::string &s)
 Change the value of the config variable based on a given string.
template<>
void assign_from_string (const gsgl::string &s)
 Change the value of the config variable based on a given string.
 config_variable (const gsgl::string &path, const T &value=T())
template<>
gsgl::string get_string () const
 Get a string representation of the value of the variable.
template<>
gsgl::string get_string () const
 Get a string representation of the value of the variable.
template<>
gsgl::string get_string () const
 Get a string representation of the value of the variable.
template<>
gsgl::string get_string () const
 Get a string representation of the value of the variable.
const T & get_value () const
 operator const T & () const

Static Public Member Functions

static const config_recordget_config ()
 Returns a reference to the global config record that contains entries for all config variables.
static void override_with (const config_record &)
 Override the global config vars with the data in the given config record.
static void save (const gsgl::string &fname)
 Save the global config to a file.

Protected Member Functions

virtual void assign_from_string (const gsgl::string &)
 Change the value of the config variable based on a given string.
virtual gsgl::string get_string () const
 Get a string representation of the value of the variable.

Protected Attributes

config_recordassociated_record

Static Protected Attributes

static config_record global_config_vars

Private Member Functions

 config_variable (const config_variable &cv)
 You cannot copy config variables.
config_variableoperator= (const config_variable &cv)
 You cannot copy config variables.

Private Attributes

value

Constructor & Destructor Documentation

config_variable ( const gsgl::string path,
const T &  value = T() 
) [inline]

Definition at line 192 of file config.hpp.

config_variable ( const config_variable< T > &  cv  )  [inline, private]

You cannot copy config variables.

Definition at line 204 of file config.hpp.


Member Function Documentation

void assign_from_string ( const gsgl::string  )  [inline, virtual]

Change the value of the config variable based on a given string.

Implements global_config.

Definition at line 110 of file color.hpp.

References iterable::iter(), string::split(), and config_variable::value.

void assign_from_string ( const gsgl::string  )  [inline, virtual]

Change the value of the config variable based on a given string.

Implements global_config.

Definition at line 262 of file config.hpp.

References string::to_int(), and config_variable::value.

void assign_from_string ( const gsgl::string  )  [inline, virtual]

Change the value of the config variable based on a given string.

Implements global_config.

Definition at line 248 of file config.hpp.

References string::to_double(), and config_variable::value.

void assign_from_string ( const gsgl::string  )  [inline, virtual]

Change the value of the config variable based on a given string.

Implements global_config.

Definition at line 222 of file config.hpp.

References config_variable::value.

virtual void assign_from_string ( const gsgl::string  )  [protected, virtual]

Change the value of the config variable based on a given string.

Implements global_config.

Referenced by config_variable< gsgl::platform::color >::config_variable().

static const config_record& get_config (  )  [inline, static, inherited]

Returns a reference to the global config record that contains entries for all config variables.

Note that not all entries may be present if package DLLs have not yet been loaded.

Definition at line 174 of file config.hpp.

Referenced by application::application(), and application::get_config_overrides().

gsgl::string get_string (  )  const [inline, virtual]

Get a string representation of the value of the variable.

Implements global_config.

Definition at line 103 of file color.hpp.

References string::format(), and config_variable::value.

gsgl::string get_string (  )  const [inline, virtual]

Get a string representation of the value of the variable.

Implements global_config.

Definition at line 269 of file config.hpp.

References string::format(), and config_variable::value.

gsgl::string get_string (  )  const [inline, virtual]

Get a string representation of the value of the variable.

Implements global_config.

Definition at line 255 of file config.hpp.

References string::format(), and config_variable::value.

gsgl::string get_string (  )  const [inline, virtual]

Get a string representation of the value of the variable.

Implements global_config.

Definition at line 229 of file config.hpp.

References config_variable::value.

virtual gsgl::string get_string (  )  const [protected, virtual]

Get a string representation of the value of the variable.

Implements global_config.

Referenced by config_variable< gsgl::platform::color >::config_variable().

const T& get_value (  )  const [inline]

Definition at line 210 of file config.hpp.

Referenced by application::get_config_overrides(), and gsgl::data::operator+().

operator const T & (  )  const [inline]

Definition at line 211 of file config.hpp.

References config_variable::value.

config_variable& operator= ( const config_variable< T > &  cv  )  [inline, private]

You cannot copy config variables.

Definition at line 207 of file config.hpp.

void override_with ( const config_record cr  )  [static, inherited]

Override the global config vars with the data in the given config record.

Definition at line 671 of file config.cpp.

References global_config::global_config_vars, and config_record::override_with().

Referenced by application::get_config_overrides().

void save ( const gsgl::string fname  )  [static, inherited]

Save the global config to a file.

Definition at line 677 of file config.cpp.

References global_config::global_config_vars, config_record::override_with(), and config_record::save().

Referenced by application::get_config_overrides().


Member Data Documentation

config_record& associated_record [protected, inherited]

config_record global_config_vars [static, protected, inherited]

Definition at line 162 of file config.hpp.

Referenced by global_config::override_with(), and global_config::save().

T value [private]


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

Generated on Sat Mar 1 13:50:05 2008 for Periapsis Project by  doxygen 1.5.5