torc::architecture::Array< T > Class Template Reference

Encapsulation of a static array. More...

#include <Array.hpp>

Inheritance diagram for torc::architecture::Array< T >:

Inheritance graph
[legend]
Collaboration diagram for torc::architecture::Array< T >:

Collaboration graph
[legend]

List of all members.

Public Types

typedef const T * const_iterator
 Constant T iterator type.
typedef T * iterator
 Non-constant T iterator type.

Public Member Functions

 Array (void)
 Null constructor.
 Array (uint32_t inSize)
 Public constructor.
 ~Array (void)
 Non-virtual destructor.
T * begin (void)
 Returns the non-constant begin iterator.
T * end (void)
 Returns the non-constant end iterator.
const T * begin (void) const
 Returns the constant begin iterator.
const T * end (void) const
 Returns the constant end iterator.
uint32_t getSize (void) const
 Returns the array size.
void setSize (uint32_t inSize)
 Discards all contents and resizes the array.
T & operator[] (uint32_t inIndex)
 Non-constant subscript operator.
const T & operator[] (uint32_t inIndex) const
 Constant subscript operator.

Protected Types

typedef boost::uint32_t uint32_t
 Imported type name.
typedef boost::remove_const< T >
::type 
T_non_const
 A type identical to template parameter T, but with any 'const' trait removed.

Protected Attributes

T * mArray
 The internal array.
uint32_t mSize
 The logical and actual size of the array.

Private Member Functions

void allocate (uint32_t inSize)
 Allocate an array of the specified size.
void deallocate (void)
 Deallocate the array.


Detailed Description

template<class T>
class torc::architecture::Array< T >

Encapsulation of a static array.

Arrays are intended for fixed-size operation without frills, and are used extensively to represent device wiring data. Although this class could be used more broadly, it is likely that most code would be better served by raw arrays or by STL containers.

Arrays can be resized, but their contents are not retained when resized, nor are the contents cleared upon initialization.

Definition at line 38 of file Array.hpp.


Member Typedef Documentation

template<class T>
typedef boost::uint32_t torc::architecture::Array< T >::uint32_t [protected]

Imported type name.

Definition at line 42 of file Array.hpp.

template<class T>
typedef boost::remove_const<T>::type torc::architecture::Array< T >::T_non_const [protected]

A type identical to template parameter T, but with any 'const' trait removed.

Definition at line 44 of file Array.hpp.

template<class T>
typedef const T* torc::architecture::Array< T >::const_iterator

Constant T iterator type.

Definition at line 82 of file Array.hpp.

template<class T>
typedef T* torc::architecture::Array< T >::iterator

Non-constant T iterator type.

Definition at line 84 of file Array.hpp.


Constructor & Destructor Documentation

template<class T>
torc::architecture::Array< T >::Array ( void   )  [inline]

Null constructor.

template<class T>
torc::architecture::Array< T >::Array ( uint32_t  inSize  )  [inline]

Public constructor.

template<class T>
torc::architecture::Array< T >::~Array ( void   )  [inline]

Non-virtual destructor.


Member Function Documentation

template<class T>
void torc::architecture::Array< T >::allocate ( uint32_t  inSize  )  [inline, private]

Allocate an array of the specified size.

Definition at line 52 of file Array.hpp.

template<class T>
void torc::architecture::Array< T >::deallocate ( void   )  [inline, private]

Deallocate the array.

Definition at line 61 of file Array.hpp.

template<class T>
T* torc::architecture::Array< T >::begin ( void   )  [inline]

Returns the non-constant begin iterator.

Definition at line 94 of file Array.hpp.

template<class T>
T* torc::architecture::Array< T >::end ( void   )  [inline]

Returns the non-constant end iterator.

Definition at line 96 of file Array.hpp.

template<class T>
const T* torc::architecture::Array< T >::begin ( void   )  const [inline]

Returns the constant begin iterator.

Definition at line 98 of file Array.hpp.

template<class T>
const T* torc::architecture::Array< T >::end ( void   )  const [inline]

Returns the constant end iterator.

Definition at line 100 of file Array.hpp.

template<class T>
uint32_t torc::architecture::Array< T >::getSize ( void   )  const [inline]

Returns the array size.

Definition at line 103 of file Array.hpp.

template<class T>
void torc::architecture::Array< T >::setSize ( uint32_t  inSize  )  [inline]

Discards all contents and resizes the array.

Definition at line 106 of file Array.hpp.

template<class T>
T& torc::architecture::Array< T >::operator[] ( uint32_t  inIndex  )  [inline]

Non-constant subscript operator.

Definition at line 109 of file Array.hpp.

template<class T>
const T& torc::architecture::Array< T >::operator[] ( uint32_t  inIndex  )  const [inline]

Constant subscript operator.

Definition at line 114 of file Array.hpp.


Member Data Documentation

template<class T>
T* torc::architecture::Array< T >::mArray [protected]

The internal array.

Definition at line 47 of file Array.hpp.

template<class T>
uint32_t torc::architecture::Array< T >::mSize [protected]

The logical and actual size of the array.

Definition at line 49 of file Array.hpp.


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

Generated on Thu Oct 13 16:49:30 2011 for TORC by  doxygen 1.5.6