00001 #include "../StrobeDelayTestResult.h"
00002 #include "StrobeDelayTestResultStreamer_v1.h"
00003 #include <vector>
00004
00005 using namespace Sct;
00006
00007 namespace SctData {
00008 namespace IO {
00009
00010
00011 unsigned StrobeDelayTestResultStreamer_v1::s_version=1;
00012
00013 StrobeDelayTestResultStreamer_v1::StrobeDelayTestResultStreamer_v1() throw() {
00014 }
00015
00016 bool StrobeDelayTestResultStreamer_v1::inMap = IOManager::addToMap("SctData::StrobeDelayTestResult", auto_ptr<Streamer>(new StrobeDelayTestResultStreamer_v1()));
00017
00018 shared_ptr<Streamable> StrobeDelayTestResultStreamer_v1::read(IStream& in, const IOManager& manager) const throw(LogicError, IoError) {
00019 shared_ptr<Streamable> ad (new StrobeDelayTestResult());
00020 read(in, *ad, manager);
00021 return ad;
00022 }
00023
00024 void StrobeDelayTestResultStreamer_v1::write(OStream& out, const Streamable& ob, const IOManager& manager) const throw(LogicError, IoError) {
00025
00026 manager.writeImpl(out, ob, "SctData::TestResult");
00027
00028 const StrobeDelayTestResult& mytest = dynamic_cast<const StrobeDelayTestResult&>(ob);
00029
00030 out << (double) 0.25;
00031
00032 unsigned int nopt=mytest.getNOptima();
00033 out << nopt;
00034 for (unsigned int i=0; i<nopt; ++i) {
00035 out << mytest.getOptimum(i);
00036 }
00037 }
00038
00039 void StrobeDelayTestResultStreamer_v1::read(IStream& in, Streamable& ob, const IOManager& manager) const throw(LogicError, IoError) {
00040 manager.readImpl(in, ob, "SctData::TestResult");
00041
00042 StrobeDelayTestResult& mytest = dynamic_cast<StrobeDelayTestResult&>(ob);
00043 double fraction;
00044 in >> fraction;
00045 unsigned int nopt;
00046 in >> nopt;
00047 mytest.setNOptima(nopt);
00048 for (unsigned int ichip=0; ichip<nopt; ++ichip) {
00049 double opt;
00050 in >> opt ;
00051 mytest.setOptimum(ichip, opt);
00052 }
00053 }
00054
00055 }
00056 }