SMACC
Loading...
Searching...
No Matches
smacc_asynchronous_client_behavior_impl.h
Go to the documentation of this file.
1/*****************************************************************************************************************
2 * ReelRobotix Inc. - Software License Agreement Copyright (c) 2018
3 * Authors: Pablo Inigo Blasco, Brett Aldrich
4 *
5 ******************************************************************************************************************/
6
7#pragma once
10
11namespace smacc
12{
13
14 template <typename TOrthogonal, typename TSourceObject>
16 {
17 postFinishEventFn_ = [=] {
18 this->onFinished_();
19 this->postEvent<EvCbFinished<TSourceObject, TOrthogonal>>();
20 };
21
23 this->onSuccess_();
24 this->postEvent<EvCbSuccess<TSourceObject, TOrthogonal>>();
25 };
26
28 this->onFailure_();
29 this->postEvent<EvCbFailure<TSourceObject, TOrthogonal>>();
30 };
31 }
32
33 template <typename TCallback, typename T>
34 boost::signals2::connection SmaccAsyncClientBehavior::onSuccess(TCallback callback, T *object)
35 {
36 return this->getStateMachine()->createSignalConnection(onSuccess_, callback, object);
37 }
38
39 template <typename TCallback, typename T>
40 boost::signals2::connection SmaccAsyncClientBehavior::onFinished(TCallback callback, T *object)
41 {
42 return this->getStateMachine()->createSignalConnection(onFinished_, callback, object);
43 }
44
45 template <typename TCallback, typename T>
46 boost::signals2::connection SmaccAsyncClientBehavior::onFailure(TCallback callback, T *object)
47 {
48 return this->getStateMachine()->createSignalConnection(onFailure_, callback, object);
49 }
50}
ISmaccStateMachine * getStateMachine()
boost::signals2::connection createSignalConnection(TSmaccSignal &signal, TMemberFunctionPrototype callback, TSmaccObjectType *object)
boost::signals2::connection onFailure(TCallback callback, T *object)
boost::signals2::connection onSuccess(TCallback callback, T *object)
boost::signals2::connection onFinished(TCallback callback, T *object)