SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
lifecyclenode_client
include
lifecyclenode_client
client_behaviors
cb_shutdown.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
CbShutdown
:
public
smacc2::SmaccAsyncClientBehavior
29
{
30
public
:
31
CbShutdown
() {}
32
virtual
~CbShutdown
() {}
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_
->
onTransitionOnShutdownSuccess_
.connect([
this
]()
42
{ this->
postSuccessEvent
(); });
43
lifecycleNodeClient_
->
onTransitionOnShutdownFailure_
.connect([
this
]()
44
{ this->
postFailureEvent
(); });
45
lifecycleNodeClient_
->
onTransitionOnShutdownError_
.connect([
this
]()
46
{ this->
postFailureEvent
(); });
47
}
48
49
virtual
void
onEntry
()
override
{
lifecycleNodeClient_
->
shutdown
(); }
50
51
private
:
52
ClLifecycleNode
*
lifecycleNodeClient_
;
53
};
54
}
// namespace cl_lifecyclenode
cl_lifecyclenode::CbShutdown
Definition:
cb_shutdown.hpp:29
cl_lifecyclenode::CbShutdown::CbShutdown
CbShutdown()
Definition:
cb_shutdown.hpp:31
cl_lifecyclenode::CbShutdown::lifecycleNodeClient_
ClLifecycleNode * lifecycleNodeClient_
Definition:
cb_shutdown.hpp:52
cl_lifecyclenode::CbShutdown::onEntry
virtual void onEntry() override
Definition:
cb_shutdown.hpp:49
cl_lifecyclenode::CbShutdown::onOrthogonalAllocation
void onOrthogonalAllocation()
Definition:
cb_shutdown.hpp:35
cl_lifecyclenode::CbShutdown::~CbShutdown
virtual ~CbShutdown()
Definition:
cb_shutdown.hpp:32
cl_lifecyclenode::ClLifecycleNode
Definition:
lifecyclenode_client.hpp:193
cl_lifecyclenode::ClLifecycleNode::onTransitionOnShutdownSuccess_
boost::signals2::signal< void()> onTransitionOnShutdownSuccess_
Definition:
lifecyclenode_client.hpp:256
cl_lifecyclenode::ClLifecycleNode::onTransitionOnShutdownError_
boost::signals2::signal< void()> onTransitionOnShutdownError_
Definition:
lifecyclenode_client.hpp:258
cl_lifecyclenode::ClLifecycleNode::shutdown
void shutdown()
Definition:
lifecyclenode_client.cpp:70
cl_lifecyclenode::ClLifecycleNode::onTransitionOnShutdownFailure_
boost::signals2::signal< void()> onTransitionOnShutdownFailure_
Definition:
lifecyclenode_client.hpp:257
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