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> 25 using boost::test_tools::output_test_stream;
37 m_sigdSIN(
"MyEntity(" + name +
")::input(double)::in_double"),
40 "MyEntity(" + name +
")::input(double)::out_double"),
43 "MyEntity(" + name +
")::input(double)::out2double")
49 double &
update(
double &res,
const int &inTime) {
50 const double &aDouble =
m_sigdSIN(inTime);
68 std::string rootdir(
"/tmp");
69 std::string basename(
"my-tracer");
70 std::string suffix(
".dat");
75 atracer.
openFiles(rootdir,
"invalid/filename", suffix);
81 atracer.
openFiles(rootdir, basename, suffix);
95 std::string emptybuf_cmd_str(
"empty");
98 for (
int i = 0; i < 1000; i++) {
104 output_test_stream output;
115 BOOST_CHECK(output.is_equal(
116 "TracerRealTime my-tracer [mode=play] : \n" 118 " -> MyEntity(my-entity)::input(double)::out_double (in output)" dynamicgraph::SignalTimeDependent< double, int > m_sigdTimeDepSOUT
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
virtual void recompute(const Time &)
void signalRegistration(const SignalArray< int > &signals)
void openFiles(const std::string &rootdir, const std::string &basename, const std::string &suffix)
command::Command * getNewStyleCommand(const std::string &cmdName)
Provides the pointer towards the Command object cmdName.
void addSignalToTraceByName(const std::string &signame, const std::string &filename="")
virtual void setConstant(const T &t)
MyEntity(const std::string &name)
Main class of the tracer real-time plug-in.
int & recordTrigger(int &dummy, const int &time)
void clearSignalToTrace()
BOOST_AUTO_TEST_CASE(test_tracer)
virtual void closeFiles()
Value execute()
Execute the command after checking parameters.
dynamicgraph::SignalTimeDependent< double, int > m_sigdTwoTimeDepSOUT
void display(std::ostream &os) const
Display information on the entity inside the output stream os.
double & update(double &res, const int &inTime)
Entity * newEntity(const std::string &classname, const std::string &objname) const
Instantiate (and allocate) an entity.
static FactoryStorage * getInstance()
Get pointer to unique object of the class.
void setBufferSize(const int &SIZE)
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity")
SignalBase< int > & getSignal(const std::string &signalName)
Provides a reference to the signal named signalName.
Exceptions raised when an error related to traces happen.
static const std::string CLASS_NAME
virtual void setTime(const Time &t)
dynamicgraph::Signal< double, int > m_sigdSIN