sot-core  4.11.8
Hierarchical task solver plug-in for dynamic-graph.
pool.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #ifndef __SOT_POOL_HH__
11 #define __SOT_POOL_HH__
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* --- STD --- */
18 #include <map>
19 #include <sstream>
20 #include <string>
21 
22 /* --- SOT --- */
23 #include <dynamic-graph/pool.h>
24 #include <dynamic-graph/signal-base.h>
25 
27 
28 #include "sot/core/api.hh"
29 
30 /* --------------------------------------------------------------------- */
31 /* --- CLASS ----------------------------------------------------------- */
32 /* --------------------------------------------------------------------- */
33 
34 namespace dynamicgraph {
35 namespace sot {
36 
37 // Preliminary declarations
38 class FeatureAbstract;
39 class TaskAbstract;
40 
64  public:
69  typedef std::map<std::string, TaskAbstract *> Tasks;
70 
72  typedef std::map<std::string, FeatureAbstract *> Features;
75  protected:
83 
88  public:
90  ~PoolStorage(void);
91 
94 
96  static void destroy();
97 
102  void registerFeature(const std::string &entname, FeatureAbstract *ent);
103 
105  FeatureAbstract &getFeature(const std::string &name);
112  void registerTask(const std::string &entname, TaskAbstract *ent);
114  TaskAbstract &getTask(const std::string &name);
119  void writeGraph(const std::string &aFileName);
120  void writeCompletionList(std::ostream &os);
121 
122  private:
123  PoolStorage();
124  static PoolStorage *instance_;
125 };
126 
127 } /* namespace sot */
128 } /* namespace dynamicgraph */
129 
130 #endif /* #ifndef __SOT_POOL_HH__ */
#define SOT_CORE_EXPORT
Definition: api.hh:20
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:76
This singleton class keep tracks of all features and tasks.
Definition: pool.hh:63
FeatureAbstract & getFeature(const std::string &name)
Get a reference to a feature.
std::map< std::string, FeatureAbstract * > Features
Sorted set of features with unique key (name).
Definition: pool.hh:72
void registerFeature(const std::string &entname, FeatureAbstract *ent)
Registering a feature.
std::map< std::string, TaskAbstract * > Tasks
Sorted set of tasks with unique key (name).
Definition: pool.hh:69
void registerTask(const std::string &entname, TaskAbstract *ent)
Registering a task.
static PoolStorage * getInstance()
Get unique instance of the class.
void writeCompletionList(std::ostream &os)
static void destroy()
destroy unique instance of the class
void writeGraph(const std::string &aFileName)
This method write a graph description on the file named FileName.
Features feature
Set of features.
Definition: pool.hh:85
TaskAbstract & getTask(const std::string &name)
Get a reference to a task.
~PoolStorage(void)
Default destructor.
Tasks task
Set of controllers.
Definition: pool.hh:82
Definition: task-abstract.hh:51
Definition: abstract-sot-external-interface.hh:17