PetaVision
Alpha
|
#include <ObserverTable.hpp>
Public Member Functions | |
bool | addObject (std::string const &name, Observer *entry) |
void | clear (bool deallocateFlag) |
void | deleteObject (std::string const &name, bool deallocateFlag) |
void | deleteObject (char const *name, bool deallocateFlag) |
Observer * | getObject (std::string const &name) const |
Observer * | getObject (char *name) const |
std::map< std::string, Observer * > const & | getObjectMap () const |
std::vector< Observer * > const & | getObjectVector () const |
template<typename S > | |
S * | lookup (std::string const &name) const |
template<typename S > | |
S * | lookup (char const *name) const |
std::vector< Observer * >::size_type | size () const |
Private Attributes | |
std::map< std::string, Observer * > | mObjectMap |
std::vector< Observer * > | mObjectVector |
An encapsulation of a map of name-object pairs and a vector of objects. The map has the object names as the keys, and pointers to objects as the values. The vector has the same set of objects as the map's values. By keeping the vector, we can guarantee the order in which we iterate through the objects. By keeping the map, we have an easy way to look up the object from the name.
Definition at line 27 of file ObserverTable.hpp.