18 #ifndef BASIC_RECORDER_HPP
19 #define BASIC_RECORDER_HPP
25 #include "../helpers/recorder_helpers.hpp"
31 #include <boost/circular_buffer.hpp>
54 inline std::string
topic()
const
74 virtual void write(
const T& msg)
76 if (!msg.header.stamp.isZero()) {
77 gr_->write(
topic_, msg, msg.header.stamp);
86 boost::mutex::scoped_lock lock_write_buffer(
mutex_ );
87 typename boost::circular_buffer<T>::iterator it;
90 if (!it->header.stamp.isZero()) {
91 gr_->write(
topic_, *it, it->header.stamp);
101 boost::mutex::scoped_lock lock_bufferize(
mutex_ );
113 virtual void reset(boost::shared_ptr<GlobalRecorder> gr,
float conv_frequency)
133 boost::mutex::scoped_lock lock_bufferize(
mutex_ );
150 boost::shared_ptr<naoqi::recorder::GlobalRecorder>
gr_;
bool is_subscribed_
Definition: basic.hpp:148
boost::circular_buffer< T > buffer_
Definition: basic.hpp:142
virtual void bufferize(const T &msg)
Definition: basic.hpp:99
virtual void writeDump(const ros::Time &time)
Definition: basic.hpp:84
virtual void write(const T &msg)
Definition: basic.hpp:74
virtual void setBufferDuration(float duration)
Definition: basic.hpp:131
bool isSubscribed() const
Definition: basic.hpp:69
virtual ~BasicRecorder()
Definition: basic.hpp:52
std::string topic() const
Definition: basic.hpp:54
bool isInitialized() const
Definition: basic.hpp:59
int counter_
Definition: basic.hpp:154
size_t buffer_size_
Definition: basic.hpp:143
BasicRecorder(const std::string &topic, float buffer_frequency=0)
Definition: basic.hpp:43
static const float bufferDefaultDuration
Definition: recorder_helpers.hpp:29
boost::shared_ptr< naoqi::recorder::GlobalRecorder > gr_
Definition: basic.hpp:150
float conv_frequency_
Definition: basic.hpp:153
float buffer_frequency_
Definition: basic.hpp:152
boost::mutex mutex_
Definition: basic.hpp:145
std::string topic_
Definition: basic.hpp:140
void subscribe(bool state)
Definition: basic.hpp:64
virtual void reset(boost::shared_ptr< GlobalRecorder > gr, float conv_frequency)
Definition: basic.hpp:113
bool is_initialized_
Definition: basic.hpp:147
float buffer_duration_
Definition: basic.hpp:144
int max_counter_
Definition: basic.hpp:155