time-stamp.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_TIME_STAMP__HH
11 #define __SOT_TIME_STAMP__HH
12 
13 /* --------------------------------------------------------------------- */
14 /* --- INCLUDE --------------------------------------------------------- */
15 /* --------------------------------------------------------------------- */
16 
17 /* Matrix */
19 
20 /* Classes standards. */
21 #ifndef WIN32
22 #include <sys/time.h>
23 #else /*WIN32*/
25 #endif /*WIN32*/
26 
27 /* SOT */
29 #include <dynamic-graph/entity.h>
30 
31 #include <sot/core/debug.hh>
32 
33 /* --------------------------------------------------------------------- */
34 /* --- API ------------------------------------------------------------- */
35 /* --------------------------------------------------------------------- */
36 
37 #if defined(WIN32)
38 #if defined(time_stamp_EXPORTS)
39 #define TimeStamp_EXPORT __declspec(dllexport)
40 #else
41 #define TimeStamp_EXPORT __declspec(dllimport)
42 #endif
43 #else
44 #define TimeStamp_EXPORT
45 #endif
46 
47 /* --------------------------------------------------------------------- */
48 /* --- CLASS ----------------------------------------------------------- */
49 /* --------------------------------------------------------------------- */
50 
51 namespace dynamicgraph {
52 namespace sot {
53 
55  public:
56  static const std::string CLASS_NAME;
57  virtual const std::string &getClassName(void) const { return CLASS_NAME; }
58 
59  protected:
60  struct timeval val;
61  unsigned int offsetValue;
62  bool offsetSet;
63 
64  public:
65  /* --- CONSTRUCTION --- */
66  TimeStamp(const std::string &name);
67 
68  public: /* --- DISPLAY --- */
69  virtual void display(std::ostream &os) const;
70 
71  public: /* --- SIGNALS --- */
72  /* These signals can be called several time per period, given
73  * each time a different results. Useful for chronos. */
76 
77  /* These signals can be called several time per period, but give
78  * always the same results different results. Useful for synchro. */
81 
82  protected: /* --- SIGNAL FUNCTIONS --- */
83  dynamicgraph::Vector &getTimeStamp(dynamicgraph::Vector &res,
84  const int &time);
85  double &getTimeStampDouble(const dynamicgraph::Vector &vect, double &res);
86 };
87 
88 } /* namespace sot */
89 } /* namespace dynamicgraph */
90 
91 #endif /* #ifndef __SOT_SOT_HH */
Eigen::VectorXd Vector
static const std::string CLASS_NAME
Definition: time-stamp.hh:56
dynamicgraph::Signal< double, int > timeDoubleSOUT
Definition: time-stamp.hh:75
virtual const std::string & getClassName(void) const
Definition: time-stamp.hh:57
dynamicgraph::SignalTimeDependent< dynamicgraph::Vector, int > timeOnceSOUT
Definition: time-stamp.hh:79
dynamicgraph::Signal< dynamicgraph::Vector, int > timeSOUT
Definition: time-stamp.hh:74
#define TimeStamp_EXPORT
Definition: time-stamp.hh:44
dynamicgraph::SignalTimeDependent< double, int > timeOnceDoubleSOUT
Definition: time-stamp.hh:80


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Wed Jun 21 2023 02:51:26