foobar2000 SDK  2015-08-03
Public Member Functions
cfg_obj< TObj >

#include <cfg_var.h>

+ Inheritance diagram for cfg_obj< TObj >:

Public Member Functions

 cfg_obj (const GUID &guid)
 
template<typename TInitData >
 cfg_obj (const GUID &guid, const TInitData &initData)
 
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)
 
TObjval ()
 
TObj const & val () const
 
- Public Member Functions inherited from cfg_var
GUID get_guid () const
 
- Public Member Functions inherited from cfg_var_reader
 cfg_var_reader (const GUID &guid)
 
 ~cfg_var_reader ()
 
- Public Member Functions inherited from cfg_var_writer
 cfg_var_writer (const GUID &guid)
 
 ~cfg_var_writer ()
 

Additional Inherited Members

- Static Public Member Functions inherited from cfg_var_reader
static void config_read_file (stream_reader *p_stream, abort_callback &p_abort)
 
- Static Public Member Functions inherited from cfg_var_writer
static void config_write_file (stream_writer *p_stream, abort_callback &p_abort)
 
- Data Fields inherited from cfg_var_reader
const GUID m_guid
 
- Data Fields inherited from cfg_var_writer
const GUID m_guid
 
- Protected Member Functions inherited from cfg_var
 cfg_var (const GUID &p_guid)
 

Detailed Description

template<typename TObj>
class cfg_obj< TObj >

Definition at line 224 of file cfg_var.h.

Constructor & Destructor Documentation

template<typename TObj >
cfg_obj< TObj >::cfg_obj ( const GUID guid)
inline

Definition at line 226 of file cfg_var.h.

226 : cfg_var(guid), TObj() {}
cfg_var(const GUID &p_guid)
Definition: cfg_var.h:57
template<typename TObj >
template<typename TInitData >
cfg_obj< TObj >::cfg_obj ( const GUID guid,
const TInitData &  initData 
)
inline

Definition at line 227 of file cfg_var.h.

227 : cfg_var(guid), TObj(initData) {}
cfg_var(const GUID &p_guid)
Definition: cfg_var.h:57

Member Function Documentation

template<typename TObj >
void cfg_obj< TObj >::get_data_raw ( stream_writer p_stream,
abort_callback p_abort 
)
inlinevirtual

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

Parameters
p_streamStream receiving state of the variable.

Implements cfg_var_writer.

Definition at line 232 of file cfg_var.h.

232  {
233  stream_writer_formatter<> out(*p_stream,p_abort);
234  const TObj * ptr = this;
235  out << *ptr;
236  }
template<typename TObj >
void cfg_obj< TObj >::set_data_raw ( stream_reader p_stream,
t_size  p_sizehint,
abort_callback p_abort 
)
inlinevirtual

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

Parameters
p_streamStream containing new state of the variable.
p_sizehintNumber of bytes contained in the stream; reading past p_sizehint bytes will fail (EOF).

Implements cfg_var_reader.

Definition at line 237 of file cfg_var.h.

237  {
238  stream_reader_formatter<> in(*p_stream,p_abort);
239  TObj * ptr = this;
240  in >> *ptr;
241  }
template<typename TObj >
TObj& cfg_obj< TObj >::val ( )
inline

Definition at line 229 of file cfg_var.h.

229 {return *this;}
template<typename TObj >
TObj const& cfg_obj< TObj >::val ( ) const
inline

Definition at line 230 of file cfg_var.h.

230 {return *this;}

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