File: XMLParserTest.hpp

package info (click to toggle)
fastdds 3.1.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 58,132 kB
  • sloc: cpp: 779,516; xml: 15,119; python: 4,356; sh: 190; makefile: 93; ansic: 12
file content (608 lines) | stat: -rw-r--r-- 18,415 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
// Copyright 2017 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/LibrarySettings.hpp>
#include <fastdds/rtps/attributes/ThreadSettings.hpp>
#include <fastdds/rtps/transport/PortBasedTransportDescriptor.hpp>

#include <xmlparser/XMLParser.h>

using namespace eprosima::fastdds;
using namespace eprosima::fastdds::dds;
using namespace eprosima::fastdds::rtps;

using eprosima::fastdds::xmlparser::XMLP_ret;
using eprosima::fastdds::xmlparser::XMLParser;
using eprosima::fastdds::xmlparser::DataNode;
using eprosima::fastdds::xmlparser::BaseNode;
using eprosima::fastdds::xmlparser::sp_transport_t;
using eprosima::fastdds::xmlparser::up_participant_t;
using eprosima::fastdds::xmlparser::up_node_participant_t;
using eprosima::fastdds::xmlparser::node_participant_t;

// Class to test protected methods
class XMLParserTest : public XMLParser
{
public:

    static XMLP_ret getXMLWriterQosPolicies_wrapper(
            tinyxml2::XMLElement* elem,
            WriterQos& qos,
            uint8_t ident)
    {
        return getXMLWriterQosPolicies(elem, qos, ident);
    }

    static XMLP_ret getXMLReaderQosPolicies_wrapper(
            tinyxml2::XMLElement* elem,
            ReaderQos& qos,
            uint8_t ident)
    {
        return getXMLReaderQosPolicies(elem, qos, ident);
    }

    static XMLP_ret getXMLLocatorList_wrapper(
            tinyxml2::XMLElement* elem,
            LocatorList_t& locatorList,
            uint8_t ident)
    {
        return getXMLLocatorList(elem, locatorList, ident);
    }

    static XMLP_ret fillDataNode_wrapper(
            tinyxml2::XMLElement* p_profile,
            DataNode<xmlparser::ParticipantAttributes>& participant_node)
    {
        return fillDataNode(p_profile, participant_node);
    }

    static XMLP_ret getXMLDiscoverySettings_wrapper(
            tinyxml2::XMLElement* elem,
            DiscoverySettings& settings,
            uint8_t ident)
    {
        return getXMLDiscoverySettings(elem, settings, ident);
    }

    static XMLP_ret getXMLPortParameters_wrapper(
            tinyxml2::XMLElement* elem,
            PortParameters& port,
            uint8_t ident)
    {
        return getXMLPortParameters(elem, port, ident);
    }

    static XMLP_ret getXMLSubscriberAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            xmlparser::SubscriberAttributes& subscriber,
            uint8_t ident)
    {
        return getXMLSubscriberAttributes(elem, subscriber, ident);
    }

    static XMLP_ret getXMLLifespanQos_wrapper(
            tinyxml2::XMLElement* elem,
            LifespanQosPolicy& lifespan,
            uint8_t ident)
    {
        return getXMLLifespanQos(elem, lifespan, ident);
    }

    static XMLP_ret getXMLDisablePositiveAcksQos_wrapper(
            tinyxml2::XMLElement* elem,
            DisablePositiveACKsQosPolicy& disablePositiveAcks,
            uint8_t ident)
    {
        return getXMLDisablePositiveAcksQos(elem, disablePositiveAcks, ident);
    }

    static XMLP_ret propertiesPolicy_wrapper(
            tinyxml2::XMLElement* elem,
            DataSharingQosPolicy& datasharingQos,
            uint8_t ident)
    {
        return getXMLDataSharingQos(elem, datasharingQos, ident);
    }

    static XMLP_ret propertiesPolicy_wrapper(
            tinyxml2::XMLElement* elem,
            OwnershipQosPolicy& ownershipQos,
            uint8_t ident)
    {
        return getXMLOwnershipQos(elem, ownershipQos, ident);
    }

    static XMLP_ret propertiesPolicy_wrapper(
            tinyxml2::XMLElement* elem,
            OwnershipStrengthQosPolicy& ownershipStrengthQos,
            uint8_t ident)
    {
        return getXMLOwnershipStrengthQos(elem, ownershipStrengthQos, ident);
    }

    static XMLP_ret propertiesPolicy_wrapper(
            tinyxml2::XMLElement* elem,
            PropertyPolicy& propertiesPolicy,
            uint8_t ident)
    {
        return getXMLPropertiesPolicy(elem, propertiesPolicy, ident);
    }

    static XMLP_ret getXMLTransports_wrapper(
            tinyxml2::XMLElement* elem,
            std::vector<std::shared_ptr<eprosima::fastdds::rtps::TransportDescriptorInterface>>& transports,
            uint8_t ident)
    {
        return getXMLTransports(elem, transports, ident);
    }

    static XMLP_ret getXMLBuiltinTransports_wrapper(
            tinyxml2::XMLElement* elem,
            eprosima::fastdds::rtps::BuiltinTransports* bt,
            uint8_t ident,
            eprosima::fastdds::rtps::BuiltinTransportsOptions* bt_opts = nullptr)
    {
        return getXMLBuiltinTransports(elem, bt, bt_opts, ident);
    }

    static XMLP_ret getXMLguidPrefix_wrapper(
            tinyxml2::XMLElement* elem,
            GuidPrefix_t& prefix,
            uint8_t ident)
    {
        return getXMLguidPrefix(elem, prefix, ident);
    }

    static XMLP_ret getXMLDuration_wrapper(
            tinyxml2::XMLElement* elem,
            dds::Duration_t& duration,
            uint8_t ident)
    {
        return getXMLDuration(elem, duration, ident);
    }

    static XMLP_ret getXMLString_wrapper(
            tinyxml2::XMLElement* elem,
            std::string* s,
            uint8_t ident)
    {
        return getXMLString(elem, s, ident);
    }

    static XMLP_ret getXMLBool_wrapper(
            tinyxml2::XMLElement* elem,
            bool* b,
            uint8_t ident)
    {
        return getXMLBool(elem, b, ident);
    }

    static XMLP_ret getXMLInt_wrapper(
            tinyxml2::XMLElement* elem,
            int* i,
            uint8_t ident)
    {
        return getXMLInt(elem, i, ident);
    }

    static XMLP_ret getXMLUint_wrapper(
            tinyxml2::XMLElement* elem,
            unsigned int* ui,
            uint8_t ident)
    {
        return getXMLUint(elem, ui, ident);
    }

    static XMLP_ret getXMLUint_wrapper(
            tinyxml2::XMLElement* elem,
            uint16_t* ui16,
            uint8_t ident)
    {
        return getXMLUint(elem, ui16, ident);
    }

    static XMLP_ret getXMLUint_wrapper(
            tinyxml2::XMLElement* elem,
            uint64_t* ui64,
            uint8_t ident)
    {
        return getXMLUint(elem, ui64, ident);
    }

    static XMLP_ret getXMLBuiltinAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            BuiltinAttributes& builtin,
            uint8_t ident)
    {
        return getXMLBuiltinAttributes(elem, builtin, ident);
    }

    static XMLP_ret getXMLFlowControllerDescriptorList_wrapper(
            tinyxml2::XMLElement* elem,
            FlowControllerDescriptorList& flow_controller_descriptors,
            uint8_t ident)
    {
        return getXMLFlowControllerDescriptorList(elem, flow_controller_descriptors, ident);
    }

    static XMLP_ret getXMLTopicAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            xmlparser::TopicAttributes& topic,
            uint8_t ident)
    {
        return getXMLTopicAttributes(elem, topic, ident);
    }

    static XMLP_ret getXMLResourceLimitsQos_wrapper(
            tinyxml2::XMLElement* elem,
            ResourceLimitsQosPolicy& resourceLimitsQos,
            uint8_t ident)
    {
        return getXMLResourceLimitsQos(elem, resourceLimitsQos, ident);
    }

    static XMLP_ret getXMLContainerAllocationConfig_wrapper(
            tinyxml2::XMLElement* elem,
            ResourceLimitedContainerConfig& allocation_config,
            uint8_t ident)
    {
        return getXMLContainerAllocationConfig(elem, allocation_config, ident);
    }

    static XMLP_ret getXMLHistoryQosPolicy_wrapper(
            tinyxml2::XMLElement* elem,
            HistoryQosPolicy& historyQos,
            uint8_t ident)
    {
        return getXMLHistoryQosPolicy(elem, historyQos, ident);
    }

    static XMLP_ret getXMLDurabilityQos_wrapper(
            tinyxml2::XMLElement* elem,
            DurabilityQosPolicy& durability,
            uint8_t ident)
    {
        return getXMLDurabilityQos(elem, durability, ident);
    }

    static XMLP_ret getXMLDeadlineQos_wrapper(
            tinyxml2::XMLElement* elem,
            DeadlineQosPolicy& deadline,
            uint8_t ident)
    {
        return getXMLDeadlineQos(elem, deadline, ident);
    }

    static XMLP_ret getXMLLatencyBudgetQos_wrapper(
            tinyxml2::XMLElement* elem,
            LatencyBudgetQosPolicy& latencyBudget,
            uint8_t ident)
    {
        return getXMLLatencyBudgetQos(elem, latencyBudget, ident);
    }

    static XMLP_ret getXMLReliabilityQos_wrapper(
            tinyxml2::XMLElement* elem,
            ReliabilityQosPolicy& reliability,
            uint8_t ident)
    {
        return getXMLReliabilityQos(elem, reliability, ident);
    }

    static XMLP_ret getXMLPartitionQos_wrapper(
            tinyxml2::XMLElement* elem,
            PartitionQosPolicy& partition,
            uint8_t ident)
    {
        return getXMLPartitionQos(elem, partition, ident);
    }

    static XMLP_ret getXMLWriterTimes_wrapper(
            tinyxml2::XMLElement* elem,
            WriterTimes& times,
            uint8_t ident)
    {
        return getXMLWriterTimes(elem, times, ident);
    }

    static XMLP_ret getXMLReaderTimes_wrapper(
            tinyxml2::XMLElement* elem,
            ReaderTimes& times,
            uint8_t ident)
    {
        return getXMLReaderTimes(elem, times, ident);
    }

    static XMLP_ret getXMLLocatorUDPv4_wrapper(
            tinyxml2::XMLElement* elem,
            Locator_t& locator,
            uint8_t ident)
    {
        return getXMLLocatorUDPv4(elem, locator, ident);
    }

    static XMLP_ret getXMLPublisherAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            xmlparser::PublisherAttributes& publisher,
            uint8_t ident)
    {
        return getXMLPublisherAttributes(elem, publisher, ident);
    }

    static XMLP_ret getXMLHistoryMemoryPolicy_wrapper(
            tinyxml2::XMLElement* elem,
            MemoryManagementPolicy_t& historyMemoryPolicy,
            uint8_t ident)
    {
        return getXMLHistoryMemoryPolicy(elem, historyMemoryPolicy, ident);
    }

    static XMLP_ret getXMLLivelinessQos_wrapper(
            tinyxml2::XMLElement* elem,
            LivelinessQosPolicy& liveliness,
            uint8_t ident)
    {
        return getXMLLivelinessQos(elem, liveliness, ident);
    }

    static XMLP_ret getXMLPublishModeQos_wrapper(
            tinyxml2::XMLElement* elem,
            PublishModeQosPolicy& publishMode,
            uint8_t ident)
    {
        return getXMLPublishModeQos(elem, publishMode, ident);
    }

    static XMLP_ret getXMLParticipantAllocationAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            RTPSParticipantAllocationAttributes& allocation,
            uint8_t ident)
    {
        return getXMLParticipantAllocationAttributes(elem, allocation, ident);
    }

    static XMLP_ret getXMLSendBuffersAllocationAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            SendBuffersAllocationAttributes& allocation,
            uint8_t ident)
    {
        return getXMLSendBuffersAllocationAttributes(elem, allocation, ident);
    }

    static XMLP_ret getXMLRemoteLocatorsAllocationAttributes_wrapper(
            tinyxml2::XMLElement* elem,
            RemoteLocatorsAllocationAttributes& allocation,
            uint8_t ident)
    {
        return getXMLRemoteLocatorsAllocationAttributes(elem, allocation, ident);
    }

    static XMLP_ret getXMLEnum_wrapper(
            tinyxml2::XMLElement* elem,
            eprosima::fastdds::IntraprocessDeliveryType* e,
            uint8_t ident)
    {
        return getXMLEnum(elem, e, ident);
    }

    static XMLP_ret getXMLEnum_wrapper(
            tinyxml2::XMLElement* elem,
            DiscoveryProtocol* e,
            uint8_t ident)
    {
        return getXMLEnum(elem, e, ident);
    }

    static XMLP_ret getXMLEnum_wrapper(
            tinyxml2::XMLElement* elem,
            ParticipantFilteringFlags* e,
            uint8_t ident)
    {
        return getXMLEnum(elem, e, ident);
    }

    static XMLP_ret getXMLOctetVector_wrapper(
            tinyxml2::XMLElement* elem,
            std::vector<octet>& e,
            uint8_t ident)
    {
        return getXMLOctetVector(elem, e, ident);
    }

    static XMLP_ret parseXMLTypes_wrapper(
            tinyxml2::XMLElement* p_root)
    {
        return parseXMLTypes(p_root);
    }

    static XMLP_ret parseXMLTransportData_wrapper(
            tinyxml2::XMLElement* p_root)
    {
        return parseXMLTransportData(p_root);
    }

    static XMLP_ret parseXMLCommonTransportData_wrapper(
            tinyxml2::XMLElement* p_root,
            sp_transport_t p_transport)
    {
        return parseXMLCommonTransportData(p_root, p_transport);
    }

    static XMLP_ret parseXMLCommonSharedMemTransportData_wrapper(
            tinyxml2::XMLElement* p_root,
            sp_transport_t p_transport)
    {
        return parseXMLCommonSharedMemTransportData(p_root, p_transport);
    }

    static XMLP_ret parseXMLCommonTCPTransportData_wrapper(
            tinyxml2::XMLElement* p_root,
            eprosima::fastdds::xmlparser::sp_transport_t p_transport)
    {
        return parseXMLCommonTCPTransportData(p_root, p_transport);
    }

    static XMLP_ret parseXMLConsumer_wrapper(
            tinyxml2::XMLElement& p_root)
    {
        return parseXMLConsumer(p_root);
    }

    static XMLP_ret parseLogConfig_wrapper(
            tinyxml2::XMLElement* p_root)
    {
        return parseLogConfig(p_root);
    }

    static XMLP_ret parseXMLTransportsProf_wrapper(
            tinyxml2::XMLElement* p_root)
    {
        return parseXMLTransportsProf(p_root);
    }

    static XMLP_ret parseXML_wrapper(
            tinyxml2::XMLDocument& xmlDoc,
            eprosima::fastdds::xmlparser::up_base_node_t& root)
    {
        return parseXML(xmlDoc, root);
    }

    static XMLP_ret parseProfiles_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& profilesNode)
    {
        return parseProfiles(p_root, profilesNode);
    }

    static XMLP_ret parse_tls_config_wrapper(
            tinyxml2::XMLElement* p_root,
            eprosima::fastdds::xmlparser::sp_transport_t tcp_transport)
    {
        return parse_tls_config(p_root, tcp_transport);
    }

    static XMLP_ret parseXMLReceptionThreads_wrapper(
            tinyxml2::XMLElement& p_root,
            eprosima::fastdds::rtps::PortBasedTransportDescriptor::ReceptionThreadsConfigMap& reception_threads)
    {
        return parseXMLReceptionThreads(p_root, reception_threads);
    }

    static XMLP_ret parseXMLLibrarySettings_wrapper(
            tinyxml2::XMLElement* p_root)
    {
        return parseXMLLibrarySettings(p_root);
    }

    static XMLP_ret fillDataNode_wrapper(
            tinyxml2::XMLElement* p_profile,
            DataNode<xmlparser::PublisherAttributes>& publisher_node)
    {
        return fillDataNode(p_profile, publisher_node);
    }

    static XMLP_ret fillDataNode_wrapper(
            tinyxml2::XMLElement* p_profile,
            DataNode<xmlparser::SubscriberAttributes>& subscriber_node)
    {
        return fillDataNode(p_profile, subscriber_node);
    }

    static XMLP_ret fillDataNode_wrapper(
            tinyxml2::XMLElement* p_profile,
            DataNode<xmlparser::TopicAttributes>& topic_node)
    {
        return fillDataNode(p_profile, topic_node);
    }

    static XMLP_ret fillDataNode_wrapper(
            tinyxml2::XMLElement* p_profile,
            DataNode<xmlparser::RequesterAttributes>& requester_node)
    {
        return fillDataNode(p_profile, requester_node);
    }

    static XMLP_ret fillDataNode_wrapper(
            tinyxml2::XMLElement* p_profile,
            DataNode<xmlparser::ReplierAttributes>& replier_node)
    {
        return fillDataNode(p_profile, replier_node);
    }

    static XMLP_ret parseXMLParticipantProf_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& rootNode)
    {
        return parseXMLParticipantProf(p_root, rootNode);
    }

    static XMLP_ret parseXMLPublisherProf_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& rootNode)
    {
        return parseXMLPublisherProf(p_root, rootNode);
    }

    static XMLP_ret parseXMLSubscriberProf_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& rootNode)
    {
        return parseXMLSubscriberProf(p_root, rootNode);
    }

    static XMLP_ret parseXMLRequesterProf_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& rootNode)
    {
        return parseXMLRequesterProf(p_root, rootNode);
    }

    static XMLP_ret parseXMLReplierProf_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& rootNode)
    {
        return parseXMLReplierProf(p_root, rootNode);
    }

    static XMLP_ret parseXMLTopicData_wrapper(
            tinyxml2::XMLElement* p_root,
            BaseNode& rootNode)
    {
        return parseXMLTopicData(p_root, rootNode);
    }

    static XMLP_ret getXMLThreadSettings_wrapper(
            tinyxml2::XMLElement* p_root,
            eprosima::fastdds::rtps::ThreadSettings& thread_settings)
    {
        return getXMLThreadSettings(*p_root, thread_settings);
    }

    static XMLP_ret getXMLThreadSettingsWithPort_wrapper(
            tinyxml2::XMLElement* p_root,
            eprosima::fastdds::rtps::ThreadSettings& thread_settings,
            uint32_t& port)
    {
        return getXMLThreadSettingsWithPort(*p_root, thread_settings, port);
    }

    static XMLP_ret getXMLEntityFactoryQos_wrapper(
            tinyxml2::XMLElement* p_root,
            eprosima::fastdds::dds::EntityFactoryQosPolicy& entity_factory)
    {
        return getXMLEntityFactoryQos(*p_root, entity_factory);
    }

};