Skip to content

Create a common C++ class for ID'd objects #3797

@pshriwise

Description

@pshriwise

Description

We have many objects that use IDs and hold an entry in a vector and map within the openmc namespace. Most commonly, these IDs are read from an attribute on an XML element in the same way. At some point I think it would make sense for these objects to inherit the ID capabilities from a class that handles ID checking/setting and insertion into the relevant vector/map pair.

This would make it more straightforward to add other ID'd types in the future. Source distributions are on my list, for example.

Alternatives

This isn't what I would call critical, so perhaps leave it as-is for now.

Compatibility

I don't believe this would affect compatibility for most users as it's primarily a refactor to reduce code duplication. Though there are perhaps cases code interfacing with the C++ objects directly may be affected (e.g. if an attribute becomes private with accessor methods).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions