vg
tools for working with variation graphs
Public Member Functions | Public Attributes | Protected Member Functions | 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

 TickChainLink ()=default
 
 TickChainLink (const TickChainLink &other)=delete
 
 TickChainLink (TickChainLink &&other)=delete
 
TickChainLinkoperator= (const TickChainLink &other)=delete
 
TickChainLinkoperator= (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 TickChainLinkchain (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 ()
 

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.

May not move after chain() has been called on it! So we make it immovable.

Constructor & Destructor Documentation

◆ TickChainLink() [1/3]

vg::subcommand::TickChainLink::TickChainLink ( )
default

◆ TickChainLink() [2/3]

vg::subcommand::TickChainLink::TickChainLink ( const TickChainLink other)
delete

◆ TickChainLink() [3/3]

vg::subcommand::TickChainLink::TickChainLink ( TickChainLink &&  other)
delete

◆ ~TickChainLink()

virtual vg::subcommand::TickChainLink::~TickChainLink ( )
virtualdefault

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.

◆ is_static()

bool vg::subcommand::TickChainLink::is_static ( ) const
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 >.

◆ operator=() [1/2]

TickChainLink& vg::subcommand::TickChainLink::operator= ( const TickChainLink other)
delete

◆ operator=() [2/2]

TickChainLink& vg::subcommand::TickChainLink::operator= ( TickChainLink &&  other)
delete

◆ reset_along_chain()

void vg::subcommand::TickChainLink::reset_along_chain ( )
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 >.

◆ reset_chain()

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

Reset the chain to its initial values.

Reimplemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.

◆ tick_along_chain()

bool vg::subcommand::TickChainLink::tick_along_chain ( )
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 >.

◆ 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. 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 >.

Member Data Documentation

◆ reset_along_chain_parent

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

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

◆ tick_along_chain_parent

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

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


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