16#include <xtypes/idl/idl.hpp>
18#include "auxiliaries.hpp"
19#include "model-descriptor.hpp"
23typedef std::tuple<std::uint32_t, std::string, std::string, config::ScalarVariableType>
SignalInfo;
52 resolve_type(
const eprosima::xtypes::DynamicData::ReadableNode& node);
59 void load_idls(
const std::filesystem::path& resource_path);
83 void add(
const std::string& topic_name,
const std::string& topic_type,
Cardinality cardinal);
100 m_potential_keys.push(std::make_pair(topic_name, topic_type));
112 return m_signal_mapping;
118 std::queue<std::pair<std::string, std::string>> m_potential_keys;
119 std::uint32_t m_real_idx, m_integer_idx, m_boolean_idx, m_string_idx, m_outputs;
120 std::vector<SignalInfo> m_signal_mapping;
121 eprosima::xtypes::idl::Context m_context;
Signal distributor helper for creating model description.
Definition: SignalDistributor.hpp:35
bool has_structure(const std::string &topic_type)
Returns true if IDL has the scoped structure topic_type.
Definition: SignalDistributor.cpp:19
SignalDistributor()
Constructor that sets integer members to 0;.
Definition: SignalDistributor.cpp:12
void queue_for_key_parameter(const std::string &topic_name, const std::string &topic_type)
Queues signal mappings in form of SignalInfo entries for key parameters, if any.
Definition: SignalDistributor.hpp:99
void load_idls(const std::filesystem::path &resource_path)
Loads the IDLs into a member variable.
Definition: SignalDistributor.cpp:15
const std::vector< SignalInfo > & get_mapping() const
Returns reference to the vector of SignalInfo.
Definition: SignalDistributor.hpp:111
void add(const std::string &topic_name, const std::string &topic_type, Cardinality cardinal)
Adds signal mappings in form of SignalInfo entries.
Definition: SignalDistributor.cpp:23
Cardinality
Definition: SignalDistributor.hpp:38
void process_key_queue()
Processes queued output data by adding them to the signal mapping.
Definition: SignalDistributor.cpp:84
static config::ScalarVariableType resolve_type(const eprosima::xtypes::DynamicData::ReadableNode &node)
Resolves the FMI primitive type given an xtypes::DynamicData node.
Definition: SignalDistributor.cpp:93
std::uint32_t outputs() const
Returns number of scalar FMU outputs.
Definition: SignalDistributor.hpp:114
ScalarVariableType
Primitive type kinds in FMI.
Definition: model-descriptor.hpp:36
Definition: auxiliaries.cpp:26
std::tuple< std::uint32_t, std::string, std::string, config::ScalarVariableType > SignalInfo
Definition: SignalDistributor.hpp:23