00001 #ifndef CBLTREADOUTFORMAT_CBLTREADOUT_H 00002 #define CBLTREADOUTFORMAT_CBLTREADOUT_H 00003 00004 /* 00005 * CbltReadout.h 00006 * CbltReadoutFormat 00007 * 00008 * Created by Simon Patton on 7/19/10. 00009 * Copyright 2010 DayaBay Collaboration. All rights reserved. 00010 * 00011 */ 00012 #include "DaqReadoutFormat/RomData.h" 00013 #include "CbltReadoutFormat/CbltBuffer.h" 00014 00015 namespace DybDaq { 00016 class CbltBody; 00017 class CbltFoot; 00018 class CbltHead; 00019 } 00020 00021 #include "DaqReadoutFormat/DaqContainer.h" 00022 00023 namespace DybDaq { 00024 00025 class CbltReadout : public DaqContainer, public RomData { 00026 00027 public: 00028 00032 CbltReadout(const unsigned int moduleAddress, 00033 const unsigned int moduleType, 00034 const RomData* romData, 00035 const CbltTraits& traits); 00036 00040 CbltReadout(const ByteBuffer& byteBuffer, 00041 const unsigned int length); 00042 00046 virtual ~CbltReadout(); 00047 00051 virtual const DaqTraits& daqTraits() const; 00052 00053 /* 00054 * Returns the CbltHead for this readout. 00055 */ 00056 const CbltHead& head() const; 00057 00058 /* 00059 * Returns the CbltBody for this readout. 00060 */ 00061 const CbltBody& body() const; 00062 00063 /* 00064 * Returns the CbltFoot for this readout. 00065 */ 00066 const CbltFoot& foot() const; 00067 00071 virtual unsigned int romSize() const; 00072 00077 virtual unsigned int gatherRom(DaqBuffer::OutputBufferList& outputBuffers) const; 00078 00083 virtual unsigned int inspectRom(DaqBuffer::Bytes& inspectors) const; 00084 00088 virtual unsigned int bufferSize() const; 00089 00090 protected: 00091 00095 virtual unsigned int gatherComponents(OutputBufferList& outputBuffers) const; 00096 00100 virtual unsigned int inspectComponents(DaqBuffer::Bytes& inspectors) const; 00101 00105 virtual void expanded(const unsigned int size); 00106 00111 virtual bool setRomExpandable(DaqExpandable& expandable); 00112 00113 private: 00114 00118 CbltReadout(); 00119 00123 CbltReadout(CbltReadout& rhs); 00124 00128 CbltReadout& operator=(CbltReadout& rhs); 00129 00133 const CbltTraits& cbltTraits() const; 00134 00135 /* 00136 * Returns the CbltFoot for this readout. 00137 */ 00138 CbltFoot& foot(); 00139 00143 mutable CbltHead* m_head; 00144 00148 mutable CbltBody* m_body; 00149 00153 mutable CbltFoot* m_foot; 00154 00155 }; 00156 00157 } 00158 00159 #endif // CBLTREADOUTFORMAT_CBLTREADOUT_H