roboligo
Loading...
Searching...
No Matches
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
23
24namespace roboligo
25{
32 enum class Sense
33 {
36 };
37
45 class Linker
46 {
47 public:
52
56 virtual ~Linker() = default;
57
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:
139
140 bool available_{false};
141
142 bool configured_{false};
143 };
144} // namespace roboligo
145
146#endif // ROBOLIGO_COMMON_TYPES__LINK_HPP_
std::string topic_name
Associated topic name.
Definition Linker.hpp:133
void set_interface(std::string name_, std::string topic_name_)
Configures the interface with name and topic.
Definition Linker.cpp:70
bool configured_
Configuration state flag.
Definition Linker.hpp:142
interfaces::modes get_mode()
Gets the current mode of the linker.
Definition Linker.cpp:28
Linker()
Default constructor.
Definition Linker.hpp:51
virtual ~Linker()=default
Virtual destructor.
std::string get_name()
Gets the linker name.
Definition Linker.cpp:40
std::string get_topic()
Gets the topic name.
Definition Linker.cpp:52
std::string name
Linker identifier name.
Definition Linker.hpp:131
bool is_available(void)
Checks if the linker is available.
Definition Linker.cpp:77
void set_configured(bool new_state)
Sets the configuration state.
Definition Linker.cpp:89
void set_available(bool new_state)
Sets the availability state.
Definition Linker.cpp:83
bool available_
Availability flag.
Definition Linker.hpp:140
void set_service(std::string new_name)
Sets the service name.
Definition Linker.cpp:64
std::shared_ptr< interfaces::Interface > interface
Shared pointer to the interface object.
Definition Linker.hpp:135
void set_mode(interfaces::modes new_mode)
Sets the linker mode.
Definition Linker.cpp:34
void set_topic(std::string new_name)
Sets the topic name.
Definition Linker.cpp:58
bool is_configured(void)
Checks if the linker is configured.
Definition Linker.cpp:95
interfaces::modes mode_
Current operating mode.
Definition Linker.hpp:138
void set_name(std::string new_name)
Sets the linker name.
Definition Linker.cpp:46
modes
Enumeration for interface operational modes.
Definition Interface.hpp:51
Definition ClassificationBase.hpp:28
Sense
Defines the direction of a linker connection.
Definition Linker.hpp:33
@ OUTPUT
Definition Linker.hpp:35
@ INPUT
Definition Linker.hpp:34