SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
lifecyclenode_client
include
lifecyclenode_client
client_behaviors
cb_cleanup.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
CbCleanup
:
public
smacc2::SmaccAsyncClientBehavior
29
{
30
public
:
31
CbCleanup
() {}
32
virtual
~CbCleanup
() {}
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_
->
onTransitionOnCleanupSuccess_
.connect([
this
]()
42
{ this->
postSuccessEvent
(); });
43
lifecycleNodeClient_
->
onTransitionOnCleanupFailure_
.connect([
this
]()
44
{ this->
postFailureEvent
(); });
45
lifecycleNodeClient_
->
onTransitionOnCleanupError_
.connect([
this
]()
46
{ this->
postFailureEvent
(); });
47
}
48
49
virtual
void
onEntry
()
override
{
lifecycleNodeClient_
->
cleanup
(); }
50
51
private
:
52
ClLifecycleNode
*
lifecycleNodeClient_
;
53
};
54
}
// namespace cl_lifecyclenode
cl_lifecyclenode::CbCleanup
Definition:
cb_cleanup.hpp:29
cl_lifecyclenode::CbCleanup::onEntry
virtual void onEntry() override
Definition:
cb_cleanup.hpp:49
cl_lifecyclenode::CbCleanup::~CbCleanup
virtual ~CbCleanup()
Definition:
cb_cleanup.hpp:32
cl_lifecyclenode::CbCleanup::CbCleanup
CbCleanup()
Definition:
cb_cleanup.hpp:31
cl_lifecyclenode::CbCleanup::lifecycleNodeClient_
ClLifecycleNode * lifecycleNodeClient_
Definition:
cb_cleanup.hpp:52
cl_lifecyclenode::CbCleanup::onOrthogonalAllocation
void onOrthogonalAllocation()
Definition:
cb_cleanup.hpp:35
cl_lifecyclenode::ClLifecycleNode
Definition:
lifecyclenode_client.hpp:193
cl_lifecyclenode::ClLifecycleNode::cleanup
void cleanup()
Definition:
lifecyclenode_client.cpp:65
cl_lifecyclenode::ClLifecycleNode::onTransitionOnCleanupSuccess_
boost::signals2::signal< void()> onTransitionOnCleanupSuccess_
Definition:
lifecyclenode_client.hpp:252
cl_lifecyclenode::ClLifecycleNode::onTransitionOnCleanupFailure_
boost::signals2::signal< void()> onTransitionOnCleanupFailure_
Definition:
lifecyclenode_client.hpp:253
cl_lifecyclenode::ClLifecycleNode::onTransitionOnCleanupError_
boost::signals2::signal< void()> onTransitionOnCleanupError_
Definition:
lifecyclenode_client.hpp:254
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:151
smacc2::SmaccAsyncClientBehavior::postFailureEvent
void postFailureEvent()
Definition:
smacc_client_async_behavior.cpp:153
lifecyclenode_client.hpp
cl_lifecyclenode
Definition:
cb_activate.hpp:27
smacc_asynchronous_client_behavior.hpp
Generated by
1.9.5