Class emulator::CouplingFieldsBase
ClassList > emulator > CouplingFieldsBase
Base utility class for coupling field index management. More...
#include <coupling_fields.hpp>
Public Attributes
| Type | Name |
|---|---|
| int | num_exports = 0Total number of export fields. |
| int | num_imports = 0Total number of import fields. |
Public Functions
| Type | Name |
|---|---|
| int | get_export_index (const std::string & name) const Look up the index of an export field by name. |
| int | get_import_index (const std::string & name) const Look up the index of an import field by name. |
| virtual void | initialize (const std::string & export_fields, const std::string & import_fields) Initialize field indices from colon-separated field lists. |
| virtual | ~CouplingFieldsBase () = default |
Protected Attributes
| Type | Name |
|---|---|
| std::map< std::string, int > | export_map Export field name to index. |
| std::map< std::string, int > | import_map Import field name to index. |
Protected Functions
| Type | Name |
|---|---|
| void | parse_field_list (const std::string & fields, std::map< std::string, int > & field_map, int & count) Parse a colon-separated field list into a name->index map. |
Detailed Description
Public Attributes Documentation
variable num_exports
Total number of export fields.
int emulator::CouplingFieldsBase::num_exports;
variable num_imports
Total number of import fields.
int emulator::CouplingFieldsBase::num_imports;
Public Functions Documentation
function get_export_index
Look up the index of an export field by name.
inline int emulator::CouplingFieldsBase::get_export_index (
const std::string & name
) const
Parameters:
nameField name to look up
Returns:
Field index (0-based), or -1 if not found
function get_import_index
Look up the index of an import field by name.
inline int emulator::CouplingFieldsBase::get_import_index (
const std::string & name
) const
Parameters:
nameField name to look up
Returns:
Field index (0-based), or -1 if not found
function initialize
Initialize field indices from colon-separated field lists.
inline virtual void emulator::CouplingFieldsBase::initialize (
const std::string & export_fields,
const std::string & import_fields
)
Parses the export and import field strings and builds internal lookup maps. Field strings use the MCT format: "field1:field2:field3".
Parameters:
export_fieldsColon-separated list of export (a2x) field namesimport_fieldsColon-separated list of import (x2a) field names
function ~CouplingFieldsBase
virtual emulator::CouplingFieldsBase::~CouplingFieldsBase () = default
Protected Attributes Documentation
variable export_map
Export field name to index.
std::map<std::string, int> emulator::CouplingFieldsBase::export_map;
variable import_map
Import field name to index.
std::map<std::string, int> emulator::CouplingFieldsBase::import_map;
Protected Functions Documentation
function parse_field_list
Parse a colon-separated field list into a name->index map.
inline void emulator::CouplingFieldsBase::parse_field_list (
const std::string & fields,
std::map< std::string, int > & field_map,
int & count
)
Parameters:
fieldsInput string of colon-separated field namesfield_mapOutput map from field name to indexcountOutput total count of fields parsed
The documentation for this class was generated from the following file components/emulator_comps/common/src/coupling_fields.hpp