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

#include <LtbReadout.h>

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

List of all members.

Public Types

typedef std::vector< const
LtbFrame * > 
LtbFramePtrList
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

 LtbReadout (const unsigned int localTriggerNumber, const unsigned int rawTriggerTotal, const unsigned int ltbStatus, const bool clockError, const LtbTraits &traits)
 Create an instance of this class.
 LtbReadout (const ByteBuffer &byteBuffer, const unsigned int bufferSize)
 Create an instance of this class.
virtual ~LtbReadout ()
 Destroy this instance of the class.
virtual const DaqTraitsdaqTraits () const
 Returns the DaqTraits instance used to parse this object's buffer.
const LtbHeadhead () const
const LtbFramePtrListltbFrames () const
const LtbFootfoot () const
virtual unsigned int romSize () const
 Returns the total size, in 4-bytes, of all the buffers for this object's components.
virtual unsigned int gatherRom (DaqBuffer::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.
virtual unsigned int inspectRom (DaqBuffer::Bytes &inspectors) const
 Adds to the supplied list the DaqBuffer::Bytes that contains inspections of this object's objects.
virtual unsigned int bufferSize () const
 Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
const LtbFrameaddFrame (const unsigned int readoutType, const unsigned int triggerMask, const LtbTraits::LtbDateTime &dateTime, const unsigned int halfNanoseconds, const int accumulation, const unsigned int hitSum, const bool totalEsum, const bool highEsum, const bool lowEsum, const unsigned int energySum, const unsigned int crossTriggerSource, const bool accumulationStatus, const bool validGps, const bool usingUtc, const bool validClockSystem, const bool feeBufferFull, const bool ltbBufferFull, const unsigned int blockedTriggerCount)
 Creates a new LtbFrame in this readout using the supplied values.
const LtbFrameaddFrame (const LtbFrame *frame)
 Adds the supplied LtbFrame to this object,.
virtual unsigned int gather (OutputBufferList &outputBuffers) const
virtual unsigned int inspect (DaqBuffer::Bytes &inspectors) const
bool hasDaqTraits () const

Static Public Attributes

static const unsigned int kBytesInInt
static const unsigned int kUndefinedFormatComponent

Protected Member Functions

virtual unsigned int gatherComponents (OutputBufferList &outputBuffers) const
 Gathers the DAQ formatted bytes for this object's components.
virtual unsigned int inspectComponents (DaqBuffer::Bytes &inspectors) const
 Inspects the DAQ formatted bytes for this object's components.
virtual void expanded (const unsigned int size)
 Tells this object that its contents has expanded by the specified number of bytes.
virtual bool setRomExpandable (DaqExpandable &expandable)
 Associates the supplied DaqExpanable with this object if it is not already associated with one.
unsigned int begin () const
unsigned int containerSize () const
bool setExpandable (DaqExpandable &expandable)
void notifyExpandable (const unsigned int size)
bool expandedByRomData (const RomData *romData)
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)
virtual unsigned int formatComponent () const

Private Member Functions

 LtbReadout ()
 Suppress default.
 LtbReadout (LtbReadout &rhs)
 Suppress default.
LtbReadoutoperator= (LtbReadout &rhs)
 Suppress default.
LtbFootfoot ()

Private Attributes

LtbHeadm_head
 The LtbHead for this fragment.
LtbFramePtrListm_frames
 The list of RomFragments in this object.
LtbFootm_foot
 The LtbFoot for this fragment.

Friends

friend class DaqContainer

Detailed Description

Definition at line 29 of file LtbReadout.h.


Member Typedef Documentation

typedef std::vector<const LtbFrame*> DybDaq::LtbReadout::LtbFramePtrList

Definition at line 33 of file LtbReadout.h.


Constructor & Destructor Documentation

LtbReadout::LtbReadout ( const unsigned int  localTriggerNumber,
const unsigned int  rawTriggerTotal,
const unsigned int  ltbStatus,
const bool  clockError,
const LtbTraits traits 
)

Create an instance of this class.

Definition at line 29 of file LtbReadout.cc.

                                                :
DaqContainer(),
m_head(new LtbHead(localTriggerNumber,
                   rawTriggerTotal,
                   ltbStatus,
                   clockError,
                   traits)),
m_frames(0),
m_foot(0) {
}
LtbReadout::LtbReadout ( const ByteBuffer byteBuffer,
const unsigned int  bufferSize 
)

Create an instance of this class.

Definition at line 44 of file LtbReadout.cc.

                                                      :
DaqContainer(byteBuffer,
             bufferSize),
m_head(0),
m_frames(0),
m_foot(0) {
    byteBuffer.position(byteBuffer.position() + (bufferSize * kBytesInInt));
}
LtbReadout::~LtbReadout ( ) [virtual]

Destroy this instance of the class.

Definition at line 54 of file LtbReadout.cc.

                        {
    if (0 != m_foot) {
        delete m_foot;
    }
        if (0 != m_frames) {
                LtbFramePtrList::iterator iterator;
                for (iterator = m_frames->begin();
                         iterator != m_frames->end();
                         ++iterator) {
                        delete const_cast<LtbFrame*>(*iterator);
                }
                delete m_frames;
        }
    if (0 != m_head) {
        delete m_head;
    }
}
DybDaq::LtbReadout::LtbReadout ( ) [private]

Suppress default.

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

Suppress default.


Member Function Documentation

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

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

Reimplemented from DybDaq::DaqContainer.

Definition at line 72 of file LtbReadout.cc.

                                             {
    return head().ltbTraits();
}
const LtbHead & LtbReadout::head ( ) const

Definition at line 76 of file LtbReadout.cc.

                                      {
    if (0 == m_head && hasByteBuffer()) {
        const ByteBuffer& buffer = byteBuffer();
        const unsigned int originalPosition = buffer.position();
        buffer.position(begin());
        m_head = new LtbHead(buffer);
        buffer.position(originalPosition);
    }
    return *m_head;
}
const LtbReadout::LtbFramePtrList & LtbReadout::ltbFrames ( ) const

Definition at line 87 of file LtbReadout.cc.

                                                             {
    if (0 == m_frames) {
        m_frames = new LtbFramePtrList();
        if (hasByteBuffer()) {
            const LtbTraits& traits = head().ltbTraits();
            const ByteBuffer& buffer = byteBuffer();
            
            const unsigned int originalPosition = buffer.position();
            buffer.position(begin() + (traits.headSize() * kBytesInInt));
            const unsigned int finished = (containerSize() - (traits.headSize() + traits.footSize())) / traits.frameSize();
            for (unsigned int count = 0;
                 count != finished;
                 ++count) {
                const LtbFrame* frame = new LtbFrame(buffer,
                                                     traits);    
                m_frames->push_back(frame);
            }
            buffer.position(originalPosition);
        }
    }
    return *m_frames;
}
const LtbFoot & LtbReadout::foot ( ) const

Definition at line 110 of file LtbReadout.cc.

                                      {
    if (0 == m_foot && hasByteBuffer()) {
        const LtbTraits& traits = head().ltbTraits();
        const ByteBuffer& buffer = byteBuffer();
        
        const unsigned int originalPosition = buffer.position();
        buffer.position(begin() + ((containerSize() - traits.footSize()) * kBytesInInt));
        m_foot = new LtbFoot(buffer,
                             head().ltbTraits());
        buffer.position(originalPosition);
        
    }
    return *m_foot;
}
unsigned int LtbReadout::romSize ( ) const [virtual]

Returns the total size, in 4-bytes, of all the buffers for this object's components.

Implements DybDaq::RomData.

Definition at line 133 of file LtbReadout.cc.

                                       {
    return bufferSize();
}
unsigned int LtbReadout::gatherRom ( DaqBuffer::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.

Implements DybDaq::RomData.

Definition at line 125 of file LtbReadout.cc.

                                                                                 {
    return gather(outputBuffers);
}
unsigned int LtbReadout::inspectRom ( DaqBuffer::Bytes inspectors) const [virtual]

Adds to the supplied list the DaqBuffer::Bytes that contains inspections of this object's objects.

Implements DybDaq::RomData.

Definition at line 129 of file LtbReadout.cc.

                                                                    {
    return inspect(inspectors);
}
unsigned int LtbReadout::bufferSize ( ) const [virtual]

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

Implements DybDaq::DaqContainer.

Definition at line 165 of file LtbReadout.cc.

                                          {
    unsigned int result = head().bufferSize();
    const LtbFramePtrList& frames = ltbFrames();
    LtbFramePtrList::const_iterator frame;
    for (frame = frames.begin();
         frame != frames.end();
         ++frame) {
        result += (*frame)->bufferSize();
    }
    result += foot().bufferSize();
    return result;
}
const LtbFrame & LtbReadout::addFrame ( const unsigned int  readoutType,
const unsigned int  triggerMask,
const LtbTraits::LtbDateTime dateTime,
const unsigned int  halfNanoseconds,
const int  accumulation,
const unsigned int  hitSum,
const bool  totalEsum,
const bool  highEsum,
const bool  lowEsum,
const unsigned int  energySum,
const unsigned int  crossTriggerSource,
const bool  accumulationStatus,
const bool  validGps,
const bool  usingUtc,
const bool  validClockSystem,
const bool  feeBufferFull,
const bool  ltbBufferFull,
const unsigned int  blockedTriggerCount 
)

Creates a new LtbFrame in this readout using the supplied values.

Definition at line 188 of file LtbReadout.cc.

                                                                             {
    LtbFrame* result = new LtbFrame(readoutType,
                                    triggerMask,
                                    dateTime,
                                    halfNanoseconds,
                                    accumulation,
                                    hitSum,
                                    totalEsum,
                                    highEsum,
                                    lowEsum,
                                    energySum,
                                    crossTriggerSource,
                                    accumulationStatus,
                                    validGps,
                                    usingUtc,
                                    validClockSystem,
                                    feeBufferFull,
                                    ltbBufferFull,
                                    blockedTriggerCount,
                                    head().ltbTraits());
    return addFrame(result);
}
const LtbFrame & LtbReadout::addFrame ( const LtbFrame frame)

Adds the supplied LtbFrame to this object,.

Definition at line 228 of file LtbReadout.cc.

                                                          {
    if (0 == m_frames) {
        m_frames = new LtbFramePtrList();
    }
    (const_cast<LtbFrame*>(frame))->setFrameNumber(m_frames->size());
    m_frames->push_back(frame);
    m_head->setRawTriggersSaved(m_frames->size());
    expanded(frame->bufferSize());
    return *frame;
}
unsigned int LtbReadout::gatherComponents ( OutputBufferList outputBuffers) const [protected, virtual]

Gathers the DAQ formatted bytes for this object's components.

Implements DybDaq::DaqContainer.

Definition at line 137 of file LtbReadout.cc.

                                                                               {
    unsigned int result = head().gather(outputBuffers);
    const LtbFramePtrList& frames = ltbFrames();
    LtbFramePtrList::const_iterator frame;
    for (frame = frames.begin();
         frame != frames.end();
         ++frame) {
        result += (*frame)->gather(outputBuffers);
    }
    
    result += foot().gather(outputBuffers);
    return result;
}
unsigned int LtbReadout::inspectComponents ( DaqBuffer::Bytes inspectors) const [protected, virtual]

Inspects the DAQ formatted bytes for this object's components.

Implements DybDaq::DaqContainer.

Definition at line 151 of file LtbReadout.cc.

                                                                           {
    unsigned int result = head().inspect(inspectors);
    const LtbFramePtrList& frames = ltbFrames();
    LtbFramePtrList::const_iterator frame;
    for (frame = frames.begin();
         frame != frames.end();
         ++frame) {
        result += (*frame)->inspect(inspectors);
    }
    
    result += foot().inspect(inspectors);
    return result;
}
void LtbReadout::expanded ( const unsigned int  size) [protected, virtual]

Tells this object that its contents has expanded by the specified number of bytes.

Implements DybDaq::DaqContainer.

Definition at line 178 of file LtbReadout.cc.

                                                 {
    LtbFoot& footToUse = foot();
    footToUse.setDataLength(footToUse.dataLength() + (size * kBytesInInt));
    notifyExpandable(size);
}
bool LtbReadout::setRomExpandable ( DaqExpandable expandable) [protected, virtual]

Associates the supplied DaqExpanable with this object if it is not already associated with one.

It returns true if the association is successful, false otherwise.

Implements DybDaq::RomData.

Definition at line 184 of file LtbReadout.cc.

                                                           {
    return setExpandable(expandable);
}
LtbReadout& DybDaq::LtbReadout::operator= ( LtbReadout rhs) [private]

Suppress default.

LtbFoot & LtbReadout::foot ( ) [private]

Definition at line 239 of file LtbReadout.cc.

                          {
    if (0 == m_foot) {
        m_foot = new LtbFoot(head());
    }
    return *m_foot;
}

Member Data Documentation

LtbHead* DybDaq::LtbReadout::m_head [mutable, private]

The LtbHead for this fragment.

Definition at line 171 of file LtbReadout.h.

The list of RomFragments in this object.

Definition at line 176 of file LtbReadout.h.

LtbFoot* DybDaq::LtbReadout::m_foot [mutable, private]

The LtbFoot for this fragment.

Definition at line 181 of file LtbReadout.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:06 for LtbReadoutFormat by doxygen 1.7.4