dynamic-graph  4.1.0-8-gdab7-dirty
Dynamic graph library
PoolStorage Class Reference

Singleton that keeps track of all the entities. More...

#include <dynamic-graph/pool.h>

Public Member Functions

 ~PoolStorage ()
 Default destructor.
 
SignalBase< int > & getSignal (std::istringstream &sigpath)
 Get a signal by name. More...
 
void writeCompletionList (std::ostream &os)
 
void writeGraph (const std::string &aFileName)
 This method write a graph description on the file named FileName.
 
Method related to the handling of entities.
void registerEntity (const std::string &entname, Entity *ent)
 Register an entity. More...
 
void deregisterEntity (const std::string &entname)
 Unregister an entity. More...
 
void deregisterEntity (const Entities::iterator &entity)
 Unregister an entity. More...
 
EntitygetEntity (const std::string &name)
 Get an entity. More...
 
const EntitiesgetEntityMap () const
 Const access to entity map.
 
bool existEntity (const std::string &name)
 Test if the entity exists.
 
bool existEntity (const std::string &name, Entity *&ptr)
 Test if the entity exists. If it does, return a pointer on it.
 
void clearPlugin (const std::string &name)
 Disallocate an entity. More...
 

Define types to simplify the writing

typedef std::map< std::string, Entity * > Entities
 Sorted set of entities with unique key (name).
 
static PoolStoragegetInstance ()
 Get unique instance of the class.
 
static void destroy ()
 Destroy the unique instance of the class.
 

Fields of the class to manage the three entities.

Also the name is singular, those are true sets.

Entities entityMap
 Set of basic objects of the SoT.
 

Detailed Description

Singleton that keeps track of all the entities.

This class gives access to and remembers all the entities created during its life.

This class provides the necessary operations to register, unregister each instance of thoses classes. As tasks and features derived from Entities, they should be registered as such.

Note
From the code it is not very clear why we should not unregister from the tasks and the features...

Definition at line 33 of file pool.h.

Member Function Documentation

◆ clearPlugin()

void clearPlugin ( const std::string &  name)

Disallocate an entity.

[in] entname: The name of the entity,

◆ deregisterEntity() [1/2]

void deregisterEntity ( const std::string &  entname)

Unregister an entity.

[in] entname: The name of the entity,

◆ deregisterEntity() [2/2]

void deregisterEntity ( const Entities::iterator &  entity)

Unregister an entity.

[in] entity: iterator in the map,

◆ getEntity()

Entity& getEntity ( const std::string &  name)

Get an entity.

[in] entname: The name of the entity,
Returns
Pointer towards the entity.

◆ getSignal()

SignalBase<int>& getSignal ( std::istringstream &  sigpath)

Get a signal by name.

Parameters
sigpathstream containing a string of the form "entity.signal"

◆ registerEntity()

void registerEntity ( const std::string &  entname,
Entity ent 
)

Register an entity.

[in] entname: The name of the entity,
[in] ent: Pointer towards the entity.

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