Fast RTPS  Version 2.5.1
Fast RTPS
XMLEndpointParser.h
1 // Copyright 2016 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 
20 #ifndef XMLENDPOINTPARSER_H_
21 #define XMLENDPOINTPARSER_H_
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
23 
24 #include <cstdint>
25 #include <set>
26 #include <string>
27 #include <vector>
28 
29 #include <tinyxml2.h>
30 
31 #include <fastdds/rtps/builtin/data/ReaderProxyData.h>
32 #include <fastdds/rtps/builtin/data/WriterProxyData.h>
33 #include <fastrtps/xmlparser/XMLParserCommon.h>
34 
35 namespace tinyxml2 {
36 class XMLElement;
37 class XMLDocument;
38 } // namespace tinyxml2
39 
40 
41 
42 namespace eprosima {
43 namespace fastrtps {
44 namespace rtps {
45 class ReaderProxyData;
46 class WriterProxyData;
47 } // namespace rtps
48 
49 namespace xmlparser {
50 
56 {
57 public:
58 
60  {
61  }
62 
64  {
65  }
66 
68  std::string m_RTPSParticipantName;
70  std::vector<rtps::ReaderProxyData*> m_readers;
72  std::vector<rtps::WriterProxyData*> m_writers;
73 };
74 
80 {
81 public:
82 
84  virtual ~XMLEndpointParser();
91  std::string& filename);
98  tinyxml2::XMLDocument& doc);
99 
101  tinyxml2::XMLElement* xml_endpoint,
103 
111  tinyxml2::XMLElement* xml_endpoint,
120  tinyxml2::XMLElement* xml_endpoint,
130  const char* partname,
131  uint16_t id,
132  rtps::ReaderProxyData** rdataptr);
141  const char* partname,
142  uint16_t id,
143  rtps::WriterProxyData** wdataptr);
144 
145 private:
146 
147  std::set<int16_t> m_endpointIds;
148  std::set<uint32_t> m_entityIds;
149 
150  std::vector<StaticRTPSParticipantInfo*> m_RTPSParticipants;
151 };
152 
153 
154 } /* xmlparser */
155 } /* namespace */
156 } /* namespace eprosima */
157 
158 #endif // ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
159 #endif /* XMLENDPOINTPARSER_H_ */
Class StaticRTPSParticipantInfo, contains the information of writers and readers loaded from the XML ...
Definition: XMLEndpointParser.h:56
std::vector< rtps::ReaderProxyData * > m_readers
Vector of ReaderProxyData pointer.
Definition: XMLEndpointParser.h:70
std::string m_RTPSParticipantName
RTPS PArticipant name.
Definition: XMLEndpointParser.h:68
StaticRTPSParticipantInfo()
Definition: XMLEndpointParser.h:59
std::vector< rtps::WriterProxyData * > m_writers
Vector of ReaderProxyData pointer.
Definition: XMLEndpointParser.h:72
virtual ~StaticRTPSParticipantInfo()
Definition: XMLEndpointParser.h:63
Class XMLEndpointParser used to parse the XML file that contains information about remote endpoints.
Definition: XMLEndpointParser.h:80
void loadXMLParticipantEndpoint(tinyxml2::XMLElement *xml_endpoint, StaticRTPSParticipantInfo *pdata)
XMLP_ret loadXMLNode(tinyxml2::XMLDocument &doc)
Load the XML node.
XMLP_ret loadXMLFile(std::string &filename)
Load the XML file.
XMLP_ret loadXMLWriterEndpoint(tinyxml2::XMLElement *xml_endpoint, StaticRTPSParticipantInfo *pdata)
Load a Writer endpoint.
XMLP_ret lookforWriter(const char *partname, uint16_t id, rtps::WriterProxyData **wdataptr)
Look for a writer in the previously loaded endpoints.
XMLP_ret lookforReader(const char *partname, uint16_t id, rtps::ReaderProxyData **rdataptr)
Look for a reader in the previously loaded endpoints.
XMLP_ret loadXMLReaderEndpoint(tinyxml2::XMLElement *xml_endpoint, StaticRTPSParticipantInfo *pdata)
Load a Reader endpoint.
XMLP_ret
Enum class XMLP_ret, used to provide a strongly typed result from the operations within this module.
Definition: XMLParserCommon.h:27
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23
Definition: XMLEndpointParser.h:35