New sysvar design (less macros, more classes)

Registered by Aarti Pai

New sysvar design (less macros, more classes).

The current system has a limited amount of types, because it defines a class per type. This means we're forced to choose between, for instance, uint32_t and uint64_t when, in fact, we want to store a size_t. (actual current problem)

To make this better, I want to replace sys_var_uint64_t_ptr and the like with sys_var<T>. Much of the code is the same to the template code should be friendlier, actually. The constructors will likely need to be re-addressed, but we should be able to handle that with some template specialization, perhaps.

The one other part that will need to be changed is the SHOW_VAR stuff.

If we remove the SHOW_TYPE show_type() and instead make a std::string to_string(); method, then making the show array would be a simple matter or iterating and calling to_string() on each sys_var. For the implementation of each to_string, rather than having a bunch of template specilizations, to_string() can be implemeted as calling sys_var_to_string(value) and then we can have non-member functions:

std::string sys_var_to_string(uint64_t value);
std::string sys_var_to_string(uint32_t value);

Blueprint information

Status:
Not started
Approver:
None
Priority:
Low
Drafter:
Brian Aker
Direction:
Needs approval
Assignee:
Monty Taylor
Definition:
Review
Series goal:
Accepted for trunk
Implementation:
Not started
Milestone target:
milestone icon future

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.