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

#include <CbltBody.h>

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

virtual ~CbltBody ()
 Destroy this instance of the class.
const RomDatadata () const
virtual unsigned int bufferSize () const
 Returns the size, in 4-bytes, of this ojbect's contents in the buffer.
virtual unsigned int gather (OutputBufferList &outputBuffers) const
virtual unsigned int inspect (DaqBuffer::Bytes &inspectors) const
bool hasDaqTraits () const
virtual const DaqTraitsdaqTraits () const

Static Public Attributes

static const unsigned int kBytesInInt
static const unsigned int kUndefinedFormatComponent

Protected Member Functions

 CbltBody (const RomData *romData, const unsigned int moduleType, DaqExpandable &expandable)
 Create an instance of this class.
 CbltBody (const ByteBuffer &byteBuffer, const unsigned int moduleType, const unsigned int size, const CbltTraits &traits)
 Create an instance of this class.
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.
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

 CbltBody ()
 Suppress default.
 CbltBody (CbltBody &rhs)
 Suppress default.
CbltBodyoperator= (CbltBody &rhs)
 Suppress default.

Private Attributes

const RomDatam_data
 The RomData for this event.
unsigned int m_moduleType
 The type of module inside this object.

Friends

class CbltReadout

Detailed Description

Definition at line 23 of file CbltBody.h.


Constructor & Destructor Documentation

CbltBody::~CbltBody ( ) [virtual]

Destroy this instance of the class.

Definition at line 52 of file CbltBody.cc.

                    {
    if (0 != m_data) {
        delete m_data;
    }
}
CbltBody::CbltBody ( const RomData romData,
const unsigned int  moduleType,
DaqExpandable expandable 
) [protected]

Create an instance of this class.

Definition at line 31 of file CbltBody.cc.

                                              :
DaqContainer(expandable),
m_data(data),
m_moduleType(moduleType) {
    expandedByRomData(data);
}
CbltBody::CbltBody ( const ByteBuffer byteBuffer,
const unsigned int  moduleType,
const unsigned int  size,
const CbltTraits traits 
) [protected]

Create an instance of this class.

Definition at line 40 of file CbltBody.cc.

                                             :
DaqContainer(byteBuffer,
             traits,
             bufferSize),
m_data(0),
m_moduleType(moduleType) {
    byteBuffer.position(byteBuffer.position() + (bufferSize * kBytesInInt));
}
DybDaq::CbltBody::CbltBody ( ) [private]

Suppress default.

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

Suppress default.


Member Function Documentation

const RomData & CbltBody::data ( ) const

Definition at line 58 of file CbltBody.cc.

                                    {
    if (0 == m_data && hasByteBuffer()) {
        const CbltTraits& traits = dynamic_cast<const CbltTraits&>(daqTraits());
        const ByteBuffer& buffer = byteBuffer();

        const unsigned int originalPosition = buffer.position();
        buffer.position(begin());
        if (m_moduleType == traits.moduleType(CbltTraits::kFadcModule)) {
            m_data = new FadcReadout(buffer,
                                     containerSize());
        } else if (m_moduleType == traits.moduleType(CbltTraits::kFeeModule)) {
            m_data = new FeeReadout(buffer,
                                    containerSize());
        } else if (m_moduleType == traits.moduleType(CbltTraits::kLtbModule)) {
            m_data = new LtbReadout(buffer,
                                    containerSize());
        }
        else if ( m_moduleType == traits.moduleType(CbltTraits::kRpcRomModule)) {
           const unsigned int version = (traits.majorVersion() << 4) | traits.minorVersion();
           m_data = new FecReadout(buffer, containerSize(), version);
        }
        else if ( m_moduleType == traits.moduleType(CbltTraits::kRpcRtmModule)) {
           const unsigned int version = (traits.majorVersion() << 4) | traits.minorVersion();
           m_data = new RtmReadout(buffer, containerSize(), version);
        }
        buffer.position(originalPosition);
    }
    return *m_data;
}
unsigned int CbltBody::bufferSize ( ) const [virtual]

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

Implements DybDaq::DaqContainer.

Definition at line 88 of file CbltBody.cc.

                                        {
    return data().romSize();
}
unsigned int CbltBody::gatherComponents ( OutputBufferList outputBuffers) const [protected, virtual]

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

Implements DybDaq::DaqContainer.

Definition at line 92 of file CbltBody.cc.

                                                                             {
    return data().gatherRom(outputBuffers);
}
unsigned int CbltBody::inspectComponents ( DaqBuffer::Bytes inspectors) const [protected, virtual]

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

Implements DybDaq::DaqContainer.

Definition at line 96 of file CbltBody.cc.

                                                                         {
 //   return 0;
    return data().inspectRom(inspectors);
}
void CbltBody::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 101 of file CbltBody.cc.

                                               {
    notifyExpandable(size);
}
CbltBody& DybDaq::CbltBody::operator= ( CbltBody rhs) [private]

Suppress default.


Friends And Related Function Documentation

friend class CbltReadout [friend]

Definition at line 27 of file CbltBody.h.


Member Data Documentation

const RomData* DybDaq::CbltBody::m_data [mutable, private]

The RomData for this event.

Definition at line 96 of file CbltBody.h.

unsigned int DybDaq::CbltBody::m_moduleType [private]

The type of module inside this object.

Definition at line 101 of file CbltBody.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:11 for CbltReadoutFormat by doxygen 1.7.4