RMW desert 1.0
Loading...
Searching...
No Matches
demangle.h
Go to the documentation of this file.
1/****************************************************************************
2 * Copyright (C) 2024 Davide Costa *
3 * *
4 * This file is part of RMW desert. *
5 * *
6 * RMW desert is free software: you can redistribute it and/or modify it *
7 * under the terms of the GNU General Public License as published by the *
8 * Free Software Foundation, either version 3 of the License, or any *
9 * later version. *
10 * *
11 * RMW desert is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with RMW desert. If not, see <http://www.gnu.org/licenses/>. *
18 ****************************************************************************/
19
34#ifndef DEMANGLE_H_
35#define DEMANGLE_H_
36
39#include <algorithm>
40#include <string>
41#include <vector>
42
43#include "rcpputils/find_and_replace.hpp"
44#include "rcutils/logging_macros.h"
45#include "rcutils/types.h"
46
49#include "CBorStream.h"
50
61namespace Discovery
62{
63
64 char * integer_to_string(int x);
65
66 const char * const ros_topic_publisher_prefix = integer_to_string(PUBLISHER_TYPE);
67 const char * const ros_topic_subscriber_prefix = integer_to_string(SUBSCRIBER_TYPE);
68 const char * const ros_service_requester_prefix = integer_to_string(CLIENT_TYPE);
69 const char * const ros_service_response_prefix = integer_to_string(SERVICE_TYPE);
70
80 std::string resolve_prefix(const std::string & name, const std::string & prefix);
81
90 std::string demangle_publisher_from_topic(const std::string & topic_name);
91
100 std::string demangle_subscriber_from_topic(const std::string & topic_name);
101
110 std::string demangle_topic(const std::string & topic_name);
111
120 std::string demangle_service_request_from_topic(const std::string & topic_name);
121
130 std::string demangle_service_reply_from_topic(const std::string & topic_name);
131
140 std::string demangle_service_from_topic(const std::string & topic_name);
141
150 std::string identity_demangle(const std::string & name);
151
152 using DemangleFunction = std::string (*)(const std::string &);
153
154}
155
156#endif // DEMANGLE_H_
Classes used to convert data types into a CBOR encoded stream.
Namespace containing discovery functions.
std::string demangle_subscriber_from_topic(const std::string &topic_name)
Demangle a subscriber.
Definition demangle.cpp:27
std::string demangle_service_request_from_topic(const std::string &topic_name)
Demangle a service request.
Definition demangle.cpp:41
std::string demangle_topic(const std::string &topic_name)
Demangle a topic.
Definition demangle.cpp:32
std::string demangle_service_from_topic(const std::string &topic_name)
Demangle a service.
Definition demangle.cpp:51
std::string identity_demangle(const std::string &name)
No demangle.
Definition demangle.cpp:60
std::string demangle_publisher_from_topic(const std::string &topic_name)
Demangle a publisher.
Definition demangle.cpp:22
std::string demangle_service_reply_from_topic(const std::string &topic_name)
Demangle a service reply.
Definition demangle.cpp:46
std::string resolve_prefix(const std::string &name, const std::string &prefix)
Resolve a prefix.
Definition demangle.cpp:14