COLLADA 1.4 DOM: daeTArray< T > Class Template Reference

COLLADA

daeTArray< T > Class Template Reference

#include <daeArray.h>

Inheritance diagram for daeTArray< T >:

Inheritance graph
[legend]
Collaboration diagram for daeTArray< T >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class T>
class daeTArray< T >

COLLADA C++ templated version of daeArray for storing items of various types.


Public Member Functions

 daeTArray ()
 Constructor.
 daeTArray (const daeTArray< T > &cpy)
 Copy Constructor.
virtual ~daeTArray ()
 Destructor.
virtual void clear ()
 Frees the memory in this array and resets it to it's initial state.
virtual daeInt removeIndex (size_t index)
 Removes an item at a specific index in the daeArray.
void setCount (size_t nElements)
 Resets the count of items in a daeArray to an absolute value, if necessary the array storage will grow to the requested size and new elements will be initialized to zero.
void set (size_t index, const T &value)
 Sets a specific index in the daeArray, growing the array if necessary.
T & get (size_t index) const
 Gets the object at a specific index in the daeArray.
size_t append (const T &value)
 Appends a new object to the end of the daeArray.
size_t appendUnique (const T &value)
 Appends a unique object to the end of the daeArray.
daeInt remove (const T &value)
 Removes an item from the daeArray.
daeInt find (const T &value, size_t &index) const
 Finds an item from the daeArray.
T & operator[] (size_t index) const
 Gets the object at a specific index in the daeArray.
void insertAt (size_t index, const T &value)
 Inserts an object at a specific index in the daeArray, growing the array if neccessary.
daeTArray< T > & operator= (const daeTArray< T > &other)
 Overloaded assignment operator.

Member Function Documentation

template<class T>
size_t daeTArray< T >::append const T &  value  )  [inline]
 

Appends a new object to the end of the daeArray.

Parameters:
value Value of the object to append.
Returns:
Returns the index of the new object.

template<class T>
size_t daeTArray< T >::appendUnique const T &  value  )  [inline]
 

Appends a unique object to the end of the daeArray.

Functions the same as append(), but does nothing if the value is already in the daeArray.

Parameters:
value Value of the object to append.
Returns:
Returns the index where this value was appended. If the value already exists in the array, returns the index in this array where the value was found.

template<class T>
daeInt daeTArray< T >::find const T &  value,
size_t &  index
const [inline]
 

Finds an item from the daeArray.

Parameters:
value A reference to the item to find.
index If the function returns DAE_OK, this is set to the index where the value appears in the array.
Returns:
Returns DAE_OK if no error or DAE_ERR_QUERY_NO_MATCH if the value was not found.

template<class T>
T& daeTArray< T >::get size_t  index  )  const [inline]
 

Gets the object at a specific index in the daeArray.

Parameters:
index Index of the object to get, asserts if the index is out of bounds.
Returns:
Returns the object at index.

template<class T>
void daeTArray< T >::insertAt size_t  index,
const T &  value
[inline]
 

Inserts an object at a specific index in the daeArray, growing the array if neccessary.

Parameters:
index Index into the array for where to place the object, asserts if the index is out of bounds
value of the object to append

template<class T>
daeTArray<T>& daeTArray< T >::operator= const daeTArray< T > &  other  )  [inline]
 

Overloaded assignment operator.

Parameters:
other A reference to the array to copy
Returns:
A reference to this object.

template<class T>
T& daeTArray< T >::operator[] size_t  index  )  const [inline]
 

Gets the object at a specific index in the daeArray.

Parameters:
index Index of the object to get, asserts if the index is out of bounds.
Returns:
Returns the object at index.

template<class T>
daeInt daeTArray< T >::remove const T &  value  )  [inline]
 

Removes an item from the daeArray.

Parameters:
value A reference to the item to delete.
Returns:
Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Note:
The daeElement objects sometimes list objects in two places, the class member and the _contents array, when you remove something from the do, you must remove it from both places.

template<class T>
virtual daeInt daeTArray< T >::removeIndex size_t  index  )  [inline, virtual]
 

Removes an item at a specific index in the daeArray.

Parameters:
index Index number of the item to delete.
Returns:
Returns DAE_OK if success, a negative value defined in daeError.h otherwise.
Note:
The daeElement objects sometimes list objects in two places, the class member and the _contents array, when you remove something from the dom, you must remove it from both places.

Reimplemented from daeArray.

template<class T>
void daeTArray< T >::set size_t  index,
const T &  value
[inline]
 

Sets a specific index in the daeArray, growing the array if necessary.

Parameters:
index Index of the object to set, asserts if the index is out of bounds.
value Value to store at index in the array.

template<class T>
void daeTArray< T >::setCount size_t  nElements  )  [inline]
 

Resets the count of items in a daeArray to an absolute value, if necessary the array storage will grow to the requested size and new elements will be initialized to zero.

Parameters:
nElements The new size of the array.
Note:
Shrinking the array does NOT free up memory.


The documentation for this class was generated from the following file:
  • C:/SVN_wf/COLLADA_DOM/include/dae/daeArray.h

©2005 Sony Computer Entertainment Inc.. All Rights Reserved.
Generated on Fri Feb 10 16:47:04 2006 for COLLADA 1.4 DOM by doxygen 1.4.3