/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
DybDaq::FileEndRecord Class Reference

#include <FileEndRecord.h>

Inheritance diagram for DybDaq::FileEndRecord:
Inheritance graph
[legend]
Collaboration diagram for DybDaq::FileEndRecord:
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

 FileEndRecord (const FileTraits::FileDateTime &dateTime, const unsigned int fileEventCount, const unsigned int filePayloadSize, const unsigned int runEventCount, const unsigned int runPayloadSize, const unsigned int status, const FileTraits &traits)
 Create an instance of this class.
 FileEndRecord (const ByteBuffer &byteBuffer, const FileTraits &traits)
 Create an instance of this class.
virtual ~FileEndRecord ()
 Destroys this instance of the class.
virtual bool isMarked (unsigned int marker) const
 Returns true if this object contains the specified marker.
FileTraits::FileDateTime dateTime () const
 Returns the date and time thefile was closed.
unsigned int fileEventCount () const
 Returns the number of events contained in this file.
unsigned int filePayloadSize () const
 Returns the size of the payload in this file, in MBs.
unsigned int runEventCount () const
 Returns the number of events contained in this run so far.
unsigned int runPayloadSize () const
 Returns the size of the payload in this run so far, in MBs.
unsigned int status () const
 Returns non-zero value if this is the last file in the run.
bool endMarkerFound () const
 Returns true if the end marker of this record is found.
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 const DaqTraitsdaqTraits () 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

 FileEndRecord ()
 Suppress default.
 FileEndRecord (FileEndRecord &rhs)
 Suppress default.
FileEndRecordoperator= (FileEndRecord &rhs)
 Suppress default.
unsigned int date () const
 Returns date when file was closed, as DDMMYYYY.
unsigned int time () const
 Returns time when file was closed, as HHMMSS.
void setDateTime (const FileTraits::FileDateTime &dateTime)
 Sets the date and time the file was closed.
void setFileEventCount (const unsigned int fileEventCount)
 Sets the number of events contained in this file.
void setFilePayloadSize (const unsigned int filePayloadSize)
 Sets the size of the payload in this file, in MBs.
void setRunEventCount (const unsigned int runEventCount)
 Sets the number of events contained in this run so far.
void setRunPayloadSize (const unsigned int runPayloadSize)
 Sets the size of the payload in this run so far, in MBs.
void setStatus (const unsigned int status)
 Sets non-zero value if this is the last file in the run.
void setDate (const unsigned int date)
 Sets date when file was closed, as DDMMYYYY.
void setTime (const unsigned int time)
 Sets time when file was closed, as HHMMSS.

Detailed Description

Definition at line 18 of file FileEndRecord.h.


Constructor & Destructor Documentation

FileEndRecord::FileEndRecord ( const FileTraits::FileDateTime dateTime,
const unsigned int  fileEventCount,
const unsigned int  filePayloadSize,
const unsigned int  runEventCount,
const unsigned int  runPayloadSize,
const unsigned int  status,
const FileTraits traits 
)
FileEndRecord::FileEndRecord ( const ByteBuffer byteBuffer,
const FileTraits traits 
)

Create an instance of this class.

Definition at line 37 of file FileEndRecord.cc.

                                                                                   :
FileBuffer(byteBuffer,
                   traits) {
}
FileEndRecord::~FileEndRecord ( ) [virtual]

Destroys this instance of the class.

Definition at line 43 of file FileEndRecord.cc.

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

Suppress default.

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

Suppress default.


Member Function Documentation

bool FileEndRecord::isMarked ( unsigned int  marker) const [virtual]

Returns true if this object contains the specified marker.

Implements DybDaq::FileBuffer.

Definition at line 46 of file FileEndRecord.cc.

FileTraits::FileDateTime FileEndRecord::dateTime ( ) const

Returns the date and time thefile was closed.

Definition at line 50 of file FileEndRecord.cc.

                                                     {
    const unsigned int closeDate = date();
    const unsigned int closeTime = time();
    struct tm tmStruct;
    tmStruct.tm_sec = closeTime % 100U;;
    tmStruct.tm_min = (closeTime /100U) % 100U;
    tmStruct.tm_hour = (closeTime /10000U) % 100U;
    tmStruct.tm_mday = (closeDate / 1000000U) % 100U;
    tmStruct.tm_mon = ((closeDate / 10000U) % 100U) - 1;
    tmStruct.tm_year = (closeDate % 10000U) - 1900;
    tmStruct.tm_wday = 0;
    tmStruct.tm_yday = 0;
    tmStruct.tm_isdst = 0;
    return tmStruct;
}
unsigned int FileEndRecord::fileEventCount ( ) const

Returns the number of events contained in this file.

Definition at line 66 of file FileEndRecord.cc.

unsigned int FileEndRecord::filePayloadSize ( ) const

Returns the size of the payload in this file, in MBs.

Definition at line 70 of file FileEndRecord.cc.

unsigned int FileEndRecord::runEventCount ( ) const

Returns the number of events contained in this run so far.

Definition at line 74 of file FileEndRecord.cc.

unsigned int FileEndRecord::runPayloadSize ( ) const

Returns the size of the payload in this run so far, in MBs.

Definition at line 78 of file FileEndRecord.cc.

unsigned int FileEndRecord::status ( ) const

Returns non-zero value if this is the last file in the run.

Definition at line 82 of file FileEndRecord.cc.

bool FileEndRecord::endMarkerFound ( ) const

Returns true if the end marker of this record is found.

Definition at line 86 of file FileEndRecord.cc.

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

Returns the component with the format of this buffer.

Reimplemented from DybDaq::DaqBuffer.

Definition at line 98 of file FileEndRecord.cc.

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

Suppress default.

unsigned int FileEndRecord::date ( ) const [private]

Returns date when file was closed, as DDMMYYYY.

Definition at line 90 of file FileEndRecord.cc.

unsigned int FileEndRecord::time ( ) const [private]

Returns time when file was closed, as HHMMSS.

Definition at line 94 of file FileEndRecord.cc.

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

Sets the date and time the file was closed.

Definition at line 102 of file FileEndRecord.cc.

                                                                      {
    setDate(dateTime.tm_year + 1900
            + (dateTime.tm_mon + 1) * 10000
            + dateTime.tm_mday * 1000000);
    setTime(dateTime.tm_sec
            + dateTime.tm_min * 100
            + dateTime.tm_hour * 10000);
}
void FileEndRecord::setFileEventCount ( const unsigned int  fileEventCount) [private]

Sets the number of events contained in this file.

Definition at line 111 of file FileEndRecord.cc.

void FileEndRecord::setFilePayloadSize ( const unsigned int  filePayloadSize) [private]

Sets the size of the payload in this file, in MBs.

Definition at line 116 of file FileEndRecord.cc.

void FileEndRecord::setRunEventCount ( const unsigned int  runEventCount) [private]

Sets the number of events contained in this run so far.

Definition at line 121 of file FileEndRecord.cc.

void FileEndRecord::setRunPayloadSize ( const unsigned int  runPayloadSize) [private]

Sets the size of the payload in this run so far, in MBs.

Definition at line 126 of file FileEndRecord.cc.

void FileEndRecord::setStatus ( const unsigned int  status) [private]

Sets non-zero value if this is the last file in the run.

Definition at line 131 of file FileEndRecord.cc.

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

Sets date when file was closed, as DDMMYYYY.

Definition at line 136 of file FileEndRecord.cc.

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

Sets time when file was closed, as HHMMSS.

Definition at line 141 of file FileEndRecord.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.


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