Skip to content

Add public class members with the parameter names in each SGObject class #5042

@gf712

Description

@gf712

Currently we register parameter names using SG_ADD(&class_member, "name", "parameter description"). The problem is that changing the registered name (in this case "name") results in issues everytime we refactor the parameter names. To address this issue the class should register a static constexpr std::string_view kParam = "name" that should be used to register the class name.
If we ever need to use get/put we should use these constexpr string_views, to avoid any typos.

Example:

Parameter name is define here:

public:
static constexpr std::string_view kWeights = "weights";

And is used in parameter registration here:

SG_ADD(&m_weights, kWeights, "weights");

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions