SMACC
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
cl_ros_publisher::CbPublishOnce< RosMsgType > Class Template Reference

#include <cb_publish_once.h>

Inheritance diagram for cl_ros_publisher::CbPublishOnce< RosMsgType >:
Inheritance graph
Collaboration diagram for cl_ros_publisher::CbPublishOnce< RosMsgType >:
Collaboration graph

Public Member Functions

 CbPublishOnce ()
 
template<typename TMessage >
 CbPublishOnce (const TMessage &data)
 
template<typename TMessage >
void setMessage (const TMessage &data)
 
virtual void onEntry () override
 
virtual void onExit () override
 
virtual void onEntry () override
 
virtual void onExit () override
 
- Public Member Functions inherited from smacc::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 
ros::NodeHandle getNode ()
 

Private Attributes

std::function< void()> deferedPublishFn
 
ClRosPublisherclient_
 

Additional Inherited Members

- Protected Member Functions inherited from smacc::ISmaccClientBehavior
virtual void runtimeConfigure ()
 
virtual void onEntry ()
 
virtual void onExit ()
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
ISmaccStategetCurrentState ()
 
virtual void executeOnEntry ()
 
virtual void executeOnExit ()
 
virtual void dispose ()
 

Detailed Description

template<typename RosMsgType>
class cl_ros_publisher::CbPublishOnce< RosMsgType >

Definition at line 9 of file cb_publish_once.h.

Constructor & Destructor Documentation

◆ CbPublishOnce() [1/2]

template<typename RosMsgType >
cl_ros_publisher::CbPublishOnce< RosMsgType >::CbPublishOnce ( )
inline

Definition at line 16 of file cb_publish_once.h.

17 : deferedPublishFn(nullptr)
18 {
19 }
std::function< void()> deferedPublishFn

◆ CbPublishOnce() [2/2]

template<typename RosMsgType >
template<typename TMessage >
cl_ros_publisher::CbPublishOnce< RosMsgType >::CbPublishOnce ( const TMessage &  data)
inline

Definition at line 22 of file cb_publish_once.h.

23 {
24 this->setMessage(data);
25 }
void setMessage(const TMessage &data)

References cl_ros_publisher::CbPublishOnce< RosMsgType >::setMessage().

Here is the call graph for this function:

Member Function Documentation

◆ onEntry()

template<typename RosMsgType >
virtual void cl_ros_publisher::CbPublishOnce< RosMsgType >::onEntry ( )
inlineoverridevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 35 of file cb_publish_once.h.

36 {
38
39 if (deferedPublishFn != nullptr)
41 }
void requiresClient(SmaccClientType *&storage)

References cl_ros_publisher::CbPublishOnce< RosMsgType >::deferedPublishFn, and smacc::ISmaccClientBehavior::requiresClient().

Here is the call graph for this function:

◆ onExit()

template<typename RosMsgType >
virtual void cl_ros_publisher::CbPublishOnce< RosMsgType >::onExit ( )
inlineoverridevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 43 of file cb_publish_once.h.

44 {
45 }

◆ setMessage()

template<typename RosMsgType >
template<typename TMessage >
void cl_ros_publisher::CbPublishOnce< RosMsgType >::setMessage ( const TMessage &  data)
inline

Definition at line 28 of file cb_publish_once.h.

29 {
30 deferedPublishFn = [=]() {
31 client_->publish(data);
32 };
33 }
void publish(const MessageType &msg)

References cl_ros_publisher::CbPublishOnce< RosMsgType >::client_, cl_ros_publisher::CbPublishOnce< RosMsgType >::deferedPublishFn, and cl_ros_publisher::ClRosPublisher::publish().

Referenced by cl_ros_publisher::CbPublishOnce< RosMsgType >::CbPublishOnce().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ client_

template<typename RosMsgType >
ClRosPublisher* cl_ros_publisher::CbPublishOnce< RosMsgType >::client_
private

◆ deferedPublishFn

template<typename RosMsgType >
std::function<void()> cl_ros_publisher::CbPublishOnce< RosMsgType >::deferedPublishFn
private

The documentation for this class was generated from the following file: