DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <BufferedFileReader.hpp>
Public Member Functions | |
BufferedFileReader (std::string filename, size_t buffer_size, std::string compression_algorithm="None") | |
BufferedFileReader () | |
BufferedFileReader (const BufferedFileReader &)=delete | |
BufferedFileReader is not copy-constructible. | |
BufferedFileReader & | operator= (const BufferedFileReader &)=delete |
BufferedFileReader is not copy-assginable. | |
BufferedFileReader (BufferedFileReader &&)=delete | |
BufferedFileReader is not move-constructible. | |
BufferedFileReader & | operator= (BufferedFileReader &&)=delete |
BufferedFileReader is not move-assignable. | |
void | open (std::string filename, size_t buffer_size, std::string compression_algorithm="None") |
bool | is_open () const |
bool | read (ReadoutType &element) |
void | close () |
Private Types | |
using | io_source_t = boost::iostreams::file_descriptor_source |
using | aligned_allocator_t = boost::alignment::aligned_allocator<io_source_t::char_type, Alignment> |
using | filtering_istream_t |
Private Attributes | |
std::string | m_filename |
size_t | m_buffer_size |
std::string | m_compression_algorithm |
filtering_istream_t | m_input_stream |
bool | m_is_open = false |
Class to read data of a specified type in a buffered manner.
ReadoutType | Type of the data that is read from the file. |
Alignment | The alignment size of internal buffers. |
Definition at line 43 of file BufferedFileReader.hpp.
|
private |
Definition at line 46 of file BufferedFileReader.hpp.
|
private |
Definition at line 47 of file BufferedFileReader.hpp.
|
private |
Definition at line 45 of file BufferedFileReader.hpp.
|
inline |
Constructor to construct and initalize an instance. The file will be open after initialization.
filename | The file to be used. |
buffer_size | The size of the buffer to be used. |
compression_algorithm | The compression algorithm to use. Can be one of: None, zstd, lzma or zlib |
CannotOpenFile | If the file can not be opened. |
ConfigurationError | If the compression algorithm parameter is not recognized. |
Definition at line 59 of file BufferedFileReader.hpp.
|
inline |
Constructor to construct and instance without opening a file.
Definition at line 67 of file BufferedFileReader.hpp.
|
delete |
BufferedFileReader is not copy-constructible.
|
delete |
BufferedFileReader is not move-constructible.
|
inline |
Close the reader.
Definition at line 138 of file BufferedFileReader.hpp.
|
inline |
Check if the file is open.
CannotOpenFile | If the file can not be opened. |
ConfigurationError | If the compression algorithm parameter is not recognized. |
Definition at line 120 of file BufferedFileReader.hpp.
|
inline |
Open a file.
filename | The file to be used. |
buffer_size | The size of the buffer to be used. |
compression_algorithm | The compression algorithm to use. Can be one of: None, zstd, lzma or zlib |
CannotOpenFile | If the file can not be opened. |
ConfigurationError | If the compression algorithm parameter is not recognized. |
Definition at line 82 of file BufferedFileReader.hpp.
|
delete |
BufferedFileReader is not move-assignable.
|
delete |
BufferedFileReader is not copy-assginable.
|
inline |
Read one element from the file.
element | Reference to the element that will contain the value that was read. |
Definition at line 127 of file BufferedFileReader.hpp.
|
private |
Definition at line 147 of file BufferedFileReader.hpp.
|
private |
Definition at line 148 of file BufferedFileReader.hpp.
|
private |
Definition at line 146 of file BufferedFileReader.hpp.
|
private |
Definition at line 151 of file BufferedFileReader.hpp.
|
private |
Definition at line 152 of file BufferedFileReader.hpp.