Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/Centralize Configure machinery #36

Open
allenss-amazon opened this issue Feb 6, 2025 · 0 comments
Open

Enhance/Centralize Configure machinery #36

allenss-amazon opened this issue Feb 6, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@allenss-amazon
Copy link
Member

There are many places in the code where there are constant values that should be configurable. Open source has a configuration mechanism for configurable values in module and our code should be using that.

This would be made easy for developers to have a few static classes within VMSDK that you could just statically declare and this
would automatically make that variable configurable. Specific features that should be include:

  1. For numerical configurables: Ability to specify range of validity ([min..max]) either as constant values or the result of some invokeable validation function.
  2. A programmable validation function. Sometimes a fixed range isn't sufficient, for those cases a callback for code that verifies.
  3. Notification on change. A registerable callback to get notification on change.
  4. Marking that change is only valid at startup. A special case of verification function, but happens often enough that it's worth providing as a service....

Some examples:

// An integer configurable with default value 10,  valid values in the range [1..100] Can only be set at startup.
VMSDK::Configure<int> x("max-fred-value", 10, 1, 100, VMSDK:ConfigureFlag::kOnlyAtInitialization);

// A float configurable with a default value of 1.5, minimum value is dynamically computed (here by a lambda) max value is 100.
VMSDK::Configure<float> y("frobisher"), 1.5, [] {return ...};);

// An int that invokes a call back when it's changed
VMSDK::Configure<int> z("foobar", 10, [] { .... Called when changed ... });
@allenss-amazon allenss-amazon added good first issue Good for newcomers enhancement New feature or request labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant