source: DMM/src/WCDigit.cxx @ 437

Last change on this file since 437 was 373, checked in by campagne, 17 years ago

Data Model for MEMPHYS

File size: 2.1 KB
Line 
1#include "DMM/WCDigit.h"
2
3
4MEMPHYS::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//----------------------------------------------------------
13MEMPHYS::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//----------------------------------------------------------
22MEMPHYS::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//----------------------------------------------------------
32void* 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//----------------------------------------------------------
44bool  MEMPHYS::DMM::WCDigit::visit(Slash::Store::IConstVisitor&) const {
45  return true;
46}//visit
47//----------------------------------------------------------
48bool MEMPHYS::DMM::WCDigit::read(Slash::Store::IVisitor&) {
49  return true;
50}//read
51//----------------------------------------------------------
52void 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
Note: See TracBrowser for help on using the repository browser.