foobar2000 SDK  2015-08-03
Public Types | Public Member Functions
cfg_objList< TObj >

#include <cfg_var.h>

+ Inheritance diagram for cfg_objList< TObj >:

Public Types

typedef cfg_objList< TObjt_self
 
- Public Types inherited from pfc::list_t< TObj >
typedef list_t< TObj, alloc_fastt_self
 
- Public Types inherited from pfc::list_impl_t< TObj, array_t< TObj, alloc_fast > >
typedef list_base_t< TObjt_base
 
typedef list_impl_t< TObj, array_t< TObj, alloc_fast > > t_self
 
- Public Types inherited from pfc::list_base_const_t< TObj >
typedef TObj t_item
 

Public Member Functions

 cfg_objList (const GUID &guid)
 
template<typename TSource , unsigned Count>
 cfg_objList (const GUID &guid, const TSource(&source)[Count])
 
void get_data_raw (stream_writer *p_stream, abort_callback &p_abort)
 
template<typename t_in >
t_selfoperator+= (t_in const &p_source)
 
template<typename t_in >
t_selfoperator= (t_in const &source)
 
template<typename t_in >
t_selfoperator|= (t_in const &p_source)
 
template<typename TSource , unsigned Count>
void reset (const TSource(&source)[Count])
 
void set_data_raw (stream_reader *p_stream, t_size p_sizehint, abort_callback &p_abort)
 
- 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 ()
 
- Public Member Functions inherited from pfc::list_t< TObj >
t_selfoperator+= (t_in const &p_source)
 
t_selfoperator= (t_in const &source)
 
t_selfoperator|= (t_in const &p_source)
 
- Public Member Functions inherited from pfc::list_impl_t< TObj, array_t< TObj, alloc_fast > >
 list_impl_t ()
 
 list_impl_t (const t_self &p_source)
 
t_size _insert_item_t (const t_in &item, t_size idx)
 
t_size _insert_items_v (const list_base_const_t< TObj > &source, t_size base)
 
t_size add_item (const TObj &item)
 
t_size add_item (const t_in &item)
 
void add_items (const t_in &in)
 
void filter_mask (const bit_array &mask)
 
void filter_mask (const bool *mask)
 
t_size find_duplicates_sorted_permutation_t (t_compare p_compare, t_permutation p_permutation, bit_array_var &p_out)
 
t_size find_duplicates_sorted_t (t_compare p_compare, bit_array_var &p_out) const
 
t_size find_item (const t_search &p_item) const
 
t_size get_count () const
 
TObj get_item (t_size n) const
 
void get_item_ex (TObj &p_out, t_size n) const
 
const TObjget_item_ref (t_size n) const
 
void get_items_mask (list_impl_t< TObj, array_t< TObj, alloc_fast > > &out, const bit_array &mask)
 
const TObjget_ptr () const
 
TObjget_ptr ()
 
t_size get_size () const
 
bool have_item (const t_search &p_item) const
 
t_size insert_item (const t_in &item, t_size idx)
 
t_size insert_item (const TObj &item, t_size idx)
 
t_size insert_items (const list_base_const_t< TObj > &source, t_size base)
 
t_size insert_items (const list_base_t< TObj > &source, t_size base)
 
t_size insert_items (const t_in &source, t_size base)
 
void move_from (t_self &other)
 
t_selfoperator+= (t_in const &p_source)
 
t_selfoperator= (t_in const &source)
 
const TObjoperator[] (t_size n) const
 
TObjoperator[] (t_size n)
 
t_selfoperator|= (t_in const &p_source)
 
void prealloc (t_size count)
 
void remove_all ()
 
TObj remove_by_idx (t_size idx)
 
void remove_from_idx (t_size idx, t_size num)
 
void remove_item (const TObj &item)
 
void remove_mask (const bit_array &mask)
 
void remove_mask (const bool *mask)
 
void reorder_partial (t_size p_base, const t_size *p_order, t_size p_count)
 
void replace_item (t_size idx, const TObj &item)
 
void set_count (t_size p_count)
 
void set_size (t_size p_count)
 
void sort ()
 
void sort (typename t_base::sort_callback &p_callback)
 
void sort_stable (typename t_base::sort_callback &p_callback)
 
void sort_stable_t (t_compare p_compare)
 
void sort_t (t_compare p_compare)
 
void swap_item_with (t_size p_index, TObj &p_item)
 
void swap_items (t_size p_index1, t_size p_index2)
 
- Public Member Functions inherited from pfc::list_base_t< TObj >
t_size add_item (const TObj &item)
 
t_size add_items (const list_base_const_t< TObj > &items)
 
t_size add_items_fromptr (const TObj *source, t_size num)
 
t_size add_items_repeat (TObjitem, t_size num)
 
void for_each (t_func p_func)
 
void for_each (t_func p_func, const bit_array &p_mask)
 
t_size insert_item (const TObj &item, t_size base)
 
t_size insert_items_fromptr (const TObj *source, t_size num, t_size base)
 
t_size insert_items_repeat (const TObj &item, t_size num, t_size base)
 
t_selfoperator+= (t_in const &p_source)
 
t_selfoperator= (t_in const &source)
 
TObj operator[] (t_size n) const
 
t_selfoperator|= (t_in const &p_source)
 
void remove_all ()
 
void remove_all_ex (t_releasefunc p_func)
 
void remove_duplicates_t (t_compare p_compare)
 
void remove_mask (const bit_array &mask)
 
void remove_mask_ex (const bit_array &p_mask, t_releasefunc p_func)
 
void reorder (const t_size *p_data)
 
TObj replace_item_ex (t_size p_index, const TObj &p_item)
 
virtual void sort (sort_callback &p_callback)=0
 
void sort ()
 
void sort_remove_duplicates_t (t_compare p_compare)
 
virtual void sort_stable (sort_callback &p_callback)=0
 
void sort_stable_remove_duplicates_t (t_compare p_compare)
 
void sort_stable_t (t_compare p_compare)
 
void sort_t (t_compare p_compare)
 
void truncate (t_size val)
 
- Public Member Functions inherited from pfc::list_base_const_t< TObj >
bool bsearch_permutation_t (t_compare p_compare, t_param const &p_param, const t_permutation &p_permutation, t_size &p_index) const
 
bool bsearch_t (t_compare p_compare, t_param const &p_param, t_size &p_index) const
 
void enumerate (t_callback &p_callback) const
 
t_size find_duplicates_sorted_permutation_t (t_compare p_compare, t_permutation const &p_permutation, bit_array_var &p_out)
 
t_size find_duplicates_sorted_t (t_compare p_compare, bit_array_var &p_out) const
 
t_size find_item (const t_search &p_item) const
 
TObj get_item (t_size n) const
 
t_size get_size () const
 
bool have_item (const t_search &p_item) const
 
bool operator!= (const t_self &item2) const
 
bool operator== (const t_self &item2) const
 
TObj operator[] (t_size n) const
 
void sort_get_permutation_t (t_compare p_compare, t_permutation const &p_permutation) const
 
void sort_stable_get_permutation_t (t_compare p_compare, t_permutation const &p_permutation) const
 

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)
 
- Static Public Member Functions inherited from pfc::list_impl_t< TObj, array_t< TObj, alloc_fast > >
static void g_swap (list_impl_t< TObj, array_t< TObj, alloc_fast > > &p_item1, list_impl_t< TObj, array_t< TObj, alloc_fast > > &p_item2)
 
- Static Public Member Functions inherited from pfc::list_base_const_t< TObj >
static bool g_equals (const t_self &item1, const t_self &item2)
 
- 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)
 
- Protected Member Functions inherited from pfc::list_base_t< TObj >
 list_base_t ()
 
 list_base_t (const t_self &)
 
 ~list_base_t ()
 
void operator= (const t_self &)
 
- Protected Member Functions inherited from pfc::list_base_const_t< TObj >
 list_base_const_t ()
 
 list_base_const_t (const t_self &)
 
 ~list_base_const_t ()
 
void operator= (const t_self &)
 
- Protected Attributes inherited from pfc::list_impl_t< TObj, array_t< TObj, alloc_fast > >
array_t< TObj, alloc_fastm_buffer
 

Detailed Description

template<typename TObj>
class cfg_objList< TObj >

Definition at line 170 of file cfg_var.h.

Member Typedef Documentation

template<typename TObj >
typedef cfg_objList<TObj> cfg_objList< TObj >::t_self

Definition at line 172 of file cfg_var.h.

Constructor & Destructor Documentation

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

Definition at line 173 of file cfg_var.h.

173 : cfg_var(guid) {}
cfg_var(const GUID &p_guid)
Definition: cfg_var.h:57
template<typename TObj >
template<typename TSource , unsigned Count>
cfg_objList< TObj >::cfg_objList ( const GUID guid,
const TSource(&)  source[Count] 
)
inline

Definition at line 174 of file cfg_var.h.

174  : cfg_var(guid) {
175  reset(source);
176  }
cfg_var(const GUID &p_guid)
Definition: cfg_var.h:57
void reset(const TSource(&source)[Count])
Definition: cfg_var.h:177

Member Function Documentation

template<typename TObj >
void cfg_objList< 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 180 of file cfg_var.h.

180  {
181  stream_writer_formatter<> out(*p_stream,p_abort);
182  out << pfc::downcast_guarded<t_uint32>(this->get_size());
183  for(t_size walk = 0; walk < this->get_size(); ++walk) out << (*this)[walk];
184  }
size_t t_size
Definition: int_types.h:48
template<typename TObj >
template<typename t_in >
t_self& cfg_objList< TObj >::operator+= ( t_in const &  p_source)
inline

Definition at line 197 of file cfg_var.h.

197 {this->add_item(p_source); return *this;}
template<typename TObj >
template<typename t_in >
t_self& cfg_objList< TObj >::operator= ( t_in const &  source)
inline

Definition at line 196 of file cfg_var.h.

196 {this->remove_all(); this->add_items(source); return *this;}
template<typename TObj >
template<typename t_in >
t_self& cfg_objList< TObj >::operator|= ( t_in const &  p_source)
inline

Definition at line 198 of file cfg_var.h.

198 {this->add_items(p_source); return *this;}
template<typename TObj >
template<typename TSource , unsigned Count>
void cfg_objList< TObj >::reset ( const TSource(&)  source[Count])
inline

Definition at line 177 of file cfg_var.h.

177  {
178  this->set_size(Count); for(t_size walk = 0; walk < Count; ++walk) (*this)[walk] = source[walk];
179  }
size_t t_size
Definition: int_types.h:48
template<typename TObj >
void cfg_objList< 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 185 of file cfg_var.h.

185  {
186  try {
187  stream_reader_formatter<> in(*p_stream,p_abort);
188  t_uint32 count; in >> count;
189  this->set_count(count);
190  for(t_uint32 walk = 0; walk < count; ++walk) in >> (*this)[walk];
191  } catch(...) {
192  this->remove_all();
193  throw;
194  }
195  }
uint32_t t_uint32
Definition: int_types.h:5

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