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

In This Package:

DybDaq::LtbHead Class Reference

#include <LtbHead.h>

Inheritance diagram for DybDaq::LtbHead:

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

virtual ~LtbHead ()
 Destroy this instance of the class.
unsigned int version () const
 Returns the version of the trigger format.
virtual const DaqTraitsdaqTraits () const
 Returns the DaqTraits instance used to parse this object's buffer.
unsigned int rawTriggerTotal () const
 Returns the total number of raw triggers belonging to this trigger.
unsigned int rawTriggersSaved () const
 Returns the total number of raw triggers saved in this trigger.
unsigned int ltbStatus () const
 Returns the LTB status.
unsigned int localTriggerNumber () const
 Returns the local trigger sequence number.
bool clockError () const
 Returns true if the external clock is not presented or unsteady.
virtual unsigned int bufferSize () const
 Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
const LtbTraitsltbTraits () const
 Returns the LtbTraits instance used to parse this object's 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

 LtbHead (const unsigned int localTriggerNumber, const unsigned int rawTriggerTotal, const unsigned int ltbStatus, const bool clockError, const LtbTraits &traits)
 Create an instance of this class.
 LtbHead (const ByteBuffer &byteBuffer)
 Create an instance of this class.
virtual unsigned int formatComponent () const
 Returns the component with the format of this 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

 LtbHead ()
 Suppress default.
 LtbHead (LtbHead &rhs)
 Suppress default.
LtbHeadoperator= (LtbHead &rhs)
 Suppress default.
void setRawTriggerTotal (const unsigned int rawTriggerTotal)
 Sets the total number of raw triggers belonging to this trigger.
void setRawTriggersSaved (const unsigned int rawTriggersSaved)
 Sets the total number of raw triggers saved in this trigger.
void setLtbStatus (const unsigned int ltbStatus)
 Sets the LTB status.
void setLocalTriggerNumber (const unsigned int localTriggerNumber)
 Sets the local trigger sequence number.
void setClockError (const bool clockError)
 Sets whether the external clock is not present or unsteady.

Private Attributes

const LtbTraitsm_traits
 The LtbTraits instance used to parse this object's buffer.

Friends

class LtbReadout

Detailed Description

Definition at line 21 of file LtbHead.h.


Constructor & Destructor Documentation

LtbHead::~LtbHead (  )  [virtual]

Destroy this instance of the class.

Definition at line 44 of file LtbHead.cc.

00044                   {
00045 }

LtbHead::LtbHead ( const unsigned int  localTriggerNumber,
const unsigned int  rawTriggerTotal,
const unsigned int  ltbStatus,
const bool  clockError,
const LtbTraits traits 
) [protected]

Create an instance of this class.

Definition at line 20 of file LtbHead.cc.

00024                                           :
00025 LtbBuffer(new char[traits.headSize() * kBytesInInt],
00026           traits) {
00027     m_traits = &traits;
00028     traits.initializeHead(buffer());
00029     setRawTriggerTotal(rawTriggerTotal);
00030     setRawTriggersSaved(0);
00031     setLtbStatus(ltbStatus);    
00032     setLocalTriggerNumber(localTriggerNumber);
00033     setClockError(clockError);
00034 }

LtbHead::LtbHead ( const ByteBuffer byteBuffer  )  [protected]

Create an instance of this class.

Definition at line 36 of file LtbHead.cc.

00036                                              :
00037 LtbBuffer(byteBuffer,
00038           *((LtbTraits*)0)) {
00039     const char* buffer = byteBuffer.cursor();
00040     m_traits = LtbTraits::readTraits(buffer);
00041         byteBuffer.position(byteBuffer.position() + kBytesInInt);
00042 }

DybDaq::LtbHead::LtbHead (  )  [private]

Suppress default.

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

Suppress default.


Member Function Documentation

unsigned int LtbHead::version (  )  const

Returns the version of the trigger format.

Definition at line 55 of file LtbHead.cc.

00055                                     {
00056         return readUnsignedInt(LtbTraits::kVersion);
00057 }

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

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

Reimplemented from DybDaq::DaqBuffer.

Definition at line 47 of file LtbHead.cc.

00047                                           {
00048         return *m_traits;
00049 }

unsigned int LtbHead::rawTriggerTotal (  )  const

Returns the total number of raw triggers belonging to this trigger.

Definition at line 59 of file LtbHead.cc.

00059                                             {
00060         return readUnsignedInt(LtbTraits::kRawTriggerTotal);
00061 }

unsigned int LtbHead::rawTriggersSaved (  )  const

Returns the total number of raw triggers saved in this trigger.

Definition at line 63 of file LtbHead.cc.

00063                                              {
00064         return readUnsignedInt(LtbTraits::kRawTriggersSaved);
00065 }

unsigned int LtbHead::ltbStatus (  )  const

Returns the LTB status.

Definition at line 67 of file LtbHead.cc.

00067                                       {
00068         return readUnsignedInt(LtbTraits::kLtbStatus);
00069 }

unsigned int LtbHead::localTriggerNumber (  )  const

Returns the local trigger sequence number.

Definition at line 71 of file LtbHead.cc.

00071                                                {
00072         return readUnsignedInt(LtbTraits::kLocalTriggerNumber);
00073 }

bool LtbHead::clockError (  )  const

Returns true if the external clock is not presented or unsteady.

Definition at line 75 of file LtbHead.cc.

00075                                {
00076         return readBool(LtbTraits::kClockError);
00077 }

unsigned int LtbHead::bufferSize (  )  const [virtual]

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

Implements DybDaq::DaqBuffer.

Definition at line 79 of file LtbHead.cc.

00079                                        {
00080     return ltbTraits().headSize();
00081 }

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

Returns the component with the format of this buffer.

Reimplemented from DybDaq::DaqBuffer.

Definition at line 51 of file LtbHead.cc.

00051                                             {
00052     return LtbTraits::kHead;
00053 }

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

Suppress default.

void LtbHead::setRawTriggerTotal ( const unsigned int  rawTriggerTotal  )  [private]

Sets the total number of raw triggers belonging to this trigger.

Definition at line 83 of file LtbHead.cc.

void LtbHead::setRawTriggersSaved ( const unsigned int  rawTriggersSaved  )  [private]

Sets the total number of raw triggers saved in this trigger.

Definition at line 88 of file LtbHead.cc.

void LtbHead::setLtbStatus ( const unsigned int  ltbStatus  )  [private]

Sets the LTB status.

Definition at line 93 of file LtbHead.cc.

00093                                                        {
00094     writeField(ltbStatus,
00095                LtbTraits::kLtbStatus);
00096 }

void LtbHead::setLocalTriggerNumber ( const unsigned int  localTriggerNumber  )  [private]

Sets the local trigger sequence number.

Definition at line 98 of file LtbHead.cc.

void LtbHead::setClockError ( const bool  clockError  )  [private]

Sets whether the external clock is not present or unsteady.

Definition at line 103 of file LtbHead.cc.

00103                                                  {
00104     writeField(clockError,
00105                LtbTraits::kClockError);
00106 }

const LtbTraits & LtbBuffer::ltbTraits (  )  const [inherited]

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

Definition at line 36 of file LtbBuffer.cc.

00036                                             {
00037         return dynamic_cast<const LtbTraits&>(daqTraits());
00038 }


Friends And Related Function Documentation

friend class LtbReadout [friend]

Definition at line 25 of file LtbHead.h.


Member Data Documentation

const LtbTraits* DybDaq::LtbHead::m_traits [private]

The LtbTraits 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 140 of file LtbHead.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:09 2011 for LtbReadoutFormat by doxygen 1.4.7