Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

TimeWalkTestResultStreamer.cpp

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

Generated on Mon Dec 15 19:36:21 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3