|
RIT VEXU Core API
|
Typedefs | |
| using | selector_t = size_t() |
| The type of an Initializer's Selector function. | |
Functions | |
| std::function< selector_t > | select (size_t n) |
| std::function< selector_t > | random (size_t a, size_t b) |
| std::function< selector_t > | random (size_t n) |
| template<size_t FLAG = NO_SELECTION_INDEX> | |
| std::function< selector_t > | skippable (std::function< selector_t > selector) |
| std::function< selector_t > | timeout (std::function< selector_t > selector, uint64_t microsec, unsigned int fallback=NO_SELECTION_INDEX, std::function< void(size_t)> cancel=nullptr) |
| std::function< selector_t > | delayed (std::function< selector_t > selector, unsigned int ms) |
| std::function< selector_t > | potentiometer (vex::pot &potentiometer, const size_t &initializations) |
| std::function< selector_t > | weighted_potentiometer (vex::pot &potentiometer, std::vector< Initialization > &initializations) |
Variables | |
| constexpr size_t | NO_SELECTION_INDEX = SIZE_MAX |
| A constant index that is used in selector functions to represent when a selection has not yet been made. | |
A namespace containing predefined selector functions and wrappers that can be passed to an Initializer.
|
inline |
A selector function wrapper that delays the program for a set amount of time before selecting the Initialization.
| selector | The selector function to execute |
| ms | The amount of time to delay for, in milliseconds |
|
inline |
A selector function that utilizes a potentiometer to select the Initialization Each initialization is corresponds to an equal percentage of the potentiometer's range.
| potentiometer | The potentiometer to select inputs based on |
| initializations | The number of initializations |
|
inline |
Returns a selector function that selects a random Initialization
| a | The inclusive beginning of the random range |
| b | The exclusive end of the random range |
|
inline |
Returns a selector function that selects a random Initialization
| n | The exclusive end of the random range |
|
inline |
Returns a selector function that selects the Initialization corresponding to N
| n | The Initialization to select |
|
inline |
Returns a selector function wrapper that allows selection to be skipped based on a compile-time flag. This should only be used for debugging, as it would otherwise defeat the purpose of the Initializer.
| FLAG | The Initialization to select if compile-time selection is wanted, or nothing to select Initializations based on the provided selector. |
| selector | The selector function for runtime selection |
|
inline |
A selector function wrapper that allows a selection to timeout, returning the fallback if it does.
| selector | The thread-safe selector function to execute |
| microsec | The amount of time until a timeout occurs, in microseconds |
| fallback | The return value if a timeout occurs |
| cancel | The callback used to notify the rest of the program if a timeout occured. It will always be passed the fallback value as its argument. |
|
inline |
A selector function that utilizes a potentiometer to select the Initialization. This function uses the metadata of the Initializations to determine their representation on the potentiometer.
| potentiometer | The potentiometer to select inputs based on |
| initializations | A vector of initializations |