14 fInterleavedRecordNBytes( 0 ),
15 fRecordInterleaved( NULL ),
16 fRecordInterleavedBytes( NULL ),
17 fSeparateRecordNBytes( 0 ),
18 fRecordSeparateOne( NULL ),
19 fRecordSeparateOneBytes( NULL ),
20 fRecordSeparateTwo( NULL ),
21 fRecordSeparateTwoBytes( NULL ),
22 fReadFunction( &
Monarch2::InterleavedFromInterleaved ),
23 fWriteFunction( &
Monarch2::InterleavedToInterleaved )
67 if( tMonarch->
fIO->
Open( aFilename ) == false )
70 throw M2Exception() <<
"could not open <" << aFilename <<
"> for reading";
87 if( tMonarch->
fIO->
Open( aFilename ) == false )
90 throw M2Exception() <<
"could not open <" << aFilename <<
"> for writing";
105 if(
fIO->
Read( &tPrelude ) == false )
107 throw M2Exception() <<
"prelude was not read properly";
111 char* tHeaderBuffer =
new char[ tPrelude ];
112 if(
fIO->
Read( tHeaderBuffer, tPrelude ) == false )
114 delete[] tHeaderBuffer;
115 throw M2Exception() <<
"header was not read properly";
120 delete[] tHeaderBuffer;
121 throw M2Exception() <<
"header was not demarshalled properly";
124 delete[] tHeaderBuffer;
205 if(
fIO->
Write( &tPrelude ) == false )
207 throw M2Exception() <<
"prelude was not written properly";
211 char* tHeaderBuffer =
new char[ tPrelude ];
214 delete[] tHeaderBuffer;
215 throw M2Exception() <<
"header was not marshalled properly";
218 if(
fIO->
Write( tHeaderBuffer, tPrelude ) == false )
220 delete[] tHeaderBuffer;
221 throw M2Exception() <<
"header was not written properly";
224 delete[] tHeaderBuffer;
383 if(
fIO->
Seek( aByteOffset ) == false )
387 std::cout <<
"could not seek to requested position" << std::endl;
397 throw M2Exception() <<
"could not read next single record";
410 if(
fIO->
Seek( aByteOffset ) == false )
414 std::cout <<
"could not seek to requested position" << std::endl;
424 throw M2Exception() <<
"could not read next channel one record";
433 throw M2Exception() <<
"could not read next channel two record";
451 if(
fIO->
Seek( aByteOffset ) == false )
455 std::cout <<
"could not seek to requested position" << std::endl;
465 throw M2Exception() <<
"could not read next interleaved record";
478 if(
fIO->
Seek( aByteOffset ) == false )
482 std::cout <<
"could not seek to requested position" << std::endl;
492 throw M2Exception() <<
"could not read next channel one record";
505 if(
fIO->
Seek( aByteOffset ) == false )
509 std::cout <<
"could not seek to requested position" << std::endl;
519 throw M2Exception() <<
"could not read next channel one record";
528 throw M2Exception() <<
"could not read next channel two record";
541 if(
fIO->
Seek( aByteOffset ) == false )
545 std::cout <<
"could not seek to requested position" << std::endl;
555 throw M2Exception() <<
"could not read next interleaved record";
580 throw M2Exception() <<
"could not write single record";
597 throw M2Exception() <<
"could not write next channel one record";
603 throw M2Exception() <<
"could not write next channel two record";
614 throw M2Exception() <<
"could not write interleaved record";
625 throw M2Exception() <<
"could not write single record";
636 throw M2Exception() <<
"could not write next channel one record";
642 throw M2Exception() <<
"could not write next channel two record";
658 throw M2Exception() <<
"could not write interleaved record";
size_t fInterleavedRecordNBytes
static const AccessModeType sAccessRead
bool SeparateFromSeparate(int anOffset) const
static Monarch2 * OpenForWriting(const std::string &filename)
bool ReadRecord(int anOffset=0) const
uint32_t InterfaceModeType
bool SeparateFromSingle(int anOffset) const
bool Seek(long int aCount)
bool InterleavedToSeparate()
byte_type * fRecordInterleavedBytes
M2RecordBytes * fRecordSeparateTwo
bool SeparateToInterleaved()
static void Unzip(const size_t aSize, const size_t aDataTypeSize, byte_type *aRecordOne, byte_type *aRecordTwo, const byte_type *anInterleavedRecord)
bool Write(byte_type *anArray, size_t aCount)
static const FormatModeType sFormatMultiSeparate
void SetInterface(InterfaceModeType aMode) const
bool InterleavedFromSeparate(int anOffset) const
static const AccessModeType sAccessWrite
bool Open(const std::string &aFilename)
byte_type * fRecordSeparateOneBytes
uint64_t AcquisitionIdType
M2RecordBytes * fRecordInterleaved
bool Read(byte_type *anArray, size_t aCount)
size_t fSeparateRecordNBytes
byte_type * fRecordSeparateTwoBytes
M2Record< byte_type > M2RecordBytes
bool InterleavedFromSingle(int anOffset) const
bool(Monarch2::* fWriteFunction)()
bool(Monarch2::* fReadFunction)(int anOffset) const
bool InterleavedToSingle()
static const AccessModeType sInterfaceInterleaved
static const FormatModeType sFormatMultiInterleaved
bool SeparateFromInterleaved(int anOffset) const
static const Monarch2 * OpenForReading(const std::string &filename)
bool SeparateToSeparate()
M2RecordBytes * fRecordSeparateOne
bool InterleavedFromInterleaved(int anOffset) const
static const AccessModeType sInterfaceSeparate
bool InterleavedToInterleaved()
static void Zip(const size_t aSize, const size_t aDataTypeSize, const byte_type *aRecordOne, const byte_type *aRecordTwo, byte_type *anInterleavedRecord)