- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::Collections::TMatrix< TypeName > Class Template Reference

Inheritance diagram for Exponent::Collections::TMatrix< TypeName >:

List of all members.

## Detailed Description

### template<class TypeName>
class Exponent::Collections::TMatrix< TypeName >

Template'd 2d array of a fixed size.

Date:
  16/12/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  TMatrix.hpp,v 1.9 2007/02/08 21:06:44 paul Exp

Definition at line 31 of file TMatrix.hpp.

## Public Member Functions

- void addElementAtIndex (const long d1, const long d2, const TypeName &object)
- void clearArray ()
- TypeName * elementAtIndex (const long d1, const long d2)
- long getDimension1Size () const
- long getDimension2Size () const
- const TypeName ** getInternalBuffer () const
- TypeName ** getMutableInternalBuffer ()
- void initialise (const long d1, const long d2)
- bool isElementInArray (const TypeName &object)
- TMatrix & operator= (const TypeName &element)
- TMatrix & operator= (const TMatrix< TypeName > &other)
- TypeName * operator[] (const long index)
- void setAllElementsTo (const TypeName &element)
- TMatrix ()
- TMatrix (const long d1, const long d2)
- ~TMatrix ()

## Protected Member Functions

- void freePointers ()

## Protected Attributes

- long m_dimension1
- long m_dimension2
- TypeName ** m_pointers

## Constructor & Destructor Documentation

template<class TypeName>

Exponent::Collections::TMatrix< TypeName >::TMatrix | ( | const long | d1,
|  | const long | d2 |
| ) |  |  |

Construction

Parameters:

  | d1 | Dimension 1 size
  | d2 | Dimension 2 size

template<class TypeName>

Exponent::Collections::TMatrix< TypeName >::TMatrix | ( |  | ) |

Default construction

template<class TypeName>

Exponent::Collections::TMatrix< TypeName >::~TMatrix | ( |  | ) |

Destruction

## Member Function Documentation

template<class TypeName>

void Exponent::Collections::TMatrix< TypeName >::addElementAtIndex | ( | const long | d1,
|  | const long | d2,
|  | const TypeName & | object |
| ) |  |  |

Insert a pointer at a specific index

Parameters:

  | d1 | Dimension 1 index
  | d2 | Dimension 2 index
  | object | The object to add

template<class TypeName>

void Exponent::Collections::TMatrix< TypeName >::clearArray | ( |  | ) |

Clear the array - releases all objects

template<class TypeName>

TypeName* Exponent::Collections::TMatrix< TypeName >::elementAtIndex | ( | const long | d1,
|  | const long | d2 |
| ) |  |  |

Get the element at a specific index

Parameters:

  | d1 | Dimension 1 index
  | d2 | Dimension 2 index

Return values:

  | TypeName* | The object requested or NULL on error

template<class TypeName>

void Exponent::Collections::TMatrix< TypeName >::freePointers | ( |  | ) | `[protected]`

Free pointers -> deleteds (but not allways) all pointers

template<class TypeName>

long Exponent::Collections::TMatrix< TypeName >::getDimension1Size | ( |  | ) | const`[inline]`

Get the size of the array

Return values:

  | long | The dimension 1 of the array

Definition at line 126 of file TMatrix.hpp.

References Exponent::Collections::TMatrix< TypeName >::m_dimension1.

template<class TypeName>

long Exponent::Collections::TMatrix< TypeName >::getDimension2Size | ( |  | ) | const`[inline]`

Get the size of the array

Return values:

  | long | The dimension 2 of the array

Definition at line 132 of file TMatrix.hpp.

References Exponent::Collections::TMatrix< TypeName >::m_dimension2.

template<class TypeName>

const TypeName** Exponent::Collections::TMatrix< TypeName >::getInternalBuffer | ( |  | ) | const`[inline]`

Get internal buffer

Return values:

  | const | TypeName ** The internal buffer

Definition at line 143 of file TMatrix.hpp.

References Exponent::Collections::TMatrix< TypeName >::m_pointers.

template<class TypeName>

TypeName** Exponent::Collections::TMatrix< TypeName >::getMutableInternalBuffer | ( |  | ) | `[inline]`

Get the internal buffer

Return values:

  | const | TypeName ** The internal buffer

Definition at line 149 of file TMatrix.hpp.

References Exponent::Collections::TMatrix< TypeName >::m_pointers.

template<class TypeName>

void Exponent::Collections::TMatrix< TypeName >::initialise | ( | const long | d1,
|  | const long | d2 |
| ) |  |  |

intialise the array with a specific size

Parameters:

  | d1 | Dimension 1 size
  | d2 | Dimension 2 size

template<class TypeName>

bool Exponent::Collections::TMatrix< TypeName >::isElementInArray | ( | const TypeName & | object | ) |

Is object in array

Parameters:

  | object | The object to look for

Return values:

  | bool | True if this object is stored in the array, false otherwise

template<class TypeName>

TMatrix& Exponent::Collections::TMatrix< TypeName >::operator= | ( | const TypeName & | element | ) |

Set all elements to

Parameters:

  | element | The element to set all to

Return values:

  | TMatrixy& | A reference to this

template<class TypeName>

TMatrix& Exponent::Collections::TMatrix< TypeName >::operator= | ( | const TMatrix< TypeName > & | other | ) |

Assignment operator

Parameters:

  | other | The vector to copy

Return values:

  | TMatrix& | A reference to this

template<class TypeName>

TypeName* Exponent::Collections::TMatrix< TypeName >::operator[] | ( | const long | index | ) | `[inline]`

Index operator

Parameters:

  | index | The dimension1 index to retrieve

Definition at line 80 of file TMatrix.hpp.

References Exponent::Collections::TMatrix< TypeName >::m_pointers.

template<class TypeName>

void Exponent::Collections::TMatrix< TypeName >::setAllElementsTo | ( | const TypeName & | element | ) |

Set all elements to

Parameters:

  | element | The element to set all to

## Member Data Documentation

template<class TypeName>

long Exponent::Collections::TMatrix< TypeName >::m_dimension1`[protected]`

Dimension 1 size

Definition at line 165 of file TMatrix.hpp.

Referenced by Exponent::Collections::TMatrix< TypeName >::getDimension1Size().

template<class TypeName>

long Exponent::Collections::TMatrix< TypeName >::m_dimension2`[protected]`

Dimension 2 size

Definition at line 166 of file TMatrix.hpp.

Referenced by Exponent::Collections::TMatrix< TypeName >::getDimension2Size().

template<class TypeName>

TypeName** Exponent::Collections::TMatrix< TypeName >::m_pointers`[protected]`

the double array of pointers

Definition at line 164 of file TMatrix.hpp.

Referenced by Exponent::Collections::TMatrix< TypeName >::getInternalBuffer(), Exponent::Collections::TMatrix< TypeName >::getMutableInternalBuffer(), and Exponent::Collections::TMatrix< TypeName >::operator[]().