RMW desert 1.0
Loading...
Searching...
No Matches
TopicsConfig.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
32#ifndef TOPICS_CONFIG_H_
33#define TOPICS_CONFIG_H_
34
37#include <map>
38#include <string>
39#include <cstdint>
40#include <fstream>
41
44#include "json.hpp"
45
46using namespace nlohmann::json_abi_v3_11_3;
47
49{
50 public:
51
58 static void load_configuration();
67 static uint8_t get_topic_identifier(std::string name);
76 static std::string get_identifier_topic(uint8_t identifier);
77
78 private:
79 static std::map<std::string, uint8_t> _topics_list;
80 static std::map<uint8_t, std::string> _identifiers_list;
81};
82
83#endif // MACROS_HPP_
Definition TopicsConfig.h:49
static void load_configuration()
Initialize the configuration.
Definition TopicsConfig.cpp:6
static std::string get_identifier_topic(uint8_t identifier)
Get identifier's topic from configuration.
Definition TopicsConfig.cpp:37
static uint8_t get_topic_identifier(std::string name)
Get topic's identifier from configuration.
Definition TopicsConfig.cpp:29