00001 #include "TimeWalkTestResultStreamer_v1.h"
00002
00003 using namespace Sct;
00004
00005 namespace SctData {
00006 namespace IO {
00007
00008
00009 unsigned TimeWalkTestResultStreamer_v1::s_version=1;
00010
00011 TimeWalkTestResultStreamer_v1::TimeWalkTestResultStreamer_v1() throw() {}
00012
00013 bool TimeWalkTestResultStreamer_v1::inMap = IOManager::addToMap("SctData::TimeWalkTestResult", auto_ptr<Streamer>(new TimeWalkTestResultStreamer_v1()));
00014
00015 shared_ptr<Streamable> TimeWalkTestResultStreamer_v1::read(IStream& in, const IOManager& manager) const throw(LogicError, IoError){
00016 boost::shared_ptr<Streamable> ad (new TimeWalkTestResult());
00017 read(in, *ad, manager);
00018 return ad;
00019 }
00020
00021 void TimeWalkTestResultStreamer_v1::write(OStream& out, const Streamable& ob, const IOManager& manager) const throw(LogicError, IoError) {
00022
00023 manager.writeImpl(out, ob, "SctData::TestResult");
00024
00025
00026 const TimeWalkTestResult& mytest = dynamic_cast<const TimeWalkTestResult&>(ob);
00027
00028 for (unsigned int ichip=0; ichip<nChipModule; ichip++) {
00029 writeChipResult(out, mytest.getChipResult(ichip), manager);
00030 }
00031 }
00032
00033 void TimeWalkTestResultStreamer_v1::read(IStream& in, Streamable& ob, const IOManager& manager) const throw(LogicError, IoError) {
00034 manager.readImpl(in, ob, "SctData::TestResult");
00035
00036 TimeWalkTestResult& mytest = dynamic_cast<TimeWalkTestResult&>(ob);
00037
00038 for (unsigned int ichip=0; ichip<nChipModule; ichip++) {
00039 readChipResult(in, mytest.getChipResult(ichip), manager);
00040 }
00041 }
00042
00043 void TimeWalkTestResultStreamer_v1::writeChipResult(OStream& out, const TimeWalkTestResult::ChipTWResult& c, const IOManager& manager) const throw (LogicError, IoError) {
00044 out << c.timewalk << c.calibration;
00045 }
00046
00047 void TimeWalkTestResultStreamer_v1::readChipResult(IStream& in, TimeWalkTestResult::ChipTWResult& c, const IOManager& manager) const throw(LogicError, IoError) {
00048 in >> c.timewalk >> c.calibration;
00049 }
00050
00051 }
00052 }