21 #include <boost/make_shared.hpp>
25 #include <qi/anyobject.hpp>
33 template <
typename Converter,
typename Publisher,
typename Recorder>
38 template <
typename Converter,
typename Publisher,
typename Recorder>
41 p_memory_( session->service(
"ALMemory") ),
53 converter_->registerCallback(
message_actions::LOG, boost::bind(&Recorder::bufferize, recorder_, _1) );
58 template <
typename Converter,
typename Publisher,
typename Recorder>
63 template <
typename Converter,
typename Publisher,
typename Recorder>
66 publisher_->reset(nh);
69 template <
typename Converter,
typename Publisher,
typename Recorder>
72 recorder_->reset(gr, converter_->frequency());
75 template <
typename Converter,
typename Publisher,
typename Recorder>
78 boost::mutex::scoped_lock start_lock(mutex_);
86 template <
typename Converter,
typename Publisher,
typename Recorder>
89 boost::mutex::scoped_lock stop_lock(mutex_);
97 template <
typename Converter,
typename Publisher,
typename Recorder>
102 recorder_->writeDump(time);
106 template <
typename Converter,
typename Publisher,
typename Recorder>
109 recorder_->setBufferDuration(duration);
112 template <
typename Converter,
typename Publisher,
typename Recorder>
115 boost::mutex::scoped_lock rec_lock(mutex_);
116 isRecording_ = state;
119 template <
typename Converter,
typename Publisher,
typename Recorder>
122 boost::mutex::scoped_lock pub_lock(mutex_);
123 isPublishing_ = state;
126 template <
typename Converter,
typename Publisher,
typename Recorder>
129 boost::mutex::scoped_lock dump_lock(mutex_);
133 template <
typename Converter,
typename Publisher,
typename Recorder>
140 template <
typename Converter,
typename Publisher,
typename Recorder>
143 signal_.disconnect(signalID_);
146 template <
typename Converter,
typename Publisher,
typename Recorder>
149 std::vector<message_actions::MessageAction> actions;
150 boost::mutex::scoped_lock callback_lock(mutex_);
153 if ( isPublishing_ && publisher_->isSubscribed() )
166 if (actions.size() >0)
168 converter_->callAll( actions );
std::string key_
Definition: basic.hpp:83
void writeDump(const ros::Time &time)
Definition: basic.hxx:98
qi::AnyObject signal_
Definition: basic.hpp:81
boost::shared_ptr< Publisher > publisher_
Definition: basic.hpp:77
Definition: message_actions.h:13
qi::AnyObject p_memory_
Definition: basic.hpp:80
void isRecording(bool state)
Definition: basic.hxx:113
void startProcess()
Definition: basic.hxx:76
Definition: message_actions.h:12
void resetPublisher(ros::NodeHandle &nh)
Definition: basic.hxx:64
Definition: message_actions.h:11
void setBufferDuration(float duration)
Definition: basic.hxx:107
boost::shared_ptr< Converter > converter_
Definition: basic.hpp:76
void onEvent()
Definition: basic.hxx:147
void stopProcess()
Definition: basic.hxx:87
~EventRegister()
Definition: basic.hxx:59
void unregisterCallback()
Definition: basic.hxx:141
EventRegister()
Constructor for recorder interface.
Definition: basic.hxx:34
boost::shared_ptr< Recorder > recorder_
Definition: basic.hpp:78
void isPublishing(bool state)
Definition: basic.hxx:120
void resetRecorder(boost::shared_ptr< naoqi::recorder::GlobalRecorder > gr)
Definition: basic.hxx:70
GlobalRecorder concept interface.
Definition: basic.hpp:45
void registerCallback()
Definition: basic.hxx:134
void isDumping(bool state)
Definition: basic.hxx:127