FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
xml_parser_utils.h File Reference

Core utility layer for parsing FERS XML scenario files. More...

#include <filesystem>
#include <functional>
#include <memory>
#include <random>
#include <string>
#include <unordered_map>
#include <vector>
#include "core/parameters.h"
#include "core/sim_id.h"
#include "radar/schedule_period.h"
#include "serial/libxml_wrapper.h"
+ Include dependency graph for xml_parser_utils.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  serial::xml_parser_utils::ReferenceLookup
 Holds maps to resolve string names to internal SimId references during XML parsing. More...
 
struct  serial::xml_parser_utils::AssetLoaders
 Container for functions that load external file-backed assets. More...
 
struct  serial::xml_parser_utils::ParserContext
 Encapsulates the state required during the XML parsing process. More...
 

Namespaces

namespace  antenna
 
namespace  fers_signal
 
namespace  radar
 
namespace  core
 
namespace  serial
 
namespace  serial::xml_parser_utils
 

Functions

RealType serial::xml_parser_utils::get_child_real_type (const XmlElement &element, const std::string &elementName)
 Extracts a floating-point (RealType) value from a named child element.
 
bool serial::xml_parser_utils::get_attribute_bool (const XmlElement &element, const std::string &attributeName, bool defaultVal)
 Extracts a boolean value from a named attribute.
 
SimId serial::xml_parser_utils::assign_id_from_attribute (const std::string &owner, ObjectType type)
 Generates a unique SimId based on the requested object type.
 
SimId serial::xml_parser_utils::resolve_reference_id (const XmlElement &element, const std::string &attributeName, const std::string &owner, const std::unordered_map< std::string, SimId > &name_map)
 Resolves an XML string reference into an internal SimId.
 
std::vector< radar::SchedulePeriodserial::xml_parser_utils::parseSchedule (const XmlElement &parent, const std::string &parentName, bool isPulsed, RealType pri=0.0)
 Parses a schedule (active periods) for a transmitter or receiver.
 
void serial::xml_parser_utils::parseParameters (const XmlElement &parameters, params::Parameters &params_out)
 Parses the <parameters> block into the isolated context parameters.
 
void serial::xml_parser_utils::parseWaveform (const XmlElement &waveform, ParserContext &ctx)
 Parses a <waveform> block and adds it to the World.
 
void serial::xml_parser_utils::parseTiming (const XmlElement &timing, ParserContext &ctx)
 Parses a <timing> block and adds the prototype timing to the World.
 
void serial::xml_parser_utils::parseAntenna (const XmlElement &antenna, ParserContext &ctx)
 Parses an <antenna> block and adds it to the World.
 
void serial::xml_parser_utils::parseMotionPath (const XmlElement &motionPath, radar::Platform *platform)
 Parses a <motionpath> block and attaches it to a Platform.
 
void serial::xml_parser_utils::parseRotationPath (const XmlElement &rotation, radar::Platform *platform, params::RotationAngleUnit unit)
 Parses a <rotationpath> block and attaches it to a Platform.
 
void serial::xml_parser_utils::parseFixedRotation (const XmlElement &rotation, radar::Platform *platform, params::RotationAngleUnit unit)
 Parses a <fixedrotation> block and attaches it to a Platform.
 
radar::Transmitterserial::xml_parser_utils::parseTransmitter (const XmlElement &transmitter, radar::Platform *platform, ParserContext &ctx, const ReferenceLookup &refs)
 Parses a <transmitter> block, resolves its dependencies, and adds it to the World.
 
radar::Receiverserial::xml_parser_utils::parseReceiver (const XmlElement &receiver, radar::Platform *platform, ParserContext &ctx, const ReferenceLookup &refs)
 Parses a <receiver> block, resolves its dependencies, and adds it to the World.
 
void serial::xml_parser_utils::parseMonostatic (const XmlElement &monostatic, radar::Platform *platform, ParserContext &ctx, const ReferenceLookup &refs)
 Parses a <monostatic> block, creating a linked transmitter and receiver pair.
 
void serial::xml_parser_utils::parseTarget (const XmlElement &target, radar::Platform *platform, ParserContext &ctx)
 Parses a <target> block and adds it to the World.
 
void serial::xml_parser_utils::parsePlatformElements (const XmlElement &platform, ParserContext &ctx, radar::Platform *plat, const std::function< void(const XmlElement &, std::string_view)> &register_name, const ReferenceLookup &refs)
 Iterates and parses all children elements (radars, targets) of a platform.
 
void serial::xml_parser_utils::parsePlatform (const XmlElement &platform, ParserContext &ctx, const std::function< void(const XmlElement &, std::string_view)> &register_name, const ReferenceLookup &refs)
 Parses a complete <platform> block, including its motion paths and sub-elements.
 
void serial::xml_parser_utils::collectIncludeElements (const XmlDocument &doc, const std::filesystem::path &currentDir, std::vector< std::filesystem::path > &includePaths)
 Recursively finds all <include> tags in a document and resolves their absolute paths.
 
bool serial::xml_parser_utils::addIncludeFilesToMainDocument (const XmlDocument &mainDoc, const std::filesystem::path &currentDir)
 Resolves and merges all <include> files directly into the provided main document.
 
void serial::xml_parser_utils::validateXml (bool didCombine, const XmlDocument &mainDoc)
 Validates an XML document against the embedded DTD and XSD schemas.
 
void serial::xml_parser_utils::processParsedDocument (const XmlDocument &doc, ParserContext &ctx)
 Coordinates the full parsing of a validated XML document tree.
 
AssetLoaders serial::xml_parser_utils::createDefaultAssetLoaders ()
 Creates an AssetLoaders struct populated with standard file-I/O implementations.
 

Detailed Description

Core utility layer for parsing FERS XML scenario files.

This file provides the internal mechanisms and data structures required to parse individual XML elements into their corresponding simulation objects. It defines a context-driven parsing approach, separating the extraction of XML data from the global simulation state and managing external file dependencies through function hooks.

Definition in file xml_parser_utils.h.