8#ifndef SEN_LIBS_CORE_SRC_LANG_FOM_COMMON_H
9#define SEN_LIBS_CORE_SRC_LANG_FOM_COMMON_H
38[[nodiscard]]
bool startsWith(
const std::string& str,
const std::string subStr)
noexcept;
41[[nodiscard]]
bool isNumber(
const std::string& s);
46[[nodiscard]] std::optional<std::uint64_t>
parseUnsigned(std::string_view text);
49[[nodiscard]] std::vector<std::string_view>
splitString(std::string_view input, std::string_view delimiters);
52[[nodiscard]] std::string
toLower(
const std::string& original);
69[[nodiscard]]
bool isTrue(std::string_view str, std::string_view attribute);
101[[nodiscard]] std::string
computeClassPath(
const ClassType* parent,
const std::string& child,
const ClassType* root);
110[[nodiscard]] std::vector<Arg>
prependArgs(
const std::vector<Arg>& currentArgs,
const std::vector<Arg>& argsToPrepend);
114[[nodiscard]] std::optional<TransportMode>
getTransportMode(
const std::string& hlaTransport);
Definition fom_common.h:28
void collectInteractionNodes(pugi::xml_node node, std::vector< pugi::xml_node > &result)
The same for interaction classes, on semantics or at least one parameter.
std::string toSenPropertyName(const std::string &original)
An HLA attribute name as a sen property name. Five names belong to the Object class,...
void collectClassesNodes(pugi::xml_node node, std::vector< pugi::xml_node > &result)
Collects the object class nodes that declare a class, descending through nested ones....
std::string computeClassPath(const ClassType *parent, const std::string &child, const ClassType *root)
The path of a class in the FOM hierarchy, up to but not including root.
std::vector< std::string_view > splitString(std::string_view input, std::string_view delimiters)
Splits input on any of the delimiters. Empty pieces are kept.
std::string computeInteractionPath(const pugi::xpath_node &interactionNode)
The path of an interaction's PARENT, without the interaction root, which is what walking up the hiera...
bool isTrue(std::string_view str, std::string_view attribute)
Reads true or false, ignoring case. An empty string is false; anything else throws.
std::optional< std::uint64_t > parseUnsigned(std::string_view text)
Reads a decimal unsigned value, or nothing if the text is not one or does not fit in 64 bits....
bool isNumber(const std::string &s)
True if s is not empty and holds digits only.
std::string objectClassPath(pugi::xml_node node)
The nested path of an object class node, without the HLA root, joined with dots. A class is identifie...
bool findStringIgnoreCase(const std::string &strHaystack, const std::string &strNeedle)
True if strNeedle appears anywhere in strHaystack, ignoring case.
std::string toLowerCamelCase(const std::string &original)
An HLA name as a sen member name: words split on _ and -, lower camel case, and a Val suffix where th...
std::optional< TransportMode > getTransportMode(const std::string &hlaTransport)
The transport mode for a property, from the FOM transportation. Nothing for a value the DIF does not ...
bool startsWith(const std::string &str, const std::string subStr) noexcept
True if str begins with subStr.
std::string toLower(const std::string &original)
A copy of original with every ASCII upper case letter lowered.
std::optional< TransportMode > getMethodTransportMode(const std::string &hlaTransport)
The same for a method: best effort is unicast there, because a call goes to one object.
std::string formatSemantics(std::string str)
Semantics text as a description: newlines become spaces and quotes become apostrophes.
void collectConstructorArgs(std::vector< Arg > &list, const ClassType &type)
The static read-write properties of a class, parents first: these are its constructor arguments.
std::optional< TransportMode > getEventTransportMode(const std::string &hlaTransport)
The same for an event.
std::vector< Arg > prependArgs(const std::vector< Arg > ¤tArgs, const std::vector< Arg > &argsToPrepend)
argsToPrepend followed by currentArgs.
std::string interactionClassPath(pugi::xml_node node)
The nested path of an interaction class node, without the interaction root, joined with dots....
constexpr std::size_t maxStaticVectorSize
The largest maximum a bounded sequence is given. Above this an array becomes unbounded.
Definition fom_common.h:31