sot-core  4.11.6
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 "sot/core/api.hh"
24 #include <dynamic-graph/pool.h>
25 #include <dynamic-graph/signal-base.h>
27 
28 /* --------------------------------------------------------------------- */
29 /* --- CLASS ----------------------------------------------------------- */
30 /* --------------------------------------------------------------------- */
31 
32 namespace dynamicgraph {
33 namespace sot {
34 
35 // Preliminary declarations
36 class FeatureAbstract;
37 class TaskAbstract;
38 
62 public:
67  typedef std::map<std::string, TaskAbstract *> Tasks;
68 
70  typedef std::map<std::string, FeatureAbstract *> Features;
73 protected:
80  Tasks task;
81 
83  Features feature;
86 public:
88  ~PoolStorage(void);
89 
91  static PoolStorage *getInstance();
92 
94  static void destroy();
95 
100  void registerFeature(const std::string &entname, FeatureAbstract *ent);
101 
103  FeatureAbstract &getFeature(const std::string &name);
110  void registerTask(const std::string &entname, TaskAbstract *ent);
112  TaskAbstract &getTask(const std::string &name);
117  void writeGraph(const std::string &aFileName);
118  void writeCompletionList(std::ostream &os);
119 
120 private:
121  PoolStorage();
122  static PoolStorage *instance_;
123 };
124 
125 } /* namespace sot */
126 } /* namespace dynamicgraph */
127 
128 #endif /* #ifndef __SOT_POOL_HH__ */
std::map< std::string, TaskAbstract * > Tasks
Sorted set of tasks with unique key (name).
Definition: pool.hh:67
This singleton class keep tracks of all features and tasks.
Definition: pool.hh:61
#define SOT_CORE_EXPORT
Definition: api.hh:20
Tasks task
Set of controllers.
Definition: pool.hh:80
Features feature
Set of features.
Definition: pool.hh:83
Definition: task-abstract.hh:48
std::map< std::string, FeatureAbstract * > Features
Sorted set of features with unique key (name).
Definition: pool.hh:70
This class gives the abstract definition of a feature.
Definition: feature-abstract.hh:75
Definition: abstract-sot-external-interface.hh:17