Class Reference for E1039 Core & Analysis Software
SyncObject.cc
Go to the documentation of this file.
1 #include "SyncObject.h"
2 
3 #include <phool/phool.h>
4 
5 #include <iostream>
6 
8 
9 using namespace std;
10 
11 void SyncObject::Reset()
12 {
13  cout << PHWHERE << "ERROR Reset() not implemented by daughter class" << endl;
14  return ;
15 }
16 
17 void SyncObject::identify(ostream& os) const
18 {
19  os << "identify yourself: virtual SyncObject Object" << endl;
20  return ;
21 }
22 
23 int SyncObject::isValid() const
24 {
25  cout << PHWHERE << "isValid not implemented by daughter class" << endl;
26  return 0;
27 }
28 
30 SyncObject::clone() const
31 {
32  cout << "SyncObject::clone() not implemented by daughter class" << endl;
33  return NULL;
34 }
35 
37 SyncObject::operator=(const SyncObject& source)
38 {
39  if ( this != &source )
40  {
41  EventCounter(source.EventCounter());
42  EventNumber(source.EventNumber());
43  RunNumber(source.RunNumber());
44  SegmentNumber(source.SegmentNumber());
45  }
46  return *this;
47 }
48 
49 int SyncObject::Different(const SyncObject *other) const
50 {
51  int iret = 0;
52  if (EventNumber() != other->EventNumber())
53  {
54  iret += 0x1;
55  }
56  if (RunNumber() != other->RunNumber())
57  {
58  iret |= 0x2;
59  }
60  return iret;
61 }
#define NULL
Definition: Pdb.h:9
virtual int Different(const SyncObject *other) const
Definition: SyncObject.cc:47
virtual void identify(std::ostream &os=std::cout) const
Definition: SyncObject.cc:15
virtual void SegmentNumber(const int)
set Segment Number
Definition: SyncObject.h:40
virtual void Reset()
Clear Sync.
Definition: SyncObject.cc:9
virtual void EventNumber(const int)
set Event Number
Definition: SyncObject.h:36
virtual SyncObject * clone() const
Virtual copy constructor.
Definition: SyncObject.cc:28
virtual SyncObject & operator=(const SyncObject &source)
Definition: SyncObject.cc:35
virtual void EventCounter(const int)
set Event Counter
Definition: SyncObject.h:33
virtual int isValid() const
isValid returns non zero if object contains valid data
Definition: SyncObject.cc:21
virtual void RunNumber(const int)
set Run Number
Definition: SyncObject.h:43
ClassImp(SyncObject) using namespace std
#define PHWHERE
Definition: phool.h:23