9 YARP_LOG_COMPONENT(EVENT_DOWNSAMPLER,
"event-downsampler")
13 mutex =
new std::mutex();
35 size_t diff = counter - latch_1;
36 bool cp = !isdownsampling;
69 expire_time = yarp::os::Time::now();
71 timer =
new yarp::os::Timer(ts, &mcEventDownsampler::step,
this,
true, mutex);
84 bool mcEventDownsampler::step(
const yarp::os::YarpTimerEvent &event)
86 if (yarp::os::Time::now() - expire_time >= 1)
88 expire_time = yarp::os::Time::now();
102 void mcEventDownsampler::printreport()
105 <<
"detected" << counter - latch_2 <<
"events on aggregate since the last message";
~mcEventDownsampler()
Destroy the Event Downsampler object.
bool start()
Instantiates the yarp::os::Timer object and starts it.
bool canprint()
Called by the object that implements the downsampler.
bool stop()
Stops the timer.