RMW desert 1.0
Loading...
Searching...
No Matches
DesertPublisher.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
33#ifndef DESERT_PUBLISHER_H_
34#define DESERT_PUBLISHER_H_
35
38#include "rosidl_typesupport_introspection_cpp/identifier.hpp"
39#include "rosidl_typesupport_introspection_c/identifier.h"
40#include "rosidl_typesupport_introspection_cpp/message_introspection.hpp"
41#include "rosidl_typesupport_introspection_c/message_introspection.h"
42#include "rosidl_typesupport_introspection_cpp/service_introspection.hpp"
43#include "rosidl_typesupport_introspection_c/service_introspection.h"
44#include "rosidl_typesupport_introspection_cpp/field_types.hpp"
45#include "rosidl_typesupport_introspection_c/field_types.h"
46
47#include "rosidl_runtime_c/message_type_support_struct.h"
48
49#include "rmw/types.h"
50
51#include <vector>
52#include <string>
53#include <regex>
54
57#include "CBorStream.h"
59
61{
62 public:
70 DesertPublisher(std::string topic_name, const rosidl_message_type_support_t * type_supports, rmw_gid_t gid);
71
81 void push(const void * msg);
82
90 rmw_gid_t get_gid();
98 std::string get_topic_name();
106 std::string get_type_name();
107
108
109 private:
110 uint8_t _id;
111 rmw_gid_t _gid;
112 std::string _name;
113 cbor::TxStream _data_stream;
114
115 int _c_cpp_identifier;
116 const void * _members;
117
118 const void * get_members(const rosidl_message_type_support_t * type_support);
119 const rosidl_message_type_support_t * get_type_support(const rosidl_message_type_support_t * type_supports);
120
121};
122
123#endif
Classes used to convert data types into a CBOR encoded stream.
Namespace containing serialization functions.
Definition DesertPublisher.h:61
void push(const void *msg)
Send a publication on the topic.
Definition DesertPublisher.cpp:13
std::string get_type_name()
Retreive the message type of the current entity.
Definition DesertPublisher.cpp:44
std::string get_topic_name()
Retreive the topic name of the current entity.
Definition DesertPublisher.cpp:39
rmw_gid_t get_gid()
Retreive the gid of the current entity.
Definition DesertPublisher.cpp:34
Definition CBorStream.h:87