00001 #ifndef DAQREADOUTFORMAT_DAQCONTAINER_H 00002 #define DAQREADOUTFORMAT_DAQCONTAINER_H 00003 00004 /* 00005 * DaqContainer.h 00006 * DaqReadoutFormat 00007 * 00008 * Created by Simon Patton on 7/21/10. 00009 * Copyright 2010 DayaBay Collaboration. All rights reserved. 00010 * 00011 */ 00012 00013 namespace DybDaq { 00014 class RomData; 00015 } 00016 00017 #include "DaqReadoutFormat/DaqBuffer.h" 00018 #include "DaqReadoutFormat/DaqExpandable.h" 00019 00020 namespace DybDaq { 00021 00022 class DaqContainer : public DaqBuffer, public DaqExpandable { 00023 00024 public: 00025 00029 virtual ~DaqContainer(); 00030 00035 virtual unsigned int gather(OutputBufferList& outputBuffers) const; 00036 00041 virtual unsigned int inspect(DaqBuffer::Bytes& inspectors) const; 00042 00043 protected: 00044 00048 DaqContainer(); 00049 00053 DaqContainer(const DaqContainer& rhs); 00054 00058 DaqContainer(DaqExpandable& expandable); 00059 00063 DaqContainer(const ByteBuffer& byteBuffer, 00064 const unsigned int bufferSize); 00065 00069 DaqContainer(const ByteBuffer& byteBuffer, 00070 const DaqTraits& traits, 00071 const unsigned int bufferSize); 00072 00077 unsigned int begin() const; 00078 00082 unsigned int containerSize() const; 00083 00087 virtual unsigned int gatherComponents(OutputBufferList& outputBuffers) const = 0; 00088 00092 virtual unsigned int inspectComponents(DaqBuffer::Bytes& inspectors) const = 0; 00093 00098 bool setExpandable(DaqExpandable& expandable); 00099 00103 void notifyExpandable(const unsigned int size); 00104 00109 bool expandedByRomData(const RomData* romData); 00110 00111 private: 00112 00116 DaqContainer& operator=(const DaqContainer& rhs); 00117 00121 DaqExpandable* m_expandable; 00122 00127 unsigned int m_begin; 00128 00132 unsigned int m_bufferSize; 00133 }; 00134 00135 } 00136 00137 #endif // DAQREADOUTFORMAT_DAQCONTAINER_H