roboligo
Toggle main menu visibility
Loading...
Searching...
No Matches
roboligo_common
include
roboligo_common
types
Linker.hpp
Go to the documentation of this file.
1
// Copyright 2026 Juan S. Cely G.
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
// https://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
#ifndef ROBOLIGO_COMMON_TYPES__LINK_HPP_
16
#define ROBOLIGO_COMMON_TYPES__LINK_HPP_
17
18
#include <string>
19
20
#include "rclcpp/rclcpp.hpp"
21
22
#include "
roboligo_common/types/Interface.hpp
"
23
24
namespace
roboligo
25
{
32
enum class
Sense
33
{
34
INPUT
,
35
OUTPUT
36
};
37
45
class
Linker
46
{
47
public
:
51
Linker
(){}
52
56
virtual
~Linker
() =
default
;
57
62
interfaces::modes
get_mode
();
63
68
void
set_mode
(
interfaces::modes
new_mode);
69
74
std::string
get_name
();
75
80
void
set_name
(std::string new_name);
81
86
std::string
get_topic
();
87
92
void
set_topic
(std::string new_name);
93
98
void
set_service
(std::string new_name);
99
105
void
set_interface
(std::string name_, std::string topic_name_);
106
111
bool
is_available
(
void
);
112
117
bool
is_configured
(
void
);
118
123
void
set_available
(
bool
new_state);
124
129
void
set_configured
(
bool
new_state);
130
131
std::string
name
{
"linker"
};
132
133
std::string
topic_name
{
"/interface"
};
134
135
std::shared_ptr<interfaces::Interface>
interface
;
136
137
protected
:
138
interfaces::modes
mode_
;
139
140
bool
available_
{
false
};
141
142
bool
configured_
{
false
};
143
};
144
}
// namespace roboligo
145
146
#endif
// ROBOLIGO_COMMON_TYPES__LINK_HPP_
Interface.hpp
roboligo::Linker::topic_name
std::string topic_name
Associated topic name.
Definition
Linker.hpp:133
roboligo::Linker::set_interface
void set_interface(std::string name_, std::string topic_name_)
Configures the interface with name and topic.
Definition
Linker.cpp:70
roboligo::Linker::configured_
bool configured_
Configuration state flag.
Definition
Linker.hpp:142
roboligo::Linker::get_mode
interfaces::modes get_mode()
Gets the current mode of the linker.
Definition
Linker.cpp:28
roboligo::Linker::Linker
Linker()
Default constructor.
Definition
Linker.hpp:51
roboligo::Linker::~Linker
virtual ~Linker()=default
Virtual destructor.
roboligo::Linker::get_name
std::string get_name()
Gets the linker name.
Definition
Linker.cpp:40
roboligo::Linker::get_topic
std::string get_topic()
Gets the topic name.
Definition
Linker.cpp:52
roboligo::Linker::name
std::string name
Linker identifier name.
Definition
Linker.hpp:131
roboligo::Linker::is_available
bool is_available(void)
Checks if the linker is available.
Definition
Linker.cpp:77
roboligo::Linker::set_configured
void set_configured(bool new_state)
Sets the configuration state.
Definition
Linker.cpp:89
roboligo::Linker::set_available
void set_available(bool new_state)
Sets the availability state.
Definition
Linker.cpp:83
roboligo::Linker::available_
bool available_
Availability flag.
Definition
Linker.hpp:140
roboligo::Linker::set_service
void set_service(std::string new_name)
Sets the service name.
Definition
Linker.cpp:64
roboligo::Linker::interface
std::shared_ptr< interfaces::Interface > interface
Shared pointer to the interface object.
Definition
Linker.hpp:135
roboligo::Linker::set_mode
void set_mode(interfaces::modes new_mode)
Sets the linker mode.
Definition
Linker.cpp:34
roboligo::Linker::set_topic
void set_topic(std::string new_name)
Sets the topic name.
Definition
Linker.cpp:58
roboligo::Linker::is_configured
bool is_configured(void)
Checks if the linker is configured.
Definition
Linker.cpp:95
roboligo::Linker::mode_
interfaces::modes mode_
Current operating mode.
Definition
Linker.hpp:138
roboligo::Linker::set_name
void set_name(std::string new_name)
Sets the linker name.
Definition
Linker.cpp:46
roboligo::interfaces::modes
modes
Enumeration for interface operational modes.
Definition
Interface.hpp:51
roboligo
Definition
ClassificationBase.hpp:28
roboligo::Sense
Sense
Defines the direction of a linker connection.
Definition
Linker.hpp:33
roboligo::Sense::OUTPUT
@ OUTPUT
Definition
Linker.hpp:35
roboligo::Sense::INPUT
@ INPUT
Definition
Linker.hpp:34
Generated by
1.17.0