SMACC
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
smacc::ISmaccClientBehavior Class Reference

#include <smacc_client_behavior_base.h>

Inheritance diagram for smacc::ISmaccClientBehavior:
Inheritance graph
Collaboration diagram for smacc::ISmaccClientBehavior:
Collaboration graph

Public Member Functions

 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 ()
 

Protected Member Functions

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 ()
 

Private Member Functions

template<typename TOrthogonal , typename TSourceObject >
void onOrthogonalAllocation ()
 

Private Attributes

ISmaccStateMachinestateMachine_
 
ISmaccStatecurrentState
 
smacc::ISmaccOrthogonalcurrentOrthogonal
 

Friends

class ISmaccState
 
class ISmaccOrthogonal
 

Detailed Description

Definition at line 12 of file smacc_client_behavior_base.h.

Constructor & Destructor Documentation

◆ ISmaccClientBehavior()

smacc::ISmaccClientBehavior::ISmaccClientBehavior ( )

Definition at line 5 of file smacc_client_behavior_base.cpp.

6{
7 stateMachine_ = nullptr;
8 currentState = nullptr;
9}

References currentState, and stateMachine_.

◆ ~ISmaccClientBehavior()

smacc::ISmaccClientBehavior::~ISmaccClientBehavior ( )
virtual

Definition at line 11 of file smacc_client_behavior_base.cpp.

12{
13 ROS_WARN("Client behavior deallocated.");
14}

Member Function Documentation

◆ dispose()

void smacc::ISmaccClientBehavior::dispose ( )
protectedvirtual

Reimplemented in smacc::SmaccAsyncClientBehavior.

Definition at line 47 of file smacc_client_behavior_base.cpp.

48{
49}

◆ executeOnEntry()

void smacc::ISmaccClientBehavior::executeOnEntry ( )
protectedvirtual

Reimplemented in smacc::SmaccAsyncClientBehavior.

Definition at line 35 of file smacc_client_behavior_base.cpp.

36{
37 ROS_DEBUG("[%s] Default empty SmaccClientBehavior onEntry", this->getName().c_str());
38 this->onEntry();
39}

References getName(), and onEntry().

Here is the call graph for this function:

◆ executeOnExit()

void smacc::ISmaccClientBehavior::executeOnExit ( )
protectedvirtual

Reimplemented in smacc::SmaccAsyncClientBehavior.

Definition at line 41 of file smacc_client_behavior_base.cpp.

42{
43 ROS_DEBUG("[%s] Default empty SmaccClientBehavior onExit", this->getName().c_str());
44 this->onExit();
45}

References getName(), and onExit().

Here is the call graph for this function:

◆ getCurrentState()

ISmaccState * smacc::ISmaccClientBehavior::getCurrentState ( )
inlineprotected

◆ getName()

std::string smacc::ISmaccClientBehavior::getName ( ) const

◆ getNode()

ros::NodeHandle smacc::ISmaccClientBehavior::getNode ( )

Definition at line 30 of file smacc_client_behavior_base.cpp.

31{
32 return this->stateMachine_->getNode();
33}

References smacc::ISmaccStateMachine::getNode(), and stateMachine_.

Here is the call graph for this function:

◆ getStateMachine()

ISmaccStateMachine * smacc::ISmaccClientBehavior::getStateMachine ( )
inline

◆ onEntry()

void smacc::ISmaccClientBehavior::onEntry ( )
protectedvirtual

Reimplemented in cl_keyboard::CbDefaultKeyboardBehavior, cl_move_base_z::CbNavigateGlobalPosition, smacc::CbServiceServerCallbackBase< TService >, smacc::CbSubscriptionCallbackBase< TMsg >, smacc::SmaccClientBehavior, cl_move_base_z::CbAbsoluteRotate, cl_move_base_z::CbNavigateBackwards, cl_move_base_z::CbNavigateForward, cl_move_base_z::CbNavigateNextWaypoint, cl_move_base_z::CbRotate, cl_move_base_z::CbUndoPathBackwards, cl_move_base_z::CbUndoPathBackwards2, cl_move_group_interface::CbAttachObject, cl_move_group_interface::CbDetachObject, cl_move_group_interface::CbEndEffectorRotate, cl_move_group_interface::CbExecuteLastTrajectory, cl_move_group_interface::CbMoveCartesianRelative, cl_move_group_interface::CbMoveEndEffector, cl_move_group_interface::CbMoveEndEffectorRelative, cl_move_group_interface::CbMoveEndEffectorTrajectory, cl_move_group_interface::CbMoveJoints, cl_move_group_interface::CbMoveLastTrajectoryInitialState, cl_move_group_interface::CbMoveNamedTarget, cl_move_group_interface::CbUndoLastTrajectory, cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >, cl_ros_publisher::CbDefaultPublishLoop, cl_ros_publisher::CbMutedBehavior< RosMsgType >, cl_ros_publisher::CbPublishOnce< RosMsgType >, cl_ros_timer::CbTimer, cl_ros_timer::CbTimerCountdownLoop, and cl_ros_timer::CbTimerCountdownOnce.

Definition at line 26 of file smacc_client_behavior_base.cpp.

26{};

Referenced by executeOnEntry(), smacc::SmaccAsyncClientBehavior::executeOnEntry(), and cl_move_group_interface::CbEndEffectorRotate::onEntry().

Here is the caller graph for this function:

◆ onExit()

void smacc::ISmaccClientBehavior::onExit ( )
protectedvirtual

◆ onOrthogonalAllocation()

template<typename TOrthogonal , typename TSourceObject >
void smacc::ISmaccClientBehavior::onOrthogonalAllocation
private

Definition at line 73 of file smacc_client_behavior_impl.h.

73{}

◆ postEvent() [1/2]

template<typename EventType >
void smacc::ISmaccClientBehavior::postEvent
protected

Definition at line 28 of file smacc_client_behavior_impl.h.

29{
30 if (stateMachine_ == nullptr)
31 {
32 ROS_ERROR("The client behavior cannot post events before being assigned to an orthogonal. Ignoring post event call.");
33 }
34 else
35 {
36
37 stateMachine_->template postEvent<EventType>(EventLifeTime::CURRENT_STATE);
38 }
39}

References smacc::CURRENT_STATE, and stateMachine_.

Referenced by cl_move_group_interface::CbMoveEndEffectorTrajectory::onOrthogonalAllocation(), and cl_keyboard::CbDefaultKeyboardBehavior::postKeyEvent().

Here is the caller graph for this function:

◆ postEvent() [2/2]

template<typename EventType >
void smacc::ISmaccClientBehavior::postEvent ( const EventType &  ev)
protected

Definition at line 15 of file smacc_client_behavior_impl.h.

16{
17 if (stateMachine_ == nullptr)
18 {
19 ROS_ERROR("The client behavior cannot post events before being assigned to an orthogonal. Ignoring post event call.");
20 }
21 else
22 {
24 }
25}
void postEvent(EventType *ev, EventLifeTime evlifetime=EventLifeTime::ABSOLUTE)

References smacc::CURRENT_STATE, smacc::ISmaccStateMachine::postEvent(), and stateMachine_.

Here is the call graph for this function:

◆ requiresClient()

template<typename SmaccClientType >
void smacc::ISmaccClientBehavior::requiresClient ( SmaccClientType *&  storage)

Definition at line 54 of file smacc_client_behavior_impl.h.

55{
57}
smacc::ISmaccOrthogonal * currentOrthogonal
bool requiresClient(SmaccClientType *&storage)

References currentOrthogonal, and smacc::ISmaccOrthogonal::requiresClient().

Referenced by cl_keyboard::CbDefaultKeyboardBehavior::onEntry(), smacc::CbServiceServerCallbackBase< TService >::onEntry(), smacc::CbSubscriptionCallbackBase< TMsg >::onEntry(), cl_move_base_z::CbRotate::onEntry(), cl_move_group_interface::CbAttachObject::onEntry(), cl_move_group_interface::CbDetachObject::onEntry(), cl_move_group_interface::CbEndEffectorRotate::onEntry(), cl_move_group_interface::CbExecuteLastTrajectory::onEntry(), cl_move_group_interface::CbMoveCartesianRelative::onEntry(), cl_move_group_interface::CbMoveEndEffector::onEntry(), cl_move_group_interface::CbMoveEndEffectorRelative::onEntry(), cl_move_group_interface::CbMoveEndEffectorTrajectory::onEntry(), cl_move_group_interface::CbMoveJoints::onEntry(), cl_move_group_interface::CbMoveNamedTarget::onEntry(), cl_move_group_interface::CbUndoLastTrajectory::onEntry(), cl_multirole_sensor::CbDefaultMultiRoleSensorBehavior< ClientType >::onEntry(), cl_ros_publisher::CbDefaultPublishLoop::onEntry(), cl_ros_publisher::CbPublishOnce< RosMsgType >::onEntry(), cl_ros_timer::CbTimer::onEntry(), cl_ros_timer::CbTimerCountdownLoop::onEntry(), cl_ros_timer::CbTimerCountdownOnce::onEntry(), and cl_move_base_z::CbMoveBaseClientBehaviorBase::onOrthogonalAllocation().

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

◆ requiresComponent()

template<typename SmaccComponentType >
void smacc::ISmaccClientBehavior::requiresComponent ( SmaccComponentType *&  storage)

Definition at line 60 of file smacc_client_behavior_impl.h.

61{
62 if (stateMachine_ == nullptr)
63 {
64 ROS_ERROR("Cannot use the requiresComponent funcionality before assigning the client behavior to an orthogonal. Try using the OnEntry method to capture required components.");
65 }
66 else
67 {
69 }
70}
void requiresComponent(SmaccComponentType *&storage)

References smacc::ISmaccStateMachine::requiresComponent(), and stateMachine_.

Referenced by cl_move_group_interface::CbAttachObject::onEntry(), cl_move_group_interface::CbDetachObject::onEntry(), cl_move_group_interface::CbExecuteLastTrajectory::onEntry(), cl_move_group_interface::CbMoveEndEffectorTrajectory::onEntry(), cl_move_group_interface::CbMoveLastTrajectoryInitialState::onEntry(), and cl_move_group_interface::CbUndoLastTrajectory::onEntry().

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

◆ runtimeConfigure()

void smacc::ISmaccClientBehavior::runtimeConfigure ( )
protectedvirtual

Definition at line 21 of file smacc_client_behavior_base.cpp.

22{
23 ROS_DEBUG("[%s] Default empty SmaccClientBehavior runtimeConfigure", this->getName().c_str());
24}

References getName().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ISmaccOrthogonal

friend class ISmaccOrthogonal
friend

Definition at line 66 of file smacc_client_behavior_base.h.

◆ ISmaccState

friend class ISmaccState
friend

Definition at line 65 of file smacc_client_behavior_base.h.

Member Data Documentation

◆ currentOrthogonal

smacc::ISmaccOrthogonal* smacc::ISmaccClientBehavior::currentOrthogonal
private

Definition at line 63 of file smacc_client_behavior_base.h.

Referenced by requiresClient().

◆ currentState

ISmaccState* smacc::ISmaccClientBehavior::currentState
private

◆ stateMachine_

ISmaccStateMachine* smacc::ISmaccClientBehavior::stateMachine_
private

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