vg
tools for working with variation graphs
|
#include <options.hpp>
Public Member Functions | |
TickChainLink ()=default | |
TickChainLink (const TickChainLink &other)=delete | |
TickChainLink (TickChainLink &&other)=delete | |
TickChainLink & | operator= (const TickChainLink &other)=delete |
TickChainLink & | operator= (TickChainLink &&other)=delete |
virtual | ~TickChainLink ()=default |
virtual void | reset_chain () |
Reset the chain to its initial values. More... | |
virtual bool | tick_chain () |
virtual bool | is_static () const |
Return true if this link never changes. We assume we are static by default. More... | |
virtual TickChainLink & | chain (TickChainLink &next) |
virtual std::function< void(const std::function< void(void)> &)> | get_iterator () |
Public Attributes | |
std::function< void(void)> | reset_along_chain_parent |
This will be called when we want to reset_along_chain what we are chained onto. More... | |
std::function< bool(void)> | tick_along_chain_parent |
This will be called when we need to tick_along_chain our parent. More... | |
Protected Member Functions | |
virtual bool | tick_along_chain () |
virtual void | reset_along_chain () |
Interface for things that form a "chain" that can be "ticked".
Each link in the chain works like a digit place in a number, and ticking increments the number. This lets us do gird search over a bunch of values of different types without a bunch of nexted loops.
May not move after chain() has been called on it! So we make it immovable.
|
default |
|
delete |
|
delete |
|
virtualdefault |
|
virtual |
Add a thing to the chain after us. Return that thing.
Reimplemented in vg::subcommand::GroupedOptionGroup, vg::subcommand::OptionGroup< Receiver >, and vg::subcommand::RangeArgSpec< T, Receiver >.
|
virtual |
Get a function that runs another function for each combination of values for this Range and all Ranges it has been chained onto.
|
virtual |
Return true if this link never changes. We assume we are static by default.
Reimplemented in vg::subcommand::RangeArgSpec< T, Receiver >, and vg::Range< Number >.
|
delete |
|
delete |
|
protectedvirtual |
Reset along the chain, makign this item and all parents take on their initial values.
Reimplemented in vg::Range< Number >, and vg::Range< T >.
|
virtual |
Reset the chain to its initial values.
Reimplemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
protectedvirtual |
Tick the chain. Return true if there's still a value for the chain, and false if the chain is out of values. Should be called by tick_chain() or a child. May not delegate to a different item.
Reimplemented in vg::Range< Number >, and vg::Range< T >.
|
virtual |
Tick the chain. Return true if there's still a value for the chain, and false if the chain is out of values. Should be called on the last item in the chain. May delegate to a different item (for e.g. groups).
Reimplemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
std::function<void(void)> vg::subcommand::TickChainLink::reset_along_chain_parent |
This will be called when we want to reset_along_chain what we are chained onto.
std::function<bool(void)> vg::subcommand::TickChainLink::tick_along_chain_parent |
This will be called when we need to tick_along_chain our parent.