Public Member Functions | List of all members
dynamicgraph::PoolStorage Class Reference

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

#include <pool.h>

Public Member Functions

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. More...
 
 ~PoolStorage ()
 Default destructor. More...
 
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. More...
 
bool existEntity (const std::string &name)
 Test if the entity exists. More...
 
bool existEntity (const std::string &name, Entity *&ptr)
 Test if the entity exists. If it does, return a pointer on it. More...
 
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). More...
 
static PoolStoragegetInstance ()
 Get unique instance of the class. More...
 
static void destroy ()
 Destroy the unique instance of the class. More...
 

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. More...
 
static PoolStorageinstance_ = 0
 
 PoolStorage ()
 

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 include/dynamic-graph/pool.h.

Member Typedef Documentation

◆ Entities

typedef std::map<std::string, Entity *> dynamicgraph::PoolStorage::Entities

Sorted set of entities with unique key (name).

Definition at line 39 of file include/dynamic-graph/pool.h.

Constructor & Destructor Documentation

◆ ~PoolStorage()

PoolStorage::~PoolStorage ( )

Default destructor.

Definition at line 43 of file src/dgraph/pool.cpp.

◆ PoolStorage()

dynamicgraph::PoolStorage::PoolStorage ( )
inlineprivate

Definition at line 110 of file include/dynamic-graph/pool.h.

Member Function Documentation

◆ clearPlugin()

void PoolStorage::clearPlugin ( const std::string &  name)

Disallocate an entity.

[in] entname: The name of the entity,

Definition at line 122 of file src/dgraph/pool.cpp.

◆ deregisterEntity() [1/2]

void PoolStorage::deregisterEntity ( const std::string &  entname)

Unregister an entity.

[in] entname: The name of the entity,

Definition at line 75 of file src/dgraph/pool.cpp.

◆ deregisterEntity() [2/2]

void PoolStorage::deregisterEntity ( const Entities::iterator &  entity)

Unregister an entity.

[in] entity: iterator in the map,

Definition at line 89 of file src/dgraph/pool.cpp.

◆ destroy()

void PoolStorage::destroy ( )
static

Destroy the unique instance of the class.

Definition at line 38 of file src/dgraph/pool.cpp.

◆ existEntity() [1/2]

bool PoolStorage::existEntity ( const std::string &  name)

Test if the entity exists.

Definition at line 108 of file src/dgraph/pool.cpp.

◆ existEntity() [2/2]

bool PoolStorage::existEntity ( const std::string &  name,
Entity *&  ptr 
)

Test if the entity exists. If it does, return a pointer on it.

Definition at line 112 of file src/dgraph/pool.cpp.

◆ getEntity()

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

Get an entity.

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

Definition at line 93 of file src/dgraph/pool.cpp.

◆ getEntityMap()

const PoolStorage::Entities & PoolStorage::getEntityMap ( ) const

Const access to entity map.

Definition at line 104 of file src/dgraph/pool.cpp.

◆ getInstance()

PoolStorage * PoolStorage::getInstance ( )
static

Get unique instance of the class.

Definition at line 31 of file src/dgraph/pool.cpp.

◆ getSignal()

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

Get a signal by name.

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

Definition at line 222 of file src/dgraph/pool.cpp.

◆ registerEntity()

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

Register an entity.

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

Definition at line 60 of file src/dgraph/pool.cpp.

◆ writeCompletionList()

void PoolStorage::writeCompletionList ( std::ostream &  os)

Definition at line 198 of file src/dgraph/pool.cpp.

◆ writeGraph()

void PoolStorage::writeGraph ( const std::string &  aFileName)

This method write a graph description on the file named FileName.

Definition at line 145 of file src/dgraph/pool.cpp.

Member Data Documentation

◆ entityMap

Entities dynamicgraph::PoolStorage::entityMap
protected

Set of basic objects of the SoT.

Definition at line 107 of file include/dynamic-graph/pool.h.

◆ instance_

PoolStorage * PoolStorage::instance_ = 0
staticprivate

Definition at line 111 of file include/dynamic-graph/pool.h.


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


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:06:03