Skip to content

Include an array of variable/parameter names (string) in each model template #1

Description

@angellareo

Include, in each model template, an array containing the names of its variables and parameters:
static const std::string param_names[]={"a", "b", "c", "d"};
static const std::string var_names[]={"u", "v"};
This allows to obtain (as strings) the names of the variables/parameters (which are now only named values from the enum), which is interesting e.g. for generic loading of the initial configuration.

Also, consider the pros/cons of using a map instead of the enum+array.

More alternatives in: https://stackoverflow.com/questions/7354305/c-using-x-macro-to-define-enum-and-string-array-inside-class

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions