| TerraLib 4.1

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Types | Protected Attributes
TeMultiContainer< TeMultiContainerKeyT > Class Template Reference
General purpose utilitary functions

A container class to store multiple types os object copies. More...

`#include <TeMultiContainer.h>`

List of all members.

## Public Types

typedef TeSharedPtr < TeMultiContainer < TeMultiContainerKeyT > > | pointer
typedef const TeSharedPtr < TeMultiContainer < TeMultiContainerKeyT > > | const_pointer

## Public Member Functions

| TeMultiContainer ()
| Default Constructor.
| TeMultiContainer (const TeMultiContainer< TeMultiContainerKeyT > &external)
| Alternative Constructor.
| ~TeMultiContainer ()
| Default Destructor.
bool | operator== (const TeMultiContainer< TeMultiContainerKeyT > &external) const
| Operator == overload.
bool | operator!= (const TeMultiContainer< TeMultiContainerKeyT > &ext_instance) const
| Operator != overload.
const TeMultiContainer < TeMultiContainerKeyT > & | operator= (const TeMultiContainer< TeMultiContainerKeyT > &ext_instance)
| operator= overload.
void | clear ()
| Clear all contents.
template<typename ObjectT >
void | store (const TeMultiContainerKeyT &obj_key, const ObjectT &obj_reference)
| Store a object copy.
template<typename ObjectT >
bool | retrive (const TeMultiContainerKeyT &obj_key, ObjectT &obj_reference) const
| Retrive a copy of a stored object.
template<typename ObjectT >
void | multiRetrive (std::vector< std::pair< TeMultiContainerKeyT, ObjectT > > &objs_vector) const
| Retrive copies of all stored objects of a defined type.
template<typename ObjectT >
bool | isStored (const TeMultiContainerKeyT &obj_key) const
| Checks if a object is stored.
void | remove (const TeMultiContainerKeyT &obj_key)
| Remove a stored object.

## Protected Types

typedef std::map < TeMultiContainerKeyT, TeMCNodeInterface < TeMultiContainerKeyT > * > | IntContainerT
| Internal container type definition.

## Protected Attributes

IntContainerT | container_instance_
| The nodes container instance.
TeMutex | lock_instance_
| This instance locking mutex.

## Detailed Description

### template<typename TeMultiContainerKeyT>
class TeMultiContainer< TeMultiContainerKeyT >

A container class to store multiple types os object copies.

Author:
  Emiliano F. Castejon <castejon@dpi.inpe.br>

Note:
  This is a thread-safe class.
  Do not use this class with polymorphic types !!

## Member Typedef Documentation

template<typename TeMultiContainerKeyT>

const TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > TeMultiContainer< TeMultiContainerKeyT >::const_pointer

Type definition for a const instance pointer

Reimplemented in TePDIParameters.

template<typename TeMultiContainerKeyT>

typedef std::map< TeMultiContainerKeyT, TeMCNodeInterface< TeMultiContainerKeyT >* > TeMultiContainer< TeMultiContainerKeyT >::IntContainerT`[protected]`

Internal container type definition.

template<typename TeMultiContainerKeyT>

TeSharedPtr< TeMultiContainer< TeMultiContainerKeyT > > TeMultiContainer< TeMultiContainerKeyT >::pointer

Type definition for a instance pointer

Reimplemented in TePDIParameters.

## Constructor & Destructor Documentation

template<typename TeMultiContainerKeyT >

TeMultiContainer< TeMultiContainerKeyT >::TeMultiContainer | ( |  | ) |

Default Constructor.

template<typename TeMultiContainerKeyT>

TeMultiContainer< TeMultiContainerKeyT >::TeMultiContainer | ( | const TeMultiContainer< TeMultiContainerKeyT > & | external | ) |

Alternative Constructor.

Parameters:

  external | External reference.

template<typename TeMultiContainerKeyT >

TeMultiContainer< TeMultiContainerKeyT >::~TeMultiContainer | ( |  | ) |

Default Destructor.

## Member Function Documentation

template<typename TeMultiContainerKeyT >

void TeMultiContainer< TeMultiContainerKeyT >::clear | ( | void |  | ) |

Clear all contents.

template<typename TeMultiContainerKeyT>
template<typename ObjectT >

bool TeMultiContainer< TeMultiContainerKeyT >::isStored | ( | const TeMultiContainerKeyT & | obj_key | ) | const

Checks if a object is stored.

Parameters:

  obj_key | Object key.

Note:
  The object type must be specified.

Returns:
  true if OK, false if the object is not stored.

template<typename TeMultiContainerKeyT>
template<typename ObjectT >

void TeMultiContainer< TeMultiContainerKeyT >::multiRetrive | ( | std::vector< std::pair< TeMultiContainerKeyT, ObjectT > > & | objs_vector | ) | const

Retrive copies of all stored objects of a defined type.

Parameters:

  objs_vector | A vector with copies of all found objects.

Note:
  An empty vector will be returned if no object was found.

template<typename TeMultiContainerKeyT>

bool TeMultiContainer< TeMultiContainerKeyT >::operator!= | ( | const TeMultiContainer< TeMultiContainerKeyT > & | ext_instance | ) | const

Operator != overload.

Parameters:

  ext_instance | External instance reference.

Returns:
  true if this instance don't have the same identical object copies.

template<typename TeMultiContainerKeyT>

const TeMultiContainer< TeMultiContainerKeyT > & TeMultiContainer< TeMultiContainerKeyT >::operator= | ( | const TeMultiContainer< TeMultiContainerKeyT > & | ext_instance | ) |

operator= overload.

Parameters:

  ext_instance | External instance reference.

Returns:
  The external instance reference.

template<typename TeMultiContainerKeyT>

bool TeMultiContainer< TeMultiContainerKeyT >::operator== | ( | const TeMultiContainer< TeMultiContainerKeyT > & | external | ) | const

Operator == overload.

Parameters:

  external | External instance reference.

Returns:
  true if this instance have the same identical object copies.

template<typename TeMultiContainerKeyT>

void TeMultiContainer< TeMultiContainerKeyT >::remove | ( | const TeMultiContainerKeyT & | obj_key | ) |

Remove a stored object.

Parameters:

  obj_key | Object key.

template<typename TeMultiContainerKeyT>
template<typename ObjectT >

bool TeMultiContainer< TeMultiContainerKeyT >::retrive | ( | const TeMultiContainerKeyT & | obj_key,
|  | ObjectT & | obj_reference
| ) |  | const

Retrive a copy of a stored object.

Parameters:

  obj_key | Object key.
  obj_reference | Object instance.

Returns:
  true if OK, false if the parameter was no found or error.

template<typename TeMultiContainerKeyT>
template<typename ObjectT >

void TeMultiContainer< TeMultiContainerKeyT >::store | ( | const TeMultiContainerKeyT & | obj_key,
|  | const ObjectT & | obj_reference
| ) |  |

Store a object copy.

Parameters:

  obj_key | Object key.
  obj_reference | Object instance.

## Member Data Documentation

template<typename TeMultiContainerKeyT>

IntContainerT TeMultiContainer< TeMultiContainerKeyT >::container_instance_`[protected]`

The nodes container instance.

template<typename TeMultiContainerKeyT>

TeMutex TeMultiContainer< TeMultiContainerKeyT >::lock_instance_`[mutable, protected]`

This instance locking mutex.

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeMultiContainer.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines