Lumiera  0.pre.03
»edit your freedom«
steam::engine::test::anonymous_namespace{testframe.cpp} Namespace Reference

Classes

class  DistinctNucleus
 
struct  TestFrameTable
 

Functions

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

Variables

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

Function Documentation

◆ generateDiscriminator()

uint64_t steam::engine::test::anonymous_namespace{testframe.cpp}::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.

◆ stampHeader()

HashVal steam::engine::test::anonymous_namespace{testframe.cpp}::stampHeader ( )
Returns
a stable characteristic memory marker for the metadata record

Definition at line 120 of file testframe.cpp.

◆ buildDataGenFrom()

auto steam::engine::test::anonymous_namespace{testframe.cpp}::buildDataGenFrom ( uint64_t const &  anchor)

build a PRNG starting from the referred fixed seed

Definition at line 129 of file testframe.cpp.

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.

◆ 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().