00001 /* 00002 * ByteInspector.cc 00003 * DaqReadoutFormat 00004 * 00005 * Created by Simon Patton on 4/4/11. 00006 * Copyright 2010 DayaBay Collaboration. All rights reserved. 00007 * 00008 */ 00009 #include "DaqReadoutFormat/ByteInspector.h" 00010 00011 #include "DaqReadoutFormat/BitsInspector.h" 00012 00013 using DybDaq::ByteInspector; 00014 using std::string; 00015 using std::vector; 00016 00017 ByteInspector::ByteInspector(unsigned int value, 00018 Bits* bits) : 00019 m_value(value), 00020 m_bits(bits) { 00021 } 00022 00023 ByteInspector::~ByteInspector() { 00024 if (0 != m_bits) { 00025 const Bits::const_iterator finished = m_bits->end(); 00026 for (Bits::iterator bitsInfo = m_bits->begin(); 00027 finished != bitsInfo; 00028 ++bitsInfo) { 00029 delete *bitsInfo; 00030 } 00031 delete m_bits; 00032 } 00033 } 00034 00035 unsigned int ByteInspector::value() const { 00036 return m_value; 00037 } 00038 00039 const ByteInspector::Bits& ByteInspector::bits() const { 00040 return *m_bits; 00041 }