/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
DybDaq::FileStartRecord Class Reference

#include <FileStartRecord.h>

Inheritance diagram for DybDaq::FileStartRecord:
Inheritance graph
[legend]
Collaboration diagram for DybDaq::FileStartRecord:
Collaboration graph
[legend]

List of all members.

Public Types

typedef std::pair< const char
*, unsigned int > 
OutputBuffer
typedef std::vector< OutputBufferOutputBufferList
typedef std::vector
< ByteInspector * > 
Bytes
typedef std::vector
< BitsInspector * > 
Bits

Public Member Functions

 FileStartRecord (const unsigned int fileNumber, const FileTraits::FileDateTime &dateTime, const unsigned int dataBlockLimit, const unsigned int megabyteLimit, const FileTraits &traits)
 FileStartRecord (const ByteBuffer &byteBuffer, const FileTraits &traits)
 Creates an instance of this class from the supplied buffer.
virtual ~FileStartRecord ()
 Destroys this instance of the class.
virtual const DaqTraitsdaqTraits () const
 Returns the DaqTraits instance used to parse this object's buffer.
virtual bool isMarked (unsigned int marker) const
 Returns true if this object contains the specified marker.
unsigned int majorVersion () const
 Returns the majorVersion of the event format.
unsigned int minorVersion () const
 Returns the minorVersion of the event format.
unsigned int fileNumber () const
 Returns the number of the file in the run.
FileTraits::FileDateTime dateTime () const
 Returns time when file was opened, as HHMMSS.
unsigned int dataBlockLimit () const
 Returns the maximum number of data blocks allowed in file.
unsigned int megabyteLimit () const
 Returns the maimum file size in MB.
unsigned int date () const
unsigned int time () const
 Returns time when file was opened, as HHMMSS.
const FileTraitsfileTraits () const
 Returns the FileTraits instance used to parse this object's buffer.
unsigned int marker () const
 Returns the marker for this FileBuffer.
unsigned int size () const
 Returns the length of this record in 4-byte words.
virtual unsigned int bufferSize () const
 Returns the size, in 4-bytes,, of this object's contents in the buffer.
bool hasDaqTraits () const
virtual unsigned int gather (OutputBufferList &outputBuffers) const
virtual unsigned int inspect (DaqBuffer::Bytes &inspectors) const

Static Public Attributes

static const unsigned int kBytesInInt
static const unsigned int kUndefinedFormatComponent

Protected Member Functions

virtual unsigned int formatComponent () const
 Returns the component with the format of this buffer.
void setMarker (const unsigned int marker)
 Sets the marker for this FileBuffer.
void setSize (const unsigned int size)
 Sets the size, in 4-bytes,, of this object's contents in the buffer.
const char * buffer () const
char * buffer ()
bool hasByteBuffer () const
const ByteBufferbyteBuffer () const
unsigned int fillInspectors (DaqBuffer::Bytes &inspectors, unsigned int component, unsigned int cursor) const
virtual bool readBool (const unsigned int field) const
virtual int readInt (const unsigned int field) const
virtual unsigned char readUnsignedChar (const unsigned int field) const
virtual unsigned int readUnsignedInt (const unsigned int field) const
virtual void writeField (const bool value, const unsigned int field)
virtual void writeField (const int value, const unsigned int field)
virtual void writeField (const unsigned int value, const unsigned int field)

Private Member Functions

 FileStartRecord ()
 Suppress default.
 FileStartRecord (FileStartRecord &rhs)
 Suppress default.
FileStartRecordoperator= (FileStartRecord &rhs)
 Suppress default.
void setMajorVersion (const unsigned int majorVersion)
 Sets the majorVersion of the event format.
void setMinorVersion (const unsigned int minorVersion)
 Sets the minorVersion of the event format.
void setHeaderSize (const unsigned int headerSize)
 Sets the length of this head in the buffer in 4-byte words.
void setTotalSize (const unsigned int totalSize)
 Sets the total size of the event in the buffer in 4-byte words.
void setFileNumber (const unsigned int fileNumber)
 Sets the number of the file in the run.
void setDateTime (const FileTraits::FileDateTime &dateTime)
 Sets time when file was opened, as HHMMSS.
void setDataBlockLimit (const unsigned int dataBlockLimit)
 Sets the maximum number of data blocks allowed in file.
void setMegabyteLimit (const unsigned int megabyteLimit)
 Sets the maimum file size in MB.
void setDate (const unsigned int date)
void setTime (const unsigned int time)
 Sets time when file was opened, as HHMMSS.

Private Attributes

const FileTraitsm_traits
 The FileTraits instance used to parse this object's buffer.

Detailed Description

Definition at line 18 of file FileStartRecord.h.


Constructor & Destructor Documentation

FileStartRecord::FileStartRecord ( const unsigned int  fileNumber,
const FileTraits::FileDateTime dateTime,
const unsigned int  dataBlockLimit,
const unsigned int  megabyteLimit,
const FileTraits traits 
)
FileStartRecord::FileStartRecord ( const ByteBuffer byteBuffer,
const FileTraits traits 
)

Creates an instance of this class from the supplied buffer.

Definition at line 39 of file FileStartRecord.cc.

                                                           :
FileBuffer(byteBuffer,
           traits) {
    m_traits = &traits;
    const char* buffer = byteBuffer.cursor() - (size() * kBytesInInt);
    m_traits = FileTraits::readTraits(buffer);
}
FileStartRecord::~FileStartRecord ( ) [virtual]

Destroys this instance of the class.

Definition at line 48 of file FileStartRecord.cc.

                                  {
}
DybDaq::FileStartRecord::FileStartRecord ( ) [private]

Suppress default.

DybDaq::FileStartRecord::FileStartRecord ( FileStartRecord rhs) [private]

Suppress default.


Member Function Documentation

const DaqTraits & FileStartRecord::daqTraits ( ) const [virtual]

Returns the DaqTraits instance used to parse this object's buffer.

Reimplemented from DybDaq::DaqBuffer.

Definition at line 51 of file FileStartRecord.cc.

                                                  {
    return *m_traits;
}
bool FileStartRecord::isMarked ( unsigned int  marker) const [virtual]

Returns true if this object contains the specified marker.

Implements DybDaq::FileBuffer.

Definition at line 55 of file FileStartRecord.cc.

unsigned int FileStartRecord::majorVersion ( ) const

Returns the majorVersion of the event format.

Definition at line 59 of file FileStartRecord.cc.

unsigned int FileStartRecord::minorVersion ( ) const

Returns the minorVersion of the event format.

Definition at line 63 of file FileStartRecord.cc.

unsigned int FileStartRecord::fileNumber ( ) const

Returns the number of the file in the run.

Definition at line 67 of file FileStartRecord.cc.

FileTraits::FileDateTime FileStartRecord::dateTime ( ) const

Returns time when file was opened, as HHMMSS.

Definition at line 71 of file FileStartRecord.cc.

                                                       {
    const unsigned int openDate = date();
    const unsigned int openTime = time();
    struct tm tmStruct;
    tmStruct.tm_sec = openTime % 100U;;
    tmStruct.tm_min = (openTime /100U) % 100U;
    tmStruct.tm_hour = (openTime /10000U) % 100U;
    tmStruct.tm_mday = (openDate / 1000000U) % 100U;
    tmStruct.tm_mon = ((openDate / 10000U) % 100U) - 1;
    tmStruct.tm_year = (openDate % 10000U) - kTmBaseYear;
    tmStruct.tm_wday = 0;
    tmStruct.tm_yday = 0;
    tmStruct.tm_isdst = 0;
    return tmStruct;
}
unsigned int FileStartRecord::dataBlockLimit ( ) const

Returns the maximum number of data blocks allowed in file.

Definition at line 87 of file FileStartRecord.cc.

unsigned int FileStartRecord::megabyteLimit ( ) const

Returns the maimum file size in MB.

Definition at line 91 of file FileStartRecord.cc.

unsigned int FileStartRecord::date ( ) const

Definition at line 95 of file FileStartRecord.cc.

unsigned int FileStartRecord::time ( ) const

Returns time when file was opened, as HHMMSS.

Definition at line 99 of file FileStartRecord.cc.

unsigned int FileStartRecord::formatComponent ( ) const [protected, virtual]

Returns the component with the format of this buffer.

Reimplemented from DybDaq::DaqBuffer.

Definition at line 103 of file FileStartRecord.cc.

FileStartRecord& DybDaq::FileStartRecord::operator= ( FileStartRecord rhs) [private]

Suppress default.

void FileStartRecord::setMajorVersion ( const unsigned int  majorVersion) [private]

Sets the majorVersion of the event format.

Definition at line 107 of file FileStartRecord.cc.

void FileStartRecord::setMinorVersion ( const unsigned int  minorVersion) [private]

Sets the minorVersion of the event format.

Definition at line 112 of file FileStartRecord.cc.

void DybDaq::FileStartRecord::setHeaderSize ( const unsigned int  headerSize) [private]

Sets the length of this head in the buffer in 4-byte words.

void DybDaq::FileStartRecord::setTotalSize ( const unsigned int  totalSize) [private]

Sets the total size of the event in the buffer in 4-byte words.

void FileStartRecord::setFileNumber ( const unsigned int  fileNumber) [private]

Sets the number of the file in the run.

Definition at line 117 of file FileStartRecord.cc.

void FileStartRecord::setDateTime ( const FileTraits::FileDateTime dateTime) [private]

Sets time when file was opened, as HHMMSS.

Definition at line 122 of file FileStartRecord.cc.

                                                                        {
    setDate(dateTime.tm_year + kTmBaseYear
            + (dateTime.tm_mon + 1) * 10000
            + dateTime.tm_mday * 1000000);
    setTime(dateTime.tm_sec
            + dateTime.tm_min * 100
            + dateTime.tm_hour * 10000);
}
void FileStartRecord::setDataBlockLimit ( const unsigned int  dataBlockLimit) [private]

Sets the maximum number of data blocks allowed in file.

Definition at line 131 of file FileStartRecord.cc.

void FileStartRecord::setMegabyteLimit ( const unsigned int  megabyteLimit) [private]

Sets the maimum file size in MB.

Definition at line 136 of file FileStartRecord.cc.

void FileStartRecord::setDate ( const unsigned int  date) [private]

Definition at line 141 of file FileStartRecord.cc.

void FileStartRecord::setTime ( const unsigned int  time) [private]

Sets time when file was opened, as HHMMSS.

Definition at line 146 of file FileStartRecord.cc.

const FileTraits & FileBuffer::fileTraits ( ) const [inherited]

Returns the FileTraits instance used to parse this object's buffer.

Definition at line 40 of file FileBuffer.cc.

                                               {
    return dynamic_cast<const FileTraits&>(daqTraits());
}
unsigned int FileBuffer::marker ( ) const [inherited]

Returns the marker for this FileBuffer.

Definition at line 44 of file FileBuffer.cc.

unsigned int FileBuffer::size ( ) const [inherited]

Returns the length of this record in 4-byte words.

Definition at line 48 of file FileBuffer.cc.

unsigned int FileBuffer::bufferSize ( ) const [virtual, inherited]

Returns the size, in 4-bytes,, of this object's contents in the buffer.

Implements DybDaq::DaqBuffer.

Definition at line 52 of file FileBuffer.cc.

                                          {
    return size();
}
void FileBuffer::setMarker ( const unsigned int  marker) [protected, inherited]

Sets the marker for this FileBuffer.

Definition at line 56 of file FileBuffer.cc.

void FileBuffer::setSize ( const unsigned int  size) [protected, inherited]

Sets the size, in 4-bytes,, of this object's contents in the buffer.

Definition at line 61 of file FileBuffer.cc.


Member Data Documentation

The FileTraits instance used to parse this object's buffer.

This is set after construction, so can not use base class's.

Reimplemented from DybDaq::DaqBuffer.

Definition at line 168 of file FileStartRecord.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:53:23 for FileReadoutFormat by doxygen 1.7.4