SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
lifecyclenode_client
include
lifecyclenode_client
client_behaviors
cb_destroy.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
CbDestroy
:
public
smacc2::SmaccAsyncClientBehavior
29
{
30
public
:
31
CbDestroy
() {}
32
virtual
~CbDestroy
() {}
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_
->onTransitionOnDestroySuccess_.connect([
this
]()
42
{ this->
postSuccessEvent
(); });
43
lifecycleNodeClient_
->onTransitionOnDestroyFailure_.connect([
this
]()
44
{ this->
postFailureEvent
(); });
45
lifecycleNodeClient_
->onTransitionOnDestroyError_.connect([
this
]()
46
{ this->
postFailureEvent
(); });
47
}
48
49
virtual
void
onEntry
()
override
{
lifecycleNodeClient_
->
destroy
(); }
50
51
private
:
52
ClLifecycleNode
*
lifecycleNodeClient_
;
53
};
54
}
// namespace cl_lifecyclenode
cl_lifecyclenode::CbDestroy
Definition:
cb_destroy.hpp:29
cl_lifecyclenode::CbDestroy::CbDestroy
CbDestroy()
Definition:
cb_destroy.hpp:31
cl_lifecyclenode::CbDestroy::lifecycleNodeClient_
ClLifecycleNode * lifecycleNodeClient_
Definition:
cb_destroy.hpp:52
cl_lifecyclenode::CbDestroy::onOrthogonalAllocation
void onOrthogonalAllocation()
Definition:
cb_destroy.hpp:35
cl_lifecyclenode::CbDestroy::onEntry
virtual void onEntry() override
Definition:
cb_destroy.hpp:49
cl_lifecyclenode::CbDestroy::~CbDestroy
virtual ~CbDestroy()
Definition:
cb_destroy.hpp:32
cl_lifecyclenode::ClLifecycleNode
Definition:
lifecyclenode_client.hpp:193
cl_lifecyclenode::ClLifecycleNode::destroy
void destroy()
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