vg
tools for working with variation graphs
|
#include <option.hpp>
Public Member Functions | |
virtual void | register_option (OptionInterface *option) |
virtual vector< OptionInterface * > | get_options () |
virtual string | get_name () |
Private Attributes | |
vector< ptrdiff_t > | option_offsets |
Represents a thing-doing class that has options. You construct the class, configure its options, and then set it going.
|
virtual |
Get the name of the thing being configured, for titling the help section.
|
virtual |
Get all the options for this class. These pointers are only valid unless or until the underlying Configurable object moves or is assigned to.
|
virtual |
Each option will call this on construction and register with its owner.
|
private |
We really should be using something like CRTP and pointer-to-members on the actual class that's configurable, but for now we'll just exploit int<->pointer conversion and store the offset from us in memory to the location of the option in memory. If the option is correctly a mamber of a class derived from this one, it will work correctly because all instances share the same memory layout for members.