SMACC2
Loading...
Searching...
No Matches
smacc2
include
smacc2
client_behaviors
cb_wait_action_server.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 <
smacc2/client_bases/smacc_action_client_base.hpp
>
24
#include <
smacc2/client_core_components/cp_action_client.hpp
>
25
#include <
smacc2/smacc_asynchronous_client_behavior.hpp
>
26
27
namespace
smacc2
28
{
29
namespace
client_behaviors
30
{
31
using namespace
smacc2::client_bases
;
32
using namespace
smacc2::client_core_components
;
33
34
// waits the action server is available in the current orthogonal
35
class
CbWaitActionServer
:
public
smacc2::SmaccAsyncClientBehavior
36
{
37
public
:
38
CbWaitActionServer
(std::chrono::milliseconds timeout);
39
virtual
~CbWaitActionServer
();
40
41
template
<
typename
TOrthogonal,
typename
TSourceObject>
42
void
onOrthogonalAllocation
()
43
{
44
SmaccAsyncClientBehavior::onOrthogonalAllocation<TOrthogonal, TSourceObject>
();
45
46
// requires an action client
47
this->
requiresClient
(
client_
);
48
}
49
50
void
onEntry
()
override
;
51
52
private
:
53
ISmaccActionClient
*
client_
;
54
55
std::chrono::milliseconds
timeout_
;
56
};
57
}
// namespace client_behaviors
58
}
// namespace smacc2
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::onOrthogonalAllocation
void onOrthogonalAllocation()
Definition
smacc_asynchronous_client_behavior_impl.hpp:34
smacc2::client_bases::ISmaccActionClient
Definition
smacc_action_client.hpp:35
smacc2::client_behaviors::CbWaitActionServer
Definition
cb_wait_action_server.hpp:36
smacc2::client_behaviors::CbWaitActionServer::client_
ISmaccActionClient * client_
Definition
cb_wait_action_server.hpp:53
smacc2::client_behaviors::CbWaitActionServer::onEntry
void onEntry() override
Definition
cb_wait_action_server.cpp:31
smacc2::client_behaviors::CbWaitActionServer::~CbWaitActionServer
virtual ~CbWaitActionServer()
Definition
cb_wait_action_server.cpp:29
smacc2::client_behaviors::CbWaitActionServer::timeout_
std::chrono::milliseconds timeout_
Definition
cb_wait_action_server.hpp:55
smacc2::client_behaviors::CbWaitActionServer::CbWaitActionServer
CbWaitActionServer(std::chrono::milliseconds timeout)
Definition
cb_wait_action_server.cpp:27
smacc2::client_behaviors::CbWaitActionServer::onOrthogonalAllocation
void onOrthogonalAllocation()
Definition
cb_wait_action_server.hpp:42
cp_action_client.hpp
smacc2::client_bases
Definition
smacc_action_client.hpp:31
smacc2::client_core_components
Definition
cp_action_client.hpp:32
smacc2
Definition
callback_counter_semaphore.hpp:30
smacc_action_client_base.hpp
smacc_asynchronous_client_behavior.hpp
Generated by
1.12.0