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 <stdexcept>
14
#include <string>
15
#include <vector>
16
17
namespace
tpglibs
{
18
namespace
testapp
{
19
26
template
<
typename
T>
27
class
BinarySignalReader
28
{
29
public
:
35
explicit
BinarySignalReader
(
const
std::string& filepath);
36
40
~BinarySignalReader
() =
default
;
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
68
private
:
69
std::ifstream
m_file
;
70
bool
m_eof_reached
;
71
};
72
73
}
// namespace testapp
74
}
// namespace tpglibs
75
76
#include "
BinarySignalReader.hxx
"
77
78
#endif
// TPGLIBS_TESTAPP_BINARYSIGNALREADER_HPP_
BinarySignalReader.hxx
tpglibs::testapp::BinarySignalReader::tellg
std::streampos tellg()
Get current file position.
Definition
BinarySignalReader.hxx:75
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:30
tpglibs::testapp::BinarySignalReader::m_eof_reached
bool m_eof_reached
Definition
BinarySignalReader.hpp:70
tpglibs::testapp::BinarySignalReader::m_file
std::ifstream m_file
Definition
BinarySignalReader.hpp:69
tpglibs::testapp::BinarySignalReader::seekg
void seekg(std::streampos pos)
Seek to specific position.
Definition
BinarySignalReader.hxx:82
tpglibs::testapp::BinarySignalReader::eof
bool eof()
Check if we've reached end of file.
Definition
BinarySignalReader.hxx:56
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.18.0