SMACC
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
cl_ros_publisher::CbDefaultPublishLoop Class Reference

#include <cb_default_publish_loop.h>

Inheritance diagram for cl_ros_publisher::CbDefaultPublishLoop:
Inheritance graph
Collaboration diagram for cl_ros_publisher::CbDefaultPublishLoop:
Collaboration graph

Public Member Functions

 CbDefaultPublishLoop ()
 
template<typename TMessage >
 CbDefaultPublishLoop (const TMessage &data)
 
template<typename TMessage >
void setMessage (const TMessage &data)
 
virtual void onEntry () override
 
virtual void update ()
 
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 ()
 
- Public Member Functions inherited from smacc::ISmaccUpdatable
 ISmaccUpdatable ()
 
 ISmaccUpdatable (ros::Duration duration)
 
void executeUpdate ()
 
void setUpdatePeriod (ros::Duration duration)
 

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 ()
 
virtual void update ()=0
 

Detailed Description

Definition at line 9 of file cb_default_publish_loop.h.

Constructor & Destructor Documentation

◆ CbDefaultPublishLoop() [1/2]

cl_ros_publisher::CbDefaultPublishLoop::CbDefaultPublishLoop ( )
inline

Definition at line 17 of file cb_default_publish_loop.h.

18 : deferedPublishFn(nullptr)
19 {
20 }

◆ CbDefaultPublishLoop() [2/2]

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

Definition at line 23 of file cb_default_publish_loop.h.

24 {
25 this->setMessage(data);
26 }

References setMessage().

Here is the call graph for this function:

Member Function Documentation

◆ onEntry()

virtual void cl_ros_publisher::CbDefaultPublishLoop::onEntry ( )
inlineoverridevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 36 of file cb_default_publish_loop.h.

37 {
39 }
void requiresClient(SmaccClientType *&storage)

References smacc::ISmaccClientBehavior::requiresClient().

Here is the call graph for this function:

◆ onExit()

virtual void cl_ros_publisher::CbDefaultPublishLoop::onExit ( )
inlineoverridevirtual

Reimplemented from smacc::SmaccClientBehavior.

Definition at line 47 of file cb_default_publish_loop.h.

48 {
49 }

◆ setMessage()

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

Definition at line 29 of file cb_default_publish_loop.h.

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

References client_, deferedPublishFn, and cl_ros_publisher::ClRosPublisher::publish().

Referenced by CbDefaultPublishLoop().

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

◆ update()

virtual void cl_ros_publisher::CbDefaultPublishLoop::update ( )
inlinevirtual

Implements smacc::ISmaccUpdatable.

Definition at line 41 of file cb_default_publish_loop.h.

42 {
43 if (deferedPublishFn != nullptr)
45 }

References deferedPublishFn.

Member Data Documentation

◆ client_

ClRosPublisher* cl_ros_publisher::CbDefaultPublishLoop::client_
private

Definition at line 14 of file cb_default_publish_loop.h.

Referenced by setMessage().

◆ deferedPublishFn

std::function<void()> cl_ros_publisher::CbDefaultPublishLoop::deferedPublishFn
private

Definition at line 13 of file cb_default_publish_loop.h.

Referenced by setMessage(), and update().


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