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

- Namespace List
- Namespace Members

# Mers::Utils::Containers Namespace Reference

## Classes
class | DynamicArray
class | DynamicArrayTemplate
class | DynamicHeap
class | DynamicQueue
class | StackTemplate
class | IntegerArray
class | intList
class | IConstantIterator
class | IIterator
class | IteratorTraits
class | IteratorTraits< t_Iterand * >
class | IteratorTraits< const t_Iterand * >
class | IteratorTraits< const t_Iterand >
class | IteratorTemplate
class | ObjectArray
class | ObjectQueue
class | DynamicCastTag
class | SharedPointer
class | VectorImpl
class | VectorIterator
| Iterator for Vector. More...
class | Vector< T * >
class | Vector2D
## Functions
ostream & | operator<< (ostream &_ostream, const intList &_intList)
template<class t_Object>
void | swap (SharedPointer< t_Object > &p1, SharedPointer< t_Object > &p2)
template<class t_NewObject, class t_OldObject>
SharedPointer< t_NewObject > | dynamic_pointer_cast (SharedPointer< t_OldObject > const &oldPointer)
template<class T>
const T * | find (const Vector< T * > *vector, const std::string &name)
template<class T>
T * | find (Vector< T * > *vector, const std::string &name)
template<class T>
bool | operator== (const Vector< T * > &vector1, const Vector< T * > &vector2)
template<class T>
bool | operator!= (const Vector< T * > &vector1, const Vector< T * > &vector2)

## Function Documentation

template<class t_NewObject, class t_OldObject>

SharedPointer< t_NewObject > Mers::Utils::Containers::dynamic_pointer_cast | ( | SharedPointer< t_OldObject > const & | oldPointer | ) |

This dynamically up-casts the pointer to which this object points via a function. If oldPointer points at an object of type t_NewObject, then the returned object will be valid. Otherwise, the returned object will point to NULL, like a normal dynamic cast.

Parameters:

  | oldPointer | The pointer being dynamic_cast into a t_NewObject.

Returns:
  a SharedPointer that points to the same t_OldObject but dynamic_cast into a t_NewObject. If the original pointer was not of type t_NewObject, then the typecast will fail and the pointer will be NULL.

Definition at line 330 of file SharedPointer.h.

Referenced by Mers::Executives::DeductiveController::Stub::DCStub::step().

template<class T>

const T* Mers::Utils::Containers::find | ( | const Vector< T * > * | vector,
|  | const std::string & | name |
| ) |  |  |

Finds the first element in the vector that points to an object with the given name. NULL elements are ignored. Requires: T implements a getName() method and is a subclass of Object

Parameters:

  | vector | vector of pointers to the objects
  | name | the name of the element being sought

Returns:
  the element, or NULL if there is no matching element in the vector

Definition at line 751 of file Vector.h.

template<class T>

bool Mers::Utils::Containers::operator!= | ( | const Vector< T * > & | vector1,
|  | const Vector< T * > & | vector2 |
| ) |  |  |

Returns true if the two vectors have the same elements in the same order. Requires: T implements the == operator and is a subclass of Object

Definition at line 792 of file Vector.h.

template<class T>

bool Mers::Utils::Containers::operator== | ( | const Vector< T * > & | vector1,
|  | const Vector< T * > & | vector2 |
| ) |  |  |

Returns true if the two vectors have the same elements in the same order. Requires: T implements the == operator and is a subclass of Object

Definition at line 777 of file Vector.h.

template<class t_Object>

void Mers::Utils::Containers::swap | ( | SharedPointer< t_Object > & | p1,
|  | SharedPointer< t_Object > & | p2 |
| ) |  |  | `[inline]`

This function swaps the contents of the two pointers.

Parameters:

  | p1 | The first pointer of the swap. After this function, this will point at the contents of p2.
  | p2 | The second pointer of the swap. After this function, this will point at the contents of p1.

Definition at line 310 of file SharedPointer.h.

References Mers::Utils::Containers::SharedPointer< t_Object >::swap().

Here is the call graph for this function: