dynamicgraph::sot::PoolStorage Class Reference

This singleton class keep tracks of all features and tasks. More...

#include <sot/core/pool.hh>

List of all members.

Public Types

Define types to simplify the writing
typedef std::map< std::string,
TaskAbstract * > 
Tasks
 Sorted set of tasks with unique key (name).
typedef std::map< std::string,
FeatureAbstract * > 
Features
 Sorted set of features with unique key (name).

Public Member Functions

 ~PoolStorage (void)
 Default destructor.
void commandLine (const std::string &objectName, const std::string &functionName, std::istringstream &cmdArg, std::ostream &os)
 This method looks for the object named objectName, and ask to provide the function functionName with the arguments cmdArg. If the method of the object displays some information this will be done on os.
void writeGraph (const std::string &aFileName)
 This method write a graph description on the file named FileName.
void writeCompletionList (std::ostream &os)
Methods related to the handling of the features
void registerFeature (const std::string &entname, FeatureAbstract *ent)
 Registering a feature.
FeatureAbstractgetFeature (const std::string &name)
 Get a reference to a feature.
Methods related to the handling of the tasks
void registerTask (const std::string &entname, TaskAbstract *ent)
 Registering a task.
TaskAbstractgetTask (const std::string &name)
 Get a reference to a task.

Static Public Member Functions

static PoolStoragegetInstance ()
 Get unique instance of the class.
static void destroy ()
 destroy unique instance of the class

Protected Attributes

Fields of the class to manage the three entities.

Also the name is singular, those are true sets.

Tasks task
 Set of controllers.
Features feature
 Set of features.

Detailed Description

This singleton class keep tracks of all features and tasks.

Three kinds of objects are handled:

  • The controllers, i.e. the tasks which inherits from TaskAbstract.
  • The features, i.e. the information which inherits from FeatureAbstract.
  • Any object which need to be inside the SoT and which inherits from Entity.

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...

The role of this class is also to look for the object supporting a command, and to apply this command.

It also returns references to signals from their fully-qualified names.


Member Typedef Documentation

Sorted set of features with unique key (name).

typedef std::map< std::string,TaskAbstract* > dynamicgraph::sot::PoolStorage::Tasks

Sorted set of tasks with unique key (name).


Constructor & Destructor Documentation

Default destructor.


Member Function Documentation

void dynamicgraph::sot::PoolStorage::commandLine ( const std::string &  objectName,
const std::string &  functionName,
std::istringstream &  cmdArg,
std::ostream &  os 
)

This method looks for the object named objectName, and ask to provide the function functionName with the arguments cmdArg. If the method of the object displays some information this will be done on os.

The commands specific to the pool< > object are:

  • list : List all the entities registered in the pool.
  • listFeature : List all the features registered in the pool.
  • listTask : List all the tasks registered in the pool.

static void dynamicgraph::sot::PoolStorage::destroy ( ) [static]

destroy unique instance of the class

Get a reference to a feature.

Get unique instance of the class.

TaskAbstract& dynamicgraph::sot::PoolStorage::getTask ( const std::string &  name)

Get a reference to a task.

void dynamicgraph::sot::PoolStorage::registerFeature ( const std::string &  entname,
FeatureAbstract ent 
)

Registering a feature.

void dynamicgraph::sot::PoolStorage::registerTask ( const std::string &  entname,
TaskAbstract ent 
)

Registering a task.

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

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


Member Data Documentation

Set of features.

Set of controllers.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines