Go to the documentation of this file.
4 #ifndef __SOT_EVENT_H__
5 #define __SOT_EVENT_H__
10 #include <dynamic-graph/entity.h>
11 #include <dynamic-graph/pool.h>
14 #include <dynamic-graph/signal.h>
16 #include <sot/core/config.hh>
49 checkSOUT(
"Event(" +
name +
")::output(bool)::check"),
50 conditionSIN(NULL,
"Event(" +
name +
")::input(bool)::condition"),
53 repeatAfterNIterations_(0) {
54 checkSOUT.setFunction(boost::bind(&
Event::check,
this, _1, _2));
55 signalRegistration(conditionSIN);
56 signalRegistration(checkSOUT);
59 std::string docstring =
62 addCommand(
"addSignal",
67 " Get list of signals\n";
73 " Repease event if input signal remains True for a while\n"
74 " Input: number of iterations before repeating output\n."
75 " 0 for no repetition";
84 return "Send an event when the input changes\n\n"
85 " The signal triggered is called whenever the condition is "
90 std::istringstream iss(signal);
96 std::ostringstream oss;
98 for (Triggers_t::const_iterator _sig = triggers.begin();
99 _sig != triggers.end(); ++_sig)
100 oss <<
'\'' << (*_sig)->getName() <<
"\', ";
106 repeatAfterNIterations_ = nbIterations;
113 bool &
check(
bool &ret,
const int64_t &time);
125 #endif // __SOT_EVENT_H__
Signal< bool, sigtime_t > checkSOUT
virtual std::string getDocString() const
Header documentation of the python class.
SignalPtr< bool, sigtime_t > conditionSIN
dg::SignalBase< dg::sigtime_t > * getSignal(dg::Entity &e, const std::string &name)
bool & check(bool &ret, const int64_t &time)
std::vector< Trigger_t > Triggers_t
#define DYNAMIC_GRAPH_ENTITY_DECL()
std::string getSignalsByName() const
void repeat(const sigtime_t &nbIterations)
bool check(const T &value, const T &other)
static PoolStorage * getInstance()
Event(const std::string &name)
void addSignal(const std::string &signal)
SignalBase< sigtime_t > * Trigger_t
CommandVoid1< E, T > * makeCommandVoid1(E &entity, boost::function< void(const T &)> function, const std::string &docString)
sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:31