| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DybDaq::DataSeparatorRecord Class Reference

#include <DataSeparatorRecord.h>

Inheritance diagram for DybDaq::DataSeparatorRecord:

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

 DataSeparatorRecord (const EventReadout &block, unsigned int blockNumber, const FileTraits &traits)
 Creates an instance of this class.
 DataSeparatorRecord (const ByteBuffer &byteBuffer, const FileTraits &traits)
 Creates an instance of this class.
virtual ~DataSeparatorRecord ()
 Destroys this instance of the class.
virtual bool isMarked (unsigned int marker) const
 Returns true if this object contains the specified marker.
const EventReadoutblock () const
 Returns the data block for this object.
const EventReadoutextractBlock () const
 Returns the data block for this object and releases the memeory management to the caller.
unsigned int blockNumber () const
 Returns the number of thefollowing data block within the file.
unsigned int blockLength () const
 Returns the size of the following data block in bytes.
void setBlock (const EventReadout *block)
 Sets the data block for this object.
virtual unsigned int gather (OutputBufferList &outputBuffers) const
 Adds to the supplied line the OutputBuffers that contain the DAQ format of this objects content returning the total number of bytes in the added buffers.
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

 DataSeparatorRecord ()
 Suppress default.
 DataSeparatorRecord (DataSeparatorRecord &rhs)
 Suppress default.
DataSeparatorRecordoperator= (DataSeparatorRecord &rhs)
 Suppress default.
void setBlockNumber (unsigned int blockNumber)
 Sets the number of thefollowing data block within the file.
void setBlockLength (unsigned int blockLength)
 Sets the size of the following data block in bytes.

Private Attributes

const EventReadoutm_block
 The data block for this object.
bool m_owner
 True if this object is the owner of the m_block.

Detailed Description

Definition at line 22 of file DataSeparatorRecord.h.


Constructor & Destructor Documentation

DataSeparatorRecord::DataSeparatorRecord ( const EventReadout block,
unsigned int  blockNumber,
const FileTraits traits 
)

Creates an instance of this class.

Definition at line 22 of file DataSeparatorRecord.cc.

00024                                                                    :
00025 FileBuffer(new char[traits.recordSize(FileTraits::kDataSeparatorRecord) * kBytesInInt],
00026            traits,
00027            FileTraits::kDataSeparatorRecord),
00028 m_block(&block),
00029 m_owner(false) {
00030     setBlockNumber(blockNumber);
00031     setBlockLength(block.header().totalSize() * kBytesInInt);
00032 }

DataSeparatorRecord::DataSeparatorRecord ( const ByteBuffer byteBuffer,
const FileTraits traits 
)

Creates an instance of this class.

Definition at line 34 of file DataSeparatorRecord.cc.

00035                                                                    :
00036 FileBuffer(byteBuffer,
00037            traits),
00038 m_block(0),
00039 m_owner(true) {
00040 }

DataSeparatorRecord::~DataSeparatorRecord (  )  [virtual]

Destroys this instance of the class.

Definition at line 42 of file DataSeparatorRecord.cc.

00042                                           {
00043     if (m_owner && (0 != m_block)) {
00044         delete m_block;
00045     }
00046 }

DybDaq::DataSeparatorRecord::DataSeparatorRecord (  )  [private]

Suppress default.

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

Suppress default.


Member Function Documentation

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

Returns true if this object contains the specified marker.

Implements DybDaq::FileBuffer.

Definition at line 48 of file DataSeparatorRecord.cc.

00048                                                             {
00049     return FileTraits::kDataSeparatorRecord == marker;
00050 }

const EventReadout & DataSeparatorRecord::block (  )  const

Returns the data block for this object.

Definition at line 52 of file DataSeparatorRecord.cc.

00052                                                      {
00053     return *m_block;
00054 }

const EventReadout * DataSeparatorRecord::extractBlock (  )  const

Returns the data block for this object and releases the memeory management to the caller.

Definition at line 56 of file DataSeparatorRecord.cc.

00056                                                             {
00057     m_owner = false;
00058     return m_block;
00059 }

unsigned int DataSeparatorRecord::blockNumber (  )  const

Returns the number of thefollowing data block within the file.

Definition at line 61 of file DataSeparatorRecord.cc.

00061                                                     {
00062     return readUnsignedInt(FileTraits::kBlockNumber);
00063 }

unsigned int DataSeparatorRecord::blockLength (  )  const

Returns the size of the following data block in bytes.

Definition at line 65 of file DataSeparatorRecord.cc.

00065                                                     {
00066     return readUnsignedInt(FileTraits::kBlockLength);
00067 }

void DataSeparatorRecord::setBlock ( const EventReadout block  ) 

Sets the data block for this object.

Definition at line 73 of file DataSeparatorRecord.cc.

00073                                                             {
00074     if (m_owner && (0 != m_block)) {
00075         delete m_block;
00076     }
00077     m_owner = true;
00078     m_block = block;
00079 }

unsigned int DataSeparatorRecord::gather ( OutputBufferList outputBuffers  )  const [virtual]

Adds to the supplied line the OutputBuffers that contain the DAQ format of this objects content returning the total number of bytes in the added buffers.

Definition at line 81 of file DataSeparatorRecord.cc.

00081                                                                               {
00082     unsigned int result = bufferSize() * kBytesInInt;
00083     outputBuffers.push_back(OutputBuffer(buffer(),
00084                                          result));
00085 
00086     result += m_block->gather(outputBuffers);
00087     return result;
00088 }

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

Returns the component with the format of this buffer.

Reimplemented from DybDaq::DaqBuffer.

Definition at line 69 of file DataSeparatorRecord.cc.

00069                                                         {
00070     return FileTraits::kDataSeparatorRecord;
00071 }

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

Suppress default.

void DataSeparatorRecord::setBlockNumber ( unsigned int  blockNumber  )  [private]

Sets the number of thefollowing data block within the file.

Definition at line 90 of file DataSeparatorRecord.cc.

00090                                                                  {
00091     writeField(blockNumber,
00092                FileTraits::kBlockNumber);
00093 }

void DataSeparatorRecord::setBlockLength ( unsigned int  blockLength  )  [private]

Sets the size of the following data block in bytes.

Definition at line 95 of file DataSeparatorRecord.cc.

00095                                                                  {
00096     writeField(blockLength,
00097                FileTraits::kBlockLength);
00098 }

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.

00040                                                {
00041     return dynamic_cast<const FileTraits&>(daqTraits());
00042 }

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

Returns the marker for this FileBuffer.

Definition at line 44 of file FileBuffer.cc.

00044                                       {
00045     return readUnsignedInt(FileTraits::kMarker);
00046 }

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

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

Definition at line 48 of file FileBuffer.cc.

00048                                     {
00049     return readUnsignedInt(FileTraits::kRecordSize);
00050 }

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.

00052                                           {
00053     return size();
00054 }

void FileBuffer::setMarker ( const unsigned int  marker  )  [protected, inherited]

Sets the marker for this FileBuffer.

Definition at line 56 of file FileBuffer.cc.

00056                                                     {
00057     writeField(marker,
00058                FileTraits::kMarker);
00059 }

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.

00061                                                 {
00062     writeField(size,
00063                FileTraits::kRecordSize);
00064 }


Member Data Documentation

const EventReadout* DybDaq::DataSeparatorRecord::m_block [private]

The data block for this object.

Definition at line 117 of file DataSeparatorRecord.h.

bool DybDaq::DataSeparatorRecord::m_owner [mutable, private]

True if this object is the owner of the m_block.

Definition at line 122 of file DataSeparatorRecord.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 Mon Apr 11 20:08:35 2011 for FileReadoutFormat by doxygen 1.4.7