Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
art::SubRunID Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/canvas/v3_06_01/source/canvas/Persistency/Provenance/SubRunID.h"

Classes

struct  FlushFlag
 

Public Member Functions

constexpr SubRunID ()
 
 SubRunID (RunID rID, SubRunNumber_t srID)
 
 SubRunID (RunNumber_t rID, SubRunNumber_t srID)
 
RunID const & runID () const
 
RunNumber_t run () const
 
SubRunNumber_t subRun () const
 
bool isValid () const
 
bool isFlush () const
 
SubRunID next () const
 
SubRunID nextRun () const
 
SubRunID previous () const
 
SubRunID previousRun () const
 
bool operator== (SubRunID const &other) const
 
bool operator!= (SubRunID const &other) const
 
bool operator< (SubRunID const &other) const
 
bool operator<= (SubRunID const &other) const
 
bool operator> (SubRunID const &other) const
 
bool operator>= (SubRunID const &other) const
 

Static Public Member Functions

static SubRunID maxSubRun ()
 
static SubRunID firstSubRun ()
 
static SubRunID firstSubRun (RunID const &rID)
 
static SubRunID invalidSubRun (RunID const &rID)
 
static constexpr SubRunID flushSubRun ()
 
static SubRunID flushSubRun (RunID const &rID)
 

Private Member Functions

constexpr SubRunID (FlushFlag)
 
 SubRunID (RunID rID, FlushFlag)
 
SubRunNumber_t inRangeOrInvalid (SubRunNumber_t sr)
 
void checkSane ()
 

Private Attributes

RunID run_
 
SubRunNumber_t subRun_
 

Friends

std::ostream & operator<< (std::ostream &os, SubRunID const &iID)
 

Detailed Description

Definition at line 17 of file SubRunID.h.

Constructor & Destructor Documentation

constexpr art::SubRunID::SubRunID ( )
inline

Definition at line 66 of file SubRunID.h.

Referenced by firstSubRun(), flushSubRun(), invalidSubRun(), maxSubRun(), next(), nextRun(), previous(), and previousRun().

68 {}
static constexpr type invalid()
Definition: IDNumber.h:51
RunID run_
Definition: SubRunID.h:62
SubRunNumber_t subRun_
Definition: SubRunID.h:63
art::SubRunID::SubRunID ( RunID  rID,
SubRunNumber_t  srID 
)
inline

Definition at line 233 of file SubRunID.h.

References checkSane().

234  : run_(std::move(rID)), subRun_(inRangeOrInvalid(srID))
235 {
236  checkSane();
237 }
RunID run_
Definition: SubRunID.h:62
void checkSane()
Definition: SubRunID.h:261
SubRunNumber_t subRun_
Definition: SubRunID.h:63
SubRunNumber_t inRangeOrInvalid(SubRunNumber_t sr)
Definition: SubRunID.h:240
art::SubRunID::SubRunID ( RunNumber_t  rID,
SubRunNumber_t  srID 
)
inline

Definition at line 70 of file SubRunID.h.

References checkSane().

71  : run_(rID), subRun_(inRangeOrInvalid(srID))
72 {
73  checkSane();
74 }
RunID run_
Definition: SubRunID.h:62
void checkSane()
Definition: SubRunID.h:261
SubRunNumber_t subRun_
Definition: SubRunID.h:63
SubRunNumber_t inRangeOrInvalid(SubRunNumber_t sr)
Definition: SubRunID.h:240
constexpr art::SubRunID::SubRunID ( FlushFlag  )
inlineexplicitprivate

Definition at line 225 of file SubRunID.h.

227 {}
static constexpr RunID flushRun()
Definition: RunID.h:120
RunID run_
Definition: SubRunID.h:62
static constexpr type flush_value()
Definition: IDNumber.h:61
SubRunNumber_t subRun_
Definition: SubRunID.h:63
art::SubRunID::SubRunID ( RunID  rID,
FlushFlag   
)
inlineprivate

Definition at line 229 of file SubRunID.h.

231 {}
RunID run_
Definition: SubRunID.h:62
static constexpr type flush_value()
Definition: IDNumber.h:61
SubRunNumber_t subRun_
Definition: SubRunID.h:63

Member Function Documentation

void art::SubRunID::checkSane ( )
inlineprivate

Definition at line 261 of file SubRunID.h.

References art::errors::InvalidNumber, isValid(), art::RunID::isValid(), and run_.

Referenced by SubRunID().

262 {
263  if (isValid() && !run_.isValid()) {
265  << "SubRunID is not meaningful with valid subRun and invalid Run.\n";
266  }
267 }
bool isValid() const
Definition: SubRunID.h:95
RunID run_
Definition: SubRunID.h:62
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool isValid() const
Definition: RunID.h:68
art::SubRunID art::SubRunID::firstSubRun ( )
inlinestatic

Definition at line 151 of file SubRunID.h.

References art::RunID::firstRun(), and SubRunID().

Referenced by art::EmptyEvent::EmptyEvent(), art::EventID::firstEvent(), and art::SamplingInput::SamplingInput().

152 {
154 }
static RunID firstRun()
Definition: RunID.h:114
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type first()
Definition: IDNumber.h:71
art::SubRunID art::SubRunID::firstSubRun ( RunID const &  rID)
inlinestatic

Definition at line 157 of file SubRunID.h.

References SubRunID().

158 {
160 }
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type first()
Definition: IDNumber.h:71
constexpr art::SubRunID art::SubRunID::flushSubRun ( )
inlinestatic

Definition at line 169 of file SubRunID.h.

References SubRunID().

170 {
171  return SubRunID(FlushFlag());
172 }
constexpr SubRunID()
Definition: SubRunID.h:66
art::SubRunID art::SubRunID::flushSubRun ( RunID const &  rID)
inlinestatic

Definition at line 175 of file SubRunID.h.

References SubRunID().

176 {
177  return SubRunID(rID, FlushFlag());
178 }
constexpr SubRunID()
Definition: SubRunID.h:66
art::SubRunNumber_t art::SubRunID::inRangeOrInvalid ( SubRunNumber_t  sr)
inlineprivate

Definition at line 240 of file SubRunID.h.

References art::errors::InvalidNumber, and sr.

241 {
243 #ifdef __clang__
244 #pragma clang diagnostic push
245 #pragma clang diagnostic ignored "-Wtautological-compare"
246 #endif
248 #ifdef __clang__
249 #pragma clang diagnostic pop
250 #endif
252  return sr;
253  } else {
255  << "Attempt to construct SubRunID with an invalid number.\n"
256  << "Maybe you want SubRunID::flushSubRun()?\n";
257  }
258 }
static constexpr type invalid()
Definition: IDNumber.h:51
caf::StandardRecord * sr
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr type first()
Definition: IDNumber.h:71
static constexpr type max_natural()
Definition: IDNumber.h:66
art::SubRunID art::SubRunID::invalidSubRun ( RunID const &  rID)
inlinestatic

Definition at line 163 of file SubRunID.h.

References SubRunID().

Referenced by art::Sampled< T >::get(), art::EventID::invalidEvent(), and evdb::EventDisplay::postProcessEvent().

164 {
166 }
static constexpr type invalid()
Definition: IDNumber.h:51
constexpr SubRunID()
Definition: SubRunID.h:66
bool art::SubRunID::isFlush ( ) const
inline

Definition at line 101 of file SubRunID.h.

References subRun_.

102 {
104 }
static constexpr type flush_value()
Definition: IDNumber.h:61
SubRunNumber_t subRun_
Definition: SubRunID.h:63
bool art::SubRunID::isValid ( ) const
inline

Definition at line 95 of file SubRunID.h.

References art::RunID::isValid(), run_, and subRun_.

Referenced by checkSane(), art::FileIndex::Element::getEntryType(), art::EventID::isValid(), next(), previous(), and art::Source< T >::throwIfInsane_().

96 {
98 }
static constexpr type invalid()
Definition: IDNumber.h:51
RunID run_
Definition: SubRunID.h:62
SubRunNumber_t subRun_
Definition: SubRunID.h:63
bool isValid() const
Definition: RunID.h:68
art::SubRunID art::SubRunID::maxSubRun ( )
inlinestatic

Definition at line 145 of file SubRunID.h.

References art::RunID::maxRun(), and SubRunID().

Referenced by art::EventID::maxEvent().

146 {
148 }
static RunID maxRun()
Definition: RunID.h:108
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type max_natural()
Definition: IDNumber.h:66
art::SubRunID art::SubRunID::next ( ) const
inline

Definition at line 109 of file SubRunID.h.

References art::errors::InvalidNumber, isValid(), nextRun(), run_, subRun_, and SubRunID().

Referenced by art::EventID::nextSubRun().

110 {
111  if (!isValid()) {
113  << "cannot increment invalid subrun number.";
115  return nextRun();
116  }
117  return SubRunID(run_, subRun_ + 1);
118 }
bool isValid() const
Definition: SubRunID.h:95
RunID run_
Definition: SubRunID.h:62
SubRunID nextRun() const
Definition: SubRunID.h:121
SubRunNumber_t subRun_
Definition: SubRunID.h:63
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type max_natural()
Definition: IDNumber.h:66
art::SubRunID art::SubRunID::nextRun ( ) const
inline

Definition at line 121 of file SubRunID.h.

References art::RunID::next(), run_, and SubRunID().

Referenced by next(), and art::EventID::nextRun().

122 {
124 }
RunID next() const
Definition: RunID.h:82
RunID run_
Definition: SubRunID.h:62
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type first()
Definition: IDNumber.h:71
bool art::SubRunID::operator!= ( SubRunID const &  other) const
inline

Definition at line 188 of file SubRunID.h.

References fhicl::other.

189 {
190  return !(*this == other);
191 }
bool art::SubRunID::operator< ( SubRunID const &  other) const
inline

Definition at line 196 of file SubRunID.h.

References run_, and subRun_.

197 {
198  static SortInvalidFirst<SubRunNumber_t> op(
200  if (run_ == other.run_) {
201  return op(subRun_, other.subRun_);
202  } else {
203  return run_ < other.run_;
204  }
205 }
static constexpr type invalid()
Definition: IDNumber.h:51
RunID run_
Definition: SubRunID.h:62
SubRunNumber_t subRun_
Definition: SubRunID.h:63
bool art::SubRunID::operator<= ( SubRunID const &  other) const
inline

Definition at line 208 of file SubRunID.h.

References fhicl::other.

209 {
210  return (*this < other) || (*this == other);
211 }
bool art::SubRunID::operator== ( SubRunID const &  other) const
inline

Definition at line 182 of file SubRunID.h.

References run_, and subRun_.

183 {
184  return other.run_ == run_ && other.subRun_ == subRun_;
185 }
RunID run_
Definition: SubRunID.h:62
SubRunNumber_t subRun_
Definition: SubRunID.h:63
bool art::SubRunID::operator> ( SubRunID const &  other) const
inline

Definition at line 214 of file SubRunID.h.

215 {
216  return (other < *this);
217 }
bool art::SubRunID::operator>= ( SubRunID const &  other) const
inline

Definition at line 220 of file SubRunID.h.

References fhicl::other.

221 {
222  return !(*this < other);
223 }
art::SubRunID art::SubRunID::previous ( ) const
inline

Definition at line 127 of file SubRunID.h.

References art::errors::InvalidNumber, isValid(), previousRun(), run_, subRun_, and SubRunID().

Referenced by art::EventID::previousSubRun().

128 {
129  if (!isValid()) {
131  << "cannot decrement invalid subrun number.";
132  } else if (subRun_ == IDNumber<Level::SubRun>::first()) {
133  return previousRun();
134  }
135  return SubRunID(run_, subRun_ - 1);
136 }
SubRunID previousRun() const
Definition: SubRunID.h:139
bool isValid() const
Definition: SubRunID.h:95
RunID run_
Definition: SubRunID.h:62
SubRunNumber_t subRun_
Definition: SubRunID.h:63
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type first()
Definition: IDNumber.h:71
art::SubRunID art::SubRunID::previousRun ( ) const
inline

Definition at line 139 of file SubRunID.h.

References art::RunID::previous(), run_, and SubRunID().

Referenced by previous(), and art::EventID::previousRun().

140 {
142 }
RunID run_
Definition: SubRunID.h:62
RunID previous() const
Definition: RunID.h:95
constexpr SubRunID()
Definition: SubRunID.h:66
static constexpr type max_natural()
Definition: IDNumber.h:66
art::RunNumber_t art::SubRunID::run ( ) const
inline

Definition at line 83 of file SubRunID.h.

References art::RunID::run(), and run_.

Referenced by art::EmptyEvent::EmptyEvent(), art::EventID::run(), art::SubRunAuxiliary::run(), and art::SamplingInput::subRunRangeSetHandler().

84 {
85  return run_.run();
86 }
RunNumber_t run() const
Definition: RunID.h:62
RunID run_
Definition: SubRunID.h:62
art::RunID const & art::SubRunID::runID ( ) const
inline
art::SubRunNumber_t art::SubRunID::subRun ( ) const
inline

Definition at line 89 of file SubRunID.h.

References subRun_.

Referenced by art::EmptyEvent::EmptyEvent(), novatb::BeamTuning::endSubRun(), art::EventID::subRun(), and art::SubRunAuxiliary::subRun().

90 {
91  return subRun_;
92 }
SubRunNumber_t subRun_
Definition: SubRunID.h:63

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
SubRunID const &  iID 
)
friend

Member Data Documentation

RunID art::SubRunID::run_
private
SubRunNumber_t art::SubRunID::subRun_
private

Definition at line 63 of file SubRunID.h.

Referenced by isFlush(), isValid(), next(), operator<(), operator==(), previous(), and subRun().


The documentation for this class was generated from the following file: