vg
tools for working with variation graphs
Public Types | Public Member Functions | Public Attributes | List of all members
vg::Range< Number > Struct Template Reference

#include <options.hpp>

Inheritance diagram for vg::Range< Number >:
vg::subcommand::TickChainLink

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...
 
Rangeoperator= (const Range &other)
 Copy assignment, preserving destination links. More...
 
Rangeoperator= (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 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...
 

Detailed Description

template<typename Number>
struct vg::Range< Number >

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.

Member Typedef Documentation

◆ type

template<typename Number >
using vg::Range< Number >::type = Number

Constructor & Destructor Documentation

◆ Range() [1/4]

template<typename Number >
vg::Range< Number >::Range ( )
inline

Default constructor.

◆ Range() [2/4]

template<typename Number >
vg::Range< Number >::Range ( const Number &  val)
inline

Construct from a single value.

◆ Range() [3/4]

template<typename Number >
vg::Range< Number >::Range ( const Range< Number > &  other)
inline

Copy, preserving destination links.

◆ Range() [4/4]

template<typename Number >
vg::Range< Number >::Range ( Range< Number > &&  other)
inline

Move, preserving destination links.

Member Function Documentation

◆ is_valid()

template<typename Number >
bool vg::Range< Number >::is_valid ( )
inline

Check the range for usefulness.

◆ operator Number()

template<typename Number >
vg::Range< Number >::operator Number ( ) const
inline

Convert to Number with the current value.

◆ operator=() [1/2]

template<typename Number >
Range& vg::Range< Number >::operator= ( const Range< Number > &  other)
inline

Copy assignment, preserving destination links.

◆ operator=() [2/2]

template<typename Number >
Range& vg::Range< Number >::operator= ( Range< Number > &&  other)
inline

Move assignment, preserving destination links.

◆ reset()

template<typename Number >
void vg::Range< Number >::reset ( )
inline

Start at our start value.

◆ reset_chain()

template<typename Number >
void vg::Range< Number >::reset_chain ( )
inlinevirtual

Start us and all the things we are chained onto at their start values.

Reimplemented from vg::subcommand::TickChainLink.

◆ tick()

template<typename Number >
bool vg::Range< Number >::tick ( )
inline

Increment our value. Returns true if the new value needs processing, and false if we have left or would leave the range.

◆ tick_chain()

template<typename Number >
bool vg::Range< Number >::tick_chain ( )
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.

Member Data Documentation

◆ end

template<typename Number >
Number vg::Range< Number >::end = 0

Represents the inclusive end of the range.

◆ here

template<typename Number >
Number vg::Range< Number >::here = 0

Represents the current value the range is at.

◆ running

template<typename Number >
bool vg::Range< Number >::running = false

Determines if we are running or not (i.e. is here valid)

◆ start

template<typename Number >
Number vg::Range< Number >::start = 0

Represents the start of the range.

◆ step

template<typename Number >
Number vg::Range< Number >::step = 1

Represents the step to move by each tick.


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