1
1
/*
2
- * Copyright 2017-, Rohan Budhiraja, CNRS
2
+ * Copyright 2017-, Rohan Budhiraja, Joseph Mirabel, CNRS
3
3
*
4
4
* This file is part of sot-core.
5
5
* sot-core is free software: you can redistribute it and/or
14
14
* with sot-core. If not, see <http://www.gnu.org/licenses/>.
15
15
*/
16
16
17
- #ifndef __SOT_SWITCH_H__
18
- #define __SOT_SWITCH_H__
17
+ #ifndef __SOT_LATCH_H__
18
+ #define __SOT_LATCH_H__
19
19
20
20
/* --------------------------------------------------------------------- */
21
21
/* --- INCLUDE --------------------------------------------------------- */
@@ -40,7 +40,7 @@ namespace dynamicgraph {
40
40
using dynamicgraph::command::makeCommandVoid0;
41
41
using dynamicgraph::command::docCommandVoid0;
42
42
43
- class Switch : public Entity
43
+ class Latch : public Entity
44
44
{
45
45
46
46
public: /* --- SIGNAL --- */
@@ -52,39 +52,39 @@ namespace dynamicgraph {
52
52
protected:
53
53
bool signalOutput;
54
54
void turnOn (){ signalOutput = true ; }
55
- bool & turnOnSwitch (bool & res, int ){ res = signalOutput = true ; return res; }
55
+ bool & turnOnLatch (bool & res, int ){ res = signalOutput = true ; return res; }
56
56
57
57
void turnOff (){ signalOutput = false ; }
58
- bool & turnOffSwitch (bool & res, int ){ res = signalOutput = false ; return res; }
58
+ bool & turnOffLatch (bool & res, int ){ res = signalOutput = false ; return res; }
59
59
60
- bool & switchOutput (bool & res, int ){ res = signalOutput; return res; }
60
+ bool & latchOutput (bool & res, int ){ res = signalOutput; return res; }
61
61
62
62
public:
63
- Switch ( const std::string& name )
63
+ Latch ( const std::string& name )
64
64
: Entity(name)
65
- ,outSOUT(" Switch (" +name+" )::output(bool)::out" )
66
- ,turnOnSOUT (" Switch (" +name+" )::output(bool)::turnOnSout" )
67
- ,turnOffSOUT(" Switch (" +name+" )::output(bool)::turnOffSout" )
65
+ ,outSOUT(" Latch (" +name+" )::output(bool)::out" )
66
+ ,turnOnSOUT (" Latch (" +name+" )::output(bool)::turnOnSout" )
67
+ ,turnOffSOUT(" Latch (" +name+" )::output(bool)::turnOffSout" )
68
68
{
69
- outSOUT.setFunction (boost::bind (&Switch::switchOutput ,this ,_1,_2));
70
- turnOnSOUT .setFunction (boost::bind (&Switch::turnOnSwitch ,this ,_1,_2));
71
- turnOffSOUT.setFunction (boost::bind (&Switch::turnOffSwitch ,this ,_1,_2));
69
+ outSOUT.setFunction (boost::bind (&Latch::latchOutput ,this ,_1,_2));
70
+ turnOnSOUT .setFunction (boost::bind (&Latch::turnOnLatch ,this ,_1,_2));
71
+ turnOffSOUT.setFunction (boost::bind (&Latch::turnOffLatch ,this ,_1,_2));
72
72
signalOutput = false ;
73
73
signalRegistration (outSOUT << turnOnSOUT << turnOffSOUT);
74
74
addCommand (" turnOn" ,
75
- makeCommandVoid0 (*this , &Switch ::turnOn,
76
- docCommandVoid0 (" Turn on the switch " )));
75
+ makeCommandVoid0 (*this , &Latch ::turnOn,
76
+ docCommandVoid0 (" Turn on the latch " )));
77
77
addCommand (" turnOff" ,
78
- makeCommandVoid0 (*this , &Switch ::turnOff,
79
- docCommandVoid0 (" Turn off the switch " )));
78
+ makeCommandVoid0 (*this , &Latch ::turnOff,
79
+ docCommandVoid0 (" Turn off the latch " )));
80
80
}
81
81
82
- virtual ~Switch ( void ) {};
82
+ virtual ~Latch ( void ) {};
83
83
84
84
};
85
85
} /* namespace sot */
86
86
} /* namespace dynamicgraph */
87
87
88
88
89
89
90
- #endif // #ifndef __SOT_SWITCH_H__
90
+ #endif // #ifndef __SOT_LATCH_H__
0 commit comments