SMACC2
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(const std::string &name)

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 80 of file cb_default_multirole_sensor_behavior.hpp.

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

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

Referenced by sm_dance_bot::cl_lidar::CbLidarSensor::onEntry(), sm_dance_bot::cl_temperature_sensor::CbConditionTemperatureSensor::onEntry(), sm_dance_bot_strikes_back::cl_lidar::CbLidarSensor::onEntry(), sm_dance_bot_strikes_back::cl_temperature_sensor::CbConditionTemperatureSensor::onEntry(), sm_dance_bot_warehouse::cl_lidar::CbLidarSensor::onEntry(), sm_dance_bot_warehouse::cl_temperature_sensor::CbConditionTemperatureSensor::onEntry(), sm_dance_bot_warehouse_2::cl_lidar::CbLidarSensor::onEntry(), sm_dance_bot_warehouse_2::cl_temperature_sensor::CbConditionTemperatureSensor::onEntry(), sm_dance_bot_warehouse_3::cl_lidar::CbLidarSensor::onEntry(), and sm_dance_bot_warehouse_3::cl_temperature_sensor::CbConditionTemperatureSensor::onEntry().

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

◆ onExit()

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

Reimplemented from smacc2::SmaccClientBehavior.

Definition at line 105 of file cb_default_multirole_sensor_behavior.hpp.

105{}

◆ onMessageCallback()

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

Definition at line 107 of file cb_default_multirole_sensor_behavior.hpp.

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

◆ 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 {
46 deferedEventPropagation = [this]() {
47 RCLCPP_INFO(
48 getLogger(), "[CbDefaultMultiRoleSensorBehavior] onEntry. Requires client of type '%s'",
49 demangleSymbol<ClientType>().c_str());
50
51 // just propagate the client events from this client behavior source.
52 sensor_->onMessageReceived(
54 EvTopicMessage<TSourceObject, TOrthogonal>>,
55 this);
56 sensor_->onFirstMessageReceived(
58 EvTopicInitialMessage<TSourceObject, TOrthogonal>>,
59 this);
60 sensor_->onMessageTimeout(
62 EvTopicMessageTimeout<TSourceObject, TOrthogonal>>,
63 this);
64 };
65 }

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 68 of file cb_default_multirole_sensor_behavior.hpp.

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

◆ propagateEvent2()

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

Definition at line 75 of file cb_default_multirole_sensor_behavior.hpp.

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

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: