Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:11

0001 // -*- C++ -*-
0002 //
0003 // Package:     Framework
0004 // Class  :     IOVSyncValue
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Wed Aug  3 18:35:35 EDT 2005
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/Framework/interface/IOVSyncValue.h"
0017 #include "DataFormats/Provenance/interface/LuminosityBlockID.h"
0018 #include "FWCore/Utilities/interface/Exception.h"
0019 
0020 //
0021 // constants, enums and typedefs
0022 //
0023 namespace edm {
0024 
0025   //
0026   // static data member definitions
0027   //
0028 
0029   //
0030   // constructors and destructor
0031   //
0032   IOVSyncValue::IOVSyncValue() : eventID_(), time_(), haveID_(true), haveTime_(true) {}
0033 
0034   IOVSyncValue::IOVSyncValue(const EventID& iID) : eventID_(iID), time_(), haveID_(true), haveTime_(false) {}
0035 
0036   IOVSyncValue::IOVSyncValue(const Timestamp& iTime) : eventID_(), time_(iTime), haveID_(false), haveTime_(true) {}
0037 
0038   IOVSyncValue::IOVSyncValue(const EventID& iID, const Timestamp& iTime)
0039       : eventID_(iID), time_(iTime), haveID_(true), haveTime_(true) {}
0040 
0041   // IOVSyncValue::IOVSyncValue(const IOVSyncValue& rhs)
0042   // {
0043   //    // do actual copying here;
0044   // }
0045 
0046   //IOVSyncValue::~IOVSyncValue()
0047   //{
0048   //}
0049 
0050   //
0051   // assignment operators
0052   //
0053   // const IOVSyncValue& IOVSyncValue::operator=(const IOVSyncValue& rhs)
0054   // {
0055   //   //An exception safe implementation is
0056   //   IOVSyncValue temp(rhs);
0057   //   swap(rhs);
0058   //
0059   //   return *this;
0060   // }
0061 
0062   //
0063   // member functions
0064   //
0065 
0066   //
0067   // const member functions
0068   //
0069   void IOVSyncValue::throwInvalidComparison() const {
0070     throw cms::Exception("InvalidIOVSyncValueComparison")
0071         << "Attempted to compare a time-only and a run/lumi/event-only IOVSyncValue. Please report this error to the "
0072            "framework experts.";
0073   }
0074 
0075   //
0076   // static member functions
0077   //
0078   const IOVSyncValue& IOVSyncValue::invalidIOVSyncValue() {
0079     static const IOVSyncValue s_invalid;
0080     return s_invalid;
0081   }
0082   const IOVSyncValue& IOVSyncValue::endOfTime() {
0083     static const IOVSyncValue s_endOfTime(
0084         EventID(0xFFFFFFFFUL, LuminosityBlockID::maxLuminosityBlockNumber(), EventID::maxEventNumber()),
0085         Timestamp::endOfTime());
0086     return s_endOfTime;
0087   }
0088   const IOVSyncValue& IOVSyncValue::beginOfTime() {
0089     static const IOVSyncValue s_beginOfTime(EventID(1, 0, 0), Timestamp::beginOfTime());
0090     return s_beginOfTime;
0091   }
0092 }  // namespace edm