foobar2000 SDK  2015-08-03
Public Member Functions | Private Member Functions | Private Attributes
pfc::array_2d_t< t_item, t_alloc >

#include <array.h>

Public Member Functions

 array_2d_t ()
 
t_item & at (t_size i1, t_size i2)
 
const t_item & at (t_size i1, t_size i2) const
 
template<typename t_filler >
void fill (const t_filler &p_filler)
 
void fill_null ()
 
t_size get_dim1 () const
 
t_size get_dim2 () const
 
const t_item * operator[] (t_size i1) const
 
t_item * operator[] (t_size i1)
 
t_item * rowPtr (t_size i1)
 
const t_item * rowPtr (t_size i1) const
 
void set_size (t_size d1, t_size d2)
 

Private Member Functions

template<typename t_ptr >
t_ptr _transformPtr (t_ptr ptr, t_size i1, t_size i2) const
 

Private Attributes

pfc::array_t< t_item, t_alloc > m_content
 
t_size m_d1
 
t_size m_d2
 

Detailed Description

template<typename t_item, template< typename > class t_alloc = alloc_standard>
class pfc::array_2d_t< t_item, t_alloc >

Definition at line 289 of file array.h.

Constructor & Destructor Documentation

template<typename t_item , template< typename > class t_alloc = alloc_standard>
pfc::array_2d_t< t_item, t_alloc >::array_2d_t ( )
inline

Definition at line 291 of file array.h.

291 : m_d1(), m_d2() {}
t_size m_d1
Definition: array.h:319
t_size m_d2
Definition: array.h:319

Member Function Documentation

template<typename t_item , template< typename > class t_alloc = alloc_standard>
template<typename t_ptr >
t_ptr pfc::array_2d_t< t_item, t_alloc >::_transformPtr ( t_ptr  ptr,
t_size  i1,
t_size  i2 
) const
inlineprivate

Definition at line 314 of file array.h.

314  {
315  PFC_ASSERT( i1 < m_d1 ); PFC_ASSERT( i2 < m_d2 );
316  return ptr + i1 * m_d2 + i2;
317  }
t_size m_d1
Definition: array.h:319
t_size m_d2
Definition: array.h:319
template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_item& pfc::array_2d_t< t_item, t_alloc >::at ( t_size  i1,
t_size  i2 
)
inline

Definition at line 299 of file array.h.

299  {
300  return * _transformPtr(m_content.get_ptr(), i1, i2);
301  }
const t_item * get_ptr() const
Definition: array.h:213
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
t_ptr _transformPtr(t_ptr ptr, t_size i1, t_size i2) const
Definition: array.h:314
template<typename t_item , template< typename > class t_alloc = alloc_standard>
const t_item& pfc::array_2d_t< t_item, t_alloc >::at ( t_size  i1,
t_size  i2 
) const
inline

Definition at line 302 of file array.h.

302  {
303  return * _transformPtr(m_content.get_ptr(), i1, i2);
304  }
const t_item * get_ptr() const
Definition: array.h:213
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
t_ptr _transformPtr(t_ptr ptr, t_size i1, t_size i2) const
Definition: array.h:314
template<typename t_item , template< typename > class t_alloc = alloc_standard>
template<typename t_filler >
void pfc::array_2d_t< t_item, t_alloc >::fill ( const t_filler &  p_filler)
inline

Definition at line 305 of file array.h.

305 {m_content.fill(p_filler);}
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
void fill(const t_filler &p_filler)
Definition: array.h:198
template<typename t_item , template< typename > class t_alloc = alloc_standard>
void pfc::array_2d_t< t_item, t_alloc >::fill_null ( )
inline

Definition at line 306 of file array.h.

306 {m_content.fill_null();}
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
void fill_null()
Definition: array.h:203
template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_size pfc::array_2d_t< t_item, t_alloc >::get_dim1 ( ) const
inline

Definition at line 296 of file array.h.

296 {return m_d1;}
t_size m_d1
Definition: array.h:319
template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_size pfc::array_2d_t< t_item, t_alloc >::get_dim2 ( ) const
inline

Definition at line 297 of file array.h.

297 {return m_d2;}
t_size m_d2
Definition: array.h:319
template<typename t_item , template< typename > class t_alloc = alloc_standard>
const t_item* pfc::array_2d_t< t_item, t_alloc >::operator[] ( t_size  i1) const
inline

Definition at line 311 of file array.h.

311 {return rowPtr(i1);}
t_item * rowPtr(t_size i1)
Definition: array.h:308
template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_item* pfc::array_2d_t< t_item, t_alloc >::operator[] ( t_size  i1)
inline

Definition at line 312 of file array.h.

312 {return rowPtr(i1);}
t_item * rowPtr(t_size i1)
Definition: array.h:308
template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_item* pfc::array_2d_t< t_item, t_alloc >::rowPtr ( t_size  i1)
inline

Definition at line 308 of file array.h.

308 {return _transformPtr(m_content.get_ptr(), i1, 0);}
const t_item * get_ptr() const
Definition: array.h:213
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
t_ptr _transformPtr(t_ptr ptr, t_size i1, t_size i2) const
Definition: array.h:314
template<typename t_item , template< typename > class t_alloc = alloc_standard>
const t_item* pfc::array_2d_t< t_item, t_alloc >::rowPtr ( t_size  i1) const
inline

Definition at line 309 of file array.h.

309 {return _transformPtr(m_content.get_ptr(), i1, 0);}
const t_item * get_ptr() const
Definition: array.h:213
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
t_ptr _transformPtr(t_ptr ptr, t_size i1, t_size i2) const
Definition: array.h:314
template<typename t_item , template< typename > class t_alloc = alloc_standard>
void pfc::array_2d_t< t_item, t_alloc >::set_size ( t_size  d1,
t_size  d2 
)
inline

Definition at line 292 of file array.h.

292  {
293  m_content.set_size(pfc::mul_safe_t<std::bad_alloc>(d1, d2));
294  m_d1 = d1; m_d2 = d2;
295  }
t_size m_d1
Definition: array.h:319
void set_size(t_size p_size)
Definition: array.h:104
pfc::array_t< t_item, t_alloc > m_content
Definition: array.h:318
t_size m_d2
Definition: array.h:319

Field Documentation

template<typename t_item , template< typename > class t_alloc = alloc_standard>
pfc::array_t<t_item, t_alloc> pfc::array_2d_t< t_item, t_alloc >::m_content
private

Definition at line 318 of file array.h.

template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_size pfc::array_2d_t< t_item, t_alloc >::m_d1
private

Definition at line 319 of file array.h.

template<typename t_item , template< typename > class t_alloc = alloc_standard>
t_size pfc::array_2d_t< t_item, t_alloc >::m_d2
private

Definition at line 319 of file array.h.


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