PetaVision  Alpha
PV::ObserverTable Class Reference

#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)
 
ObservergetObject (std::string const &name) const
 
ObservergetObject (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
 

Detailed Description

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.


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