sot-core  4.11.8
Hierarchical task solver plug-in for dynamic-graph.
dynamicgraph::sot::PoolStorage Class Reference

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

#include <sot/core/pool.hh>

Public Types

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

Public Member Functions

 ~PoolStorage (void)
 Default destructor. More...
 
void writeGraph (const std::string &aFileName)
 This method write a graph description on the file named FileName. More...
 
void writeCompletionList (std::ostream &os)
 
Methods related to the handling of the features
void registerFeature (const std::string &entname, FeatureAbstract *ent)
 Registering a feature. More...
 
FeatureAbstractgetFeature (const std::string &name)
 Get a reference to a feature. More...
 
Methods related to the handling of the tasks
void registerTask (const std::string &entname, TaskAbstract *ent)
 Registering a task. More...
 
TaskAbstractgetTask (const std::string &name)
 Get a reference to a task. More...
 

Static Public Member Functions

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

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. More...
 
Features feature
 Set of features. More...
 

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

◆ Features

Sorted set of features with unique key (name).

◆ Tasks

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

Sorted set of tasks with unique key (name).

Constructor & Destructor Documentation

◆ ~PoolStorage()

dynamicgraph::sot::PoolStorage::~PoolStorage ( void  )

Default destructor.

Member Function Documentation

◆ destroy()

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

destroy unique instance of the class

◆ getFeature()

FeatureAbstract& dynamicgraph::sot::PoolStorage::getFeature ( const std::string &  name)

Get a reference to a feature.

◆ getInstance()

static PoolStorage* dynamicgraph::sot::PoolStorage::getInstance ( )
static

Get unique instance of the class.

◆ getTask()

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

Get a reference to a task.

◆ registerFeature()

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

Registering a feature.

◆ registerTask()

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

Registering a task.

◆ writeCompletionList()

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

◆ writeGraph()

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

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

Member Data Documentation

◆ feature

Features dynamicgraph::sot::PoolStorage::feature
protected

Set of features.

◆ task

Tasks dynamicgraph::sot::PoolStorage::task
protected

Set of controllers.


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