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