-
Notifications
You must be signed in to change notification settings - Fork 525
Expand file tree
/
Copy pathexecutable_list.cpp
More file actions
84 lines (69 loc) · 1.98 KB
/
executable_list.cpp
File metadata and controls
84 lines (69 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Copyright 2019 Nobleo Technology
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <utility>
#include "rclcpp/experimental/executable_list.hpp"
using rclcpp::experimental::ExecutableList;
ExecutableList::ExecutableList()
: number_of_subscriptions(0),
number_of_timers(0),
number_of_services(0),
number_of_clients(0),
number_of_waitables(0)
{}
ExecutableList::~ExecutableList()
{}
void
ExecutableList::clear()
{
this->timer.clear();
this->number_of_timers = 0;
this->subscription.clear();
this->number_of_subscriptions = 0;
this->service.clear();
this->number_of_services = 0;
this->client.clear();
this->number_of_clients = 0;
this->waitable.clear();
this->number_of_waitables = 0;
}
void
ExecutableList::add_subscription(rclcpp::SubscriptionBase::SharedPtr subscription)
{
this->subscription.push_back(std::move(subscription));
this->number_of_subscriptions++;
}
void
ExecutableList::add_timer(rclcpp::TimerBase::SharedPtr timer)
{
this->timer.push_back(std::move(timer));
this->number_of_timers++;
}
void
ExecutableList::add_service(rclcpp::ServiceBase::SharedPtr service)
{
this->service.push_back(std::move(service));
this->number_of_services++;
}
void
ExecutableList::add_client(rclcpp::ClientBase::SharedPtr client)
{
this->client.push_back(std::move(client));
this->number_of_clients++;
}
void
ExecutableList::add_waitable(rclcpp::Waitable::SharedPtr waitable)
{
this->waitable.push_back(std::move(waitable));
this->number_of_waitables++;
}