00001 #ifndef DAQFORMATMODULES_STRUCTURECONVERTER_H 00002 #define DAQFORMATMODULES_STRUCTURECONVERTER_H 00003 00004 /* 00005 * StructureConverter.h 00006 * DaqFormatModules 00007 * 00008 * Created by Simon Patton on 8/11/10. 00009 * Copyright 2010 DayaBay Collaboration. All rights reserved. 00010 * 00011 */ 00012 00013 #include "GaudiKernel/GenericAddress.h" 00014 #include "GaudiKernel/Converter.h" 00015 00016 namespace DayaBay { 00017 class ReadoutHeader; 00018 } 00019 00020 namespace DybDaq { 00021 class DaqFormatContext; 00022 } 00023 00024 namespace DybDaq { 00025 00026 class StructureConverter : public Converter { 00027 00028 public: 00029 00033 static const unsigned int kEvent; 00034 00038 static const unsigned int kReadout; 00039 00043 static const unsigned int kLastElement; 00044 00048 static const long storageType(); 00049 00053 static const CLID& classID(); 00054 00058 class Address : virtual public GenericAddress { 00059 00060 public: 00061 Address(const DybDaq::DaqFormatContext& context, 00062 const unsigned int element); 00063 virtual ~Address(); 00064 00065 const DaqFormatContext& context() const; 00066 00067 unsigned int element() const; 00068 00069 private: 00070 Address(); 00071 Address(const Address& address); 00072 Address& operator=(const Address& address); 00073 const DybDaq::DaqFormatContext& m_context; 00074 const unsigned int m_element; 00075 }; 00076 00080 StructureConverter(unsigned char storageType, 00081 const CLID& clid, 00082 ISvcLocator* svc); 00083 00087 StructureConverter(ISvcLocator* svc); 00088 00092 ~StructureConverter(); 00093 00097 virtual StatusCode createObj(IOpaqueAddress* addr, 00098 DataObject*& pObject); 00099 00103 virtual StatusCode fillObjRefs(IOpaqueAddress* addr, 00104 DataObject* pObject); 00105 00106 00110 virtual long repSvcType() const; 00111 00112 private: 00113 00117 StructureConverter(); 00118 00122 StructureConverter(const StructureConverter& rhs); 00123 00127 StructureConverter& operator=(const StructureConverter& rhs); 00128 00129 }; 00130 00131 } 00132 #endif // DAQFORMATMODULES_STRUCTURECONVERTER_H