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

#include <FeeReadout.h>

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

List of all members.

Public Types

typedef std::vector< const
FeeHit * > 
FeeHitPtrList
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

 FeeReadout (const unsigned int triggerNumber, const unsigned int triggerType, const bool checked, const bool error, const FeeTraits &traits)
 FeeReadout (const ByteBuffer &byteBuffer, const unsigned int length)
 Create an instance of this class.
virtual ~FeeReadout ()
 Destroy this instance of the class.
virtual const DaqTraitsdaqTraits () const
 Returns the DaqTraits instance used to parse this object's buffer.
const FeeHeadhead () const
const FeeHitPtrListfeeHits () const
const FeeFootfoot () 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 FeeHitaddHit (const unsigned int channel, const unsigned int peakCycle, const bool highRangeAdc, const unsigned int pedestal, const unsigned int charge, const unsigned int hitNumber, const unsigned int time)
 Creates a new FeeHit in this readout using the supplied values.
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

 FeeReadout ()
 Suppress default.
 FeeReadout (FeeReadout &rhs)
 Suppress default.
FeeReadoutoperator= (FeeReadout &rhs)
 Suppress default.
const FeeHitadd (const FeeHit *hit)
 Adds the supplied FeeHit to this object,.
FeeFootfoot ()

Private Attributes

FeeHeadm_head
 The FeeHead for this fragment.
FeeHitPtrListm_hits
 The list of Fee Hits in this object.
FeeFootm_foot
 The FeeFoot for this fragment.

Friends

friend class DaqContainer

Detailed Description

Definition at line 27 of file FeeReadout.h.


Member Typedef Documentation

typedef std::vector<const FeeHit*> DybDaq::FeeReadout::FeeHitPtrList

Definition at line 31 of file FeeReadout.h.


Constructor & Destructor Documentation

FeeReadout::FeeReadout ( const unsigned int  triggerNumber,
const unsigned int  triggerType,
const bool  checked,
const bool  error,
const FeeTraits traits 
)

Definition at line 25 of file FeeReadout.cc.

                                                :
DaqContainer(),
m_head(new FeeHead(triggerNumber,
                   triggerType,
                   checked,
                   error,
                   traits)),
m_hits(0),
m_foot(0) {
}
FeeReadout::FeeReadout ( const ByteBuffer byteBuffer,
const unsigned int  length 
)

Create an instance of this class.

Definition at line 40 of file FeeReadout.cc.

FeeReadout::~FeeReadout ( ) [virtual]

Destroy this instance of the class.

Definition at line 50 of file FeeReadout.cc.

                        {
    if (0 != m_foot) {
        delete m_foot;
    }
        if (0 != m_hits) {
                FeeHitPtrList::const_iterator hit;
                for (hit = m_hits->begin();
                         hit != m_hits->end();
                         ++hit) {
                        delete const_cast<FeeHit*>(*hit);
                }
                delete m_hits;
        }
    if (0 != m_head) {
        delete m_head;
    }
}
DybDaq::FeeReadout::FeeReadout ( ) [private]

Suppress default.

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

Suppress default.


Member Function Documentation

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

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

Reimplemented from DybDaq::DaqContainer.

Definition at line 68 of file FeeReadout.cc.

                                             {
    return head().feeTraits();
}
const FeeHead & FeeReadout::head ( ) const

Definition at line 72 of file FeeReadout.cc.

                                      {
    if (0 == m_head && hasByteBuffer()) {
        const ByteBuffer& buffer = byteBuffer();
        const unsigned int originalPosition = buffer.position();
        buffer.position(begin());
        m_head = new FeeHead(buffer);
        buffer.position(originalPosition);
    }
    return *m_head;
}
const FeeReadout::FeeHitPtrList & FeeReadout::feeHits ( ) const

Definition at line 83 of file FeeReadout.cc.

                                                         {
    if (0 == m_hits) {
        m_hits = new FeeHitPtrList();
        if (hasByteBuffer()) {
            const FeeTraits& traits = head().feeTraits();
            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.hitSize();
            for (unsigned int count = 0;
                 count != finished;
                 ++count) {
                FeeHit* hit = new FeeHit(buffer,
                                         traits);
                m_hits->push_back(hit);
            }
            buffer.position(originalPosition);
        }
    }
    return *m_hits;
}
const FeeFoot & FeeReadout::foot ( ) const

Definition at line 106 of file FeeReadout.cc.

                                      {
    if (0 == m_foot) {
        if (hasByteBuffer()) {
            const FeeTraits& traits = head().feeTraits();
            const ByteBuffer& buffer = byteBuffer();
            
            const unsigned int originalPosition = buffer.position();
            buffer.position(begin() + ((containerSize() - traits.footSize()) * kBytesInInt));
            m_foot = new FeeFoot(buffer,
                                 head().feeTraits());
            buffer.position(originalPosition);
        } else {
            m_foot = new FeeFoot(head());
        }
    }
    return *m_foot;
}
unsigned int FeeReadout::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 132 of file FeeReadout.cc.

                                       {
    return bufferSize();
}
unsigned int FeeReadout::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 124 of file FeeReadout.cc.

                                                                                 {
    return gather(outputBuffers);
}
unsigned int FeeReadout::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 128 of file FeeReadout.cc.

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

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

Implements DybDaq::DaqContainer.

Definition at line 164 of file FeeReadout.cc.

                                          {
    unsigned int result = head().bufferSize();
    const FeeHitPtrList& hits = feeHits();
    FeeHitPtrList::const_iterator hit;
    for (hit = hits.begin();
         hit != hits.end();
         ++hit) {
        result += (*hit)->bufferSize();
    }
    result += foot().bufferSize();
    return result;
}
const FeeHit & FeeReadout::addHit ( const unsigned int  channel,
const unsigned int  peakCycle,
const bool  highRangeAdc,
const unsigned int  pedestal,
const unsigned int  charge,
const unsigned int  hitNumber,
const unsigned int  time 
)

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

Definition at line 187 of file FeeReadout.cc.

                                                             {
    const FeeTraits& traits = head().feeTraits();
    FeeHit* result = new FeeHit(channel,
                                peakCycle,
                                highRangeAdc,
                                pedestal,
                                charge,
                                hitNumber,
                                time,
                                traits);
    return add(result);
}
unsigned int FeeReadout::gatherComponents ( OutputBufferList outputBuffers) const [protected, virtual]

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

Implements DybDaq::DaqContainer.

Definition at line 136 of file FeeReadout.cc.

                                                                               {
    unsigned int result = head().gather(outputBuffers);
    const FeeHitPtrList& hits = feeHits();
    FeeHitPtrList::const_iterator hit;
    for (hit = hits.begin();
         hit != hits.end();
         ++hit) {
        result += (*hit)->gather(outputBuffers);
    }
    
    result += foot().gather(outputBuffers);
    return result;
}
unsigned int FeeReadout::inspectComponents ( DaqBuffer::Bytes inspectors) const [protected, virtual]

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

Implements DybDaq::DaqContainer.

Definition at line 150 of file FeeReadout.cc.

                                                                           {
    unsigned int result = head().inspect(inspectors);
    const FeeHitPtrList& hits = feeHits();
    FeeHitPtrList::const_iterator hit;
    for (hit = hits.begin();
         hit != hits.end();
         ++hit) {
        result += (*hit)->inspect(inspectors);
    }
    
    result += foot().inspect(inspectors);
    return result;
}
void FeeReadout::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 177 of file FeeReadout.cc.

                                                 {
    FeeFoot& footToUse = foot();
    footToUse.setDataLength(footToUse.dataLength() + (size * kBytesInInt));
    notifyExpandable(size);
}
bool FeeReadout::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 183 of file FeeReadout.cc.

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

Suppress default.

const FeeHit & FeeReadout::add ( const FeeHit hit) [private]

Adds the supplied FeeHit to this object,.

Definition at line 206 of file FeeReadout.cc.

                                               {
    if (0 == m_hits) {
        m_hits = new FeeHitPtrList();
    }
    m_hits->push_back(hit);
    expanded(hit->bufferSize());
    return *hit;
}
FeeFoot & FeeReadout::foot ( ) [private]

Definition at line 215 of file FeeReadout.cc.

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

Member Data Documentation

FeeHead* DybDaq::FeeReadout::m_head [mutable, private]

The FeeHead for this fragment.

Definition at line 156 of file FeeReadout.h.

The list of Fee Hits in this object.

Definition at line 161 of file FeeReadout.h.

FeeFoot* DybDaq::FeeReadout::m_foot [mutable, private]

The FeeFoot for this fragment.

Definition at line 166 of file FeeReadout.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:02 for FeeReadoutFormat by doxygen 1.7.4