sot-core  4.10.1
Hierarchical task solver plug-in for dynamic-graph.
seqplay.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_SEQPLAY_HH
11 #define __SOT_SEQPLAY_HH
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* -- MaaL --- */
18 #include <dynamic-graph/linear-algebra.h>
19 
20 /* SOT */
21 #include <dynamic-graph/all-signals.h>
22 #include <dynamic-graph/entity.h>
23 
24 #include <list>
25 
26 /* --------------------------------------------------------------------- */
27 /* --- API ------------------------------------------------------------- */
28 /* --------------------------------------------------------------------- */
29 
30 #if defined(WIN32)
31 #if defined(seq_play_EXPORTS)
32 #define SOTSEQPLAY_EXPORT __declspec(dllexport)
33 #else
34 #define SOTSEQPLAY_EXPORT __declspec(dllimport)
35 #endif
36 #else
37 #define SOTSEQPLAY_EXPORT
38 #endif
39 
40 /* --------------------------------------------------------------------- */
41 /* --- CLASS ----------------------------------------------------------- */
42 /* --------------------------------------------------------------------- */
43 
44 namespace dynamicgraph {
45 namespace sot {
46 
47 class SOTSEQPLAY_EXPORT SeqPlay : public dynamicgraph::Entity {
48 public:
49  static const std::string CLASS_NAME;
50  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
51 
52 protected:
53  typedef std::list<dynamicgraph::Vector> StateList;
54  StateList stateList;
55  StateList::iterator currPos;
56  unsigned int currRank;
57  bool init;
58  int time;
59 
60 public:
61  /* --- CONSTRUCTION --- */
62  SeqPlay(const std::string &name);
63  virtual ~SeqPlay(void) {}
64 
65  void loadFile(const std::string &name);
66 
67  dynamicgraph::Vector &getNextPosition(dynamicgraph::Vector &pos,
68  const int &time);
69 
70 public: /* --- DISPLAY --- */
71  virtual void display(std::ostream &os) const;
72  SOTSEQPLAY_EXPORT friend std::ostream &operator<<(std::ostream &os,
73  const SeqPlay &r) {
74  r.display(os);
75  return os;
76  }
77 
78 public: /* --- SIGNALS --- */
79  dynamicgraph::SignalTimeDependent<int, int> refresherSINTERN;
80  dynamicgraph::SignalTimeDependent<dynamicgraph::Vector, int> positionSOUT;
81 };
82 
83 } /* namespace sot */
84 } /* namespace dynamicgraph */
85 
86 #endif /* #ifndef __SOT_SEQPLAY_HH */
virtual ~SeqPlay(void)
Definition: seqplay.hh:63
#define SOTSEQPLAY_EXPORT
Definition: seqplay.hh:37
virtual void display(std::ostream &os) const
SOTSEQPLAY_EXPORT friend std::ostream & operator<<(std::ostream &os, const SeqPlay &r)
Definition: seqplay.hh:72
virtual const std::string & getClassName(void) const
Definition: seqplay.hh:50
Definition: abstract-sot-external-interface.hh:17
std::list< dynamicgraph::Vector > StateList
Definition: seqplay.hh:53