Fast RTPS  Version 2.1.0
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 <fastrtps/xmlparser/XMLParserCommon.h>
25 #include <set>
26 #include <vector>
27 #include <cstdint>
28 
29 namespace tinyxml2
30 {
31  class XMLElement;
32  class XMLDocument;
33 }
34 
35 
36 
37 namespace eprosima{
38 namespace fastrtps{
39 namespace rtps{
40 class ReaderProxyData;
41 class WriterProxyData;
42 }
43 
44 namespace xmlparser{
45 
51 public:
55  std::string m_RTPSParticipantName;
57  std::vector<rtps::ReaderProxyData*> m_readers;
59  std::vector<rtps::WriterProxyData*> m_writers;
60 };
61 
67 public:
69  virtual ~XMLEndpointParser();
75  XMLP_ret loadXMLFile(std::string& filename);
81  XMLP_ret loadXMLNode(tinyxml2::XMLDocument& doc);
82 
83  void loadXMLParticipantEndpoint(tinyxml2::XMLElement* xml_endpoint, StaticRTPSParticipantInfo* pdata);
84 
91  XMLP_ret loadXMLReaderEndpoint(tinyxml2::XMLElement* xml_endpoint,StaticRTPSParticipantInfo* pdata);
98  XMLP_ret loadXMLWriterEndpoint(tinyxml2::XMLElement* xml_endpoint, StaticRTPSParticipantInfo* pdata);
106  XMLP_ret lookforReader(const char* partname, uint16_t id, rtps::ReaderProxyData** rdataptr);
114  XMLP_ret lookforWriter(const char* partname, uint16_t id, rtps::WriterProxyData** wdataptr);
115 
116 private:
117  std::set<int16_t> m_endpointIds;
118  std::set<uint32_t> m_entityIds;
119 
120  std::vector<StaticRTPSParticipantInfo*> m_RTPSParticipants;
121 };
122 
123 
124 } /* xmlparser */
125 } /* namespace */
126 } /* namespace eprosima */
127 
128 #endif
129 #endif /* XMLENDPOINTPARSER_H_ */
Class StaticRTPSParticipantInfo, contains the information of writers and readers loaded from the XML ...
Definition: XMLEndpointParser.h:50
std::vector< rtps::ReaderProxyData * > m_readers
Vector of ReaderProxyData pointer.
Definition: XMLEndpointParser.h:57
std::string m_RTPSParticipantName
RTPS PArticipant name.
Definition: XMLEndpointParser.h:53
StaticRTPSParticipantInfo()
Definition: XMLEndpointParser.h:52
std::vector< rtps::WriterProxyData * > m_writers
Vector of ReaderProxyData pointer.
Definition: XMLEndpointParser.h:59
virtual ~StaticRTPSParticipantInfo()
Definition: XMLEndpointParser.h:53
Class XMLEndpointParser used to parse the XML file that contains information about remote endpoints.
Definition: XMLEndpointParser.h:66
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:30
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23
Definition: XMLEndpointParser.h:30