SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
lifecyclenode_client
include
lifecyclenode_client
client_behaviors
cb_deactivate_on_exit.hpp
Go to the documentation of this file.
1
// Copyright 2021 RobosoftAI Inc.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
/*****************************************************************************************************************
16
*
17
* Authors: Pablo Inigo Blasco, Brett Aldrich
18
*
19
******************************************************************************************************************/
20
21
#pragma once
22
23
#include <
lifecyclenode_client/lifecyclenode_client.hpp
>
24
#include <
smacc2/smacc_asynchronous_client_behavior.hpp
>
25
26
namespace
cl_lifecyclenode
27
{
28
class
CbDeactivateOnExit
:
public
smacc2::SmaccAsyncClientBehavior
29
{
30
public
:
31
CbDeactivateOnExit
() {}
32
virtual
~CbDeactivateOnExit
() {}
33
34
template
<
typename
TOrthogonal,
typename
TSourceObject>
35
void
onOrthogonalAllocation
()
36
{
37
smacc2::SmaccAsyncClientBehavior::onOrthogonalAllocation<TOrthogonal, TSourceObject>();
38
39
this->
requiresClient
(this->
lifecycleNodeClient_
);
40
41
lifecycleNodeClient_
->
onTransitionOnDeactivateSuccess_
.connect([
this
]()
42
{ this->
postSuccessEvent
(); });
43
lifecycleNodeClient_
->
onTransitionOnDeactivateFailure_
.connect([
this
]()
44
{ this->
postFailureEvent
(); });
45
lifecycleNodeClient_
->
onTransitionOnDeactivateError_
.connect([
this
]()
46
{ this->
postFailureEvent
(); });
47
}
48
49
virtual
void
onExit
()
override
{
lifecycleNodeClient_
->
deactivate
(); }
50
51
private
:
52
ClLifecycleNode
*
lifecycleNodeClient_
;
53
};
54
}
// namespace cl_lifecyclenode
cl_lifecyclenode::CbDeactivateOnExit
Definition
cb_deactivate_on_exit.hpp:29
cl_lifecyclenode::CbDeactivateOnExit::onExit
virtual void onExit() override
Definition
cb_deactivate_on_exit.hpp:49
cl_lifecyclenode::CbDeactivateOnExit::~CbDeactivateOnExit
virtual ~CbDeactivateOnExit()
Definition
cb_deactivate_on_exit.hpp:32
cl_lifecyclenode::CbDeactivateOnExit::lifecycleNodeClient_
ClLifecycleNode * lifecycleNodeClient_
Definition
cb_deactivate_on_exit.hpp:52
cl_lifecyclenode::CbDeactivateOnExit::onOrthogonalAllocation
void onOrthogonalAllocation()
Definition
cb_deactivate_on_exit.hpp:35
cl_lifecyclenode::CbDeactivateOnExit::CbDeactivateOnExit
CbDeactivateOnExit()
Definition
cb_deactivate_on_exit.hpp:31
cl_lifecyclenode::ClLifecycleNode
Definition
lifecyclenode_client.hpp:193
cl_lifecyclenode::ClLifecycleNode::onTransitionOnDeactivateFailure_
boost::signals2::signal< void()> onTransitionOnDeactivateFailure_
Definition
lifecyclenode_client.hpp:249
cl_lifecyclenode::ClLifecycleNode::onTransitionOnDeactivateSuccess_
boost::signals2::signal< void()> onTransitionOnDeactivateSuccess_
Definition
lifecyclenode_client.hpp:248
cl_lifecyclenode::ClLifecycleNode::deactivate
void deactivate()
Definition
lifecyclenode_client.cpp:55
cl_lifecyclenode::ClLifecycleNode::onTransitionOnDeactivateError_
boost::signals2::signal< void()> onTransitionOnDeactivateError_
Definition
lifecyclenode_client.hpp:250
smacc2::ISmaccClientBehavior::requiresClient
void requiresClient(SmaccClientType *&storage)
Definition
smacc_client_behavior_impl.hpp:67
smacc2::SmaccAsyncClientBehavior
Definition
smacc_asynchronous_client_behavior.hpp:56
smacc2::SmaccAsyncClientBehavior::postSuccessEvent
void postSuccessEvent()
Definition
smacc_client_async_behavior.cpp:153
smacc2::SmaccAsyncClientBehavior::postFailureEvent
void postFailureEvent()
Definition
smacc_client_async_behavior.cpp:155
lifecyclenode_client.hpp
cl_lifecyclenode
Definition
cb_activate.hpp:27
smacc_asynchronous_client_behavior.hpp
Generated by
1.9.8