foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >

#include <alloc.h>

Public Types

enum  { alloc_prioritizes_speed = t_alloc<t_item>::alloc_prioritizes_speed }
 

Public Member Functions

 alloc ()
 
void force_reset ()
 
t_size get_size () const
 
bool is_ptr_owned (const void *p_item) const
 
void move_from (t_self &other)
 
t_item & operator[] (t_size p_index)
 
const t_item & operator[] (t_size p_index) const
 
void prealloc (t_size p_size)
 
void set_size (t_size p_size)
 

Private Types

typedef alloc< t_item > t_self
 

Private Member Functions

 alloc (const t_self &)
 
const t_selfoperator= (const t_self &)
 

Private Attributes

alloc_fixed< p_width >::template alloc< t_item > m_fixed
 
t_alloc< t_item > m_variable
 

Detailed Description

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item>
class pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >

Definition at line 468 of file alloc.h.

Member Typedef Documentation

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
typedef alloc<t_item> pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::t_self
private

Definition at line 469 of file alloc.h.

Member Enumeration Documentation

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
anonymous enum
Enumerator
alloc_prioritizes_speed 

Definition at line 503 of file alloc.h.

503 { alloc_prioritizes_speed = t_alloc<t_item>::alloc_prioritizes_speed };

Constructor & Destructor Documentation

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::alloc ( )
inline

Definition at line 471 of file alloc.h.

471 {}
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::alloc ( const t_self )
inlineprivate

Definition at line 510 of file alloc.h.

510 {throw pfc::exception_not_implemented();}

Member Function Documentation

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
void pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::force_reset ( )
inline

Definition at line 500 of file alloc.h.

500  {
501  m_fixed.force_reset(); m_variable.force_reset();
502  }
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
t_size pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::get_size ( ) const
inline

Definition at line 495 of file alloc.h.

495 {return m_fixed.get_size() + m_variable.get_size();}
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
bool pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::is_ptr_owned ( const void *  p_item) const
inline

Definition at line 496 of file alloc.h.

496 {return m_fixed.is_ptr_owned(p_item) || m_variable.is_ptr_owned(p_item);}
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
void pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::move_from ( t_self other)
inline

Definition at line 505 of file alloc.h.

505  {
506  m_fixed.move_from(other.m_fixed);
507  m_variable.move_from(other.m_variable);
508  }
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
const t_self& pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::operator= ( const t_self )
inlineprivate

Definition at line 511 of file alloc.h.

511 {throw pfc::exception_not_implemented();}
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
t_item& pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::operator[] ( t_size  p_index)
inline

Definition at line 483 of file alloc.h.

483  {
484  PFC_ASSERT(p_index < get_size());
485  if (p_index < p_width) return m_fixed[p_index];
486  else return m_variable[p_index - p_width];
487  }
t_size get_size() const
Definition: alloc.h:495
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
const t_item& pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::operator[] ( t_size  p_index) const
inline

Definition at line 489 of file alloc.h.

489  {
490  PFC_ASSERT(p_index < get_size());
491  if (p_index < p_width) return m_fixed[p_index];
492  else return m_variable[p_index - p_width];
493  }
t_size get_size() const
Definition: alloc.h:495
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
void pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::prealloc ( t_size  p_size)
inline

Definition at line 497 of file alloc.h.

497  {
498  if (p_size > p_width) m_variable.prealloc(p_size - p_width);
499  }
t_alloc< t_item > m_variable
Definition: alloc.h:514
template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
void pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::set_size ( t_size  p_size)
inline

Definition at line 473 of file alloc.h.

473  {
474  if (p_size > p_width) {
475  m_fixed.set_size(p_width);
476  m_variable.set_size(p_size - p_width);
477  } else {
478  m_fixed.set_size(p_size);
479  m_variable.set_size(0);
480  }
481  }
t_alloc< t_item > m_variable
Definition: alloc.h:514
alloc_fixed< p_width >::template alloc< t_item > m_fixed
Definition: alloc.h:513

Field Documentation

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
alloc_fixed<p_width>::template alloc<t_item> pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::m_fixed
private

Definition at line 513 of file alloc.h.

template<t_size p_width, template< typename > class t_alloc = alloc_standard>
template<typename t_item >
t_alloc<t_item> pfc::alloc_hybrid< p_width, t_alloc >::alloc< t_item >::m_variable
private

Definition at line 514 of file alloc.h.


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