Program listing for file control/src/Sensor/ControlSensor.hpp#
Return to documentation for this file
1#ifndef ControlSensor_H
2#define ControlSensor_H
3
4#include "Sensor.hpp"
5#include <boost/circular_buffer.hpp>
6
7
8class ControlSensor : public Sensor
9{
10private:
11
12 ACCEPT_SERIALIZATION(ControlSensor);
13
14protected:
15
16 SP::SiconosVector _storedY;
17
18
19 double _delay;
20
21
22 boost::circular_buffer<SP::SiconosVector> _bufferY;
23
24
25 ControlSensor() {};
26
27
28 ControlSensor(unsigned int type, SP::DynamicalSystem ds, double delay = 0):
29 Sensor(type, ds), _delay(delay) {}
30
31public:
32
33 virtual void initialize(const NonSmoothDynamicalSystem& nsds);
34
35
36 unsigned int getYDim() const ;
37
38
39 inline const SiconosVector& y() const
40 {
41 if (_delay == 0)
42 return *_storedY;
43 else
44 return *_bufferY.front();
45 };
46
47 inline SP::SiconosVector yTk() const
48 {
49 return _storedY;
50 }
51
52
53
54
55 virtual void capture() = 0;
56};
57#endif