FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
xml_parser.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2//
3// Copyright (c) 2006-2008 Marc Brooker and Michael Inggs
4// Copyright (c) 2008-present FERS Contributors (see AUTHORS.md).
5//
6// See the GNU GPLv2 LICENSE file in the FERS project root for more information.
7
8/**
9 * @file xml_parser.h
10 * @brief Header file for parsing XML configuration files for simulation.
11 */
12
13#pragma once
14
15#include <random>
16#include <string>
17
18namespace core
19{
20 class World;
21}
22
23namespace serial
24{
25 /**
26 * @brief Parses a simulation configuration from an XML file.
27 *
28 * This function loads an XML file, merges any included files, validates it against
29 * the FERS DTD and XSD schemas, and then populates the simulation `World` object
30 * with the parsed parameters and components.
31 *
32 * @param filename The path to the main XML simulation script.
33 * @param world A pointer to the `World` object to be populated.
34 * @param validate A boolean indicating whether to perform XML validation.
35 * @param masterSeeder A reference to the master random number generator used for seeding components.
36 * @throws XmlException if the XML is malformed, fails validation, or contains invalid data.
37 * @throws std::runtime_error for file I/O errors or other critical issues.
38 */
39 void parseSimulation(const std::string& filename, core::World* world, bool validate, std::mt19937& masterSeeder);
40
41 void parseSimulationFromString(const std::string& xmlContent, core::World* world, bool validate,
42 std::mt19937& masterSeeder);
43}
The World class manages the simulator environment.
Definition world.h:38
void parseSimulationFromString(const std::string &xmlContent, World *world, const bool validate, std::mt19937 &masterSeeder)
void parseSimulation(const std::string &filename, World *world, const bool validate, std::mt19937 &masterSeeder)
Parses a simulation configuration from an XML file.