SMACC2
|
#include <smacc_subscriber_client.hpp>
Public Types | |
typedef MessageType | TMessageType |
Public Member Functions | |
SmaccSubscriberClient () | |
SmaccSubscriberClient (std::string topicname) | |
virtual | ~SmaccSubscriberClient () |
template<typename T > | |
boost::signals2::connection | onMessageReceived (void(T::*callback)(const MessageType &), T *object) |
template<typename T > | |
boost::signals2::connection | onFirstMessageReceived (void(T::*callback)(const MessageType &), T *object) |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
Public Member Functions inherited from smacc2::ISmaccClient | |
ISmaccClient () | |
virtual | ~ISmaccClient () |
virtual void | onInitialize () |
virtual std::string | getName () const |
template<typename TComponent > | |
TComponent * | getComponent () |
template<typename TComponent > | |
TComponent * | getComponent (std::string name) |
template<typename TComponent > | |
TComponent * | getComponent (int index) |
virtual smacc2::introspection::TypeInfo::Ptr | getType () |
ISmaccStateMachine * | getStateMachine () |
template<typename TSmaccSignal , typename T > | |
void | connectSignal (TSmaccSignal &signal, void(T::*callback)(), T *object) |
template<typename SmaccClientType > | |
void | requiresClient (SmaccClientType *&storage) |
void | getComponents (std::vector< std::shared_ptr< ISmaccComponent > > &components) |
const std::vector< std::shared_ptr< ISmaccComponent > > & | iterateComponents () const |
template<typename EventType > | |
void | postEvent (const EventType &ev) |
template<typename EventType > | |
void | postEvent () |
Public Attributes | |
std::optional< std::string > | topicName |
std::optional< int > | queueSize |
smacc2::SmaccSignal< void(const MessageType &)> | onFirstMessageReceived_ |
smacc2::SmaccSignal< void(const MessageType &)> | onMessageReceived_ |
std::function< void(const MessageType &)> | postMessageEvent |
std::function< void(const MessageType &)> | postInitialMessageEvent |
Protected Member Functions | |
void | onInitialize () override |
Protected Member Functions inherited from smacc2::ISmaccClient | |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createComponent (TArgs... targs) |
template<typename SmaccComponentType , typename TOrthogonal , typename TClient , typename... TArgs> | |
SmaccComponentType * | createNamedComponent (std::string name, TArgs... targs) |
rclcpp::Node::SharedPtr | getNode () |
rclcpp::Logger | getLogger () |
Private Member Functions | |
void | messageCallback (const MessageType &msg) |
Private Attributes | |
rclcpp::Subscription< MessageType >::SharedPtr | sub_ |
bool | firstMessage_ |
bool | initialized_ |
Additional Inherited Members | |
Protected Attributes inherited from smacc2::ISmaccClient | |
std::map< ComponentKey, std::shared_ptr< smacc2::ISmaccComponent > > | components_ |
Definition at line 38 of file smacc_subscriber_client.hpp.
typedef MessageType smacc2::client_bases::SmaccSubscriberClient< MessageType >::TMessageType |
Definition at line 44 of file smacc_subscriber_client.hpp.
|
inline |
Definition at line 46 of file smacc_subscriber_client.hpp.
References smacc2::client_bases::SmaccSubscriberClient< MessageType >::initialized_.
|
inline |
Definition at line 48 of file smacc_subscriber_client.hpp.
References smacc2::client_bases::SmaccSubscriberClient< MessageType >::topicName.
|
inlinevirtual |
Definition at line 50 of file smacc_subscriber_client.hpp.
|
inlineprivate |
Definition at line 127 of file smacc_subscriber_client.hpp.
References smacc2::client_bases::SmaccSubscriberClient< MessageType >::firstMessage_, smacc2::client_bases::SmaccSubscriberClient< MessageType >::onFirstMessageReceived_, smacc2::client_bases::SmaccSubscriberClient< MessageType >::onMessageReceived_, smacc2::client_bases::SmaccSubscriberClient< MessageType >::postInitialMessageEvent, and smacc2::client_bases::SmaccSubscriberClient< MessageType >::postMessageEvent.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::onInitialize().
|
inline |
Definition at line 66 of file smacc_subscriber_client.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
|
inlineoverrideprotectedvirtual |
Reimplemented from smacc2::ISmaccClient.
Reimplemented in cl_multirole_sensor::ClMultiroleSensor< MessageType >.
Definition at line 94 of file smacc_subscriber_client.hpp.
References smacc2::client_bases::SmaccSubscriberClient< MessageType >::firstMessage_, smacc2::ISmaccClient::getLogger(), smacc2::ISmaccClient::getName(), smacc2::ISmaccClient::getNode(), smacc2::client_bases::SmaccSubscriberClient< MessageType >::initialized_, smacc2::client_bases::SmaccSubscriberClient< MessageType >::messageCallback(), smacc2::client_bases::SmaccSubscriberClient< MessageType >::queueSize, smacc2::client_bases::SmaccSubscriberClient< MessageType >::sub_, and smacc2::client_bases::SmaccSubscriberClient< MessageType >::topicName.
Referenced by cl_multirole_sensor::ClMultiroleSensor< MessageType >::onInitialize().
|
inline |
Definition at line 59 of file smacc_subscriber_client.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), and smacc2::ISmaccClient::getStateMachine().
Referenced by smacc2::client_behaviors::CbSubscriptionCallbackBase< TMsg >::onEntry(), and cl_multirole_sensor::ClMultiroleSensor< MessageType >::onInitialize().
|
inline |
Definition at line 74 of file smacc_subscriber_client.hpp.
References smacc2::ISmaccClient::postEvent().
|
private |
Definition at line 124 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::messageCallback(), and smacc2::client_bases::SmaccSubscriberClient< MessageType >::onInitialize().
|
private |
Definition at line 125 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::onInitialize(), and smacc2::client_bases::SmaccSubscriberClient< MessageType >::SmaccSubscriberClient().
smacc2::SmaccSignal<void(const MessageType &)> smacc2::client_bases::SmaccSubscriberClient< MessageType >::onFirstMessageReceived_ |
Definition at line 52 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::messageCallback().
smacc2::SmaccSignal<void(const MessageType &)> smacc2::client_bases::SmaccSubscriberClient< MessageType >::onMessageReceived_ |
Definition at line 53 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::messageCallback().
std::function<void(const MessageType &)> smacc2::client_bases::SmaccSubscriberClient< MessageType >::postInitialMessageEvent |
Definition at line 56 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::messageCallback().
std::function<void(const MessageType &)> smacc2::client_bases::SmaccSubscriberClient< MessageType >::postMessageEvent |
Definition at line 55 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::messageCallback().
std::optional<int> smacc2::client_bases::SmaccSubscriberClient< MessageType >::queueSize |
Definition at line 42 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::onInitialize().
|
private |
Definition at line 123 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::onInitialize().
std::optional<std::string> smacc2::client_bases::SmaccSubscriberClient< MessageType >::topicName |
Definition at line 41 of file smacc_subscriber_client.hpp.
Referenced by smacc2::client_bases::SmaccSubscriberClient< MessageType >::onInitialize(), and smacc2::client_bases::SmaccSubscriberClient< MessageType >::SmaccSubscriberClient().