SMACC2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType > Class Template Reference

#include <cb_default_multirole_sensor_behavior.hpp>

Inheritance diagram for cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >:
Inheritance graph
Collaboration diagram for cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >:
Collaboration graph

Public Types

typedef ClientType::TMessageType TMessageType
 

Public Member Functions

 CbDefaultMultiRoleSensorBehavior ()
 
template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 
template<typename EvType >
void propagateEvent (const TMessageType &)
 
template<typename EvType >
void propagateEvent2 ()
 
void onEntry () override
 
void onExit ()
 
virtual void onMessageCallback (const TMessageType &)
 
void onEntry () override
 
void onExit () override
 
- Public Member Functions inherited from smacc2::ISmaccClientBehavior
 ISmaccClientBehavior ()
 
virtual ~ISmaccClientBehavior ()
 
ISmaccStateMachinegetStateMachine ()
 
std::string getName () const
 
template<typename SmaccClientType >
void requiresClient (SmaccClientType *&storage)
 
template<typename SmaccComponentType >
void requiresComponent (SmaccComponentType *&storage)
 

Static Public Member Functions

static std::string getEventLabel ()
 

Public Attributes

ClientType * sensor_
 
std::function< void()> deferedEventPropagation
 

Additional Inherited Members

- Protected Member Functions inherited from smacc2::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 dispose ()
 
virtual rclcpp::Node::SharedPtr getNode ()
 
virtual rclcpp::Logger getLogger ()
 

Detailed Description

template<typename ClientType>
class cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >

Definition at line 26 of file cb_default_multirole_sensor_behavior.hpp.

Member Typedef Documentation

◆ TMessageType

template<typename ClientType >
typedef ClientType::TMessageType cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::TMessageType

Definition at line 29 of file cb_default_multirole_sensor_behavior.hpp.

Constructor & Destructor Documentation

◆ CbDefaultMultiRoleSensorBehavior()

template<typename ClientType >
cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::CbDefaultMultiRoleSensorBehavior ( )
inline

Member Function Documentation

◆ getEventLabel()

template<typename ClientType >
static std::string cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::getEventLabel ( )
inlinestatic

Definition at line 35 of file cb_default_multirole_sensor_behavior.hpp.

36 {
37 // show ros message type
38 return demangleSymbol(typeid(TMessageType).name());
39 }
std::string demangleSymbol()

References smacc2::introspection::demangleSymbol().

Here is the call graph for this function:

◆ onEntry()

template<typename ClientType >
void cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::onEntry ( )
inlineoverridevirtual

Reimplemented from smacc2::SmaccClientBehavior.

Definition at line 81 of file cb_default_multirole_sensor_behavior.hpp.

82 {
83 RCLCPP_INFO(
84 getLogger(), "[CbDefaultMultiRoleSensorBehavior] onEntry. Requires client of type '%s'",
85 demangleSymbol<ClientType>().c_str());
86
87 if (sensor_ == nullptr)
88 {
90 }
91
92 if (sensor_ == nullptr)
93 {
94 RCLCPP_FATAL_STREAM(
95 getLogger(),
96 "[CbDefaultMultiRoleSensorBehavior]Sensor client behavior needs a client of type: "
97 << demangleSymbol<ClientType>() << " but it is not found.");
98 }
99 else
100 {
102 RCLCPP_INFO(getLogger(), "[CbDefaultMultiRoleSensorBehavior] onEntry. sensor initialize");
103 }
104 }
void requiresClient(SmaccClientType *&storage)

References cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::deferedEventPropagation, smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::requiresClient(), and cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::sensor_.

Here is the call graph for this function:

◆ onExit()

template<typename ClientType >
void cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::onExit ( )
inlinevirtual

Reimplemented from smacc2::SmaccClientBehavior.

Definition at line 106 of file cb_default_multirole_sensor_behavior.hpp.

106{}

◆ onMessageCallback()

template<typename ClientType >
virtual void cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::onMessageCallback ( const TMessageType )
inlinevirtual

Definition at line 108 of file cb_default_multirole_sensor_behavior.hpp.

109 {
110 // empty to fill by sensor customization based on inheritance
111 }

◆ onOrthogonalAllocation()

template<typename ClientType >
template<typename TOrthogonal , typename TSourceObject >
void cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::onOrthogonalAllocation ( )
inline

Definition at line 44 of file cb_default_multirole_sensor_behavior.hpp.

45 {
47 {
48 RCLCPP_INFO(
49 getLogger(), "[CbDefaultMultiRoleSensorBehavior] onEntry. Requires client of type '%s'",
50 demangleSymbol<ClientType>().c_str());
51
52 // just propagate the client events from this client behavior source.
53 sensor_->onMessageReceived(
55 EvTopicMessage<TSourceObject, TOrthogonal>>,
56 this);
57 sensor_->onFirstMessageReceived(
59 EvTopicInitialMessage<TSourceObject, TOrthogonal>>,
60 this);
61 sensor_->onMessageTimeout(
63 EvTopicMessageTimeout<TSourceObject, TOrthogonal>>,
64 this);
65 };
66 }

References cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::deferedEventPropagation, smacc2::ISmaccClientBehavior::getLogger(), and cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::sensor_.

Here is the call graph for this function:

◆ propagateEvent()

template<typename ClientType >
template<typename EvType >
void cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::propagateEvent ( const TMessageType )
inline

Definition at line 69 of file cb_default_multirole_sensor_behavior.hpp.

70 {
71 // TODO: copy event concept fields
72 this->postEvent<EvType>();
73 }

◆ propagateEvent2()

template<typename ClientType >
template<typename EvType >
void cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::propagateEvent2 ( )
inline

Definition at line 76 of file cb_default_multirole_sensor_behavior.hpp.

77 {
78 this->postEvent<EvType>();
79 }

Member Data Documentation

◆ deferedEventPropagation

template<typename ClientType >
std::function<void()> cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::deferedEventPropagation

◆ sensor_

template<typename ClientType >
ClientType* cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::sensor_

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