|
FastLED 3.10.8
|
A random number generator class that wraps FastLED's random functions.
This class provides a standard C++ random generator interface that can be used with algorithms like fl::shuffle. Each instance maintains its own seed state independent of other instances and the global FastLED random state.
All public methods delegate to private _nolock helpers. This means external locking (via the LockedRandom singleton in random.cpp.hpp) only needs to wrap the public entry points.
#include <random.h>
Public Types | |
| typedef u32 | result_type |
Public Member Functions | |
| random () FL_NO_EXCEPT | |
| Default constructor - uses current global random seed. | |
| random (u16 seed) FL_NO_EXCEPT | |
| Constructor with explicit seed. | |
| void | add_entropy (u16 entropy) FL_NO_EXCEPT |
| u16 | get_seed () const FL_NO_EXCEPT |
| result_type | operator() () FL_NO_EXCEPT |
| result_type | operator() (result_type min, result_type max) FL_NO_EXCEPT |
| result_type | operator() (result_type n) FL_NO_EXCEPT |
| u16 | random16 () FL_NO_EXCEPT |
| u16 | random16 (u16 min, u16 max) FL_NO_EXCEPT |
| u16 | random16 (u16 n) FL_NO_EXCEPT |
| u8 | random8 () FL_NO_EXCEPT |
| u8 | random8 (u8 min, u8 max) FL_NO_EXCEPT |
| u8 | random8 (u8 n) FL_NO_EXCEPT |
| void | set_seed (u16 seed) FL_NO_EXCEPT |
Static Public Member Functions | |
| static constexpr result_type | maximum () FL_NO_EXCEPT |
| static constexpr result_type | minimum () FL_NO_EXCEPT |
Private Member Functions | |
| result_type | generate_nolock () FL_NO_EXCEPT |
| result_type | generate_nolock (result_type min, result_type max) FL_NO_EXCEPT |
| result_type | generate_nolock (result_type n) FL_NO_EXCEPT |
| u16 | next_random16_nolock () FL_NO_EXCEPT |
| u32 | next_random32_nolock () FL_NO_EXCEPT |
| u16 | random16_nolock () FL_NO_EXCEPT |
| u8 | random8_nolock () FL_NO_EXCEPT |
| u8 | random8_nolock (u8 min, u8 max) FL_NO_EXCEPT |
| u8 | random8_nolock (u8 n) FL_NO_EXCEPT |
Private Attributes | |
| u16 | mSeed |