Fast RTPS  Version 2.1.0
Fast RTPS
XMLProfileManager.h
1 // Copyright 2017 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 XML_PROFILE_MANAGER_H_
16 #define XML_PROFILE_MANAGER_H_
17 
18 #include <fastrtps/attributes/ParticipantAttributes.h>
19 #include <fastrtps/attributes/PublisherAttributes.h>
20 #include <fastrtps/attributes/SubscriberAttributes.h>
21 #include <fastrtps/xmlparser/XMLParserCommon.h>
22 #include <fastrtps/xmlparser/XMLParser.h>
23 #include <fastrtps/types/DynamicTypeBuilderFactory.h>
24 #include <fastrtps/types/DynamicTypeBuilder.h>
25 #include <fastrtps/types/DynamicPubSubType.h>
26 
27 #include <stdio.h>
28 #include <string>
29 #include <map>
30 
31 namespace eprosima {
32 namespace fastrtps {
33 namespace xmlparser {
34 
35 using participant_map_t = std::map<std::string, up_participant_t>;
36 using part_map_iterator_t = participant_map_t::iterator;
37 using publisher_map_t = std::map<std::string, up_publisher_t>;
38 using publ_map_iterator_t = publisher_map_t::iterator;
39 using subscriber_map_t = std::map<std::string, up_subscriber_t>;
40 using subs_map_iterator_t = subscriber_map_t::iterator;
41 using topic_map_t = std::map<std::string, up_topic_t>;
42 using topic_map_iterator_t = topic_map_t::iterator;
43 using requester_map_t = std::map<std::string, up_requester_t>;
44 using requester_map_iterator_t = requester_map_t::iterator;
45 using replier_map_t = std::map<std::string, up_replier_t>;
46 using replier_map_iterator_t = replier_map_t::iterator;
47 using xmlfiles_map_t = std::map<std::string, XMLP_ret>;
48 using xmlfile_map_iterator_t = xmlfiles_map_t::iterator;
49 
50 
56 {
57 public:
58 
62  RTPS_DllAPI static void loadDefaultXMLFile();
63 
70  RTPS_DllAPI static XMLP_ret loadXMLFile(
71  const std::string& filename);
72 
79  RTPS_DllAPI static XMLP_ret loadXMLNode(
80  tinyxml2::XMLDocument& doc);
81 
88  RTPS_DllAPI static XMLP_ret loadXMLProfiles(
89  tinyxml2::XMLElement& profiles);
90 
96  RTPS_DllAPI static XMLP_ret loadXMLDynamicTypes(
97  tinyxml2::XMLElement& types);
98 
103  RTPS_DllAPI static void library_settings(