LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
art::SubRunID Class Reference

#include "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 67 of file SubRunID.h.

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

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

Definition at line 234 of file SubRunID.h.

References checkSane().

235  : run_(std::move(rID)), subRun_(inRangeOrInvalid(srID))
236 {
237  checkSane();
238 }
RunID run_
Definition: SubRunID.h:63
void checkSane()
Definition: SubRunID.h:262
SubRunNumber_t subRun_
Definition: SubRunID.h:64
SubRunNumber_t inRangeOrInvalid(SubRunNumber_t sr)
Definition: SubRunID.h:241
art::SubRunID::SubRunID ( RunNumber_t  rID,
SubRunNumber_t  srID 
)
inline

Definition at line 71 of file SubRunID.h.

References checkSane().

72  : run_(rID), subRun_(inRangeOrInvalid(srID))
73 {
74  checkSane();
75 }
RunID run_
Definition: SubRunID.h:63
void checkSane()
Definition: SubRunID.h:262
SubRunNumber_t subRun_
Definition: SubRunID.h:64
SubRunNumber_t inRangeOrInvalid(SubRunNumber_t sr)
Definition: SubRunID.h:241
constexpr art::SubRunID::SubRunID ( FlushFlag  )
inlineexplicitprivate

Definition at line 226 of file SubRunID.h.

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

Definition at line 230 of file SubRunID.h.

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

Member Function Documentation

void art::SubRunID::checkSane ( )
inlineprivate

Definition at line 262 of file SubRunID.h.

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

Referenced by SubRunID().

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

Definition at line 152 of file SubRunID.h.

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

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

153 {
155 }
static RunID firstRun()
Definition: RunID.h:115
constexpr SubRunID()
Definition: SubRunID.h:67
static constexpr type first()
Definition: IDNumber.h:71
art::SubRunID art::SubRunID::firstSubRun ( RunID const &  rID)
inlinestatic

Definition at line 158 of file SubRunID.h.

References SubRunID().

159 {
161 }
constexpr SubRunID()
Definition: SubRunID.h:67
static constexpr type first()
Definition: IDNumber.h:71
constexpr art::SubRunID art::SubRunID::flushSubRun ( )
inlinestatic

Definition at line 170 of file SubRunID.h.

References SubRunID().

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

Definition at line 176 of file SubRunID.h.

References SubRunID().

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

Definition at line 241 of file SubRunID.h.

References art::errors::InvalidNumber.

242 {
243  if (sr == IDNumber<Level::SubRun>::invalid() ||
244 #ifdef __clang__
245 #pragma clang diagnostic push
246 #pragma clang diagnostic ignored "-Wtautological-compare"
247 #endif
249 #ifdef __clang__
250 #pragma clang diagnostic pop
251 #endif
253  return sr;
254  } else {
256  << "Attempt to construct SubRunID with an invalid number.\n"
257  << "Maybe you want SubRunID::flushSubRun()?\n";
258  }
259 }
static constexpr type invalid()
Definition: IDNumber.h:51
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 164 of file SubRunID.h.

References SubRunID().

Referenced by art::EventID::invalidEvent(), evdb::EventDisplay::postProcessEvent(), and art::FileStatsCollector::recordRun().

165 {
167 }
static constexpr type invalid()
Definition: IDNumber.h:51
constexpr SubRunID()
Definition: SubRunID.h:67
bool art::SubRunID::isFlush ( ) const
inline

Definition at line 102 of file SubRunID.h.

References subRun_.

Referenced by art::EventIDMatcher::match(), and art::operator<<().

103 {
105 }
static constexpr type flush_value()
Definition: IDNumber.h:61
SubRunNumber_t subRun_
Definition: SubRunID.h:64
art::SubRunID art::SubRunID::maxSubRun ( )
inlinestatic

Definition at line 146 of file SubRunID.h.

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

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

147 {
149 }
static RunID maxRun()
Definition: RunID.h:109
constexpr SubRunID()
Definition: SubRunID.h:67
static constexpr type max_natural()
Definition: IDNumber.h:66
art::SubRunID art::SubRunID::next ( ) const
inline

Definition at line 110 of file SubRunID.h.

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

Referenced by art::FileIndex::findEventForUnspecifiedSubRun(), art::RootInputFile::getNextEntryTypeWanted(), and art::EventID::nextSubRun().

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

Definition at line 122 of file SubRunID.h.

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

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

123 {
125 }
RunID next() const
Definition: RunID.h:83
RunID run_
Definition: SubRunID.h:63
constexpr SubRunID()
Definition: SubRunID.h:67
static constexpr type first()
Definition: IDNumber.h:71
bool art::SubRunID::operator!= ( SubRunID const &  other) const
inline

Definition at line 189 of file SubRunID.h.

References fhicl::other.

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

Definition at line 197 of file SubRunID.h.

References run_, and subRun_.

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

Definition at line 209 of file SubRunID.h.

References fhicl::other.

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

Definition at line 183 of file SubRunID.h.

References run_, and subRun_.

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

Definition at line 215 of file SubRunID.h.

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

Definition at line 221 of file SubRunID.h.

References fhicl::other.

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

Definition at line 128 of file SubRunID.h.

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

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

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

Definition at line 140 of file SubRunID.h.

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

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

141 {
143 }
RunID run_
Definition: SubRunID.h:63
RunID previous() const
Definition: RunID.h:96
constexpr SubRunID()
Definition: SubRunID.h:67
static constexpr type max_natural()
Definition: IDNumber.h:66

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 64 of file SubRunID.h.

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


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