Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
steam::engine::test::anonymous_namespace{testframe.cpp} Namespace Reference

Classes

class  DistinctNucleus
 
struct  TestFrameTable
 

Functions

HashVal drawSeed (lib::Random &srcGen)
 
uint64_t generateDiscriminator (uint seq, uint family)
 
HashVal stampHeader ()
 
auto buildDataGenFrom (uint64_t const &anchor)
 
TestFrameaccessAsTestFrame (void *memoryLocation)
 

Variables

const size_t SEQUENCE_SPREAD = 100
 Offset to set the seed values of »families« apart.
 
HashVal dataSeed {drawSeed(lib::entropyGen)}
 
std::unique_ptr< TestFrameTabletestFrames
 

Function Documentation

◆ drawSeed()

HashVal drawSeed ( lib::Random srcGen)

Definition at line 74 of file testframe.cpp.

References RandomSequencer< GEN >::distribute(), drawSeed(), and SEQUENCE_SPREAD.

Referenced by drawSeed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateDiscriminator()

uint64_t generateDiscriminator ( uint  seq,
uint  family 
)

helper for generating unique test frames. This »discriminator« is used as a random seed when filling the test frame data buffers. It is generated to be very likely different on adjacent frames of the same series, as well as to differ to all nearby neighbouring channels.

Note
the dataSeed hash is limited by SEQUENCE_SPREAD to prevent „risky“ families; the extreme case would be dataSeed+family ≡ 0 (all frames would be equal then)
Parameters
seqthe sequence number of the frame within the channel
familythe channel this frame belongs to

Definition at line 94 of file testframe.cpp.

References dataSeed, and generateDiscriminator().

Referenced by generateDiscriminator().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ stampHeader()

HashVal stampHeader ( )
Returns
a stable characteristic memory marker for the metadata record

Definition at line 120 of file testframe.cpp.

References lib::entropyGen, RandomSequencer< GEN >::hash(), and stampHeader().

Referenced by stampHeader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildDataGenFrom()

auto buildDataGenFrom ( uint64_t const &  anchor)

build a PRNG starting from the referred fixed seed

Definition at line 129 of file testframe.cpp.

References buildDataGenFrom().

Referenced by buildDataGenFrom().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ accessAsTestFrame()

TestFrame & accessAsTestFrame ( void *  memoryLocation)

Definition at line 137 of file testframe.cpp.

References accessAsTestFrame().

Referenced by accessAsTestFrame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ SEQUENCE_SPREAD

const size_t SEQUENCE_SPREAD = 100

Offset to set the seed values of »families« apart.

The data in the test frames is generated from a distinctive ID-seed, which is controlled by the family and the seq-No within each family. The seeds for consecutive frames are spread apart by the dataSeed, and the SEQUENCE_SPREAD constant acts as minimum spread. While seed values can wrap within the 64bit number range, this generation scheme makes it very unlikely that neighbouring frames end up with the same seed.

Definition at line 71 of file testframe.cpp.

Referenced by drawSeed().

◆ dataSeed

HashVal dataSeed {drawSeed(lib::entropyGen)}

a static seed hash used to anchor the data distinction ID-seeds

Definition at line 82 of file testframe.cpp.

Referenced by generateDiscriminator().

◆ testFrames

std::unique_ptr<TestFrameTable> testFrames

Definition at line 178 of file testframe.cpp.