foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Private Member Functions | Private Attributes
cfg_objListImporter< TObj, TImport >

#include <cfg_var.h>

+ Inheritance diagram for cfg_objListImporter< TObj, TImport >:

Public Types

typedef cfg_objList< TObjTMasterVar
 

Public Member Functions

 cfg_objListImporter (TMasterVar &var, const GUID &guid)
 

Private Member Functions

void set_data_raw (stream_reader *p_stream, t_size p_sizehint, abort_callback &p_abort)
 
- Private Member Functions inherited from cfg_var_reader
 cfg_var_reader (const GUID &guid)
 
 ~cfg_var_reader ()
 

Private Attributes

TMasterVarm_var
 
- Private Attributes inherited from cfg_var_reader
const GUID m_guid
 

Additional Inherited Members

- Static Private Member Functions inherited from cfg_var_reader
static void config_read_file (stream_reader *p_stream, abort_callback &p_abort)
 

Detailed Description

template<typename TObj, typename TImport>
class cfg_objListImporter< TObj, TImport >

Definition at line 244 of file cfg_var.h.

Member Typedef Documentation

template<typename TObj , typename TImport >
typedef cfg_objList<TObj> cfg_objListImporter< TObj, TImport >::TMasterVar

Definition at line 246 of file cfg_var.h.

Constructor & Destructor Documentation

template<typename TObj , typename TImport >
cfg_objListImporter< TObj, TImport >::cfg_objListImporter ( TMasterVar var,
const GUID guid 
)
inline

Definition at line 247 of file cfg_var.h.

247 : m_var(var), cfg_var_reader(guid) {}
TMasterVar & m_var
Definition: cfg_var.h:265
cfg_var_reader(const GUID &guid)
Definition: cfg_var.h:11

Member Function Documentation

template<typename TObj , typename TImport >
void cfg_objListImporter< TObj, TImport >::set_data_raw ( stream_reader p_stream,
t_size  p_sizehint,
abort_callback p_abort 
)
inlineprivatevirtual

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 250 of file cfg_var.h.

250  {
251  TImport temp;
252  try {
253  stream_reader_formatter<> in(*p_stream,p_abort);
254  t_uint32 count; in >> count;
255  m_var.set_count(count);
256  for(t_uint32 walk = 0; walk < count; ++walk) {
257  in >> temp;
258  m_var[walk] = temp;
259  }
260  } catch(...) {
261  m_var.remove_all();
262  throw;
263  }
264  }
void set_count(t_size p_count)
Definition: list.h:315
TMasterVar & m_var
Definition: cfg_var.h:265
void remove_all()
Definition: list.h:530
uint32_t t_uint32
Definition: int_types.h:5

Field Documentation

template<typename TObj , typename TImport >
TMasterVar& cfg_objListImporter< TObj, TImport >::m_var
private

Definition at line 265 of file cfg_var.h.


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