Monarch
v3.8.2
Project 8 Data File Format Library
|
Egg file read/write access. More...
#include <M3Monarch.hh>
Public Types | |
enum | State { eOpenToRead, eOpenToWrite, eReadyToRead, eReadyToWrite, eClosed } |
Public Member Functions | |
State | GetState () const |
~Monarch3 () | |
void | ReadHeader () const |
const M3Header * | GetHeader () const |
Get the pointer to the header. More... | |
const M3Stream * | GetStream (unsigned stream) const |
Get the pointer to a particular stream. More... | |
void | FinishReading () const |
Close the file. More... | |
void | WriteHeader () |
M3Header * | GetHeader () |
Get the pointer to the header. More... | |
M3Stream * | GetStream (unsigned stream) |
Get the pointer to a particular stream. More... | |
void | FinishWriting () |
Close the file. More... | |
Static Public Member Functions | |
static const Monarch3 * | OpenForReading (const std::string &filename) |
static Monarch3 * | OpenForWriting (const std::string &filename) |
Private Member Functions | |
Monarch3 () | |
Monarch3 (const Monarch3 &)=delete | |
Monarch3 (Monarch3 &&)=delete | |
Private Attributes | |
State | fState |
H5::H5File * | fFile |
M3Header * | fHeader |
std::vector< M3Stream *> | fStreams |
mutex_ptr | fMutexPtr |
Egg file read/write access.
Monarch3 objects are created with one of the two static Open functions:
The data structure and general header information is setup/read via the header (accessed with GetHeader()).
Stream data is written or read via the stream objects (accessed with GetStream( unsigned )).
Definition at line 40 of file M3Monarch.hh.
enum State |
Enumerator | |
---|---|
eOpenToRead | |
eOpenToWrite | |
eReadyToRead | |
eReadyToWrite | |
eClosed |
Definition at line 54 of file M3Monarch.hh.
|
private |
Definition at line 19 of file M3Monarch.cc.
~Monarch3 | ( | ) |
Definition at line 27 of file M3Monarch.cc.
void FinishReading | ( | ) | const |
Close the file.
Definition at line 224 of file M3Monarch.cc.
void FinishWriting | ( | ) |
Close the file.
Definition at line 255 of file M3Monarch.cc.
|
inline |
Get the pointer to the header.
Definition at line 135 of file M3Monarch.hh.
|
inline |
Get the pointer to the header.
Definition at line 139 of file M3Monarch.hh.
Monarch3::State GetState | ( | ) | const |
Definition at line 51 of file M3Monarch.cc.
|
inline |
Get the pointer to a particular stream.
Definition at line 144 of file M3Monarch.hh.
|
inline |
Get the pointer to a particular stream.
Definition at line 155 of file M3Monarch.hh.
|
static |
This static method opens the file for reading. If the file exists and can be read, this returns a prepared monarch pointer, and memory is allocated for the header. Upon successful return monarch is in the eOpen state.
Definition at line 56 of file M3Monarch.cc.
|
static |
This static method opens the file for writing. If the file exists and can be written, this returns a prepared monarch pointer, and memory is allocated for the header. Upon successful return monarch is in the eOpen state.
Definition at line 92 of file M3Monarch.cc.
void ReadHeader | ( | ) | const |
This method extracts the header information from the file. If the header read correctly, this returns and the header may be examined, and memory is allocated for the record. Upon successful return monarch is in the eReady state. An exception is thrown if the header is not read.
Definition at line 128 of file M3Monarch.cc.
void WriteHeader | ( | ) |
This method marshals the current header to the file. If the header marshalled correctly, this returns true, memory is allocated for the record(s). Upon successful return monarch is in the eReady state.
Definition at line 176 of file M3Monarch.cc.
|
mutableprivate |
Definition at line 122 of file M3Monarch.hh.
|
mutableprivate |
Definition at line 125 of file M3Monarch.hh.
|
mutableprivate |
Definition at line 131 of file M3Monarch.hh.
|
mutableprivate |
Definition at line 64 of file M3Monarch.hh.
|
mutableprivate |
Definition at line 128 of file M3Monarch.hh.