cfg_var Class Reference

#include <cfg_var.h>

Inheritance diagram for cfg_var:

cfg_dsp_chain_config cfg_guidlist cfg_int_t< t_inttype > cfg_string cfg_struct_t< t_struct > cfg_structlist_t< T > cfg_window_placement cfg_window_size config_object_fixed_impl_t< p_size > config_object_impl titleformat_config_impl

List of all members.

Public Member Functions

virtual void get_data_raw (stream_writer *p_stream, abort_callback &p_abort)=0
virtual void set_data_raw (stream_reader *p_stream, t_size p_sizehint, abort_callback &p_abort)=0
const GUID & get_guid () const
 For internal use only, do not call.

Static Public Member Functions

static void config_read_file (stream_reader *p_stream, abort_callback &p_abort)
 For internal use only, do not call.
static void config_write_file (stream_writer *p_stream, abort_callback &p_abort)
 For internal use only, do not call.

Protected Member Functions

 cfg_var (const GUID &p_guid)
 ~cfg_var ()


Detailed Description

Base class for configuration variable classes; provides self-registration mechaisms and methods to set/retrieve configuration data; those methods are automatically called for all registered instances by backend when configuration file is being read or written.
Note that cfg_var class and its derivatives may be only instantiated statically (as static objects or members of other static objects), NEVER dynamically (operator new, local variables, members of objects instantiated as such).

Constructor & Destructor Documentation

cfg_var::cfg_var ( const GUID &  p_guid  )  [inline, protected]

Parameters:
p_guid GUID of the variable, used to identify variable implementations owning specific configuration file entries when reading the configuration file back. You must generate a new GUID every time you declare a new cfg_var.

cfg_var::~cfg_var (  )  [inline, protected]


Member Function Documentation

virtual void cfg_var::get_data_raw ( stream_writer *  p_stream,
abort_callback &  p_abort 
) [pure virtual]

Retrieves state of the variable. Called only from main thread, when writing configuration file.

Parameters:
p_stream Stream receiving state of the variable.

Implemented in cfg_int_t< t_inttype >, cfg_string, cfg_struct_t< t_struct >, cfg_dsp_chain_config, cfg_guidlist, cfg_structlist_t< T >, cfg_window_placement, cfg_window_size, cfg_int_t< bool >, and cfg_int_t< uint64_t >.

virtual void cfg_var::set_data_raw ( stream_reader *  p_stream,
t_size  p_sizehint,
abort_callback &  p_abort 
) [pure virtual]

Sets state of the variable. Called only from main thread, when reading configuration file.

Parameters:
p_stream Stream containing new state of the variable.
p_sizehint Number of bytes contained in the stream; reading past p_sizehint bytes will fail (EOF).

Implemented in cfg_int_t< t_inttype >, cfg_string, cfg_struct_t< t_struct >, cfg_dsp_chain_config, cfg_guidlist, cfg_structlist_t< T >, cfg_window_placement, cfg_window_size, cfg_int_t< bool >, and cfg_int_t< uint64_t >.

const GUID& cfg_var::get_guid (  )  const [inline]

For internal use only, do not call.

Reimplemented in config_object_impl, and config_object_fixed_impl_t< p_size >.

static void cfg_var::config_read_file ( stream_reader *  p_stream,
abort_callback &  p_abort 
) [static]

For internal use only, do not call.

static void cfg_var::config_write_file ( stream_writer *  p_stream,
abort_callback &  p_abort 
) [static]

For internal use only, do not call.


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

Generated on Fri Apr 18 13:56:49 2008 for foobar2000 SDK by  doxygen 1.5.5