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 namespace dg = dynamicgraph;
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<dg::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  dg::Vector &getNextPosition(dg::Vector &pos, const int &time);
68 
69 public: /* --- DISPLAY --- */
70  virtual void display(std::ostream &os) const;
71  SOTSEQPLAY_EXPORT friend std::ostream &operator<<(std::ostream &os,
72  const SeqPlay &r) {
73  r.display(os);
74  return os;
75  }
76 
77 public: /* --- SIGNALS --- */
78  // dynamicgraph::SignalPtr<dg::Vector,int> positionSIN;
79  // dynamicgraph::SignalTimeDependant<dg::Vector,int> velocitySOUT;
80  dynamicgraph::SignalTimeDependent<int, int> refresherSINTERN;
81  dynamicgraph::SignalTimeDependent<dg::Vector, int> positionSOUT;
82 };
83 
84 } /* namespace sot */
85 } /* namespace dynamicgraph */
86 
87 #endif /* #ifndef __SOT_SEQPLAY_HH */
dynamicgraph
Definition: abstract-sot-external-interface.hh:17
dynamicgraph::sot::SeqPlay::display
virtual void display(std::ostream &os) const
dynamicgraph::sot::SeqPlay
Definition: seq-play.hh:47
dynamicgraph::sot::SeqPlay::operator<<
SOTSEQPLAY_EXPORT friend std::ostream & operator<<(std::ostream &os, const SeqPlay &r)
Definition: seqplay.hh:71
dynamicgraph::sot::SeqPlay::getClassName
virtual const std::string & getClassName(void) const
Definition: seqplay.hh:50
dynamicgraph::sot::SeqPlay::StateList
std::list< dg::Vector > StateList
Definition: seqplay.hh:53
SOTSEQPLAY_EXPORT
#define SOTSEQPLAY_EXPORT
Definition: seqplay.hh:37
dynamicgraph::sot::SeqPlay::~SeqPlay
virtual ~SeqPlay(void)
Definition: seqplay.hh:63