|
Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
|
Base for the binary readers: file handling plus a ReadEvent() contract. More...
#include <BinaryUtils.hpp>
Public Member Functions | |
| BinaryReader () | |
| Construct a reader with no file open. | |
| virtual | ~BinaryReader () |
| Closes the file if it is still open. | |
| virtual Bool_t | Open (const char *fname) |
| Open a binary file for reading. | |
| virtual void | Close () |
| Close the file. Safe to call when nothing is open. | |
| Bool_t | IsOpen () const |
| Whether a file is currently open. | |
| TString | GetFileName () const |
| Path most recently passed to Open(). | |
| Long64_t | GetBytesRead () const |
| Bytes consumed so far, for progress reporting. | |
| Bool_t | IsEOF () const |
| Whether the file is exhausted or was never opened. | |
| virtual Bool_t | ReadEvent ()=0 |
| Decode the next record into the derived reader's current event. | |
Protected Attributes | |
| std::ifstream | file |
| TString | filename |
| Bool_t | file_open |
| Long64_t | bytes_read |
Base for the binary readers: file handling plus a ReadEvent() contract.
Derived classes implement ReadEvent() to decode one record into their own current-event object.
Definition at line 54 of file BinaryUtils.hpp.
|
inline |
Construct a reader with no file open.
Definition at line 63 of file BinaryUtils.hpp.
Referenced by CoMPASSReader::CoMPASSReader(), SOLReader::SOLReader(), and WaveDump742Reader::WaveDump742Reader().
|
inlinevirtual |
Closes the file if it is still open.
Definition at line 66 of file BinaryUtils.hpp.
|
inlinevirtual |
Close the file. Safe to call when nothing is open.
Definition at line 94 of file BinaryUtils.hpp.
Referenced by InitUtils::ConvertCoMPASSBinToHits(), InitUtils::ConvertCoMPASSBinToROOT(), InitUtils::ConvertSOLBinToHits(), InitUtils::ConvertSOLBinToROOT(), and InitUtils::ConvertWavedumpBinToROOT().
|
inline |
Bytes consumed so far, for progress reporting.
Definition at line 106 of file BinaryUtils.hpp.
Referenced by InitUtils::ConvertCoMPASSBinToHits(), InitUtils::ConvertCoMPASSBinToROOT(), InitUtils::ConvertSOLBinToHits(), InitUtils::ConvertSOLBinToROOT(), and InitUtils::ConvertWavedumpBinToROOT().
|
inline |
Path most recently passed to Open().
Definition at line 104 of file BinaryUtils.hpp.
|
inline |
Whether the file is exhausted or was never opened.
Definition at line 109 of file BinaryUtils.hpp.
Referenced by CoMPASSReader::ReadEvent(), SOLReader::ReadEvent(), and WaveDump742Reader::ReadEvent().
|
inline |
Whether a file is currently open.
Definition at line 102 of file BinaryUtils.hpp.
|
inlinevirtual |
Open a binary file for reading.
| fname | Path to the file. |
Reimplemented in CoMPASSReader.
Definition at line 78 of file BinaryUtils.hpp.
Referenced by InitUtils::ConvertSOLBinToHits(), InitUtils::ConvertSOLBinToROOT(), InitUtils::ConvertWavedumpBinToROOT(), CoMPASSReader::Open(), and CoMPASSReader::Open().
|
pure virtual |
Decode the next record into the derived reader's current event.
Implemented in CoMPASSReader, SOLReader, and WaveDump742Reader.
|
protected |
Definition at line 59 of file BinaryUtils.hpp.
Referenced by BinaryReader(), GetBytesRead(), Open(), CoMPASSReader::Open(), CoMPASSReader::Open(), CoMPASSReader::ReadEvent(), SOLReader::ReadEvent(), and WaveDump742Reader::ReadEvent().
|
protected |
Definition at line 56 of file BinaryUtils.hpp.
Referenced by Close(), IsEOF(), Open(), CoMPASSReader::Open(), CoMPASSReader::Open(), CoMPASSReader::ReadEvent(), SOLReader::ReadEvent(), WaveDump742Reader::ReadEvent(), and ~BinaryReader().
|
protected |
Definition at line 58 of file BinaryUtils.hpp.
Referenced by BinaryReader(), Close(), IsEOF(), IsOpen(), and Open().
|
protected |
Definition at line 57 of file BinaryUtils.hpp.
Referenced by GetFileName(), and Open().