![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cRandom.h>
Public Member Functions | |
cRandomOS () | |
virtual | ~cRandomOS () |
virtual HRESULT | GetNoise (void *pData, size_t iSize) override |
fill array with random. return # filled. More... | |
virtual UINT | get_RandUns () |
const void * | get_HeapPtr () const noexcept override |
Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More... | |
![]() | |
cRandomBase () noexcept | |
virtual | ~cRandomBase () |
void | InitSeed (IRandomNoise *pSrc, size_t iSize) |
the default random number generator. NOT Thread Safe! More... | |
void | InitSeedDefault (size_t iSize=sizeof(int)) |
void | InitSeedUns (UINT iSeed) |
bool | GetRandBool () |
virtual UINT | GetRandUX (UINT nScale) |
int | GetRandIRange (int iRangeLo, int iRangeHi) |
![]() | |
virtual | ~CObject () |
virtual bool | isValidCheck () const noexcept |
< memory allocation and structure definitions are valid. More... | |
virtual void | AssertValid () const |
< memory allocation and structure definitions are valid. More... | |
virtual void | Serialize (cArchive &a) |
![]() | |
cHeapObject () | |
virtual | ~cHeapObject () |
bool | IsValidInsideN (INT_PTR index) const |
bool | IsValidInsidePtr (void const *pTest) const |
virtual size_t | GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const |
virtual bool | isValidCheck () const noexcept |
Static Public Member Functions | |
static HRESULT __stdcall | GetNoiseOS (void *pData, size_t iSize) |
![]() | |
static cRandomOS *__stdcall | get_Single () |
static TYPE2 *__stdcall | get_SingleT () |
static cRandomOS &__stdcall | I () |
![]() | |
static bool | isSingleCreated () noexcept |
static TYPE * | get_SingleU () noexcept |
static TYPE * | get_Single () |
template<class TYPE2 > | |
static TYPE2 *__stdcall | get_SingleCast () |
static TYPE & | I () noexcept |
![]() | |
static void __stdcall | ReleaseModule (HMODULE hMod) |
Additional Inherited Members | |
![]() | |
typedef UINT | SEED_t |
default seed size might be 32 or 64 bit depending on k_RAND_MAX. More... | |
![]() | |
static cThreadLockFast | sm_LockSingle |
common lock for all cSingleton. More... | |
![]() | |
cSingleton (cRandomOS *pObject, const TYPEINFO_t &rAddrCode=typeid(cRandomOS)) noexcept | |
virtual | ~cSingleton () |
![]() | |
cSingletonStatic (TYPE *pObject) noexcept | |
virtual | ~cSingletonStatic () noexcept |
![]() | |
cSingletonRegister (const TYPEINFO_t &rAddrCode) noexcept | |
virtual | ~cSingletonRegister () |
void | RegisterSingleton () |
![]() | |
HMODULE | m_hModuleLoaded |
What modules loaded this ? So singletons can be destroyed if DLL/SO unloads. More... | |
![]() | |
static TYPE * | sm_pThe = nullptr |
pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More... | |
Get Low level Hardware based noise supplied by the OS. NO SEED. NOT Deterministic (in theory) linux use "/dev/urandom" as a get_RandomSeed().
Gray::cRandomOS::cRandomOS | ( | ) |
|
virtual |
|
inlineoverridevirtualnoexcept |
Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr().
Reimplemented from Gray::cHeapObject.
|
virtual |
Reimplemented from Gray::cRandomBase.
|
overridevirtual |
fill array with random. return # filled.
Get the best source or random noise the system can supply. Make a random seed from the most random source we can find.
fill a buffer with random bytes of data. < 0 = error.
Reimplemented from Gray::cRandomBase.
Try to use the OS supplied noise generator. It may not work.