Template Class MapContainer

Inheritance Relationships

Base Type

Class Documentation

template <typename _T>
class MapContainer : public ObjectContainer<_T>

Public Functions

MapContainer()
~MapContainer()

Clean up all classes.

std::map<std::string, _T *>::iterator begin()

Iterator accessor for object pairs in the map container

Return
Iterator to the beginning of the map.

std::map<std::string, _T *>::iterator end()

Iterator accessor for object pairs in the map container

Return
Iterator to the end of the map.

bool exists(const std::string &obj_name)

Check if the object exists in the map.

Return
True if the object exists in the map container.
Parameters
  • obj_name: Name of the object.

void add(_T *new_obj)

Add the object to the container

Parameters
  • new_obj: New object to add.

_T *get(const std::string &str)

Extract the specified object by its object name. If the specified object name does not exist, then return nullptr.

Return
A pointer to the object with the specified name if it exists and nullptr otherwise.
Parameters
  • str: Name of the object to be extracted.

unsigned long count()

Access for the number of objects in the container.

Return
Numebr of objects in the container

void clear()

Delete all stored objects in the maps.

const void print_original_src_(unsigned int indent_depth, const std::string &print_sep)

Print the object container for debug.

Parameters
  • indent_depth:

Protected Attributes

std::map<std::string, _T *> objs_