Scopira  20080306
scopira::tool::array_view< T > Class Template Reference

#include <array.h>

Public Types

typedef T data_type
 
typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

 array_view (basic_array< T > &rhs)
 
 array_view (T *b, T *e)
 
template<size_t N>
 array_view (fixed_array< T, N > &rhs)
 
template<size_t N>
 array_view (hybrid_array< T, N > &rhs)
 
T * array (void)
 
const T * array (void) const
 
T * c_array (void)
 
const T * c_array (void) const
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
void clear_zero (void)
 
size_t size (void) const
 
bool empty (void) const
 
void set (size_t idx, const T &v)
 
const T & get (size_t idx) const
 
T & get (size_t idx)
 
const T & operator[] (size_t idx) const
 
T & operator[] (size_t idx)
 

Protected Attributes

T * dm_ary
 
T * dm_end
 

Detailed Description

template<class T>
class scopira::tool::array_view< T >

A (non-resizable) "view" of another array

Author
Aleksander Demko

Constructor & Destructor Documentation

◆ array_view() [1/4]

template<class T>
scopira::tool::array_view< T >::array_view ( basic_array< T > &  rhs)
inline

Converting ctor

Author
Aleksander Demko

◆ array_view() [2/4]

template<class T>
scopira::tool::array_view< T >::array_view ( T *  b,
T *  e 
)
inline

Converting ctor

Author
Aleksander Demko

◆ array_view() [3/4]

template<class T>
template<size_t N>
scopira::tool::array_view< T >::array_view ( fixed_array< T, N > &  rhs)
inline

Converting ctor

Author
Aleksander Demko

◆ array_view() [4/4]

template<class T>
template<size_t N>
scopira::tool::array_view< T >::array_view ( hybrid_array< T, N > &  rhs)
inline

Converting ctor

Author
Aleksander Demko

Member Function Documentation

◆ array() [1/2]

template<class T>
T* scopira::tool::array_view< T >::array ( void  )
inline

Raw access to the array

Author
Aleksander Demko

◆ array() [2/2]

template<class T>
const T* scopira::tool::array_view< T >::array ( void  ) const
inline

Raw access to the array

Author
Aleksander Demko

◆ begin() [1/2]

template<class T>
iterator scopira::tool::array_view< T >::begin ( void  )
inline

STL-like iteration

Author
Aleksander Demko

◆ begin() [2/2]

template<class T>
const_iterator scopira::tool::array_view< T >::begin ( void  ) const
inline

STL-like iteration

Author
Aleksander Demko

◆ c_array() [1/2]

template<class T>
T* scopira::tool::array_view< T >::c_array ( void  )
inline

Raw access to the array

Author
Aleksander Demko

◆ c_array() [2/2]

template<class T>
const T* scopira::tool::array_view< T >::c_array ( void  ) const
inline

Raw access to the array

Author
Aleksander Demko

◆ clear_zero()

template<class T>
void scopira::tool::array_view< T >::clear_zero ( void  )
inline

Clears all the array values to binary 0. Does not resize the array. This is dangerous on non-POD classes.

Author
Aleksander Demko

References scopira::tool::array_view< T >::size().

◆ empty()

template<class T>
bool scopira::tool::array_view< T >::empty ( void  ) const
inline

Is the array empty (0 length)?

Author
Aleksander Demko

◆ end() [1/2]

template<class T>
iterator scopira::tool::array_view< T >::end ( void  )
inline

STL-like iteration

Author
Aleksander Demko

◆ end() [2/2]

template<class T>
const_iterator scopira::tool::array_view< T >::end ( void  ) const
inline

STL-like iteration

Author
Aleksander Demko

◆ get() [1/2]

template<class T>
const T& scopira::tool::array_view< T >::get ( size_t  idx) const
inline

Individual element setter

Author
Aleksander Demko

◆ get() [2/2]

template<class T>
T& scopira::tool::array_view< T >::get ( size_t  idx)
inline

Individual element setter

Author
Aleksander Demko

◆ operator[]() [1/2]

template<class T>
const T& scopira::tool::array_view< T >::operator[] ( size_t  idx) const
inline

Nice reference access

Author
Aleksander Demko

◆ operator[]() [2/2]

template<class T>
T& scopira::tool::array_view< T >::operator[] ( size_t  idx)
inline

Nice reference access

Author
Aleksander Demko

◆ set()

template<class T>
void scopira::tool::array_view< T >::set ( size_t  idx,
const T &  v 
)
inline

Individual element setter

Author
Aleksander Demko

◆ size()

template<class T>
size_t scopira::tool::array_view< T >::size ( void  ) const
inline

Gets the size of the array

Author
Aleksander Demko

Referenced by scopira::tool::array_view< T >::clear_zero().


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