daeTArray< T > Class Template Reference

#include <daeArray.h>

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

List of all members.

Public Member Functions

size_t append (const T &value)
void append2 (const T &one, const T &two)
void append3 (const T &one, const T &two, const T &three)
void append4 (const T &one, const T &two, const T &three, const T &four)
void appendArray (const daeTArray< T > &array)
void appendArray (size_t num, T *array)
size_t appendUnique (const T &value)
virtual void clear ()
 daeTArray (const T &el)
 daeTArray (const daeTArray< T > &cpy)
 daeTArray (T *prototype)
 daeTArray ()
T * find (const T &value) const
daeInt find (const T &value, size_t &index) const
const T & get (size_t index) const
T & get (size_t index)
daeInt get2at (size_t index, T &one, T &two)
daeInt get3at (size_t index, T &one, T &two, T &three)
daeInt get4at (size_t index, T &one, T &two, T &three, T &four)
void grow (size_t minCapacity)
void insert (size_t index, size_t n, const T &val=T())
void insert2at (size_t index, const T &one, const T &two)
void insert3at (size_t index, const T &one, const T &two, const T &three)
void insert4at (size_t index, const T &one, const T &two, const T &three, const T &four)
void insertAt (size_t index, const T &value)
daeTArray< T > & operator= (const daeTArray< T > &other)
bool operator== (const daeTArray< T > &other)
const T & operator[] (size_t index) const
T & operator[] (size_t index)
void prepend (const T &value)
daeInt remove (const T &value, size_t *idx=NULL)
virtual daeInt removeIndex (size_t index)
void set (size_t index, const T &value)
void set2 (const T &one, const T &two)
void set2at (size_t index, const T &one, const T &two)
void set3 (const T &one, const T &two, const T &three)
void set3at (size_t index, const T &one, const T &two, const T &three)
void set4 (const T &one, const T &two, const T &three, const T &four)
void set4at (size_t index, const T &one, const T &two, const T &three, const T &four)
virtual void setCount (size_t nElements)
void setCount (size_t nElements, const T &value)
virtual ~daeTArray ()

Protected Attributes

T * prototype

Detailed Description

template<class T>
class daeTArray< T >

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

Definition at line 100 of file daeArray.h.


Constructor & Destructor Documentation

template<class T>
daeTArray< T >::daeTArray (  )  [inline]

Constructor.

Definition at line 108 of file daeArray.h.

template<class T>
daeTArray< T >::daeTArray ( T *  prototype  )  [inline, explicit]

Constructor.

Definition at line 115 of file daeArray.h.

template<class T>
daeTArray< T >::daeTArray ( const daeTArray< T > &  cpy  )  [inline]

Copy Constructor

Definition at line 121 of file daeArray.h.

template<class T>
daeTArray< T >::daeTArray ( const T &  el  )  [inline, explicit]

Constructor that takes one element and turns into an array

Definition at line 128 of file daeArray.h.

template<class T>
virtual daeTArray< T >::~daeTArray (  )  [inline, virtual]

Destructor.

Definition at line 136 of file daeArray.h.


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.

Definition at line 263 of file daeArray.h.

template<class T>
void daeTArray< T >::append2 ( const T &  one,
const T &  two 
) [inline]

Appends two values to the array.

Parameters:
one The first value.
two The second value.

Definition at line 516 of file daeArray.h.

template<class T>
void daeTArray< T >::append3 ( const T &  one,
const T &  two,
const T &  three 
) [inline]

Appends three values to the array.

Parameters:
one The first value.
two The second value.
three The third value.

Definition at line 527 of file daeArray.h.

template<class T>
void daeTArray< T >::append4 ( const T &  one,
const T &  two,
const T &  three,
const T &  four 
) [inline]

Appends four values to the array.

Parameters:
one The first value.
two The second value.
three The third value.
four The fourth value.

Definition at line 540 of file daeArray.h.

template<class T>
void daeTArray< T >::appendArray ( const daeTArray< T > &  array  )  [inline]

Appends a number of elements to this array from another daeTArray.

Parameters:
array The daeTArray that contains the values to append.

Definition at line 693 of file daeArray.h.

template<class T>
void daeTArray< T >::appendArray ( size_t  num,
T *  array 
) [inline]

Appends a number of elements to this array from a C native array.

Parameters:
num The number of elements to append.
array The C native array that contains the values to append.

Definition at line 681 of file daeArray.h.

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.

Definition at line 275 of file daeArray.h.

template<class T>
virtual void daeTArray< T >::clear (  )  [inline, virtual]

Frees the memory in this array and resets it to it's initial state.

Implements daeArray.

Definition at line 143 of file daeArray.h.

template<class T>
T* daeTArray< T >::find ( const T &  value  )  const [inline]

Just like the previous function, but has a more reasonable interface.

Parameters:
value The value to find.
Returns:
Returns a pointer to the value if found, null otherwise.

Definition at line 339 of file daeArray.h.

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.

Definition at line 320 of file daeArray.h.

template<class T>
const 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.

Definition at line 254 of file daeArray.h.

template<class T>
T& daeTArray< T >::get ( size_t  index  )  [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.

Definition at line 246 of file daeArray.h.

template<class T>
daeInt daeTArray< T >::get2at ( size_t  index,
T &  one,
T &  two 
) [inline]

Gets two values from the array at the specified location.

Parameters:
index The position in the array to start getting.
one Variable to store the first value.
two Variable to store the second value.
Returns:
Returns The number of elements retrieved.

Definition at line 598 of file daeArray.h.

template<class T>
daeInt daeTArray< T >::get3at ( size_t  index,
T &  one,
T &  two,
T &  three 
) [inline]

Gets three values from the array at the specified location.

Parameters:
index The position in the array to start getting.
one Variable to store the first value.
two Variable to store the second value.
three Variable to store the third value.
Returns:
Returns The number of elements retrieved.

Definition at line 621 of file daeArray.h.

template<class T>
daeInt daeTArray< T >::get4at ( size_t  index,
T &  one,
T &  two,
T &  three,
T &  four 
) [inline]

Gets four values from the array at the specified location.

Parameters:
index The position in the array to start getting.
one Variable to store the first value.
two Variable to store the second value.
three Variable to store the third value.
four Variable to store the fourth value.
Returns:
Returns The number of elements retrieved.

Definition at line 650 of file daeArray.h.

template<class T>
void daeTArray< T >::grow ( size_t  minCapacity  )  [inline, virtual]

Increases the capacity of the daeArray.

Parameters:
minCapacity The minimum array capacity (the actual resulting capacity may be higher).

Implements daeArray.

Definition at line 157 of file daeArray.h.

template<class T>
void daeTArray< T >::insert ( size_t  index,
size_t  n,
const T &  val = T() 
) [inline]

Inserts the specified number of elements at a specific location in the array.

Parameters:
index Index into the array where the elements will be inserted
n The number of elements to insert
val The value to insert

Definition at line 368 of file daeArray.h.

template<class T>
void daeTArray< T >::insert2at ( size_t  index,
const T &  one,
const T &  two 
) [inline]

Inserts two values into the array at the specified location.

Parameters:
index The position in the array to start inserting.
one The first value.
two The second value.

Definition at line 554 of file daeArray.h.

template<class T>
void daeTArray< T >::insert3at ( size_t  index,
const T &  one,
const T &  two,
const T &  three 
) [inline]

Inserts three values into the array at the specified location.

Parameters:
index The position in the array to start inserting.
one The first value.
two The second value.
three The third value.

Definition at line 567 of file daeArray.h.

template<class T>
void daeTArray< T >::insert4at ( size_t  index,
const T &  one,
const T &  two,
const T &  three,
const T &  four 
) [inline]

Inserts four values into the array at the specified location.

Parameters:
index The position in the array to start inserting.
one The first value.
two The second value.
three The third value.
four The fourth value.

Definition at line 582 of file daeArray.h.

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
value The object to append

Definition at line 390 of file daeArray.h.

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.

Definition at line 400 of file daeArray.h.

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

Overloaded equality operator

Parameters:
other A reference to the other array.
Returns:
true if the arrays are equal, false otherwise.

Definition at line 418 of file daeArray.h.

template<class T>
const 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.

Definition at line 358 of file daeArray.h.

template<class T>
T& daeTArray< T >::operator[] ( size_t  index  )  [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.

Definition at line 350 of file daeArray.h.

template<class T>
void daeTArray< T >::prepend ( const T &  value  )  [inline]

Adds a new item to the front of the daeArray.

Parameters:
value Item to be added.

Definition at line 287 of file daeArray.h.

template<class T>
daeInt daeTArray< T >::remove ( const T &  value,
size_t *  idx = NULL 
) [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.

Definition at line 299 of file daeArray.h.

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.

Implements daeArray.

Definition at line 186 of file daeArray.h.

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.

Definition at line 235 of file daeArray.h.

template<class T>
void daeTArray< T >::set2 ( const T &  one,
const T &  two 
) [inline]

Sets the array to the contain the two values specified.

Parameters:
one The first value.
two The second value.

Definition at line 433 of file daeArray.h.

template<class T>
void daeTArray< T >::set2at ( size_t  index,
const T &  one,
const T &  two 
) [inline]

Sets the values in the array at the specified location to the contain the two values specified. This function will grow the array if needed.

Parameters:
index The position in the array to start setting.
one The first value.
two The second value.

Definition at line 475 of file daeArray.h.

template<class T>
void daeTArray< T >::set3 ( const T &  one,
const T &  two,
const T &  three 
) [inline]

Sets the array to the contain the three values specified.

Parameters:
one The first value.
two The second value.
three The third value.

Definition at line 445 of file daeArray.h.

template<class T>
void daeTArray< T >::set3at ( size_t  index,
const T &  one,
const T &  two,
const T &  three 
) [inline]

Sets the values in the array at the specified location to the contain the three values specified. This function will grow the array if needed.

Parameters:
index The position in the array to start setting.
one The first value.
two The second value.
three The third value.

Definition at line 488 of file daeArray.h.

template<class T>
void daeTArray< T >::set4 ( const T &  one,
const T &  two,
const T &  three,
const T &  four 
) [inline]

Sets the array to the contain the four values specified.

Parameters:
one The first value.
two The second value.
three The third value.
four The fourth value.

Definition at line 459 of file daeArray.h.

template<class T>
void daeTArray< T >::set4at ( size_t  index,
const T &  one,
const T &  two,
const T &  three,
const T &  four 
) [inline]

Sets the values in the array at the specified location to the contain the four values specified. This function will grow the array if needed.

Parameters:
index The position in the array to start setting.
one The first value.
two The second value.
three The third value.
four The fourth value.

Definition at line 503 of file daeArray.h.

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

Resets the number of elements in the array. If the array increases in size, the new elements will be initialized with a default constructor.

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

Implements daeArray.

Definition at line 223 of file daeArray.h.

template<class T>
void daeTArray< T >::setCount ( size_t  nElements,
const T &  value 
) [inline]

Resets the number of elements in the array. If the array increases in size, the new elements will be initialized to the specified value.

Parameters:
nElements The new size of the array.
value The value new elements will be initialized to.
Note:
Shrinking the array does NOT free up memory.

Definition at line 205 of file daeArray.h.


Member Data Documentation

template<class T>
T* daeTArray< T >::prototype [protected]

Definition at line 103 of file daeArray.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


colladadom
Author(s): Du Hung Hou, Khronos.org, Marcus Barnes, Greg Corson, Herbert Law, Sebastian Schwarz, Steven Thomas, John Hsu (ros package), Tim Field (ros package)
autogenerated on Fri Jan 11 09:29:16 2013