cfg_int_t< t_inttype > Class Template Reference

#include <cfg_var.h>

Inheritance diagram for cfg_int_t< t_inttype >:

cfg_var

List of all members.

Public Member Functions

 cfg_int_t (const GUID &p_guid, t_inttype p_default)
const cfg_int_t< t_inttype > & operator= (const cfg_int_t< t_inttype > &p_val)
t_inttype operator= (t_inttype p_val)
 operator t_inttype () const
t_inttype get_value () 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_inttype>
class cfg_int_t< t_inttype >

Generic integer config variable class. Template parameter can be used to specify integer type to use.
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_inttype>
cfg_int_t< t_inttype >::cfg_int_t ( const GUID &  p_guid,
t_inttype  p_default 
) [inline, explicit]

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.
p_default Default value of the variable.


Member Function Documentation

template<typename t_inttype>
void cfg_int_t< t_inttype >::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_inttype>
void cfg_int_t< t_inttype >::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_inttype>
const cfg_int_t<t_inttype>& cfg_int_t< t_inttype >::operator= ( const cfg_int_t< t_inttype > &  p_val  )  [inline]

template<typename t_inttype>
t_inttype cfg_int_t< t_inttype >::operator= ( t_inttype  p_val  )  [inline]

template<typename t_inttype>
cfg_int_t< t_inttype >::operator t_inttype (  )  const [inline]

template<typename t_inttype>
t_inttype cfg_int_t< t_inttype >::get_value (  )  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