BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
CalibBase.cxx
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/CalibData/src/CalibBase.cxx,v 1.4 2011/02/17 05:10:16 maqm Exp $
2
3/** @class CalibBase
4 * Implementation of base class for all calibration data objects
5 */
6
8//#include "CalibData/CalibTime.h"
9#include "GaudiKernel/StatusCode.h"
10
11namespace CalibData {
12 /* CalibBase::CalibBase() : m_validSince(0), m_validTill(0), m_serNo(-1)
13 {}
14
15 CalibBase::CalibBase(const ITime& since, const ITime& till, int serNo) :
16 m_validSince(0), m_validTill(0), m_serNo(serNo)
17 {
18 m_validSince = new CalibData::CalibTime(since);
19 m_validTill = new CalibData::CalibTime(till);
20 }
21*/
23 DataObject( (DataObject&) other) {
24 // m_validSince = other.m_validSince;
25 // m_validTill = other.m_validTill;
26 m_serNo = other.m_serNo;
27 }
28
30 /* delete m_validSince;
31 delete m_validTill;*/
32 }
33
34
35StatusCode CalibBase::update(CalibBase& obj, MsgStream* ) {
36 /*
37 delete m_validSince;
38 delete m_validTill;
39
40 m_validTill = new CalibData::CalibTime(obj.validTill() );
41
42 m_validSince = new CalibData::CalibTime(obj.validSince() );*/
43 m_serNo = obj.m_serNo;
44 return StatusCode::SUCCESS;
45 }
46
47 /* bool CalibBase::isValid() {
48 return ((m_validSince != 0) && (m_validTill != 0)
49 && (validSince() <= validTill()) );
50 }
51
52*/
53 // It makes no sense to go comparing times or setting times
54 // using ITime interface unless we have an agreed-upon base;
55 // i.e., ITime::absoluteTime() must always return something
56 // in consistent units, counting from the same zero point.
57 // There is no way to enforce this; it has to be a programmers'
58 // agreement.
59 // In our case, we assume that the underlying class implementing
60 // ITime is always CalibTime.
61
62 /*bool CalibBase::isValid (const ITime& t) {
63 if (!isValid()) return false;
64 return validSince() <= t && t <= validTill();
65 }
66
67 const ITime& CalibBase::validSince() {
68 return *m_validSince;
69 }
70
71 const ITime& CalibBase::validTill() {
72 return *m_validTill;
73 }
74
75 void CalibBase::setValidity(const ITime& since, const ITime& till) {
76 setValiditySince(since);
77 setValidityTill(till);
78 }
79
80 void CalibBase::setValiditySince(const ITime& since) {
81 delete m_validSince;
82 m_validSince = new CalibTime(since);
83 }
84
85 void CalibBase::setValidityTill(const ITime& till) {
86 delete m_validTill;
87 m_validTill = new CalibTime(till);
88 }
89
90 StatusCode CalibBase::updateValidity() {
91 return StatusCode::SUCCESS;
92 }*/
93}
int m_serNo
Serial number of corresponding metadata row.
virtual StatusCode update(CalibBase &obj, MsgStream *)
Following is intended for deep copy.
Definition CalibBase.cxx:35