|
Sen API
Sen Libraries
|
Classes | |
| struct | Document |
| One document that was read, and the nodes in it that declare something. More... | |
| struct | MappingDocument |
| A mapping file and where it was read from, so a refusal can name the file that asked for something the FOM does not have. More... | |
| struct | DocumentTypeSet |
| A type set and the path it was built from. One caller resolves a single FOM file by path. More... | |
| struct | Declaration |
| One declaring node and the document it came from, so a refusal can name the file. More... | |
| struct | Declarations |
| Everything that declares one type. The complete definition owns the type and decides its package; every other declaration adds its members to it. HLA 4 calls this the union over the collective set of modules, and uses the same two words for the two roles. More... | |
| class | FomDocuments |
| Reads every document, indexes what each one declares, then builds the types. A type is built on first reference, from every declaration of it rather than only the first, which is what lets a file beside the FOM add members to it. More... | |
Functions | |
| bool | startsWith (const std::string &str, const std::string subStr) noexcept |
| True if str begins with subStr. | |
| bool | isNumber (const std::string &s) |
| True if s is not empty and holds digits only. | |
| 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. Surrounding whitespace and a leading + are ignored; any other trailing character is a failure, so a half-numeric value is not read as its numeric prefix. | |
| 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 | toLower (const std::string &original) |
| A copy of original with every ASCII upper case letter lowered. | |
| 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 the result would be a C++ keyword. | |
| bool | findStringIgnoreCase (const std::string &strHaystack, const std::string &strNeedle) |
| True if strNeedle appears anywhere in strHaystack, ignoring case. | |
| std::string | toSenPropertyName (const std::string &original) |
| An HLA attribute name as a sen property name. Five names belong to the Object class, so an attribute that would take one of them gets NonSen appended. | |
| std::string | formatSemantics (std::string str) |
| Semantics text as a description: newlines become spaces and quotes become apostrophes. | |
| bool | isTrue (std::string_view str, std::string_view attribute) |
| Reads true or false, ignoring case. An empty string is false; anything else throws. | |
| 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. A node declares one if it carries semantics or an attribute; an extension carries no semantics. | |
| 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 | computeInteractionPath (const pugi::xpath_node &interactionNode) |
| The path of an interaction's PARENT, without the interaction root, which is what walking up the hierarchy needs. Empty for an interaction directly under the root. For the interaction's own path, which is its identity, use interactionClassPath. | |
| std::string | interactionClassPath (pugi::xml_node node) |
| The nested path of an interaction class node, without the interaction root, joined with dots. An interaction is identified by its path, so two sharing a leaf name in different branches stay apart, and one named by two modules is recognized as one interaction. | |
| 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 identified by its path, so two classes sharing a leaf name in different branches stay apart. | |
| 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. | |
| void | collectConstructorArgs (std::vector< Arg > &list, const ClassType &type) |
| The static read-write properties of a class, parents first: these are its constructor arguments. | |
| void | collectConstructorArgs (std::vector< Arg > &list, const ClassSpec &spec) |
| The same from a spec that has not been made into a type yet. | |
| std::vector< Arg > | prependArgs (const std::vector< Arg > ¤tArgs, const std::vector< Arg > &argsToPrepend) |
| argsToPrepend followed by currentArgs. | |
| 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 define: the caller knows the file and the member, so it writes the message. | |
| 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::optional< TransportMode > | getEventTransportMode (const std::string &hlaTransport) |
| The same for an event. | |
Variables | |
| constexpr std::size_t | maxStaticVectorSize = 1024 * 1024 |
| The largest maximum a bounded sequence is given. Above this an array becomes unbounded. | |
| struct sen::lang::fom::Document |
One document that was read, and the nodes in it that declare something.
| Class Members | ||
|---|---|---|
| path | path | |
| xml_document | xml | |
| xml_node | objectModel | |
| string | name | modelIdentification/name, used to resolve dependency references |
| string | package | the directory name in lower case |
| bool | isExtension {} | from the extensions input: adds members, never owns a type |
| bool | built {} | guards ensureBuilt's recursion |
| vector< Document * > | dependencies | |
| vector< Document * > | mappingImports | documents a mapping pulled in |
| vector< xml_node > | classNodes | |
| vector< xml_node > | interactionNodes | |
| CustomTypeRegistry | registry | The types this document owns. They become its type set, so this decides which generated file each type lands in. |
| vector< ConstTypeHandle<> > | storage | |
| struct sen::lang::fom::MappingDocument |
| struct sen::lang::fom::DocumentTypeSet |
A type set and the path it was built from. One caller resolves a single FOM file by path.
| Class Members | ||
|---|---|---|
| path | path | |
| unique_ptr< TypeSet > | typeSet | |
| struct sen::lang::fom::Declaration |
One declaring node and the document it came from, so a refusal can name the file.
| Class Members | ||
|---|---|---|
| xml_node | node | |
| Document * | document {} | |
| struct sen::lang::fom::Declarations |
Everything that declares one type. The complete definition owns the type and decides its package; every other declaration adds its members to it. HLA 4 calls this the union over the collective set of modules, and uses the same two words for the two roles.
| Class Members | ||
|---|---|---|
| vector< Declaration > | all | in the order the documents were read |
| Document * | owner {} | null when only extensions declare the type |
| bool | ownerIsComplete {false} | the owner's declaration carries semantics |
|
nodiscardnoexcept |
True if str begins with subStr.
|
nodiscard |
True if s is not empty and holds digits only.
|
nodiscard |
Reads a decimal unsigned value, or nothing if the text is not one or does not fit in 64 bits. Surrounding whitespace and a leading + are ignored; any other trailing character is a failure, so a half-numeric value is not read as its numeric prefix.
|
nodiscard |
Splits input on any of the delimiters. Empty pieces are kept.
|
nodiscard |
A copy of original with every ASCII upper case letter lowered.
|
nodiscard |
An HLA name as a sen member name: words split on _ and -, lower camel case, and a Val suffix where the result would be a C++ keyword.
|
nodiscard |
True if strNeedle appears anywhere in strHaystack, ignoring case.
|
nodiscard |
An HLA attribute name as a sen property name. Five names belong to the Object class, so an attribute that would take one of them gets NonSen appended.
|
nodiscard |
Semantics text as a description: newlines become spaces and quotes become apostrophes.
|
nodiscard |
Reads true or false, ignoring case. An empty string is false; anything else throws.
| void sen::lang::fom::collectClassesNodes | ( | pugi::xml_node | node, |
| std::vector< pugi::xml_node > & | result ) |
Collects the object class nodes that declare a class, descending through nested ones. A node declares one if it carries semantics or an attribute; an extension carries no semantics.
| void sen::lang::fom::collectInteractionNodes | ( | pugi::xml_node | node, |
| std::vector< pugi::xml_node > & | result ) |
The same for interaction classes, on semantics or at least one parameter.
|
nodiscard |
The path of an interaction's PARENT, without the interaction root, which is what walking up the hierarchy needs. Empty for an interaction directly under the root. For the interaction's own path, which is its identity, use interactionClassPath.
|
nodiscard |
The nested path of an interaction class node, without the interaction root, joined with dots. An interaction is identified by its path, so two sharing a leaf name in different branches stay apart, and one named by two modules is recognized as one interaction.
|
nodiscard |
The nested path of an object class node, without the HLA root, joined with dots. A class is identified by its path, so two classes sharing a leaf name in different branches stay apart.
|
nodiscard |
The path of a class in the FOM hierarchy, up to but not including root.
| void sen::lang::fom::collectConstructorArgs | ( | std::vector< Arg > & | list, |
| const ClassType & | type ) |
The static read-write properties of a class, parents first: these are its constructor arguments.
| void sen::lang::fom::collectConstructorArgs | ( | std::vector< Arg > & | list, |
| const ClassSpec & | spec ) |
The same from a spec that has not been made into a type yet.
|
nodiscard |
argsToPrepend followed by currentArgs.
|
nodiscard |
The transport mode for a property, from the FOM transportation. Nothing for a value the DIF does not define: the caller knows the file and the member, so it writes the message.
|
nodiscard |
The same for a method: best effort is unicast there, because a call goes to one object.
|
nodiscard |
The same for an event.
|
constexpr |
The largest maximum a bounded sequence is given. Above this an array becomes unbounded.