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

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

Classes

struct  FlushFlag
 

Public Member Functions

constexpr RunID ()
 
 RunID (RunNumber_t i)
 
RunNumber_t run () const
 
bool isValid () const
 
bool isFlush () const
 
RunID next () const
 
RunID previous () const
 
bool operator== (RunID const &other) const
 
bool operator!= (RunID const &other) const
 
bool operator< (RunID const &other) const
 
bool operator<= (RunID const &other) const
 
bool operator> (RunID const &other) const
 
bool operator>= (RunID const &other) const
 

Static Public Member Functions

static RunID maxRun ()
 
static RunID firstRun ()
 
static constexpr RunID flushRun ()
 

Private Member Functions

constexpr RunID (FlushFlag)
 
RunNumber_t inRangeOrInvalid (RunNumber_t r)
 

Private Attributes

RunNumber_t run_
 

Friends

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

Detailed Description

Definition at line 21 of file RunID.h.

Constructor & Destructor Documentation

constexpr art::RunID::RunID ( )
inline

Definition at line 57 of file RunID.h.

Referenced by firstRun(), flushRun(), maxRun(), next(), and previous().

static constexpr type invalid()
Definition: IDNumber.h:81
RunNumber_t run_
Definition: RunID.h:54
art::RunID::RunID ( RunNumber_t  i)
inlineexplicit

Definition at line 59 of file RunID.h.

59 : run_(inRangeOrInvalid(i)) {}
RunNumber_t inRangeOrInvalid(RunNumber_t r)
Definition: RunID.h:166
RunNumber_t run_
Definition: RunID.h:54
constexpr art::RunID::RunID ( FlushFlag  )
inlineexplicitprivate

Definition at line 179 of file RunID.h.

181 {}
RunNumber_t run_
Definition: RunID.h:54
static constexpr type flush_value()
Definition: IDNumber.h:91

Member Function Documentation

art::RunID art::RunID::firstRun ( )
inlinestatic

Definition at line 114 of file RunID.h.

References RunID().

Referenced by art::EmptyEvent::EmptyEvent(), art::SubRunID::firstSubRun(), and art::SamplingInput::SamplingInput().

115 {
117 }
static constexpr type first()
Definition: IDNumber.h:101
constexpr RunID()
Definition: RunID.h:57
constexpr art::RunID art::RunID::flushRun ( )
inlinestatic

Definition at line 120 of file RunID.h.

References RunID().

121 {
122  return RunID(FlushFlag());
123 }
constexpr RunID()
Definition: RunID.h:57
art::RunNumber_t art::RunID::inRangeOrInvalid ( RunNumber_t  r)
inlineprivate

Definition at line 166 of file RunID.h.

References art::errors::InvalidNumber, and r().

167 {
168  if (r == IDNumber<Level::Run>::invalid() ||
171  return r;
172  } else {
174  << "Attempt to construct RunID with an invalid number.\n"
175  << "Maybe you want RunID::flushRun()?\n";
176  }
177 }
static constexpr type invalid()
Definition: IDNumber.h:81
static constexpr type max_natural()
Definition: IDNumber.h:96
static constexpr type first()
Definition: IDNumber.h:101
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
TRandom3 r(0)
bool art::RunID::isFlush ( ) const
inline

Definition at line 74 of file RunID.h.

References run_.

75 {
77 }
RunNumber_t run_
Definition: RunID.h:54
static constexpr type flush_value()
Definition: IDNumber.h:91
bool art::RunID::isValid ( ) const
inline

Definition at line 68 of file RunID.h.

References run_.

Referenced by art::SubRunID::checkSane(), art::EmptyEvent::getNextItemType(), art::SubRunID::isValid(), next(), previous(), and art::Source< T >::throwIfInsane_().

69 {
70  return (run_ != IDNumber<Level::Run>::invalid());
71 }
static constexpr type invalid()
Definition: IDNumber.h:81
RunNumber_t run_
Definition: RunID.h:54
art::RunID art::RunID::maxRun ( )
inlinestatic

Definition at line 108 of file RunID.h.

References RunID().

Referenced by art::SubRunID::maxSubRun().

109 {
111 }
static constexpr type max_natural()
Definition: IDNumber.h:96
constexpr RunID()
Definition: RunID.h:57
art::RunID art::RunID::next ( ) const
inline

Definition at line 82 of file RunID.h.

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

Referenced by art::SubRunID::nextRun().

83 {
84  if (!isValid()) {
86  << "cannot increment invalid run number.";
87  } else if (run_ == IDNumber<Level::Run>::max_natural()) {
89  << "cannot increment maximum run number.";
90  }
91  return RunID(run_ + 1);
92 }
static constexpr type max_natural()
Definition: IDNumber.h:96
RunNumber_t run_
Definition: RunID.h:54
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool isValid() const
Definition: RunID.h:68
constexpr RunID()
Definition: RunID.h:57
bool art::RunID::operator!= ( RunID const &  other) const
inline

Definition at line 133 of file RunID.h.

References fhicl::other.

134 {
135  return !(*this == other);
136 }
bool art::RunID::operator< ( RunID const &  other) const
inline

Definition at line 141 of file RunID.h.

References run_.

142 {
143  static SortInvalidFirst<RunNumber_t> op(IDNumber<Level::Run>::invalid());
144  return op(run_, other.run_);
145 }
static constexpr type invalid()
Definition: IDNumber.h:81
RunNumber_t run_
Definition: RunID.h:54
bool art::RunID::operator<= ( RunID const &  other) const
inline

Definition at line 148 of file RunID.h.

References fhicl::other.

149 {
150  return (*this < other) || (*this == other);
151 }
bool art::RunID::operator== ( RunID const &  other) const
inline

Definition at line 127 of file RunID.h.

References run_.

128 {
129  return other.run_ == run_;
130 }
RunNumber_t run_
Definition: RunID.h:54
bool art::RunID::operator> ( RunID const &  other) const
inline

Definition at line 154 of file RunID.h.

155 {
156  return (other < *this);
157 }
bool art::RunID::operator>= ( RunID const &  other) const
inline

Definition at line 160 of file RunID.h.

References fhicl::other.

161 {
162  return !(*this < other);
163 }
art::RunID art::RunID::previous ( ) const
inline

Definition at line 95 of file RunID.h.

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

Referenced by art::SubRunID::previousRun().

96 {
97  if (!isValid()) {
99  << "cannot decrement minimum run number.";
100  } else if (run_ == IDNumber<Level::Run>::max_natural()) {
102  << "cannot increment maximum run number.";
103  }
104  return RunID(run_ - 1);
105 }
static constexpr type max_natural()
Definition: IDNumber.h:96
RunNumber_t run_
Definition: RunID.h:54
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool isValid() const
Definition: RunID.h:68
constexpr RunID()
Definition: RunID.h:57
art::RunNumber_t art::RunID::run ( ) const
inline

Definition at line 62 of file RunID.h.

References run_.

Referenced by novatb::BeamTuning::beginRun(), art::EmptyEvent::EmptyEvent(), art::SubRunID::run(), art::RunAuxiliary::run(), and art::SamplingInput::runRangeSetHandler().

63 {
64  return run_;
65 }
RunNumber_t run_
Definition: RunID.h:54

Friends And Related Function Documentation

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

Member Data Documentation

RunNumber_t art::RunID::run_
private

Definition at line 54 of file RunID.h.

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


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