Monarch
v3.8.2
Project 8 Data File Format Library
|
Read/write access for a data stream. More...
#include <M3Stream.hh>
Public Types | |
enum | Mode { kRead, kWrite } |
Public Member Functions | |
M3Stream (const M3StreamHeader &aHeader, HAS_GRP_IFC *aH5StreamParentLoc, uint32_t aAccessFormat=sSeparate) | |
virtual | ~M3Stream () |
M3Stream (const M3Stream &)=delete | |
M3Stream & | operator= (const M3Stream &)=delete |
camel_case_mv_accessible_mutable (Mode, Mode) | |
void | Initialize () const |
Setup to read/write data (called in constructor; only call this if read/write parameters change during file reading) More... | |
void | SetMutex (const mutex_ptr &aMutexPtr) |
const M3Record * | GetStreamRecord () const |
Get the pointer to the stream record. More... | |
const M3Record * | GetChannelRecord (unsigned aChannel) const |
Get the pointer to a particular channel record. More... | |
bool | ReadRecord (int anOffset=0, bool aIfNewAcqStartAtFirstRec=true) const |
Read the next record from the file. More... | |
void | Close () const |
Close the file. More... | |
M3Record * | GetStreamRecord () |
Get the pointer to the stream record. More... | |
M3Record * | GetChannelRecord (unsigned aChannel) |
Get the pointer to a particular channel record. More... | |
bool | WriteRecord (bool aIsNewAcquisition) |
Write the record contents to the file. More... | |
void | Close () |
Close the stream. More... | |
bool | GetIsInitialized () const |
bool | GetRecordsAccessed () const |
unsigned | GetDataTypeSize () const |
unsigned | GetSampleSize () const |
unsigned | GetStreamRecordNBytes () const |
unsigned | GetStreamRecordSize () const |
unsigned | GetChannelRecordNBytes () const |
unsigned | GetChannelRecordSize () const |
unsigned | GetNChannels () const |
unsigned | GetNAcquisitions () const |
AcquisitionIdType | GetAcquisitionId () const |
unsigned | GetRecordCountInAcq () const |
unsigned | GetNRecordsInAcquisition () const |
TimeType | GetAcqFirstRecordTime () const |
RecordIdType | GetAcqFirstRecordId () const |
TimeType * | GetAcqFirstRecTimes () const |
RecordIdType * | GetAcqFirstRecordIds () const |
unsigned | GetRecordCountInFile () const |
unsigned | GetNRecordsInFile () const |
unsigned | GetFirstRecordInFile () const |
bool | GetIsInterleaved () const |
void | SetAccessFormat (uint32_t aFormat) const |
Access format can be changed during read or write; must call Initialize() after this. More... | |
uint32_t | GetAccessFormat () const |
Private Types | |
enum | { N_DATA_DIMS = 2 } |
typedef void(M3Stream::* | DoReadRecordFunc) (bool) const |
typedef void(M3Stream::* | DoWriteRecordFunc) (bool) |
Private Member Functions | |
void | ReadRecordInterleavedToSeparate (bool aIsNewAcquisition) const |
void | ReadRecordAsIs (bool aIsNewAcquisition) const |
void | WriteRecordSeparateToInterleaved (bool aIsNewAcquisition) |
void | WriteRecordAsIs (bool aIsNewAcquisition) |
void | BuildIndex () const |
void | FinalizeCurrentAcq () |
void | FinalizeStream () |
Read/write access for a data stream.
Data can be read/written either for the stream as a whole, or for individual channels within the stream by accessing the relevant record objects.
The function ReadRecord extracts a record from disk. The offset allows the file to move forward or back within the file. After that call, the new record is available via the record objects.
The function WriteRecord moves the data in memory to disk. Before calling WriteRecord, the appropriate data should be copied to the record object(s).
When a stream object is created, most of the information needed to define the stream characteristics is extracted from the stream header object that is passed to the constructor. Most users won't need to worry about this, as it's already taken care of by the Monarch3 object.
Definition at line 41 of file M3Stream.hh.
|
private |
Definition at line 51 of file M3Stream.hh.
|
private |
Definition at line 52 of file M3Stream.hh.
|
private |
Enumerator | |
---|---|
N_DATA_DIMS |
Definition at line 204 of file M3Stream.hh.
enum Mode |
Enumerator | |
---|---|
kRead | |
kWrite |
Definition at line 44 of file M3Stream.hh.
M3Stream | ( | const M3StreamHeader & | aHeader, |
HAS_GRP_IFC * | aH5StreamParentLoc, | ||
uint32_t | aAccessFormat = sSeparate |
||
) |
Definition at line 40 of file M3Stream.cc.
|
virtual |
Definition at line 200 of file M3Stream.cc.
|
private |
Definition at line 615 of file M3Stream.cc.
void Close | ( | ) | const |
Close the file.
Definition at line 390 of file M3Stream.cc.
void Close | ( | ) |
Close the stream.
Definition at line 473 of file M3Stream.cc.
|
private |
Definition at line 637 of file M3Stream.cc.
|
private |
Definition at line 653 of file M3Stream.cc.
|
inline |
Definition at line 140 of file M3Stream.hh.
|
inline |
Definition at line 130 of file M3Stream.hh.
|
inline |
Definition at line 132 of file M3Stream.hh.
|
inline |
Definition at line 129 of file M3Stream.hh.
|
inline |
Definition at line 131 of file M3Stream.hh.
|
inline |
Definition at line 126 of file M3Stream.hh.
const M3Record * GetChannelRecord | ( | unsigned | aChannel | ) | const |
Get the pointer to a particular channel record.
Definition at line 304 of file M3Stream.cc.
M3Record * GetChannelRecord | ( | unsigned | aChannel | ) |
Get the pointer to a particular channel record.
Definition at line 403 of file M3Stream.cc.
|
inline |
Definition at line 122 of file M3Stream.hh.
|
inline |
Definition at line 123 of file M3Stream.hh.
|
inline |
Definition at line 118 of file M3Stream.hh.
|
inline |
Definition at line 135 of file M3Stream.hh.
|
inline |
Definition at line 116 of file M3Stream.hh.
|
inline |
Definition at line 136 of file M3Stream.hh.
|
inline |
Definition at line 125 of file M3Stream.hh.
|
inline |
Definition at line 124 of file M3Stream.hh.
|
inline |
Definition at line 128 of file M3Stream.hh.
|
inline |
Definition at line 134 of file M3Stream.hh.
|
inline |
Definition at line 127 of file M3Stream.hh.
|
inline |
Definition at line 133 of file M3Stream.hh.
|
inline |
Definition at line 117 of file M3Stream.hh.
|
inline |
Definition at line 119 of file M3Stream.hh.
const M3Record * GetStreamRecord | ( | ) | const |
Get the pointer to the stream record.
Definition at line 299 of file M3Stream.cc.
|
inline |
Get the pointer to the stream record.
Definition at line 222 of file M3Stream.hh.
|
inline |
Definition at line 120 of file M3Stream.hh.
|
inline |
Definition at line 121 of file M3Stream.hh.
void Initialize | ( | ) | const |
Setup to read/write data (called in constructor; only call this if read/write parameters change during file reading)
Definition at line 210 of file M3Stream.cc.
bool ReadRecord | ( | int | anOffset = 0 , |
bool | aIfNewAcqStartAtFirstRec = true |
||
) | const |
Read the next record from the file.
Assuming the last record read was [J], ReadRecord will access the [J+1+offset] record. This means that the offset parameter has the following meanings:
Definition at line 313 of file M3Stream.cc.
|
private |
Definition at line 535 of file M3Stream.cc.
|
private |
Definition at line 493 of file M3Stream.cc.
void SetAccessFormat | ( | uint32_t | aFormat | ) | const |
Access format can be changed during read or write; must call Initialize() after this.
Definition at line 486 of file M3Stream.cc.
|
inline |
Definition at line 216 of file M3Stream.hh.
bool WriteRecord | ( | bool | aIsNewAcquisition | ) |
Write the record contents to the file.
Definition at line 412 of file M3Stream.cc.
|
private |
Definition at line 600 of file M3Stream.cc.
|
private |
Definition at line 573 of file M3Stream.cc.
|
mutableprivate |
Definition at line 180 of file M3Stream.hh.
|
mutableprivate |
Definition at line 175 of file M3Stream.hh.
|
mutableprivate |
Definition at line 177 of file M3Stream.hh.
|
mutableprivate |
Definition at line 174 of file M3Stream.hh.
|
mutableprivate |
Definition at line 176 of file M3Stream.hh.
|
mutableprivate |
Definition at line 193 of file M3Stream.hh.
|
mutableprivate |
Definition at line 170 of file M3Stream.hh.
|
mutableprivate |
Definition at line 167 of file M3Stream.hh.
|
mutableprivate |
Definition at line 162 of file M3Stream.hh.
|
mutableprivate |
Definition at line 160 of file M3Stream.hh.
|
mutableprivate |
Definition at line 161 of file M3Stream.hh.
|
mutableprivate |
Definition at line 211 of file M3Stream.hh.
|
mutableprivate |
Definition at line 208 of file M3Stream.hh.
|
mutableprivate |
Definition at line 179 of file M3Stream.hh.
|
mutableprivate |
Definition at line 209 of file M3Stream.hh.
|
mutableprivate |
Definition at line 210 of file M3Stream.hh.
|
mutableprivate |
Definition at line 201 of file M3Stream.hh.
|
mutableprivate |
Definition at line 154 of file M3Stream.hh.
|
mutableprivate |
Definition at line 202 of file M3Stream.hh.
|
mutableprivate |
Definition at line 145 of file M3Stream.hh.
|
mutableprivate |
Definition at line 149 of file M3Stream.hh.
|
mutableprivate |
Definition at line 185 of file M3Stream.hh.
|
mutableprivate |
Definition at line 196 of file M3Stream.hh.
|
mutableprivate |
Definition at line 197 of file M3Stream.hh.
|
mutableprivate |
Definition at line 199 of file M3Stream.hh.
|
mutableprivate |
Definition at line 195 of file M3Stream.hh.
|
mutableprivate |
Definition at line 151 of file M3Stream.hh.
|
mutableprivate |
Definition at line 213 of file M3Stream.hh.
|
mutableprivate |
Definition at line 169 of file M3Stream.hh.
|
mutableprivate |
Definition at line 166 of file M3Stream.hh.
|
mutableprivate |
Definition at line 173 of file M3Stream.hh.
|
mutableprivate |
Definition at line 184 of file M3Stream.hh.
|
mutableprivate |
Definition at line 172 of file M3Stream.hh.
|
mutableprivate |
Definition at line 183 of file M3Stream.hh.
|
mutableprivate |
Definition at line 182 of file M3Stream.hh.
|
mutableprivate |
Definition at line 152 of file M3Stream.hh.
|
mutableprivate |
Definition at line 155 of file M3Stream.hh.
|
mutableprivate |
Definition at line 207 of file M3Stream.hh.
|
mutableprivate |
Definition at line 205 of file M3Stream.hh.
|
mutableprivate |
Definition at line 164 of file M3Stream.hh.
|
mutableprivate |
Definition at line 206 of file M3Stream.hh.
|
mutableprivate |
Definition at line 157 of file M3Stream.hh.
|
mutableprivate |
Definition at line 158 of file M3Stream.hh.