rmw_fastrtps_shared_cpp  master
Code shared on static and dynamic type support of rmw_fastrtps_cpp.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
utils.hpp
Go to the documentation of this file.
1 // Copyright 2021 Proyectos y Sistemas de Mantenimiento SL (eProsima).
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 // http://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 RMW_FASTRTPS_SHARED_CPP__UTILS_HPP_
16 #define RMW_FASTRTPS_SHARED_CPP__UTILS_HPP_
17 
18 #include <mutex>
19 #include <string>
20 
21 #include "fastdds/dds/topic/TopicDescription.hpp"
22 #include "fastdds/dds/topic/TypeSupport.hpp"
23 
24 #include "fastrtps/types/TypesBase.h"
25 
28 
29 #include "rmw/rmw.h"
30 
31 
33 {
34 
50 {
52  {
53  if (should_be_deleted) {
54  participant->delete_topic(topic);
55  }
56  }
57 
58  eprosima::fastdds::dds::DomainParticipant * participant = nullptr;
59  eprosima::fastdds::dds::TopicDescription * desc = nullptr;
60  eprosima::fastdds::dds::Topic * topic = nullptr;
61  bool should_be_deleted = false;
62 };
63 
71 cast_error_dds_to_rmw(eprosima::fastrtps::types::ReturnCode_t code);
72 
94 bool
96  eprosima::fastdds::dds::DomainParticipant * participant,
97  eprosima::fastdds::dds::TopicDescription * desc,
98  const std::string & topic_name,
99  const std::string & type_name,
100  const eprosima::fastdds::dds::TopicQos & topic_qos,
101  bool is_writer_topic,
102  TopicHolder * topic_holder);
103 
118 bool
120  const CustomParticipantInfo * participant_info,
121  const std::string & topic_name,
122  const std::string & type_name,
123  eprosima::fastdds::dds::TopicDescription ** returned_topic,
124  eprosima::fastdds::dds::TypeSupport * returned_type);
125 
134 void
136  const CustomParticipantInfo * participant_info,
137  const eprosima::fastdds::dds::TopicDescription * topic,
138  const eprosima::fastdds::dds::TypeSupport & type);
139 
140 } // namespace rmw_fastrtps_shared_cpp
141 
142 #endif // RMW_FASTRTPS_SHARED_CPP__UTILS_HPP_
std::string
rmw_fastrtps_shared_cpp::cast_or_create_topic
bool cast_or_create_topic(eprosima::fastdds::dds::DomainParticipant *participant, eprosima::fastdds::dds::TopicDescription *desc, const std::string &topic_name, const std::string &type_name, const eprosima::fastdds::dds::TopicQos &topic_qos, bool is_writer_topic, TopicHolder *topic_holder)
rmw.h
rmw_fastrtps_shared_cpp
Definition: create_rmw_gid.hpp:24
rmw_fastrtps_shared_cpp::find_and_check_topic_and_type
bool find_and_check_topic_and_type(const CustomParticipantInfo *participant_info, const std::string &topic_name, const std::string &type_name, eprosima::fastdds::dds::TopicDescription **returned_topic, eprosima::fastdds::dds::TypeSupport *returned_type)
RMW_FASTRTPS_SHARED_CPP_PUBLIC
#define RMW_FASTRTPS_SHARED_CPP_PUBLIC
Definition: visibility_control.h:50
TypeSupport.hpp
custom_participant_info.hpp
rmw_fastrtps_shared_cpp::TopicHolder::participant
eprosima::fastdds::dds::DomainParticipant * participant
Definition: utils.hpp:58
rmw_fastrtps_shared_cpp::TopicHolder::~TopicHolder
~TopicHolder()
Definition: utils.hpp:51
rmw_fastrtps_shared_cpp::TopicHolder::should_be_deleted
bool should_be_deleted
Definition: utils.hpp:61
CustomParticipantInfo
Definition: custom_participant_info.hpp:56
rmw_fastrtps_shared_cpp::TopicHolder
Definition: utils.hpp:49
rmw_ret_t
int32_t rmw_ret_t
rmw_fastrtps_shared_cpp::remove_topic_and_type
void remove_topic_and_type(const CustomParticipantInfo *participant_info, const eprosima::fastdds::dds::TopicDescription *topic, const eprosima::fastdds::dds::TypeSupport &type)
rmw_fastrtps_shared_cpp::TopicHolder::desc
eprosima::fastdds::dds::TopicDescription * desc
Definition: utils.hpp:59
rmw_fastrtps_shared_cpp::TopicHolder::topic
eprosima::fastdds::dds::Topic * topic
Definition: utils.hpp:60
rmw_fastrtps_shared_cpp::cast_error_dds_to_rmw
rmw_ret_t cast_error_dds_to_rmw(eprosima::fastrtps::types::ReturnCode_t code)