17 #define BOOST_TEST_MODULE debug - tracer 19 #if BOOST_VERSION >= 105900 20 #include <boost/test/tools/output_test_stream.hpp> 22 #include <boost/test/output_test_stream.hpp> 24 #include <boost/test/unit_test.hpp> 37 m_sigdSIN(
"MyEntity(" + name +
")::input(double)::in_double"),
40 "MyEntity(" + name +
")::input(double)::out_double"),
43 "MyEntity(" + name +
")::input(vector)::out_vector"),
46 "MyEntity(" + name +
")::input(double)::out2double")
50 << m_sigdTwoTimeDepSOUT);
53 virtual void display(std::ostream &os)
const {
54 os <<
"Hello! My name is " <<
getName() <<
" !" << std::endl;
59 double &
update(
double &res,
const int &inTime) {
60 const double &aDouble =
m_sigdSIN(inTime);
66 const double &aDouble =
m_sigdSIN(inTime);
68 res << aDouble, 2 * aDouble;
87 std::string rootdir(
"/tmp");
88 std::string basename(
"my-tracer");
89 std::string suffix(
".dat");
92 atracer.
openFiles(rootdir, basename, suffix);
116 for (
int i = 0; i < 1000; i++) {
dynamicgraph::SignalTimeDependent< double, int > m_sigdTimeDepSOUT
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
void signalRegistration(const SignalArray< int > &signals)
void openFiles(const std::string &rootdir, const std::string &basename, const std::string &suffix)
void addSignalToTraceByName(const std::string &signame, const std::string &filename="")
virtual void display(std::ostream &os) const
Display information on the entity inside the output stream os.
virtual void setConstant(const T &t)
MyEntity(const std::string &name)
int & recordTrigger(int &dummy, const int &time)
Vector & updateVector(Vector &res, const int &inTime)
void clearSignalToTrace()
virtual void closeFiles()
BOOST_AUTO_TEST_CASE(test_tracer)
virtual void recompute(const Time &t)
dynamicgraph::SignalTimeDependent< double, int > m_sigdTwoTimeDepSOUT
const std::string & getName() const
double & update(double &res, const int &inTime)
Tracer plug-in main class.
virtual const std::string & getClassName() const
Entity * newEntity(const std::string &classname, const std::string &objname) const
Instantiate (and allocate) an entity.
dynamicgraph::SignalTimeDependent< Vector, int > m_sigVTimeDepSOUT
void addSignalToTrace(const SignalBase< int > &sig, const std::string &filename="")
static FactoryStorage * getInstance()
Get pointer to unique object of the class.
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity")
SignalBase< int > & getSignal(const std::string &signalName)
Provides a reference to the signal named signalName.
static const std::string CLASS_NAME
virtual void setTime(const Time &t)
dynamicgraph::Signal< double, int > m_sigdSIN
virtual const T & access(const Time &t)