Quantum 3xplorer (Q3)
Loading...
Searching...
No Matches
init.hpp
Go to the documentation of this file.
1
#pragma once
2
3
/**
4
* BinaryRecordFormat — abstract interface for binary record I/O formats.
5
*
6
* Defines the contract for writing and reading framed binary records.
7
* Concrete implementations handle the specific byte-level framing:
8
* - QE: Fortran unformatted sequential [4-byte len][data][4-byte len]
9
* - Q3: raw sequential (no framing, just raw bytes)
10
*
11
* Use create_binary_record_format() from factory.hpp to obtain an instance.
12
*/
13
14
#include <cstdint>
15
#include <fstream>
16
17
namespace
q3
{
18
19
class
BinaryRecordFormat
{
20
public
:
21
virtual
~BinaryRecordFormat
() =
default
;
22
23
/**
24
* Write a single framed record to the output stream.
25
*/
26
virtual
void
27
write_record
(std::ofstream& output_file,
const
void
* data, int32_t number_of_bytes)
const
= 0;
28
29
/**
30
* Read a single framed record from the input stream.
31
*/
32
virtual
void
33
read_record
(std::ifstream& input_file,
void
* data, int32_t number_of_bytes)
const
= 0;
34
};
35
36
}
// namespace q3
q3::BinaryRecordFormat
Definition
init.hpp:19
q3::BinaryRecordFormat::read_record
virtual void read_record(std::ifstream &input_file, void *data, int32_t number_of_bytes) const =0
q3::BinaryRecordFormat::write_record
virtual void write_record(std::ofstream &output_file, const void *data, int32_t number_of_bytes) const =0
q3::BinaryRecordFormat::~BinaryRecordFormat
virtual ~BinaryRecordFormat()=default
q3
Definition
q3_core_api.hpp:33
src
io
checkpoint
init.hpp
Generated by
1.9.8