dds-fmu 0.5.1
DDS-FMU communication integration
model-descriptor.hpp
1#pragma once
2
3/*
4 Copyright 2023, SINTEF Ocean
5 This Source Code Form is subject to the terms of the Mozilla Public
6 License, v. 2.0. If a copy of the MPL was not distributed with this
7 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8*/
9
10#include <filesystem>
11#include <string>
12#include <vector>
13
14#include <rapidxml/rapidxml.hpp>
15#include <xtypes/idl/idl.hpp>
16
17
18namespace ddsfmu {
19namespace config {
20
31void name_generator(std::string& name, const eprosima::xtypes::DynamicData::ReadableNode& rnode);
32
33
34// TODO: for fmi3 this and related impl need to be extended.
37
38
45std::string print_xml(const rapidxml::xml_document<>& doc);
46
59 rapidxml::xml_document<>& doc, const std::filesystem::path& template_xml,
60 std::vector<char>& buffer);
61
73 rapidxml::xml_document<>& doc, const std::filesystem::path& ddsfmu_mapping,
74 std::vector<char>& buffer);
75
86 const rapidxml::xml_document<>& doc, const std::filesystem::path& fmu_root);
87
100 rapidxml::xml_document<>& doc, rapidxml::xml_node<>* model_variables_node,
101 const std::string& name, const std::string& causality, const std::uint32_t& value_ref,
103
115 rapidxml::xml_document<>& doc, rapidxml::xml_node<>* root, const std::uint32_t& num_outputs);
116
117}
118}
void write_model_description(const rapidxml::xml_document<> &doc, const std::filesystem::path &fmu_root)
Writes contents of xml document to modelDescription.xml.
Definition: model-descriptor.cpp:76
void model_structure_outputs_generator(rapidxml::xml_document<> &doc, rapidxml::xml_node<> *root, const std::uint32_t &num_outputs)
Create <Outputs> tag with necessary <Unknown>
Definition: model-descriptor.cpp:190
ScalarVariableType
Primitive type kinds in FMI.
Definition: model-descriptor.hpp:36
void load_template_xml(rapidxml::xml_document<> &doc, const std::filesystem::path &template_xml, std::vector< char > &buffer)
Loads template modelDescription.xml.
Definition: model-descriptor.cpp:29
void model_variable_generator(rapidxml::xml_document<> &doc, rapidxml::xml_node<> *parent, const std::string &name, const std::string &causality, const std::uint32_t &value_ref, const ddsfmu::config::ScalarVariableType &type)
Constructs a <ScalarVariable> tag to be used in <ModelVariables> of the modelDescription....
Definition: model-descriptor.cpp:125
std::string print_xml(const rapidxml::xml_document<> &doc)
Prints xml document as string.
Definition: model-descriptor.cpp:21
void name_generator(std::string &name, const eprosima::xtypes::DynamicData::ReadableNode &rnode)
Finds structured name for a given node.
Definition: model-descriptor.cpp:87
void load_ddsfmu_mapping(rapidxml::xml_document<> &doc, const std::filesystem::path &ddsfmu_mapping, std::vector< char > &buffer)
Loads mapping between dds topics and fmu signal references ddsfmu_mapping.
Definition: model-descriptor.cpp:61
Definition: auxiliaries.cpp:26