DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
BinarySignalReader.hpp
Go to the documentation of this file.
1
8
9#ifndef TPGLIBS_TESTAPP_BINARYSIGNALREADER_HPP_
10#define TPGLIBS_TESTAPP_BINARYSIGNALREADER_HPP_
11
12#include <fstream>
13#include <stdexcept>
14#include <string>
15#include <vector>
16
17namespace tpglibs {
18namespace testapp {
19
26template<typename T>
28{
29public:
35 explicit BinarySignalReader(const std::string& filepath);
36
41
48 std::vector<T> next(size_t n);
49
54 bool eof();
55
60 std::streampos tellg();
61
66 void seekg(std::streampos pos);
67
68private:
69 std::ifstream m_file;
71};
72
73} // namespace testapp
74} // namespace tpglibs
75
77
78#endif // TPGLIBS_TESTAPP_BINARYSIGNALREADER_HPP_
std::streampos tellg()
Get current file position.
~BinarySignalReader()=default
Destructor - closes the file.
std::vector< T > next(size_t n)
Read next chunk of data.
void seekg(std::streampos pos)
Seek to specific position.
bool eof()
Check if we've reached end of file.
BinarySignalReader(const std::string &filepath)
Constructor - opens the file for reading.