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 
7 using namespace std;
8 
10 {
11  cout << PHWHERE << "ERROR Reset() not implemented by daughter class" << endl;
12  return ;
13 }
14 
15 void SyncObject::identify(ostream& os) const
16 {
17  os << "identify yourself: virtual SyncObject Object" << endl;
18  return ;
19 }
20 
22 {
23  cout << PHWHERE << "isValid not implemented by daughter class" << endl;
24  return 0;
25 }
26 
29 {
30  cout << "SyncObject::clone() not implemented by daughter class" << endl;
31  return NULL;
32 }
33 
36 {
37  if ( this != &source )
38  {
39  EventCounter(source.EventCounter());
40  EventNumber(source.EventNumber());
41  RunNumber(source.RunNumber());
42  SegmentNumber(source.SegmentNumber());
43  }
44  return *this;
45 }
46 
47 int SyncObject::Different(const SyncObject *other) const
48 {
49  int iret = 0;
50  if (EventNumber() != other->EventNumber())
51  {
52  iret += 0x1;
53  }
54  if (RunNumber() != other->RunNumber())
55  {
56  iret |= 0x2;
57  }
58  return iret;
59 }
#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
#define PHWHERE
Definition: phool.h:23