Skip to content

Commit f1b6da8

Browse files
committed
Rename entity Switch into Latch
1 parent 0f0bb64 commit f1b6da8

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ SET(NEWHEADERS
3131
sot/core/exception-tools.hh
3232
sot/core/binary-op.hh
3333
sot/core/derivator.hh
34-
sot/core/switch.hh
34+
sot/core/latch.hh
3535
sot/core/fir-filter.hh
3636
sot/core/integrator-abstract.hh
3737
sot/core/integrator-euler.hh

include/sot/core/switch.hh renamed to include/sot/core/latch.hh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-, Rohan Budhiraja, CNRS
2+
* Copyright 2017-, Rohan Budhiraja, Joseph Mirabel, CNRS
33
*
44
* This file is part of sot-core.
55
* sot-core is free software: you can redistribute it and/or
@@ -14,8 +14,8 @@
1414
* with sot-core. If not, see <http://www.gnu.org/licenses/>.
1515
*/
1616

17-
#ifndef __SOT_SWITCH_H__
18-
#define __SOT_SWITCH_H__
17+
#ifndef __SOT_LATCH_H__
18+
#define __SOT_LATCH_H__
1919

2020
/* --------------------------------------------------------------------- */
2121
/* --- INCLUDE --------------------------------------------------------- */
@@ -40,7 +40,7 @@ namespace dynamicgraph {
4040
using dynamicgraph::command::makeCommandVoid0;
4141
using dynamicgraph::command::docCommandVoid0;
4242

43-
class Switch : public Entity
43+
class Latch : public Entity
4444
{
4545

4646
public: /* --- SIGNAL --- */
@@ -52,39 +52,39 @@ namespace dynamicgraph {
5252
protected:
5353
bool signalOutput;
5454
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; }
5656

5757
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; }
5959

60-
bool& switchOutput(bool& res, int){ res = signalOutput; return res; }
60+
bool& latchOutput(bool& res, int){ res = signalOutput; return res; }
6161

6262
public:
63-
Switch( const std::string& name )
63+
Latch( const std::string& name )
6464
: 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")
6868
{
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));
7272
signalOutput = false;
7373
signalRegistration (outSOUT << turnOnSOUT << turnOffSOUT);
7474
addCommand ("turnOn",
75-
makeCommandVoid0 (*this, &Switch::turnOn,
76-
docCommandVoid0 ("Turn on the switch")));
75+
makeCommandVoid0 (*this, &Latch::turnOn,
76+
docCommandVoid0 ("Turn on the latch")));
7777
addCommand ("turnOff",
78-
makeCommandVoid0 (*this, &Switch::turnOff,
79-
docCommandVoid0 ("Turn off the switch")));
78+
makeCommandVoid0 (*this, &Latch::turnOff,
79+
docCommandVoid0 ("Turn off the latch")));
8080
}
8181

82-
virtual ~Switch( void ) {};
82+
virtual ~Latch( void ) {};
8383

8484
};
8585
} /* namespace sot */
8686
} /* namespace dynamicgraph */
8787

8888

8989

90-
#endif // #ifndef __SOT_SWITCH_H__
90+
#endif // #ifndef __SOT_LATCH_H__

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ SET(plugins
9191
tools/binary-int-to-uint
9292
tools/periodic-call-entity
9393
tools/joint-trajectory-entity
94-
tools/switch
94+
tools/latch
9595
9696
control/control-gr
9797
control/control-pd

src/tools/switch.cpp renamed to src/tools/latch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-, Rohan Budhiraja, CNRS
2+
* Copyright 2017-2018, Rohan Budhiraja, Joseph Mirabel, CNRS
33
*
44
* CNRS/AIST
55
*
@@ -16,11 +16,11 @@
1616
* with sot-core. If not, see <http://www.gnu.org/licenses/>.
1717
*/
1818

19-
#include <sot/core/switch.hh>
19+
#include <sot/core/latch.hh>
2020
#include <sot/core/factory.hh>
2121

2222
namespace dynamicgraph {
2323
namespace sot {
24-
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (Switch, "Switch");
24+
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN (Latch, "Latch");
2525
} // namespace sot
2626
} // namespace dynamicgraph

0 commit comments

Comments
 (0)