foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Private Attributes
pfc::mem_block_aligned_t< obj_t, alignBytes >

#include <memalign.h>

Public Types

typedef mem_block_aligned_t< obj_t, alignBytes > self_t
 

Public Member Functions

 mem_block_aligned_t ()
 
 mem_block_aligned_t (self_t const &other)
 
 mem_block_aligned_t (self_t &&other)
 
obj_t * get_ptr ()
 
const obj_t * get_ptr () const
 
size_t get_size () const
 
self_t const & operator= (self_t const &other)
 
self_t const & operator= (self_t &&other)
 
obj_t * ptr ()
 
const obj_t * ptr () const
 
void resize (size_t s)
 
void set_size (size_t s)
 
size_t size () const
 

Private Attributes

mem_block_aligned< alignBytes > m
 

Detailed Description

template<typename obj_t, unsigned alignBytes = 16>
class pfc::mem_block_aligned_t< obj_t, alignBytes >

Definition at line 90 of file memalign.h.

Member Typedef Documentation

template<typename obj_t, unsigned alignBytes = 16>
typedef mem_block_aligned_t<obj_t, alignBytes> pfc::mem_block_aligned_t< obj_t, alignBytes >::self_t

Definition at line 92 of file memalign.h.

Constructor & Destructor Documentation

template<typename obj_t, unsigned alignBytes = 16>
pfc::mem_block_aligned_t< obj_t, alignBytes >::mem_block_aligned_t ( )
inline

Definition at line 101 of file memalign.h.

101 {}
template<typename obj_t, unsigned alignBytes = 16>
pfc::mem_block_aligned_t< obj_t, alignBytes >::mem_block_aligned_t ( self_t const &  other)
inline

Definition at line 102 of file memalign.h.

102 : m(other.m) {}
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
pfc::mem_block_aligned_t< obj_t, alignBytes >::mem_block_aligned_t ( self_t &&  other)
inline

Definition at line 103 of file memalign.h.

103 : m(std::move(other.m)) {}
mem_block_aligned< alignBytes > m
Definition: memalign.h:107

Member Function Documentation

template<typename obj_t, unsigned alignBytes = 16>
obj_t* pfc::mem_block_aligned_t< obj_t, alignBytes >::get_ptr ( )
inline

Definition at line 99 of file memalign.h.

99 { return reinterpret_cast<obj_t*>(m.ptr()); }
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
const obj_t* pfc::mem_block_aligned_t< obj_t, alignBytes >::get_ptr ( ) const
inline

Definition at line 100 of file memalign.h.

100 { return reinterpret_cast<const obj_t*>(m.ptr()); }
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
size_t pfc::mem_block_aligned_t< obj_t, alignBytes >::get_size ( ) const
inline

Definition at line 96 of file memalign.h.

96 {return size();}
size_t size() const
Definition: memalign.h:95
template<typename obj_t, unsigned alignBytes = 16>
self_t const& pfc::mem_block_aligned_t< obj_t, alignBytes >::operator= ( self_t const &  other)
inline

Definition at line 104 of file memalign.h.

104 {m = other.m; return *this;}
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
self_t const& pfc::mem_block_aligned_t< obj_t, alignBytes >::operator= ( self_t &&  other)
inline

Definition at line 105 of file memalign.h.

105 {m = std::move(other.m); return *this;}
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
obj_t* pfc::mem_block_aligned_t< obj_t, alignBytes >::ptr ( )
inline

Definition at line 97 of file memalign.h.

97 { return reinterpret_cast<obj_t*>(m.ptr()); }
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
const obj_t* pfc::mem_block_aligned_t< obj_t, alignBytes >::ptr ( ) const
inline

Definition at line 98 of file memalign.h.

98 { return reinterpret_cast<const obj_t*>(m.ptr()); }
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
void pfc::mem_block_aligned_t< obj_t, alignBytes >::resize ( size_t  s)
inline

Definition at line 93 of file memalign.h.

93 { m.resize( multiply_guarded(s, sizeof(obj_t) ) ); }
t_int multiply_guarded(t_int v1, t_int v2)
Definition: primitives.h:593
mem_block_aligned< alignBytes > m
Definition: memalign.h:107
template<typename obj_t, unsigned alignBytes = 16>
void pfc::mem_block_aligned_t< obj_t, alignBytes >::set_size ( size_t  s)
inline

Definition at line 94 of file memalign.h.

94 {resize(s);}
void resize(size_t s)
Definition: memalign.h:93
template<typename obj_t, unsigned alignBytes = 16>
size_t pfc::mem_block_aligned_t< obj_t, alignBytes >::size ( ) const
inline

Definition at line 95 of file memalign.h.

95 { return m.size() / sizeof(obj_t); }
mem_block_aligned< alignBytes > m
Definition: memalign.h:107

Field Documentation

template<typename obj_t, unsigned alignBytes = 16>
mem_block_aligned<alignBytes> pfc::mem_block_aligned_t< obj_t, alignBytes >::m
private

Definition at line 107 of file memalign.h.


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