randfmt
randfmt
Section titled “randfmt”Classes
Section titled “Classes”| Name | Description |
|---|---|
Block |
The main descriptor of a Block of data in the sbio randfmt format. |
ConfigBlock |
The payload of a ConfigBlock. |
DetectorSpec |
A simplified description of a detector to allow specifying how to write payloads. |
FileTrailer |
|
Header |
|
IndexBlock |
The payload of an IndexBlock. |
IndexEntry |
An entry to describe the location of a prior SuperBlock. |
MetadataBlock |
The payload of a MetadataBlock. |
SuperBlock |
The payload of a SuperBlock. |
Enumerations
Section titled “Enumerations”| Name | Description |
|---|---|
BlockType |
|
FormatFlags |
File format flags. |
BlockType
Section titled “BlockType”enum BlockType| Value | Description |
|---|---|
Super |
Block defining a group of upcoming blocks. |
Config |
Block to define global configuration (like PRNG seed) |
Metadata |
Block containing metadata for interpreting later Data blocks. |
Data |
Block containing raw data payloads. |
Index |
Block to write SuperBlock indices (if enabled) |
FormatFlags
Section titled “FormatFlags”enum FormatFlagsFile format flags.
Some flags control features at the granularity of super-blocks, some at the block level, and some at the full stream level. They are always written to Config block payloads, though, as well as into the Header of every block.
| Value | Description |
|---|---|
SubBlockOffsetTable |
Each SuperBlock will write an offset table to jump within the SuperBlock. |
SuperBlockOffsetTable |
Write an offset-table to each SuperBlock at the end. |
Typedefs
Section titled “Typedefs”| Return | Name | Description |
|---|---|---|
int |
FileHandle |
FileHandle
Section titled “FileHandle”using FileHandle = intFunctions
Section titled “Functions”| Return | Name | Description |
|---|---|---|
void |
write_bytes |
|
void |
write_super_block |
|
void |
construct_data_block |
|
void |
construct_cfg_block |
|
void |
construct_meta_block |
|
void |
write_sbiornd_file |
|
SBIO_HD bool |
test_feature_flag inline |
write_bytes
Section titled “write_bytes”void write_bytes(FileHandle fd, const void * buf, hd_std::size_t sz, hd_std::uint64_t off)write_super_block
Section titled “write_super_block”void write_super_block(FileHandle f_handle, hd_std::uint64_t seq_no, hd_std::uint8_t flags, hd_std::uint8_t num_sub_blocks, BlockType * block_types, hd_std::uint8_t * block_ids, void ** payloads, hd_std::uint32_t * sizes, hd_std::uint64_t & curr_offset)construct_data_block
Section titled “construct_data_block”void construct_data_block(hd_std::uint32_t size, hd_std::uint8_t pattern_type, hd_std::uint8_t *& payload, hd_std::uint32_t seed, hd_std::uint64_t seq_no)construct_cfg_block
Section titled “construct_cfg_block”void construct_cfg_block(hd_std::uint32_t seed, hd_std::uint8_t pattern_type, hd_std::uint64_t total_events, hd_std::uint8_t flags, hd_std::uint8_t *& payload)construct_meta_block
Section titled “construct_meta_block”void construct_meta_block(hd_std::uint8_t num_detectors, const DetectorSpec * detector_specs, hd_std::uint8_t *& payload)write_sbiornd_file
Section titled “write_sbiornd_file”void write_sbiornd_file(FileHandle f_handle, hd_std::uint64_t & curr_offset, hd_std::uint8_t num_detectors, const DetectorSpec * detector_specs, hd_std::uint8_t * det_block_ids, hd_std::uint32_t seed, hd_std::uint8_t pattern_type, hd_std::uint64_t total_events, hd_std::uint8_t flags)test_feature_flag
Section titled “test_feature_flag”inline
inline SBIO_HD bool test_feature_flag(hd_std::uint8_t flags, FormatFlags feat)Variables
Section titled “Variables”| Return | Name | Description |
|---|---|---|
constexpr hd_std::uint16_t |
MaxRank static constexpr |
The maximum number of dimensions a data payload may have. |
constexpr hd_std::uint16_t |
MaxNameSize static constexpr |
The maximum number of bytes for string/character payloads. |
constexpr char |
MagicBytes static constexpr |
Magic byte start sequence: SBIORND0. |
constexpr char |
MagicTail static constexpr |
Magic byte tail sequence: SBIOTAIL. |
MaxRank
Section titled “MaxRank”static constexpr
constexpr hd_std::uint16_t MaxRank { 5 }The maximum number of dimensions a data payload may have.
MaxNameSize
Section titled “MaxNameSize”static constexpr
constexpr hd_std::uint16_t MaxNameSize { 64 }The maximum number of bytes for string/character payloads.
MagicBytes
Section titled “MagicBytes”static constexpr
constexpr char MagicBytes { 'S', 'B', 'I', 'O', 'R', 'N', 'D', '0' }Magic byte start sequence: SBIORND0.
Last byte (currently 0) provides a version identifier.
Regardless of any additional data, all blocks for the random format must begin with the magic bytes.
MagicTail
Section titled “MagicTail”static constexpr
constexpr char MagicTail { 'S', 'B', 'I', 'O', 'T', 'A', 'I', 'L' }Magic byte tail sequence: SBIOTAIL.
The final bytes are always the tail sequence. Preceeding this, a trailer includes a byte offset of the IndexBlock (if that feature was enabled during writing).