Monarch  v3.8.2
Project 8 Data File Format Library
Public Member Functions | Private Attributes | List of all members
M3Record Class Reference

Contains the information that makes up a record. More...

#include <M3Record.hh>

Public Member Functions

 M3Record (unsigned aNBytes=0)
 
 M3Record (RecordIdType *aRecPtr, TimeType *aTimePtr, byte_type *aDataPtr)
 
 ~M3Record ()
 
 M3Record (const M3Record &)=delete
 
M3Recordoperator= (const M3Record &)=delete
 
void Initialize ()
 Allocate no memory for the record; data pointer is to NULL. More...
 
void Initialize (unsigned aNBytes)
 Allocate aNBytes of memory for the record. More...
 
void Initialize (RecordIdType *aRecPtr, TimeType *aTimePtr, byte_type *aDataPtr)
 
void ClearData ()
 
RecordIdType GetRecordId () const
 
RecordIdTypeGetRecordIdPtr () const
 
void SetRecordId (RecordIdType aId)
 
TimeType GetTime () const
 
TimeTypeGetTimePtr () const
 
void SetTime (TimeType aTime)
 
const byte_typeGetData () const
 
byte_typeGetData ()
 
void UpdateDataPtr (const byte_type *aDataPtr) const
 
void UpdateDataPtr (byte_type *aDataPtr)
 
 camel_case_mv_accessible_mutable_noset (bool, OwnsData)
 

Private Attributes

RecordIdTypefRecordId
 
TimeTypefTime
 
byte_typefData
 

Detailed Description

Contains the information that makes up a record.

Author
N. S. Oblath

Includes the record ID, timestamp (ns since the start of the run), and data array.

The array can either own its own data, or point to data elsewhere. This is useful for having streams with multiple non-interleaved channels The channel record objects can point to the appropriate location in the stream record object.

If the M3Record( unsigned ) constructor or SetData( unsigned ) function is used, the record will allocate its own data. If the M3Record( byte_type* ) constructor or SetData( byte_type* ) function is used, the record will point to data elsewhere that it does not own.

If the record does not own the data, then the data pointer can be updatd with UpdateDataPtr().

Definition at line 35 of file M3Record.hh.

Constructor & Destructor Documentation

◆ M3Record() [1/3]

M3Record ( unsigned  aNBytes = 0)

Definition at line 13 of file M3Record.cc.

◆ M3Record() [2/3]

M3Record ( RecordIdType aRecPtr,
TimeType aTimePtr,
byte_type aDataPtr 
)

Definition at line 27 of file M3Record.cc.

◆ ~M3Record()

~M3Record ( )

Definition at line 35 of file M3Record.cc.

◆ M3Record() [3/3]

M3Record ( const M3Record )
delete

Member Function Documentation

◆ camel_case_mv_accessible_mutable_noset()

camel_case_mv_accessible_mutable_noset ( bool  ,
OwnsData   
)

◆ ClearData()

void ClearData ( )

Definition at line 67 of file M3Record.cc.

◆ GetData() [1/2]

const byte_type * GetData ( ) const
inline

Definition at line 111 of file M3Record.hh.

◆ GetData() [2/2]

byte_type * GetData ( )
inline

Definition at line 116 of file M3Record.hh.

◆ GetRecordId()

RecordIdType GetRecordId ( ) const
inline

Definition at line 79 of file M3Record.hh.

◆ GetRecordIdPtr()

RecordIdType * GetRecordIdPtr ( ) const
inline

Definition at line 84 of file M3Record.hh.

◆ GetTime()

TimeType GetTime ( ) const
inline

Definition at line 95 of file M3Record.hh.

◆ GetTimePtr()

TimeType * GetTimePtr ( ) const
inline

Definition at line 100 of file M3Record.hh.

◆ Initialize() [1/3]

void Initialize ( )

Allocate no memory for the record; data pointer is to NULL.

Definition at line 40 of file M3Record.cc.

◆ Initialize() [2/3]

void Initialize ( unsigned  aNBytes)

Allocate aNBytes of memory for the record.

Definition at line 46 of file M3Record.cc.

◆ Initialize() [3/3]

void Initialize ( RecordIdType aRecPtr,
TimeType aTimePtr,
byte_type aDataPtr 
)

Do not allocate memory for the record; instead point to someone else's memory. Warning: if the memory pointed to is de-allocated, use of this record should be discontinued

Definition at line 57 of file M3Record.cc.

◆ operator=()

M3Record& operator= ( const M3Record )
delete

◆ SetRecordId()

void SetRecordId ( RecordIdType  aId)
inline

Definition at line 89 of file M3Record.hh.

◆ SetTime()

void SetTime ( TimeType  aTime)
inline

Definition at line 105 of file M3Record.hh.

◆ UpdateDataPtr() [1/2]

void UpdateDataPtr ( const byte_type aDataPtr) const

Definition at line 82 of file M3Record.cc.

◆ UpdateDataPtr() [2/2]

void UpdateDataPtr ( byte_type aDataPtr)

Definition at line 88 of file M3Record.cc.

Member Data Documentation

◆ fData

byte_type* fData
mutableprivate

Definition at line 75 of file M3Record.hh.

◆ fRecordId

RecordIdType* fRecordId
private

Definition at line 72 of file M3Record.hh.

◆ fTime

TimeType* fTime
private

Definition at line 73 of file M3Record.hh.


The documentation for this class was generated from the following files: