WARPXM v1.10.0
Loading...
Searching...
No Matches
wxm::array::array_allocation_t< T > Class Template Reference

#include <array.h>

Public Member Functions

 array_allocation_t ()=default
 Default Constructor.
 
 array_allocation_t (const WxRange &range)
 Allocate the array for a given range.
 
 array_allocation_t (const array_allocation_t &other)=default
 Copy Constructor.
 
virtual ~array_allocation_t ()
 Destructor.
 
array_allocation_toperator= (const array_allocation_t &other)
 Assignment operator - makes a shallow copy.
 
void fill (const T &value)
 Fill array with a value.
 
T * data ()
 Access the underlying data array.
 
const T * data () const
 
virtual T & operator[] (int index)
 
virtual const T & operator[] (int index) const
 
T & operator() (size_t i, size_t j)
 2D array access
 
const T & operator() (size_t i, size_t j) const
 2D array access
 
const T & operator() (size_t i, size_t j, size_t k) const
 3D array access
 
T & operator() (size_t i, size_t j, size_t k)
 3D array access
 
const WxRangerange () const
 

Protected Member Functions

void copy (const array_allocation_t &other)
 
void link (const array_allocation_t &other)
 
void allocate ()
 
void terminate ()
 

Protected Attributes

WxRange _range
 Range of data.
 
std::shared_ptr< std::vector< T > > _data
 Shared pointer containing data.
 

Friends

std::ostream & operator<< (std::ostream &stream, const array_allocation_t &array)
 

Constructor & Destructor Documentation

◆ array_allocation_t() [1/3]

template<typename T >
wxm::array::array_allocation_t< T >::array_allocation_t ( )
default

Default Constructor.

◆ array_allocation_t() [2/3]

template<typename T >
wxm::array::array_allocation_t< T >::array_allocation_t ( const WxRange range)
inline

Allocate the array for a given range.

Parameters
rangeRange of array

◆ array_allocation_t() [3/3]

template<typename T >
wxm::array::array_allocation_t< T >::array_allocation_t ( const array_allocation_t< T > &  other)
default

Copy Constructor.

◆ ~array_allocation_t()

template<typename T >
virtual wxm::array::array_allocation_t< T >::~array_allocation_t ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ allocate()

template<typename T >
void wxm::array::array_allocation_t< T >::allocate ( )
inlineprotected

◆ copy()

template<typename T >
void wxm::array::array_allocation_t< T >::copy ( const array_allocation_t< T > &  other)
inlineprotected

◆ data() [1/2]

template<typename T >
T * wxm::array::array_allocation_t< T >::data ( )
inline

Access the underlying data array.

Returns
Pointer to start of data array

◆ data() [2/2]

template<typename T >
const T * wxm::array::array_allocation_t< T >::data ( ) const
inline

◆ fill()

template<typename T >
void wxm::array::array_allocation_t< T >::fill ( const T &  value)
inline

Fill array with a value.

Parameters
valueValue to fill with

◆ link()

template<typename T >
void wxm::array::array_allocation_t< T >::link ( const array_allocation_t< T > &  other)
inlineprotected

◆ operator()() [1/4]

template<typename T >
T & wxm::array::array_allocation_t< T >::operator() ( size_t  i,
size_t  j 
)
inline

2D array access

◆ operator()() [2/4]

template<typename T >
const T & wxm::array::array_allocation_t< T >::operator() ( size_t  i,
size_t  j 
) const
inline

2D array access

◆ operator()() [3/4]

template<typename T >
T & wxm::array::array_allocation_t< T >::operator() ( size_t  i,
size_t  j,
size_t  k 
)
inline

3D array access

◆ operator()() [4/4]

template<typename T >
const T & wxm::array::array_allocation_t< T >::operator() ( size_t  i,
size_t  j,
size_t  k 
) const
inline

3D array access

◆ operator=()

template<typename T >
array_allocation_t & wxm::array::array_allocation_t< T >::operator= ( const array_allocation_t< T > &  other)
inline

Assignment operator - makes a shallow copy.

Parameters
otherOther array
Returns
Reference to this object

◆ operator[]() [1/2]

template<typename T >
virtual T & wxm::array::array_allocation_t< T >::operator[] ( int  index)
inlinevirtual

◆ operator[]() [2/2]

template<typename T >
virtual const T & wxm::array::array_allocation_t< T >::operator[] ( int  index) const
inlinevirtual

◆ range()

template<typename T >
const WxRange & wxm::array::array_allocation_t< T >::range ( ) const
inline

◆ terminate()

template<typename T >
void wxm::array::array_allocation_t< T >::terminate ( )
inlineprotected

Friends And Related Function Documentation

◆ operator<<

template<typename T >
std::ostream & operator<< ( std::ostream &  stream,
const array_allocation_t< T > &  array 
)
friend

Member Data Documentation

◆ _data

template<typename T >
std::shared_ptr<std::vector<T> > wxm::array::array_allocation_t< T >::_data
protected

Shared pointer containing data.

◆ _range

template<typename T >
WxRange wxm::array::array_allocation_t< T >::_range
protected

Range of data.


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