vg
tools for working with variation graphs
Public Member Functions | Public Attributes | List of all members
vg::subcommand::TickChainLink Struct Reference

#include <options.hpp>

Inheritance diagram for vg::subcommand::TickChainLink:
vg::Range< T > vg::Range< Number > vg::subcommand::BaseArgSpec< Receiver > vg::subcommand::BaseOptionGroup vg::subcommand::ArgSpec< bool, Receiver > vg::subcommand::ArgSpec< T, Receiver > vg::subcommand::GroupedOptionGroup vg::subcommand::OptionGroup< Receiver > vg::subcommand::ValueArgSpec< bool, Receiver > vg::subcommand::ValueArgSpec< T, Receiver, Range< T > > vg::subcommand::ValueArgSpec< T, Receiver, Holder > vg::subcommand::FlagArgSpec< Receiver > vg::subcommand::RangeArgSpec< T, Receiver >

Public Member Functions

virtual void reset_chain ()
 Reset the chain to its initial values. More...
 
virtual bool tick_chain ()
 
virtual TickChainLinkchain (TickChainLink &next)
 
virtual std::function< void(const std::function< void(void)> &)> get_iterator ()
 

Public Attributes

std::function< void(void)> reset_chain_parent
 This will be called when we want to reset_chain what we are chained onto. More...
 
std::function< bool(void)> tick_chain_parent
 This will be called when we need to tick_chain our parent. More...
 

Detailed Description

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.

Member Function Documentation

◆ chain()

TickChainLink & vg::subcommand::TickChainLink::chain ( TickChainLink next)
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 >.

◆ get_iterator()

std::function< void(const std::function< void(void)> &)> vg::subcommand::TickChainLink::get_iterator ( )
virtual

Get a function that runs another function for each combination of values for this Range and all Ranges it has been chained onto.

◆ reset_chain()

void vg::subcommand::TickChainLink::reset_chain ( )
virtual

Reset the chain to its initial values.

Reimplemented in vg::Range< Number >, and vg::Range< T >.

◆ tick_chain()

bool vg::subcommand::TickChainLink::tick_chain ( )
virtual

Tick the chain. Return true if there's still a value for the chain, and false if the chain is out of values.

Reimplemented in vg::Range< Number >, and vg::Range< T >.

Member Data Documentation

◆ reset_chain_parent

std::function<void(void)> vg::subcommand::TickChainLink::reset_chain_parent
Initial value:
= []() {
}

This will be called when we want to reset_chain what we are chained onto.

◆ tick_chain_parent

std::function<bool(void)> vg::subcommand::TickChainLink::tick_chain_parent
Initial value:
= []() {
return false;
}

This will be called when we need to tick_chain our parent.


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