Class ByteSequence

Inheritance Relationships

Derived Types

Class Documentation

class ByteSequence

Abstract base class of objects that generate a sequence of bytes.

Subclassed by ska::pst::common::MersenneTFPSequence, ska::pst::common::NormalSequence, ska::pst::common::RandomSequence, ska::pst::common::SawtoothSequence, ska::pst::common::UniformSequence< T >

Public Functions

virtual ~ByteSequence() = default

Virtual destructor of abstract base class.

inline virtual void configure(const ska::pst::common::AsciiHeader &header)

Configure the byte sequence using AsciiHeader parameters.

Parameters

header – contains any required/optional configuration parameters

inline virtual void reset()

Reset the internal state of the byte sequence.

Post

The next call to generate or validate will behave as per the first call to these functions

virtual void generate(char *buffer, uint64_t bufsz) = 0

Generate a sequence of bytes.

Parameters
  • buffer – pointer to buffer to which the byte sequence will be written

  • bufsz – number of bytes to write to the buffer

virtual void generate_block(char *buffer, uint64_t bufsz, uint64_t block_size, uint64_t block_stride)

Generate a sequence of bytes in blocks separated by a stride.

Parameters
  • buffer – pointer to buffer to which the block sequence will be written

  • bufsz – size of the buffer, in bytes

  • block_size – size of each block to write, in bytes

  • block_stride – separation between start of each block, in bytes

virtual bool validate(char *buffer, uint64_t bufsz) = 0

Validate a sequence of bytes.

Parameters
  • buffer – pointer to buffer containing byte sequence to be validated

  • bufsz – number of bytes in the buffer to be validated

Returns

true if all bytes in the buffer are valid

virtual bool validate_block(char *buffer, uint64_t bufsz, uint64_t block_size, uint64_t block_stride)

Validate a sequence of bytes in blocks separated by a stride.

Parameters
  • buffer – pointer to buffer containing block sequence to be validated

  • bufsz – size of the buffer, in bytes

  • block_size – size of each block to validate, in bytes

  • block_stride – separation between start of each block, in bytes

Returns

true if all bytes in every block of the buffer are valid