foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
pfc::alloc_fast< t_item >

#include <alloc.h>

Public Types

enum  { alloc_prioritizes_speed = true }
 

Public Member Functions

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

Private Types

typedef alloc_fast< t_item > t_self
 

Private Member Functions

 alloc_fast (const t_self &)
 
const t_selfoperator= (const t_self &)
 

Private Attributes

__array_fast_helper_t< t_item > m_data
 

Detailed Description

template<typename t_item>
class pfc::alloc_fast< t_item >

Definition at line 336 of file alloc.h.

Member Typedef Documentation

template<typename t_item >
typedef alloc_fast<t_item> pfc::alloc_fast< t_item >::t_self
private

Definition at line 337 of file alloc.h.

Member Enumeration Documentation

template<typename t_item >
anonymous enum
Enumerator
alloc_prioritizes_speed 

Definition at line 363 of file alloc.h.

Constructor & Destructor Documentation

template<typename t_item >
pfc::alloc_fast< t_item >::alloc_fast ( )
inline

Definition at line 339 of file alloc.h.

339 {}
template<typename t_item >
pfc::alloc_fast< t_item >::alloc_fast ( const t_self )
inlineprivate

Definition at line 367 of file alloc.h.

367 {throw pfc::exception_not_implemented();}

Member Function Documentation

template<typename t_item >
void pfc::alloc_fast< t_item >::force_reset ( )
inline

Definition at line 361 of file alloc.h.

361 {m_data.set_size(0,0);}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
const t_item* pfc::alloc_fast< t_item >::get_ptr ( ) const
inline

Definition at line 357 of file alloc.h.

357 {return m_data.get_ptr();}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
t_item* pfc::alloc_fast< t_item >::get_ptr ( )
inline

Definition at line 358 of file alloc.h.

358 {return m_data.get_ptr();}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
t_size pfc::alloc_fast< t_item >::get_size ( ) const
inline

Definition at line 353 of file alloc.h.

353 {return m_data.get_size();}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
bool pfc::alloc_fast< t_item >::is_ptr_owned ( const void *  p_item) const
inline

Definition at line 359 of file alloc.h.

359 {return m_data.is_ptr_owned(p_item);}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
void pfc::alloc_fast< t_item >::move_from ( t_self other)
inline

Definition at line 365 of file alloc.h.

365 { m_data.move_from(other.m_data); }
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
const t_self& pfc::alloc_fast< t_item >::operator= ( const t_self )
inlineprivate

Definition at line 368 of file alloc.h.

368 {throw pfc::exception_not_implemented();}
template<typename t_item >
const t_item& pfc::alloc_fast< t_item >::operator[] ( t_size  p_index) const
inline

Definition at line 354 of file alloc.h.

354 {return m_data[p_index];}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
t_item& pfc::alloc_fast< t_item >::operator[] ( t_size  p_index)
inline

Definition at line 355 of file alloc.h.

355 {return m_data[p_index];}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369
template<typename t_item >
void pfc::alloc_fast< t_item >::prealloc ( t_size  )
inline

Definition at line 360 of file alloc.h.

360 {}
template<typename t_item >
void pfc::alloc_fast< t_item >::set_size ( t_size  p_size)
inline

Definition at line 341 of file alloc.h.

341  {
342  t_size size_base = m_data.get_size_total();
343  if (size_base == 0) size_base = 1;
344  while(size_base < p_size) {
345  size_base = safe_shift_left_t<std::bad_alloc,t_size>(size_base,1);
346  }
347  while(size_base >> 2 > p_size) {
348  size_base >>= 1;
349  }
350  m_data.set_size(p_size,size_base);
351  }
size_t t_size
Definition: int_types.h:48
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:369

Field Documentation

template<typename t_item >
__array_fast_helper_t<t_item> pfc::alloc_fast< t_item >::m_data
private

Definition at line 369 of file alloc.h.


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