source: DMM/src/WCHit.cxx@ 406

Last change on this file since 406 was 373, checked in by campagne, 18 years ago

Data Model for MEMPHYS

File size: 1.9 KB
Line 
1#include "DMM/WCHit.h"
2
3
4MEMPHYS::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//----------------------------------------------------------
12MEMPHYS::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//----------------------------------------------------------
20MEMPHYS::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//----------------------------------------------------------
29void* 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//----------------------------------------------------------
41bool MEMPHYS::DMM::WCHit::visit(Slash::Store::IConstVisitor&) const {
42 return true;
43}//visit
44//----------------------------------------------------------
45bool MEMPHYS::DMM::WCHit::read(Slash::Store::IVisitor&) {
46 return true;
47}//read
48//----------------------------------------------------------
49void 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
Note: See TracBrowser for help on using the repository browser.