DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
tpglibs
include
tpglibs
testapp
reader
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 <vector>
14
#include <string>
15
#include <stdexcept>
16
17
namespace
tpglibs
{
18
namespace
testapp
{
19
26
template
<
typename
T>
27
class
BinarySignalReader
{
28
public
:
34
explicit
BinarySignalReader
(
const
std::string& filepath);
35
39
~BinarySignalReader
() =
default
;
40
47
std::vector<T>
next
(
size_t
n);
48
53
bool
eof
();
54
59
std::streampos
tellg
();
60
65
void
seekg
(std::streampos pos);
66
67
private
:
68
std::ifstream
m_file
;
69
bool
m_eof_reached
;
70
};
71
72
}
// namespace testapp
73
}
// namespace tpglibs
74
75
#include "
BinarySignalReader.hxx
"
76
77
#endif
// TPGLIBS_TESTAPP_BINARYSIGNALREADER_HPP_
BinarySignalReader.hxx
tpglibs::testapp::BinarySignalReader::tellg
std::streampos tellg()
Get current file position.
Definition
BinarySignalReader.hxx:68
tpglibs::testapp::BinarySignalReader::~BinarySignalReader
~BinarySignalReader()=default
Destructor - closes the file.
tpglibs::testapp::BinarySignalReader::next
std::vector< T > next(size_t n)
Read next chunk of data.
Definition
BinarySignalReader.hxx:27
tpglibs::testapp::BinarySignalReader::m_eof_reached
bool m_eof_reached
Definition
BinarySignalReader.hpp:69
tpglibs::testapp::BinarySignalReader::m_file
std::ifstream m_file
Definition
BinarySignalReader.hpp:68
tpglibs::testapp::BinarySignalReader::seekg
void seekg(std::streampos pos)
Seek to specific position.
Definition
BinarySignalReader.hxx:73
tpglibs::testapp::BinarySignalReader::eof
bool eof()
Check if we've reached end of file.
Definition
BinarySignalReader.hxx:51
tpglibs::testapp::BinarySignalReader::BinarySignalReader
BinarySignalReader(const std::string &filepath)
Constructor - opens the file for reading.
Definition
BinarySignalReader.hxx:19
tpglibs::testapp
Definition
BinarySignalReader.hpp:18
tpglibs
Definition
AbstractFactory.hpp:20
Generated on
for DUNE-DAQ by
1.17.0