SMACC2
|
#include <smacc_asynchronous_client_behavior.hpp>
Protected Member Functions | |
void | postSuccessEvent () |
void | postFailureEvent () |
virtual void | dispose () override |
bool | isShutdownRequested () |
onEntry is executed in a new thread. However the current state cannot be left until the onEntry thread finishes. This flag can be checked from the onEntry thread to force finishing the thread. | |
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 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 151 of file smacc_client_async_behavior.cpp.
|
overrideprotectedvirtual |
Reimplemented from smacc2::ISmaccClientBehavior.
Definition at line 122 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 105 of file smacc_client_async_behavior.cpp.
References smacc2::ISmaccClientBehavior::getLogger(), smacc2::ISmaccClientBehavior::getName(), smacc2::ISmaccClientBehavior::onExit(), onExitThread_, and waitOnEntryThread().
|
protected |
onEntry is executed in a new thread. However the current state cannot be left until the onEntry thread finishes. This flag can be checked from the onEntry thread to force finishing the thread.
Definition at line 165 of file smacc_client_async_behavior.cpp.
References isShutdownRequested_.
Referenced by cl_nav2z::CbNav2ZClientBehaviorBase::isOwnActionResponse(), cl_nitrosz::CbNav2ZClientBehaviorBase::isOwnActionResponse(), smacc2::client_behaviors::CbServiceCall< ServiceType >::onEntry(), smacc2::client_behaviors::CbRosLaunch::onEntry(), smacc2::client_behaviors::CbRosLaunch2::onEntry(), smacc2::client_behaviors::CbSequence::onEntry(), smacc2::client_behaviors::CbSleepFor::onEntry(), smacc2::client_behaviors::CbWaitActionServer::onEntry(), smacc2::client_behaviors::CbWaitNode::onEntry(), smacc2::client_behaviors::CbWaitTopic::onEntry(), cl_nav2z::CbActiveStop::onEntry(), and cl_nitrosz::CbActiveStop::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 | ||
) |
Referenced by cl_nav2z::CbNavigateNextWaypointFree::onEntry(), and cl_nitrosz::CbNavigateNextWaypointFree::onEntry().
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 155 of file smacc_client_async_behavior.cpp.
References postFailureEventFn_.
Referenced by cl_moveit2z::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory(), cl_moveit2z::CbMoveJoints::moveJoints(), cl_moveit2z::CbMoveEndEffectorRelative::moveRelative(), cl_moveit2z::CbMoveCartesianRelative::moveRelativeCartesian(), cl_moveit2z::CbMoveEndEffector::moveToAbsolutePose(), smacc2::client_behaviors::CbServiceCall< ServiceType >::onEntry(), smacc2::client_behaviors::CbSequence::onEntry(), smacc2::client_behaviors::CbWaitActionServer::onEntry(), smacc2::client_behaviors::CbWaitNode::onEntry(), smacc2::client_behaviors::CbWaitTopic::onEntry(), cl_moveit2z::CbAttachObject::onEntry(), cl_moveit2z::CbDetachObject::onEntry(), cl_moveit2z::CbMoveEndEffectorTrajectory::onEntry(), cl_nav2z::CbWaitPose::onEntry(), cl_nav2z::CbWaitTransform::onEntry(), cl_nitrosz::CbWaitPose::onEntry(), cl_nitrosz::CbWaitTransform::onEntry(), cl_nav2z::CbNav2ZClientBehaviorBase::onNavigationActionAbort(), cl_nitrosz::CbNav2ZClientBehaviorBase::onNavigationActionAbort(), cl_lifecyclenode::CbActivate::onOrthogonalAllocation(), cl_lifecyclenode::CbCleanup::onOrthogonalAllocation(), cl_lifecyclenode::CbConfigure::onOrthogonalAllocation(), cl_lifecyclenode::CbDeactivate::onOrthogonalAllocation(), cl_lifecyclenode::CbDeactivateOnExit::onOrthogonalAllocation(), cl_lifecyclenode::CbDestroy::onOrthogonalAllocation(), cl_lifecyclenode::CbShutdown::onOrthogonalAllocation(), and smacc2::client_behaviors::CbSequence::onSubNodeAbort().
|
protected |
Definition at line 153 of file smacc_client_async_behavior.cpp.
References postSuccessEventFn_.
Referenced by cl_moveit2z::CbMoveEndEffectorTrajectory::executeJointSpaceTrajectory(), cl_moveit2z::CbMoveJoints::moveJoints(), cl_moveit2z::CbMoveEndEffectorRelative::moveRelative(), cl_moveit2z::CbMoveCartesianRelative::moveRelativeCartesian(), cl_moveit2z::CbMoveEndEffector::moveToAbsolutePose(), smacc2::client_behaviors::CbServiceCall< ServiceType >::onEntry(), smacc2::client_behaviors::CbSequence::onEntry(), smacc2::client_behaviors::CbSleepFor::onEntry(), smacc2::client_behaviors::CbWaitActionServer::onEntry(), smacc2::client_behaviors::CbWaitNode::onEntry(), smacc2::client_behaviors::CbWaitTopic::onEntry(), cl_moveit2z::CbAttachObject::onEntry(), cl_moveit2z::CbDetachObject::onEntry(), cl_nav2z::CbAbortNavigation::onEntry(), cl_nav2z::CbActiveStop::onEntry(), cl_nav2z::CbLoadWaypointsFile::onEntry(), cl_nav2z::CbPositionControlFreeSpace::onEntry(), cl_nav2z::CbPureSpinning::onEntry(), cl_nav2z::CbWaitPose::onEntry(), cl_nav2z::CbWaitTransform::onEntry(), cl_nitrosz::CbAbortNavigation::onEntry(), cl_nitrosz::CbActiveStop::onEntry(), cl_nitrosz::CbLoadWaypointsFile::onEntry(), cl_nitrosz::CbPositionControlFreeSpace::onEntry(), cl_nitrosz::CbPureSpinning::onEntry(), cl_nitrosz::CbWaitPose::onEntry(), cl_nitrosz::CbWaitTransform::onEntry(), cl_nav2z::CbWaitNav2Nodes::onMessageReceived(), cl_nitrosz::CbWaitNav2Nodes::onMessageReceived(), smacc2::client_behaviors::CbWaitTopicMessage< TMessage >::onMessageReceived(), cl_nav2z::CbNav2ZClientBehaviorBase::onNavigationActionSuccess(), cl_nav2z::CbNavigateNextWaypointUntilReached::onNavigationActionSuccess(), cl_nitrosz::CbNav2ZClientBehaviorBase::onNavigationActionSuccess(), cl_nitrosz::CbNavigateNextWaypointUntilReached::onNavigationActionSuccess(), cl_lifecyclenode::CbActivate::onOrthogonalAllocation(), cl_lifecyclenode::CbCleanup::onOrthogonalAllocation(), cl_lifecyclenode::CbConfigure::onOrthogonalAllocation(), cl_lifecyclenode::CbDeactivate::onOrthogonalAllocation(), cl_lifecyclenode::CbDeactivateOnExit::onOrthogonalAllocation(), cl_lifecyclenode::CbDestroy::onOrthogonalAllocation(), and cl_lifecyclenode::CbShutdown::onOrthogonalAllocation().
void smacc2::SmaccAsyncClientBehavior::requestForceFinish | ( | ) |
Definition at line 157 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().
Definition at line 100 of file smacc_client_async_behavior.cpp.
References onEntryThread_, and waitFutureIfNotFinished().
Referenced by executeOnExit().
Definition at line 109 of file smacc_asynchronous_client_behavior.hpp.
Referenced by isShutdownRequested(), and requestForceFinish().
|
private |
Definition at line 98 of file smacc_asynchronous_client_behavior.hpp.
Referenced by executeOnEntry(), and waitOnEntryThread().
|
private |
Definition at line 99 of file smacc_asynchronous_client_behavior.hpp.
Referenced by dispose(), and executeOnExit().
|
private |
Definition at line 107 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onFailure(), and onOrthogonalAllocation().
|
private |
Definition at line 105 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onFinished(), and onOrthogonalAllocation().
|
private |
Definition at line 106 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onOrthogonalAllocation(), and onSuccess().
|
private |
Definition at line 103 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onOrthogonalAllocation(), and postFailureEvent().
|
private |
Definition at line 101 of file smacc_asynchronous_client_behavior.hpp.
Referenced by executeOnEntry(), and onOrthogonalAllocation().
|
private |
Definition at line 102 of file smacc_asynchronous_client_behavior.hpp.
Referenced by onOrthogonalAllocation(), and postSuccessEvent().