4#include <boost/optional/optional_io.hpp>
14template <
typename MessageType>
45 boost::signals2::connection
onMessageReceived(
void (T::*callback)(
const MessageType &), T *
object)
47 return this->getStateMachine()->createSignalConnection(
onMessageReceived_, callback,
object);
56 template <
typename TOrthogonal,
typename TSourceObject>
59 this->postMessageEvent = [=](
auto msg) {
65 this->postInitialMessageEvent = [=](
auto msg) {
83 ROS_ERROR(
"topic client with no topic name set. Skipping subscribing");
87 ROS_INFO_STREAM(
"[" << this->
getName() <<
"] Subscribing to topic: " << topicName);
virtual std::string getName() const
std::function< void(const MessageType &)> postMessageEvent
virtual void initialize()
CpTopicSubscriber(std::string topicname)
void onOrthogonalAllocation()
virtual ~CpTopicSubscriber()
boost::optional< std::string > topicName
std::function< void(const MessageType &)> postInitialMessageEvent
smacc::SmaccSignal< void(const MessageType &)> onFirstMessageReceived_
boost::signals2::connection onFirstMessageReceived(void(T::*callback)(const MessageType &), T *object)
boost::optional< int > queueSize
smacc::SmaccSignal< void(const MessageType &)> onMessageReceived_
void messageCallback(const MessageType &msg)
boost::signals2::connection onMessageReceived(void(T::*callback)(const MessageType &), T *object)