1 | #include "DMM/MCWCHit.h" |
---|
2 | |
---|
3 | |
---|
4 | MEMPHYS::DMM::MCWCHit::MCWCHit(MEMPHYS::DMM::IDataServices& aService) |
---|
5 | :MEMPHYS::DMM::WCHit(aService) |
---|
6 | ,m_totalPE(0) |
---|
7 | ,m_PEtimes() |
---|
8 | { |
---|
9 | std::cout << "Create MCWCHit("<<this<<")"<<std::endl; |
---|
10 | }//Ctor |
---|
11 | //---------------------------------------------------------- |
---|
12 | MEMPHYS::DMM::MCWCHit::MCWCHit(const MEMPHYS::DMM::MCWCHit& aMCWCHit) |
---|
13 | :MEMPHYS::DMM::WCHit(aMCWCHit) |
---|
14 | ,m_totalPE(aMCWCHit.m_totalPE) |
---|
15 | ,m_PEtimes(aMCWCHit.m_PEtimes) |
---|
16 | { |
---|
17 | std::cout << "Copy Create MCWCHit("<<this<<") from ("<< &aMCWCHit <<")" <<std::endl; |
---|
18 | }//CCtor |
---|
19 | //---------------------------------------------------------- |
---|
20 | MEMPHYS::DMM::MCWCHit& MEMPHYS::DMM::MCWCHit::operator=(const MEMPHYS::DMM::MCWCHit& aMCWCHit) { |
---|
21 | std::cout << "Assign ("<<&aMCWCHit<<") to (" << this << ")" <<std::endl; |
---|
22 | if (&aMCWCHit != this) { |
---|
23 | MEMPHYS::DMM::WCHit::operator=(aMCWCHit); |
---|
24 | m_totalPE = aMCWCHit.m_totalPE; |
---|
25 | m_PEtimes = aMCWCHit.m_PEtimes; |
---|
26 | } |
---|
27 | return *this; |
---|
28 | }//op= |
---|
29 | //---------------------------------------------------------- |
---|
30 | void* MEMPHYS::DMM::MCWCHit::cast(const std::string& aClass) const { |
---|
31 | if(aClass=="Slash::Store::IStorable") { |
---|
32 | return (void*)static_cast<const Slash::Store::IStorable*>(this); |
---|
33 | } else if(aClass=="MEMPHYS::DMM::MCWCHit") { |
---|
34 | return (void*)static_cast<const MEMPHYS::DMM::MCWCHit*>(this); |
---|
35 | } else if(aClass=="MEMPHYS:DMM::WCHit") { |
---|
36 | return (void*)static_cast<const MEMPHYS::DMM::BaseData*>(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::MCWCHit::visit(Slash::Store::IConstVisitor&) const { |
---|
45 | return true; |
---|
46 | }//visit |
---|
47 | //---------------------------------------------------------- |
---|
48 | bool MEMPHYS::DMM::MCWCHit::read(Slash::Store::IVisitor&) { |
---|
49 | return true; |
---|
50 | }//read |
---|
51 | //---------------------------------------------------------- |
---|
52 | void MEMPHYS::DMM::MCWCHit::dump(std::ostream& f, |
---|
53 | const std::string& option) { |
---|
54 | MEMPHYS::DMM::WCHit::dump(f,option); |
---|
55 | f << "totalPE " << m_totalPE |
---|
56 | << std::endl; |
---|
57 | if(option == "deep") { |
---|
58 | if( m_totalPE >0 ) { |
---|
59 | //dump the time Container |
---|
60 | std::vector<double>::const_iterator i; |
---|
61 | f << "PEs < "; |
---|
62 | for( i = m_PEtimes.begin(); i != m_PEtimes.end(); ++i) { |
---|
63 | f << *i << " , "; |
---|
64 | } |
---|
65 | f << ">" << std::endl; |
---|
66 | }//non-empty PE container |
---|
67 | }//deep dump |
---|
68 | }//dump |
---|
69 | |
---|
70 | |
---|