[373] | 1 | #include "DMM/WCDigit.h" |
---|
| 2 | |
---|
| 3 | |
---|
| 4 | MEMPHYS::DMM::WCDigit::WCDigit(MEMPHYS::DMM::IDataServices& aService) |
---|
| 5 | :MEMPHYS::DMM::BaseData(aService) |
---|
| 6 | ,m_hit() |
---|
| 7 | ,m_effPE(0) |
---|
| 8 | ,m_time(0) |
---|
| 9 | { |
---|
| 10 | std::cout << "Create Digit("<<this<<")"<<std::endl; |
---|
| 11 | }//Ctor |
---|
| 12 | //---------------------------------------------------------- |
---|
| 13 | MEMPHYS::DMM::WCDigit::WCDigit(const MEMPHYS::DMM::WCDigit& aWCDigit) |
---|
| 14 | :MEMPHYS::DMM::BaseData(aWCDigit) |
---|
| 15 | ,m_hit(aWCDigit.m_hit) |
---|
| 16 | ,m_effPE(aWCDigit.m_effPE) |
---|
| 17 | ,m_time(aWCDigit.m_time) |
---|
| 18 | { |
---|
| 19 | std::cout << "Copy Create Digit("<<this<<") from ("<< &aWCDigit <<")" <<std::endl; |
---|
| 20 | }//CCtor |
---|
| 21 | //---------------------------------------------------------- |
---|
| 22 | MEMPHYS::DMM::WCDigit& MEMPHYS::DMM::WCDigit::operator=(const MEMPHYS::DMM::WCDigit& aWCDigit) { |
---|
| 23 | std::cout << "Assign ("<<&aWCDigit<<") to (" << this << ")" <<std::endl; |
---|
| 24 | if (&aWCDigit != this) { |
---|
| 25 | m_hit = aWCDigit.m_hit; |
---|
| 26 | m_effPE = aWCDigit.m_effPE; |
---|
| 27 | m_time = aWCDigit.m_time; |
---|
| 28 | } |
---|
| 29 | return *this; |
---|
| 30 | }//op= |
---|
| 31 | //---------------------------------------------------------- |
---|
| 32 | void* MEMPHYS::DMM::WCDigit::cast(const std::string& aClass) const { |
---|
| 33 | if(aClass=="Slash::Store::IStorable") { |
---|
| 34 | return (void*)static_cast<const Slash::Store::IStorable*>(this); |
---|
| 35 | } else if(aClass=="MEMPHYS::DMM::WCDigit") { |
---|
| 36 | return (void*)static_cast<const MEMPHYS::DMM::WCDigit*>(this); |
---|
| 37 | } else if(aClass=="MEMPHYS:DMM::BaseData") { |
---|
| 38 | return (void*)static_cast<const MEMPHYS::DMM::BaseData*>(this); |
---|
| 39 | } else { |
---|
| 40 | return 0; |
---|
| 41 | } |
---|
| 42 | }//cast |
---|
| 43 | //---------------------------------------------------------- |
---|
| 44 | bool MEMPHYS::DMM::WCDigit::visit(Slash::Store::IConstVisitor&) const { |
---|
| 45 | return true; |
---|
| 46 | }//visit |
---|
| 47 | //---------------------------------------------------------- |
---|
| 48 | bool MEMPHYS::DMM::WCDigit::read(Slash::Store::IVisitor&) { |
---|
| 49 | return true; |
---|
| 50 | }//read |
---|
| 51 | //---------------------------------------------------------- |
---|
| 52 | void MEMPHYS::DMM::WCDigit::dump(std::ostream& f, |
---|
| 53 | const std::string& option) { |
---|
| 54 | MEMPHYS::DMM::BaseData::dump(f,option); |
---|
| 55 | f << "effective # pe " << m_effPE << ", " |
---|
| 56 | << "time " << m_time |
---|
| 57 | << std::endl; |
---|
| 58 | f << " The corresponding WCHit" << std::endl; |
---|
| 59 | m_hit->dump(f,option); |
---|
| 60 | }//dump |
---|
| 61 | |
---|
| 62 | |
---|