vg
tools for working with variation graphs
|
#include <options.hpp>
Public Types | |
using | type = Number |
Public Member Functions | |
Range () | |
Default constructor. More... | |
Range (const Number &val) | |
Construct from a single value. More... | |
Range (const Range &other) | |
Copy, preserving destination links. More... | |
Range (Range &&other) | |
Move, preserving destination links. More... | |
Range & | operator= (const Range &other) |
Copy assignment, preserving destination links. More... | |
Range & | operator= (Range &&other) |
Move assignment, preserving destination links. More... | |
bool | is_valid () |
Check the range for usefulness. More... | |
operator Number () const | |
Convert to Number with the current value. More... | |
void | reset () |
Start at our start value. More... | |
void | reset_chain () |
Start us and all the things we are chained onto at their start values. More... | |
bool | tick () |
bool | tick_chain () |
Public Member Functions inherited from vg::subcommand::TickChainLink | |
virtual TickChainLink & | chain (TickChainLink &next) |
virtual std::function< void(const std::function< void(void)> &)> | get_iterator () |
Public Attributes | |
Number | start = 0 |
Represents the start of the range. More... | |
Number | end = 0 |
Represents the inclusive end of the range. More... | |
Number | step = 1 |
Represents the step to move by each tick. More... | |
Number | here = 0 |
Represents the current value the range is at. More... | |
bool | running = false |
Determines if we are running or not (i.e. is here valid) More... | |
Public Attributes inherited from vg::subcommand::TickChainLink | |
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... | |
Tickable link that represents a single value or a range of values. Range rusn from start to <=end, going up by step. You can set the range to s aingle value or to a full range, and when you read it you see the current value.
Construct from a single value.
Copy, preserving destination links.
Move, preserving destination links.
|
inline |
Check the range for usefulness.
|
inline |
Convert to Number with the current value.
|
inline |
Copy assignment, preserving destination links.
Move assignment, preserving destination links.
|
inline |
Start at our start value.
|
inlinevirtual |
Start us and all the things we are chained onto at their start values.
Reimplemented from vg::subcommand::TickChainLink.
|
inline |
Increment our value. Returns true if the new value needs processing, and false if we have left or would leave the range.
|
inlinevirtual |
Increment our value. If it overflows, tick_chain whatever we are chained onto, and reset and succeed if that succeeds.
Reimplemented from vg::subcommand::TickChainLink.
Number vg::Range< Number >::end = 0 |
Represents the inclusive end of the range.
Number vg::Range< Number >::here = 0 |
Represents the current value the range is at.
bool vg::Range< Number >::running = false |
Determines if we are running or not (i.e. is here valid)
Number vg::Range< Number >::start = 0 |
Represents the start of the range.
Number vg::Range< Number >::step = 1 |
Represents the step to move by each tick.