SMACC2
|
#include <smacc_asynchronous_client_behavior.hpp>
Public Member Functions | |
template<typename TOrthogonal , typename TSourceObject > | |
void | onOrthogonalAllocation () |
virtual | ~SmaccAsyncClientBehavior () |
template<typename TCallback , typename T > | |
boost::signals2::connection | onSuccess (TCallback callback, T *object) |
template<typename TCallback , typename T > | |
boost::signals2::connection | onFinished (TCallback callback, T *object) |
template<typename TCallback , typename T > | |
boost::signals2::connection | onFailure (TCallback callback, T *object) |
void | requestForceFinish () |
void | executeOnEntry () override |
void | executeOnExit () override |
void | waitOnEntryThread (bool requestFinish) |
template<typename TCallbackMethod , typename T > | |
boost::signals2::connection | onSuccess (TCallbackMethod callback, T *object) |
template<typename TCallbackMethod , typename T > | |
boost::signals2::connection | onFinished (TCallbackMethod callback, T *object) |
template<typename TCallbackMethod , typename T > | |
boost::signals2::connection | onFailure (TCallbackMethod callback, T *object) |
Public Member Functions inherited from smacc2::ISmaccClientBehavior | |
ISmaccClientBehavior () | |
virtual | ~ISmaccClientBehavior () |
ISmaccStateMachine * | getStateMachine () |
std::string | getName () const |
template<typename SmaccClientType > | |
void | requiresClient (SmaccClientType *&storage) |
template<typename SmaccComponentType > | |
void | requiresComponent (SmaccComponentType *&storage, bool throwExceptionIfNotExist=false) |
virtual void | onEntry () |
virtual void | onExit () |
virtual void | executeOnEntry () |
virtual void | executeOnExit () |
Protected Member Functions | |
void | postSuccessEvent () |
void | postFailureEvent () |
virtual void | dispose () override |
bool | isShutdownRequested () |
Protected Member Functions inherited from smacc2::ISmaccClientBehavior | |
virtual void | runtimeConfigure () |
template<typename EventType > | |
void | postEvent (const EventType &ev) |
template<typename EventType > | |
void | postEvent () |
ISmaccState * | getCurrentState () |
virtual void | dispose () |
virtual rclcpp::Node::SharedPtr | getNode () const |
virtual rclcpp::Logger | getLogger () const |
Private Member Functions | |
void | waitFutureIfNotFinished (std::optional< std::future< int > > &threadfut, bool requestFinish) |
Private Attributes | |
std::optional< std::future< int > > | onEntryThread_ |
std::optional< std::future< int > > | onExitThread_ |
std::function< void()> | postFinishEventFn_ |
std::function< void()> | postSuccessEventFn_ |
std::function< void()> | postFailureEventFn_ |
SmaccSignal< void()> | onFinished_ |
SmaccSignal< void()> | onSuccess_ |
SmaccSignal< void()> | onFailure_ |
bool | isShutdownRequested_ = false |
Definition at line 55 of file smacc_asynchronous_client_behavior.hpp.
|
virtual |
Definition at line 149 of file smacc_client_async_behavior.cpp.
|
overrideprotectedvirtual |
Reimplemented from smacc2::ISmaccClientBehavior.
Definition at line 120 of file smacc_client_async_behavior.cpp.
References smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), and onExitThread_.
|
overridevirtual |
Reimplemented from smacc2::ISmaccClientBehavior.
Definition at line 27 of file smacc_client_async_behavior.cpp.
References smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), smacc2::ISmaccClientBehavior::onEntry(), onEntryThread_, and postFinishEventFn_.
|
overridevirtual |
Reimplemented from smacc2::ISmaccClientBehavior.
Definition at line 103 of file smacc_client_async_behavior.cpp.
References smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), smacc2::ISmaccClientBehavior::onExit(), onExitThread_, and waitOnEntryThread().
|
inlineprotected |
Definition at line 87 of file smacc_asynchronous_client_behavior.hpp.
References isShutdownRequested_.
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::isOwnActionResponse(), smacc2::client_behaviors::CbServiceCall< ServiceType >::onEntry(), smacc2::client_behaviors::CbRosLaunch::onEntry(), smacc2::client_behaviors::CbSequence::onEntry(), and smacc2::client_behaviors::CbWaitNode::onEntry().
boost::signals2::connection smacc2::SmaccAsyncClientBehavior::onFailure | ( | TCallback | callback, |
T * | object | ||
) |
boost::signals2::connection smacc2::SmaccAsyncClientBehavior::onFailure | ( | TCallbackMethod | callback, |
T * | object | ||
) |
Definition at line 64 of file smacc_asynchronous_client_behavior_impl.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::ISmaccClientBehavior::getStateMachine(), and onFailure_.
boost::signals2::connection smacc2::SmaccAsyncClientBehavior::onFinished | ( | TCallback | callback, |
T * | object | ||
) |
boost::signals2::connection smacc2::SmaccAsyncClientBehavior::onFinished | ( | TCallbackMethod | callback, |
T * | object | ||
) |
Definition at line 57 of file smacc_asynchronous_client_behavior_impl.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::ISmaccClientBehavior::getStateMachine(), and onFinished_.
void smacc2::SmaccAsyncClientBehavior::onOrthogonalAllocation |
Definition at line 28 of file smacc_asynchronous_client_behavior_impl.hpp.
References onFailure_, onFinished_, onSuccess_, postFailureEventFn_, postFinishEventFn_, and postSuccessEventFn_.
boost::signals2::connection smacc2::SmaccAsyncClientBehavior::onSuccess | ( | TCallback | callback, |
T * | object | ||
) |
boost::signals2::connection smacc2::SmaccAsyncClientBehavior::onSuccess | ( | TCallbackMethod | callback, |
T * | object | ||
) |
Definition at line 50 of file smacc_asynchronous_client_behavior_impl.hpp.
References smacc2::ISmaccStateMachine::createSignalConnection(), smacc2::ISmaccClientBehavior::getStateMachine(), and onSuccess_.
|
protected |
Definition at line 153 of file smacc_client_async_behavior.cpp.
References postFailureEventFn_.
Referenced by cl_move_group_interface::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory(), cl_move_group_interface::CbMoveJoints::moveJoints(), cl_move_group_interface::CbMoveEndEffectorRelative::moveRelative(), cl_move_group_interface::CbMoveCartesianRelative::moveRelativeCartesian(), cl_move_group_interface::CbMoveEndEffector::moveToAbsolutePose(), smacc2::client_behaviors::CbServiceCall< ServiceType >::onEntry(), smacc2::client_behaviors::CbSequence::onEntry(), smacc2::client_behaviors::CbWaitActionServer::onEntry(), smacc2::client_behaviors::CbWaitNode::onEntry(), cl_move_group_interface::CbAttachObject::onEntry(), cl_move_group_interface::CbDetachObject::onEntry(), cl_move_group_interface::CbMoveEndEffectorTrajectory::onEntry(), cl_nav2z::CbWaitPose::onEntry(), cl_nav2z::CbWaitTransform::onEntry(), cl_nav2z::CbNav2ZClientBehaviorBase::onNavigationActionAbort(), cl_lifecyclenode::CbActivate::onOrthogonalAllocation(), cl_lifecyclenode::CbCleanup::onOrthogonalAllocation(), cl_lifecyclenode::CbConfigure::onOrthogonalAllocation(), cl_lifecyclenode::CbDeactivate::onOrthogonalAllocation(), cl_lifecyclenode::CbDestroy::onOrthogonalAllocation(), cl_lifecyclenode::CbShutdown::onOrthogonalAllocation(), and smacc2::client_behaviors::CbSequence::onSubNodeAbort().
|
protected |
Definition at line 151 of file smacc_client_async_behavior.cpp.
References postSuccessEventFn_.
Referenced by cl_move_group_interface::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory(), cl_move_group_interface::CbMoveJoints::moveJoints(), cl_move_group_interface::CbMoveEndEffectorRelative::moveRelative(), cl_move_group_interface::CbMoveCartesianRelative::moveRelativeCartesian(), cl_move_group_interface::CbMoveEndEffector::moveToAbsolutePose(), smacc2::client_behaviors::CbServiceCall< ServiceType >::onEntry(), smacc2::client_behaviors::CbSequence::onEntry(), smacc2::client_behaviors::CbWaitActionServer::onEntry(), smacc2::client_behaviors::CbWaitNode::onEntry(), cl_move_group_interface::CbAttachObject::onEntry(), cl_move_group_interface::CbDetachObject::onEntry(), cl_nav2z::CbAbortNavigation::onEntry(), cl_nav2z::CbWaitPose::onEntry(), cl_nav2z::CbWaitTransform::onEntry(), cl_nav2z::CbWaitNav2Nodes::onMessageReceived(), smacc2::client_behaviors::CbWaitTopicMessage< TMessage >::onMessageReceived(), cl_nav2z::CbNav2ZClientBehaviorBase::onNavigationActionSuccess(), cl_nav2z::CbNavigateNextWaypointUntilReached::onNavigationActionSuccess(), cl_lifecyclenode::CbActivate::onOrthogonalAllocation(), cl_lifecyclenode::CbCleanup::onOrthogonalAllocation(), cl_lifecyclenode::CbConfigure::onOrthogonalAllocation(), cl_lifecyclenode::CbDeactivate::onOrthogonalAllocation(), cl_lifecyclenode::CbDestroy::onOrthogonalAllocation(), and cl_lifecyclenode::CbShutdown::onOrthogonalAllocation().
void smacc2::SmaccAsyncClientBehavior::requestForceFinish | ( | ) |
Definition at line 155 of file smacc_client_async_behavior.cpp.
References smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), smacc2::ISmaccClientBehavior::getNode(), and isShutdownRequested_.
Referenced by smacc2::client_behaviors::CbSequence::onSubNodeAbort(), and waitFutureIfNotFinished().
|
private |
Definition at line 41 of file smacc_client_async_behavior.cpp.
References smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), smacc2::ISmaccClientBehavior::getNode(), and requestForceFinish().
Referenced by waitOnEntryThread().
void smacc2::SmaccAsyncClientBehavior::waitOnEntryThread | ( | bool | requestFinish | ) |
Definition at line 98 of file smacc_client_async_behavior.cpp.
References onEntryThread_, and waitFutureIfNotFinished().
Referenced by executeOnExit().
|
private |
Definition at line 103 of file smacc_asynchronous_client_behavior.hpp.
Referenced by isShutdownRequested(), and requestForceFinish().
|
private |
Definition at line 92 of file smacc_asynchronous_client_behavior.hpp.
Referenced by executeOnEntry(), and waitOnEntryThread().
|
private |
Definition at line 93 of file smacc_asynchronous_client_behavior.hpp.
Referenced by dispose(), and executeOnExit().
|
private |
Definition at line 101 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onFailure(), and onOrthogonalAllocation().
|
private |
Definition at line 99 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onFinished(), and onOrthogonalAllocation().
|
private |
Definition at line 100 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onOrthogonalAllocation(), and onSuccess().
|
private |
Definition at line 97 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onOrthogonalAllocation(), and postFailureEvent().
|
private |
Definition at line 95 of file smacc_asynchronous_client_behavior.hpp.
Referenced by executeOnEntry(), and onOrthogonalAllocation().
|
private |
Definition at line 96 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onOrthogonalAllocation(), and postSuccessEvent().