vg
tools for working with variation graphs
Public Member Functions | Private Attributes | List of all members
vg::Configurable Class Reference

#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
 

Detailed Description

Represents a thing-doing class that has options. You construct the class, configure its options, and then set it going.

Member Function Documentation

◆ get_name()

string vg::Configurable::get_name ( )
virtual

Get the name of the thing being configured, for titling the help section.

◆ get_options()

vector< OptionInterface * > vg::Configurable::get_options ( )
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.

◆ register_option()

void vg::Configurable::register_option ( OptionInterface option)
virtual

Each option will call this on construction and register with its owner.

Member Data Documentation

◆ option_offsets

vector<ptrdiff_t> vg::Configurable::option_offsets
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.


The documentation for this class was generated from the following files: