torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::architecture::Array2D< T > Class Template Reference

Encapsulation of a 2D static array. More...

#include <Array.hpp>

+ Inheritance diagram for torc::architecture::Array2D< T >:
+ Collaboration diagram for torc::architecture::Array2D< T >:

Public Types

typedef const Array< T > * const_iterator
 Constant T iterator type. More...
 
typedef Array< T > * iterator
 Non-constant T iterator type. More...
 

Public Member Functions

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

Protected Types

typedef Array< Array< T > > super
 Typedef for the base class. More...
 
typedef boost::uint32_t uint32_t
 Imported type name. More...
 
typedef boost::remove_const
< Array< T > >::type 
T_non_const
 A type identical to template parameter T, but with any 'const' trait removed. More...
 

Protected Attributes

Array< T > * mArray
 The internal array. More...
 
uint32_t mSize
 The logical and actual size of the array. More...
 

Detailed Description

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

Encapsulation of a 2D static array.

2D arrays are used to represent parts of the device wiring data. In general, the nested arrays will not be identically sized, so we provide no deep constructor here. See Array for more details on the superclass.

Definition at line 125 of file Array.hpp.

Member Typedef Documentation

typedef const Array< T > * torc::architecture::Array< Array< T > >::const_iterator
inherited

Constant T iterator type.

Definition at line 83 of file Array.hpp.

typedef Array< T > * torc::architecture::Array< Array< T > >::iterator
inherited

Non-constant T iterator type.

Definition at line 85 of file Array.hpp.

template<class T>
typedef Array< Array<T> > torc::architecture::Array2D< T >::super
protected

Typedef for the base class.

Definition at line 129 of file Array.hpp.

typedef boost::remove_const<Array< T > >::type torc::architecture::Array< Array< T > >::T_non_const
protectedinherited

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

Definition at line 45 of file Array.hpp.

typedef boost::uint32_t torc::architecture::Array< Array< T > >::uint32_t
protectedinherited

Imported type name.

Definition at line 43 of file Array.hpp.

Constructor & Destructor Documentation

template<class T>
torc::architecture::Array2D< T >::Array2D ( void  )
inline

Null constructor.

Definition at line 133 of file Array.hpp.

133 : super() {}
Array< Array< T > > super
Typedef for the base class.
Definition: Array.hpp:129
template<class T>
torc::architecture::Array2D< T >::Array2D ( uint32_t  inSize)
inline

Public constructor.

Parameters
inSizeThe size of the outer array. The inner arrays will be constructed with their unsized default constructor.

Definition at line 137 of file Array.hpp.

137 : super(inSize) {}
Array< Array< T > > super
Typedef for the base class.
Definition: Array.hpp:129

Member Function Documentation

Array< T > * torc::architecture::Array< Array< T > >::begin ( void  )
inlineinherited

Returns the non-constant begin iterator.

Definition at line 95 of file Array.hpp.

95 { return mArray; }
Array< T > * mArray
The internal array.
Definition: Array.hpp:48
const Array< T > * torc::architecture::Array< Array< T > >::begin ( void  ) const
inlineinherited

Returns the constant begin iterator.

Definition at line 99 of file Array.hpp.

99 { return mArray; }
Array< T > * mArray
The internal array.
Definition: Array.hpp:48
Array< T > * torc::architecture::Array< Array< T > >::end ( void  )
inlineinherited

Returns the non-constant end iterator.

Definition at line 97 of file Array.hpp.

97 { return mArray + mSize; }
Array< T > * mArray
The internal array.
Definition: Array.hpp:48
uint32_t mSize
The logical and actual size of the array.
Definition: Array.hpp:50
const Array< T > * torc::architecture::Array< Array< T > >::end ( void  ) const
inlineinherited

Returns the constant end iterator.

Definition at line 101 of file Array.hpp.

101 { return mArray + mSize; }
Array< T > * mArray
The internal array.
Definition: Array.hpp:48
uint32_t mSize
The logical and actual size of the array.
Definition: Array.hpp:50
uint32_t torc::architecture::Array< Array< T > >::getSize ( void  ) const
inlineinherited

Returns the array size.

Definition at line 104 of file Array.hpp.

104 { return mSize; }
uint32_t mSize
The logical and actual size of the array.
Definition: Array.hpp:50
Array< T > & torc::architecture::Array< Array< T > >::operator[] ( uint32_t  inIndex)
inlineinherited

Non-constant subscript operator.

Definition at line 110 of file Array.hpp.

110  {
111  enforceBounds(inIndex);
112  return mArray[inIndex];
113  }
#define enforceBounds(index)
Enforce array bounds if so requested.
Definition: Array.hpp:78
Array< T > * mArray
The internal array.
Definition: Array.hpp:48
const Array< T > & torc::architecture::Array< Array< T > >::operator[] ( uint32_t  inIndex) const
inlineinherited

Constant subscript operator.

Definition at line 115 of file Array.hpp.

115  {
116  enforceBounds(inIndex);
117  return mArray[inIndex];
118  }
#define enforceBounds(index)
Enforce array bounds if so requested.
Definition: Array.hpp:78
Array< T > * mArray
The internal array.
Definition: Array.hpp:48
void torc::architecture::Array< Array< T > >::setSize ( uint32_t  inSize)
inlineinherited

Discards all contents and resizes the array.

Definition at line 107 of file Array.hpp.

107 { allocate(inSize); }
void allocate(uint32_t inSize)
Allocate an array of the specified size.
Definition: Array.hpp:53

Field Documentation

Array< T > * torc::architecture::Array< Array< T > >::mArray
protectedinherited

The internal array.

Definition at line 48 of file Array.hpp.

uint32_t torc::architecture::Array< Array< T > >::mSize
protectedinherited

The logical and actual size of the array.

Definition at line 50 of file Array.hpp.


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