foobar2000 SDK  2015-08-03
Public Member Functions | Private Member Functions
cfg_objMap< TMap >

#include <cfg_var.h>

+ Inheritance diagram for cfg_objMap< TMap >:

Public Member Functions

 cfg_objMap (const GUID &id)
 

Private 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)
 
- Private Member Functions inherited from cfg_var
GUID get_guid () const
 
 cfg_var (const GUID &p_guid)
 
- Private Member Functions inherited from cfg_var_reader
 cfg_var_reader (const GUID &guid)
 
 ~cfg_var_reader ()
 
- Private Member Functions inherited from cfg_var_writer
 cfg_var_writer (const GUID &guid)
 
 ~cfg_var_writer ()
 

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)
 
- Static Private Member Functions inherited from cfg_var_writer
static void config_write_file (stream_writer *p_stream, abort_callback &p_abort)
 
- Private Attributes inherited from cfg_var_reader
const GUID m_guid
 
- Private Attributes inherited from cfg_var_writer
const GUID m_guid
 

Detailed Description

template<typename TMap>
class cfg_objMap< TMap >

Definition at line 267 of file cfg_var.h.

Constructor & Destructor Documentation

template<typename TMap >
cfg_objMap< TMap >::cfg_objMap ( const GUID id)
inline

Definition at line 269 of file cfg_var.h.

269 : cfg_var(id) {}
cfg_var(const GUID &p_guid)
Definition: cfg_var.h:57

Member Function Documentation

template<typename TMap >
void cfg_objMap< TMap >::get_data_raw ( stream_writer p_stream,
abort_callback p_abort 
)
inlineprivatevirtual

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

271  {
272  stream_writer_formatter<> out(*p_stream, p_abort);
273  out << pfc::downcast_guarded<t_uint32>(this->get_count());
274  for(typename TMap::const_iterator walk = this->first(); walk.is_valid(); ++walk) {
275  out << walk->m_key << walk->m_value;
276  }
277  }
template<typename TMap >
void cfg_objMap< TMap >::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 278 of file cfg_var.h.

278  {
279  this->remove_all();
280  stream_reader_formatter<> in(*p_stream, p_abort);
281  t_uint32 count; in >> count;
282  for(t_uint32 walk = 0; walk < count; ++walk) {
283  typename TMap::t_key key; in >> key; PFC_ASSERT( !this->have_item(key) );
284  try { in >> this->find_or_add( key ); } catch(...) { this->remove(key); throw; }
285  }
286  }
uint32_t t_uint32
Definition: int_types.h:5

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