roboligo
Loading...
Searching...
No Matches
Interface.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__INTERFACE_HPP_
16#define ROBOLIGO_COMMON_TYPES__INTERFACE_HPP_
17
18#include <string>
19#include <iostream>
20
21#include "rclcpp/rclcpp.hpp"
22
23namespace roboligo
24{
29 namespace interfaces
30 {
37 enum class types
38 {
41 };
42
50 enum class modes
51 {
55 };
56
64 struct type {
67 std::string value = "";
68 };
69
77 class Interface {
78 public:
85 Interface(std::string name, modes mode, std::string value);
86
87 virtual ~Interface() = default;
88
93 std::string get_name(void);
94
99 types get_type(void);
100
105 modes get_mode(void);
106
111 std::string get_value(void);
112
117 void set_value(std::string value);
118
123 void show();
124
125 private:
126 std::string name_{};
127 type type_{};
128 modes mode_{};
129 };
130
131 } // namespace interfaces
132} // namespace roboligo
133
134#endif // ROBOLIGO_COMMON_TYPES__INTERFACE_HPP_
modes get_mode(void)
Retrieves the interface mode.
Definition Interface.cpp:64
std::string get_name(void)
Retrieves the interface name.
Definition Interface.cpp:52
types get_type(void)
Retrieves the interface type.
Definition Interface.cpp:58
std::string get_value(void)
Retrieves the current value of the interface.
Definition Interface.cpp:70
void set_value(std::string value)
Updates the interface value.
Definition Interface.cpp:76
Interface(std::string name, modes mode, std::string value)
Constructs an Interface with the specified parameters.
Definition Interface.cpp:38
void show()
Displays the interface information. Outputs current interface properties to the standard output.
Definition Interface.cpp:82
Namespace containing interface management classes and types.
types
Enumeration for interface communication types.
Definition Interface.hpp:38
@ MSG
Definition Interface.hpp:39
@ SRV
Definition Interface.hpp:40
modes
Enumeration for interface operational modes.
Definition Interface.hpp:51
@ PUBLISHER
Definition Interface.hpp:52
@ CALLER
Definition Interface.hpp:54
@ SUBSCRIBER
Definition Interface.hpp:53
Definition ClassificationBase.hpp:28
Defines interface configuration structure. @member types type The communication type (MSG or SRV) @me...
Definition Interface.hpp:64
std::string value
Interface value as topic name (i. e. /prueba).
Definition Interface.hpp:67
types type
Type MSG or SRV.
Definition Interface.hpp:65
modes mode
Interface mode PUBLISHER, SUBSCRIBER, CALLER.
Definition Interface.hpp:66