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

#include <alloc.h>

Public Types

enum  { alloc_prioritizes_speed = true }
 

Public Member Functions

 alloc_fast_aggressive ()
 
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 p_size)
 
void set_size (t_size p_size)
 

Private Types

typedef alloc_fast_aggressive< t_item > t_self
 

Private Member Functions

 alloc_fast_aggressive (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_aggressive< t_item >

Definition at line 372 of file alloc.h.

Member Typedef Documentation

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

Definition at line 373 of file alloc.h.

Member Enumeration Documentation

template<typename t_item >
anonymous enum
Enumerator
alloc_prioritizes_speed 

Definition at line 406 of file alloc.h.

Constructor & Destructor Documentation

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

Definition at line 375 of file alloc.h.

375 {}
template<typename t_item >
pfc::alloc_fast_aggressive< t_item >::alloc_fast_aggressive ( const t_self )
inlineprivate

Definition at line 410 of file alloc.h.

410 {throw pfc::exception_not_implemented();}

Member Function Documentation

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

Definition at line 404 of file alloc.h.

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

Definition at line 401 of file alloc.h.

401 {return m_data.get_ptr();}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:412
template<typename t_item >
t_item* pfc::alloc_fast_aggressive< t_item >::get_ptr ( )
inline

Definition at line 402 of file alloc.h.

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

Definition at line 397 of file alloc.h.

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

Definition at line 403 of file alloc.h.

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

Definition at line 408 of file alloc.h.

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

Definition at line 411 of file alloc.h.

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

Definition at line 398 of file alloc.h.

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

Definition at line 399 of file alloc.h.

399 {return m_data[p_index];}
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:412
template<typename t_item >
void pfc::alloc_fast_aggressive< t_item >::prealloc ( t_size  p_size)
inline

Definition at line 386 of file alloc.h.

386  {
387  if (p_size > 0) {
388  t_size size_base = m_data.get_size_total();
389  if (size_base == 0) size_base = 1;
390  while(size_base < p_size) {
391  size_base = safe_shift_left_t<std::bad_alloc,t_size>(size_base,1);
392  }
393  m_data.set_size(m_data.get_size(),size_base);
394  }
395  }
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:412
size_t t_size
Definition: int_types.h:48
template<typename t_item >
void pfc::alloc_fast_aggressive< t_item >::set_size ( t_size  p_size)
inline

Definition at line 377 of file alloc.h.

377  {
378  t_size size_base = m_data.get_size_total();
379  if (size_base == 0) size_base = 1;
380  while(size_base < p_size) {
381  size_base = safe_shift_left_t<std::bad_alloc,t_size>(size_base,1);
382  }
383  m_data.set_size(p_size,size_base);
384  }
__array_fast_helper_t< t_item > m_data
Definition: alloc.h:412
size_t t_size
Definition: int_types.h:48

Field Documentation

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

Definition at line 412 of file alloc.h.


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