File indexing completed on 2025-08-05 08:16:06
0001 #include "SyncObject.h"
0002
0003 #include <phool/phool.h>
0004
0005 #include <iostream>
0006
0007 class PHObject;
0008
0009 void SyncObject::Reset()
0010 {
0011 std::cout << PHWHERE << "ERROR Reset() not implemented by daughter class" << std::endl;
0012 return;
0013 }
0014
0015 void SyncObject::identify(std::ostream& os) const
0016 {
0017 os << "identify yourself: virtual SyncObject Object" << std::endl;
0018 return;
0019 }
0020
0021 int SyncObject::isValid() const
0022 {
0023 std::cout << PHWHERE << "isValid not implemented by daughter class" << std::endl;
0024 return 0;
0025 }
0026
0027 PHObject*
0028 SyncObject::CloneMe() const
0029 {
0030 std::cout << "SyncObject::CloneMe() not implemented by daughter class" << std::endl;
0031 return nullptr;
0032 }
0033
0034 SyncObject&
0035 SyncObject::operator=(const SyncObject& source)
0036 {
0037 if (this != &source)
0038 {
0039 EventCounter(source.EventCounter());
0040 EventNumber(source.EventNumber());
0041 RunNumber(source.RunNumber());
0042 SegmentNumber(source.SegmentNumber());
0043 }
0044 return *this;
0045 }
0046
0047 unsigned int SyncObject::Different(const SyncObject* other) const
0048 {
0049 unsigned int iret = 0;
0050 if (EventNumber() != other->EventNumber())
0051 {
0052 iret += 0x1U;
0053 }
0054 if (RunNumber() != other->RunNumber())
0055 {
0056 iret |= 0x2U;
0057 }
0058 if (SegmentNumber() != other->SegmentNumber())
0059 {
0060 iret |= 0x4U;
0061 }
0062 return iret;
0063 }