cfg_struct_t< t_struct > Class Template Reference

#include <cfg_var.h>

Inheritance diagram for cfg_struct_t< t_struct >:

cfg_var

List of all members.

Public Member Functions

 cfg_struct_t (const GUID &p_guid, const t_struct &p_val)
 cfg_struct_t (const GUID &p_guid, int filler)
const cfg_struct_t< t_struct > & operator= (const cfg_struct_t< t_struct > &p_val)
const cfg_struct_t< t_struct > & operator= (const t_struct &p_val)
const t_struct & get_value () const
t_struct & get_value ()
 operator t_struct () const

Protected Member Functions

void get_data_raw (stream_writer *p_stream, abort_callback &p_abort)
void set_data_raw (stream_reader *p_stream, t_size p_sizehint, abort_callback &p_abort)


Detailed Description

template<typename t_struct>
class cfg_struct_t< t_struct >

Struct config variable template. Warning: not endian safe, should be used only for nonportable code.
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

template<typename t_struct>
cfg_struct_t< t_struct >::cfg_struct_t ( const GUID &  p_guid,
const t_struct &  p_val 
) [inline]

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.

template<typename t_struct>
cfg_struct_t< t_struct >::cfg_struct_t ( const GUID &  p_guid,
int  filler 
) [inline]

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.


Member Function Documentation

template<typename t_struct>
void cfg_struct_t< t_struct >::get_data_raw ( stream_writer *  p_stream,
abort_callback &  p_abort 
) [inline, protected, virtual]

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

Parameters:
p_stream Stream receiving state of the variable.

Implements cfg_var.

template<typename t_struct>
void cfg_struct_t< t_struct >::set_data_raw ( stream_reader *  p_stream,
t_size  p_sizehint,
abort_callback &  p_abort 
) [inline, protected, 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).

Implements cfg_var.

template<typename t_struct>
const cfg_struct_t<t_struct>& cfg_struct_t< t_struct >::operator= ( const cfg_struct_t< t_struct > &  p_val  )  [inline]

template<typename t_struct>
const cfg_struct_t<t_struct>& cfg_struct_t< t_struct >::operator= ( const t_struct &  p_val  )  [inline]

template<typename t_struct>
const t_struct& cfg_struct_t< t_struct >::get_value (  )  const [inline]

template<typename t_struct>
t_struct& cfg_struct_t< t_struct >::get_value (  )  [inline]

template<typename t_struct>
cfg_struct_t< t_struct >::operator t_struct (  )  const [inline]


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