Defect.cpp

00001 #include "Defect.h"
00002 #include "DefectPrototype.h"
00003 
00004 std::ostream&operator << (std::ostream& os, const SctData::Defect& d){
00005   os << "DEFECT NAME           : " << d.getPrototype().getName()<<std::endl;
00006   os << "FIRST CHANNEL         : " << d.getModuleElement().getFirst()<<std::endl;
00007   os << "LAST CHANNEL          : " << d.getModuleElement().getLast()<<std::endl;
00008   if (d.getParameter()){
00009     os << "PARAMETER             : " << *d.getParameter() << std::endl;
00010   }
00011   return os;
00012 }
00013 
00014 namespace SctData{
00015 Defect::Defect(const DefectPrototype& proto, ModuleElement element, boost::optional<double> opt_par) :
00016   prototype(&proto), element(element), opt_par(opt_par)
00017 {
00018 }
00019 
00020 const ModuleElement& Defect::getModuleElement() const {
00021   return element;
00022 }
00023 
00024 const DefectPrototype& Defect::getPrototype() const {
00025   return *prototype;
00026 }
00027 
00028 bool Defect::operator==(const Defect& defect) const{
00029   return element==defect.element && *prototype==*defect.prototype;
00030 }
00031 
00032 bool Defect::operator!=(const Defect& defect) const{
00033   return (!this->operator==(defect));
00034 }
00035 
00037  boost::optional<double> Defect::getParameter() const {
00038    return opt_par;
00039  }
00040  
00042  void Defect::setParameter(double param) {
00043    opt_par = boost::optional<double>(param);
00044  }
00045  
00046 }

Generated on Mon Feb 6 14:01:19 2006 for SCT DAQ/DCS Software - C++ by  doxygen 1.4.6