Add override keyword to functions

Signed-off-by: Monika Idzik <monika.idzik@apex.ai>
This commit is contained in:
Monika Idzik 2019-10-18 13:08:43 +02:00
parent ef52953824
commit c024189773
11 changed files with 61 additions and 61 deletions

View file

@ -62,7 +62,7 @@ public:
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
spin(); spin() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
size_t size_t

View file

@ -56,7 +56,7 @@ public:
// It will only be interrupt by a CTRL-C (managed by the global signal handler). // It will only be interrupt by a CTRL-C (managed by the global signal handler).
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
spin(); spin() override;
private: private:
RCLCPP_DISABLE_COPY(SingleThreadedExecutor) RCLCPP_DISABLE_COPY(SingleThreadedExecutor)

View file

@ -52,87 +52,87 @@ public:
RCLCPP_PUBLIC RCLCPP_PUBLIC
const char * const char *
get_name() const; get_name() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
const char * const char *
get_namespace() const; get_namespace() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
const char * const char *
get_fully_qualified_name() const; get_fully_qualified_name() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
rclcpp::Context::SharedPtr rclcpp::Context::SharedPtr
get_context(); get_context() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
rcl_node_t * rcl_node_t *
get_rcl_node_handle(); get_rcl_node_handle() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
const rcl_node_t * const rcl_node_t *
get_rcl_node_handle() const; get_rcl_node_handle() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::shared_ptr<rcl_node_t> std::shared_ptr<rcl_node_t>
get_shared_rcl_node_handle(); get_shared_rcl_node_handle() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::shared_ptr<const rcl_node_t> std::shared_ptr<const rcl_node_t>
get_shared_rcl_node_handle() const; get_shared_rcl_node_handle() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
bool bool
assert_liveliness() const; assert_liveliness() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
rclcpp::callback_group::CallbackGroup::SharedPtr rclcpp::callback_group::CallbackGroup::SharedPtr
create_callback_group(rclcpp::callback_group::CallbackGroupType group_type); create_callback_group(rclcpp::callback_group::CallbackGroupType group_type) override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
rclcpp::callback_group::CallbackGroup::SharedPtr rclcpp::callback_group::CallbackGroup::SharedPtr
get_default_callback_group(); get_default_callback_group() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
bool bool
callback_group_in_node(rclcpp::callback_group::CallbackGroup::SharedPtr group); callback_group_in_node(rclcpp::callback_group::CallbackGroup::SharedPtr group) override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
const std::vector<rclcpp::callback_group::CallbackGroup::WeakPtr> & const std::vector<rclcpp::callback_group::CallbackGroup::WeakPtr> &
get_callback_groups() const; get_callback_groups() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::atomic_bool & std::atomic_bool &
get_associated_with_executor_atomic(); get_associated_with_executor_atomic() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
rcl_guard_condition_t * rcl_guard_condition_t *
get_notify_guard_condition(); get_notify_guard_condition() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::unique_lock<std::recursive_mutex> std::unique_lock<std::recursive_mutex>
acquire_notify_guard_condition_lock() const; acquire_notify_guard_condition_lock() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
bool bool
get_use_intra_process_default() const; get_use_intra_process_default() const override;
private: private:
RCLCPP_DISABLE_COPY(NodeBase) RCLCPP_DISABLE_COPY(NodeBase)

View file

@ -52,7 +52,7 @@ public:
RCLCPP_PUBLIC RCLCPP_PUBLIC
rclcpp::Clock::SharedPtr rclcpp::Clock::SharedPtr
get_clock(); get_clock() override;
private: private:
RCLCPP_DISABLE_COPY(NodeClock) RCLCPP_DISABLE_COPY(NodeClock)

View file

@ -58,64 +58,64 @@ public:
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::map<std::string, std::vector<std::string>> std::map<std::string, std::vector<std::string>>
get_topic_names_and_types(bool no_demangle = false) const; get_topic_names_and_types(bool no_demangle = false) const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::map<std::string, std::vector<std::string>> std::map<std::string, std::vector<std::string>>
get_service_names_and_types() const; get_service_names_and_types() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::vector<std::string> std::vector<std::string>
get_node_names() const; get_node_names() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
std::vector<std::pair<std::string, std::string>> std::vector<std::pair<std::string, std::string>>
get_node_names_and_namespaces() const; get_node_names_and_namespaces() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
size_t size_t
count_publishers(const std::string & topic_name) const; count_publishers(const std::string & topic_name) const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
size_t size_t
count_subscribers(const std::string & topic_name) const; count_subscribers(const std::string & topic_name) const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
const rcl_guard_condition_t * const rcl_guard_condition_t *
get_graph_guard_condition() const; get_graph_guard_condition() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
notify_graph_change(); notify_graph_change() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
notify_shutdown(); notify_shutdown() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
rclcpp::Event::SharedPtr rclcpp::Event::SharedPtr
get_graph_event(); get_graph_event() override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
wait_for_graph_change( wait_for_graph_change(
rclcpp::Event::SharedPtr event, rclcpp::Event::SharedPtr event,
std::chrono::nanoseconds timeout); std::chrono::nanoseconds timeout) override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
size_t size_t
count_graph_users(); count_graph_users() override;
private: private:
RCLCPP_DISABLE_COPY(NodeGraph) RCLCPP_DISABLE_COPY(NodeGraph)

View file

@ -44,12 +44,12 @@ public:
RCLCPP_PUBLIC RCLCPP_PUBLIC
rclcpp::Logger rclcpp::Logger
get_logger() const; get_logger() const override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
const char * const char *
get_logger_name() const; get_logger_name() const override;
private: private:
RCLCPP_DISABLE_COPY(NodeLogging) RCLCPP_DISABLE_COPY(NodeLogging)

View file

@ -46,14 +46,14 @@ public:
void void
add_client( add_client(
rclcpp::ClientBase::SharedPtr client_base_ptr, rclcpp::ClientBase::SharedPtr client_base_ptr,
rclcpp::callback_group::CallbackGroup::SharedPtr group); rclcpp::callback_group::CallbackGroup::SharedPtr group) override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
add_service( add_service(
rclcpp::ServiceBase::SharedPtr service_base_ptr, rclcpp::ServiceBase::SharedPtr service_base_ptr,
rclcpp::callback_group::CallbackGroup::SharedPtr group); rclcpp::callback_group::CallbackGroup::SharedPtr group) override;
private: private:
RCLCPP_DISABLE_COPY(NodeServices) RCLCPP_DISABLE_COPY(NodeServices)

View file

@ -46,7 +46,7 @@ public:
void void
add_timer( add_timer(
rclcpp::TimerBase::SharedPtr timer, rclcpp::TimerBase::SharedPtr timer,
rclcpp::callback_group::CallbackGroup::SharedPtr callback_group); rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) override;
private: private:
RCLCPP_DISABLE_COPY(NodeTimers) RCLCPP_DISABLE_COPY(NodeTimers)

View file

@ -46,14 +46,14 @@ public:
void void
add_waitable( add_waitable(
rclcpp::Waitable::SharedPtr waitable_base_ptr, rclcpp::Waitable::SharedPtr waitable_base_ptr,
rclcpp::callback_group::CallbackGroup::SharedPtr group); rclcpp::callback_group::CallbackGroup::SharedPtr group) override;
RCLCPP_PUBLIC RCLCPP_PUBLIC
void void
remove_waitable( remove_waitable(
rclcpp::Waitable::SharedPtr waitable_ptr, rclcpp::Waitable::SharedPtr waitable_ptr,
rclcpp::callback_group::CallbackGroup::SharedPtr group) noexcept; rclcpp::callback_group::CallbackGroup::SharedPtr group) noexcept override;
private: private:
RCLCPP_DISABLE_COPY(NodeWaitables) RCLCPP_DISABLE_COPY(NodeWaitables)

View file

@ -213,12 +213,12 @@ public:
{ {
} }
std::shared_ptr<void> create_request() std::shared_ptr<void> create_request() override
{ {
return std::shared_ptr<void>(new typename ServiceT::Request()); return std::shared_ptr<void>(new typename ServiceT::Request());
} }
std::shared_ptr<rmw_request_id_t> create_request_header() std::shared_ptr<rmw_request_id_t> create_request_header() override
{ {
// TODO(wjwwood): This should probably use rmw_request_id's allocator. // TODO(wjwwood): This should probably use rmw_request_id's allocator.
// (since it is a C type) // (since it is a C type)
@ -227,7 +227,7 @@ public:
void handle_request( void handle_request(
std::shared_ptr<rmw_request_id_t> request_header, std::shared_ptr<rmw_request_id_t> request_header,
std::shared_ptr<void> request) std::shared_ptr<void> request) override
{ {
auto typed_request = std::static_pointer_cast<typename ServiceT::Request>(request); auto typed_request = std::static_pointer_cast<typename ServiceT::Request>(request);
auto response = std::shared_ptr<typename ServiceT::Response>(new typename ServiceT::Response); auto response = std::shared_ptr<typename ServiceT::Response>(new typename ServiceT::Response);

View file

@ -61,7 +61,7 @@ public:
allocator_ = std::make_shared<VoidAlloc>(); allocator_ = std::make_shared<VoidAlloc>();
} }
void add_guard_condition(const rcl_guard_condition_t * guard_condition) void add_guard_condition(const rcl_guard_condition_t * guard_condition) override
{ {
for (const auto & existing_guard_condition : guard_conditions_) { for (const auto & existing_guard_condition : guard_conditions_) {
if (existing_guard_condition == guard_condition) { if (existing_guard_condition == guard_condition) {
@ -71,7 +71,7 @@ public:
guard_conditions_.push_back(guard_condition); guard_conditions_.push_back(guard_condition);
} }
void remove_guard_condition(const rcl_guard_condition_t * guard_condition) void remove_guard_condition(const rcl_guard_condition_t * guard_condition) override
{ {
for (auto it = guard_conditions_.begin(); it != guard_conditions_.end(); ++it) { for (auto it = guard_conditions_.begin(); it != guard_conditions_.end(); ++it) {
if (*it == guard_condition) { if (*it == guard_condition) {
@ -81,7 +81,7 @@ public:
} }
} }
void clear_handles() void clear_handles() override
{ {
subscription_handles_.clear(); subscription_handles_.clear();
service_handles_.clear(); service_handles_.clear();
@ -90,7 +90,7 @@ public:
waitable_handles_.clear(); waitable_handles_.clear();
} }
void remove_null_handles(rcl_wait_set_t * wait_set) void remove_null_handles(rcl_wait_set_t * wait_set) override
{ {
// TODO(jacobperron): Check if wait set sizes are what we expect them to be? // TODO(jacobperron): Check if wait set sizes are what we expect them to be?
// e.g. wait_set->size_of_clients == client_handles_.size() // e.g. wait_set->size_of_clients == client_handles_.size()
@ -150,7 +150,7 @@ public:
); );
} }
bool collect_entities(const WeakNodeList & weak_nodes) bool collect_entities(const WeakNodeList & weak_nodes) override
{ {
bool has_invalid_weak_nodes = false; bool has_invalid_weak_nodes = false;
for (auto & weak_node : weak_nodes) { for (auto & weak_node : weak_nodes) {
@ -191,7 +191,7 @@ public:
return has_invalid_weak_nodes; return has_invalid_weak_nodes;
} }
bool add_handles_to_wait_set(rcl_wait_set_t * wait_set) bool add_handles_to_wait_set(rcl_wait_set_t * wait_set) override
{ {
for (auto subscription : subscription_handles_) { for (auto subscription : subscription_handles_) {
if (rcl_wait_set_add_subscription(wait_set, subscription.get(), NULL) != RCL_RET_OK) { if (rcl_wait_set_add_subscription(wait_set, subscription.get(), NULL) != RCL_RET_OK) {
@ -253,7 +253,7 @@ public:
void void
get_next_subscription( get_next_subscription(
executor::AnyExecutable & any_exec, executor::AnyExecutable & any_exec,
const WeakNodeList & weak_nodes) const WeakNodeList & weak_nodes) override
{ {
auto it = subscription_handles_.begin(); auto it = subscription_handles_.begin();
while (it != subscription_handles_.end()) { while (it != subscription_handles_.end()) {
@ -288,7 +288,7 @@ public:
void void
get_next_service( get_next_service(
executor::AnyExecutable & any_exec, executor::AnyExecutable & any_exec,
const WeakNodeList & weak_nodes) const WeakNodeList & weak_nodes) override
{ {
auto it = service_handles_.begin(); auto it = service_handles_.begin();
while (it != service_handles_.end()) { while (it != service_handles_.end()) {
@ -321,7 +321,7 @@ public:
} }
void void
get_next_client(executor::AnyExecutable & any_exec, const WeakNodeList & weak_nodes) get_next_client(executor::AnyExecutable & any_exec, const WeakNodeList & weak_nodes) override
{ {
auto it = client_handles_.begin(); auto it = client_handles_.begin();
while (it != client_handles_.end()) { while (it != client_handles_.end()) {
@ -356,7 +356,7 @@ public:
void void
get_next_timer( get_next_timer(
executor::AnyExecutable & any_exec, executor::AnyExecutable & any_exec,
const WeakNodeList & weak_nodes) const WeakNodeList & weak_nodes) override
{ {
auto it = timer_handles_.begin(); auto it = timer_handles_.begin();
while (it != timer_handles_.end()) { while (it != timer_handles_.end()) {
@ -389,7 +389,7 @@ public:
} }
void void
get_next_waitable(executor::AnyExecutable & any_exec, const WeakNodeList & weak_nodes) get_next_waitable(executor::AnyExecutable & any_exec, const WeakNodeList & weak_nodes) override
{ {
auto it = waitable_handles_.begin(); auto it = waitable_handles_.begin();
while (it != waitable_handles_.end()) { while (it != waitable_handles_.end()) {
@ -421,12 +421,12 @@ public:
} }
} }
rcl_allocator_t get_allocator() rcl_allocator_t get_allocator() override
{ {
return rclcpp::allocator::get_rcl_allocator<void *, VoidAlloc>(*allocator_.get()); return rclcpp::allocator::get_rcl_allocator<void *, VoidAlloc>(*allocator_.get());
} }
size_t number_of_ready_subscriptions() const size_t number_of_ready_subscriptions() const override
{ {
size_t number_of_subscriptions = subscription_handles_.size(); size_t number_of_subscriptions = subscription_handles_.size();
for (auto waitable : waitable_handles_) { for (auto waitable : waitable_handles_) {
@ -435,7 +435,7 @@ public:
return number_of_subscriptions; return number_of_subscriptions;
} }
size_t number_of_ready_services() const size_t number_of_ready_services() const override
{ {
size_t number_of_services = service_handles_.size(); size_t number_of_services = service_handles_.size();
for (auto waitable : waitable_handles_) { for (auto waitable : waitable_handles_) {
@ -444,7 +444,7 @@ public:
return number_of_services; return number_of_services;
} }
size_t number_of_ready_events() const size_t number_of_ready_events() const override
{ {
size_t number_of_events = 0; size_t number_of_events = 0;
for (auto waitable : waitable_handles_) { for (auto waitable : waitable_handles_) {
@ -453,7 +453,7 @@ public:
return number_of_events; return number_of_events;
} }
size_t number_of_ready_clients() const size_t number_of_ready_clients() const override
{ {
size_t number_of_clients = client_handles_.size(); size_t number_of_clients = client_handles_.size();
for (auto waitable : waitable_handles_) { for (auto waitable : waitable_handles_) {
@ -462,7 +462,7 @@ public:
return number_of_clients; return number_of_clients;
} }
size_t number_of_guard_conditions() const size_t number_of_guard_conditions() const override
{ {
size_t number_of_guard_conditions = guard_conditions_.size(); size_t number_of_guard_conditions = guard_conditions_.size();
for (auto waitable : waitable_handles_) { for (auto waitable : waitable_handles_) {
@ -471,7 +471,7 @@ public:
return number_of_guard_conditions; return number_of_guard_conditions;
} }
size_t number_of_ready_timers() const size_t number_of_ready_timers() const override
{ {
size_t number_of_timers = timer_handles_.size(); size_t number_of_timers = timer_handles_.size();
for (auto waitable : waitable_handles_) { for (auto waitable : waitable_handles_) {
@ -480,7 +480,7 @@ public:
return number_of_timers; return number_of_timers;
} }
size_t number_of_waitables() const size_t number_of_waitables() const override
{ {
return waitable_handles_.size(); return waitable_handles_.size();
} }