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

#include <SubRunID.h>

Classes

struct  FlushFlag
 

Public Member Functions

constexpr SubRunID () noexcept
 
 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 () noexcept
 
static SubRunID flushSubRun (RunID const &rID)
 

Private Member Functions

constexpr SubRunID (FlushFlag) noexcept
 
 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 19 of file SubRunID.h.

Constructor & Destructor Documentation

constexpr art::SubRunID::SubRunID ( )
inlinenoexcept

Definition at line 68 of file SubRunID.h.

70 {}
RunID run_
Definition: SubRunID.h:64
SubRunNumber_t subRun_
Definition: SubRunID.h:65
static constexpr type invalid() noexcept
Definition: IDNumber.h:52
art::SubRunID::SubRunID ( RunID  rID,
SubRunNumber_t  srID 
)
inline

Definition at line 235 of file SubRunID.h.

236  : run_(std::move(rID)), subRun_(inRangeOrInvalid(srID))
237 {
238  checkSane();
239 }
RunID run_
Definition: SubRunID.h:64
def move(depos, offset)
Definition: depos.py:107
void checkSane()
Definition: SubRunID.h:253
SubRunNumber_t subRun_
Definition: SubRunID.h:65
SubRunNumber_t inRangeOrInvalid(SubRunNumber_t sr)
Definition: SubRunID.h:242
art::SubRunID::SubRunID ( RunNumber_t  rID,
SubRunNumber_t  srID 
)
inline

Definition at line 72 of file SubRunID.h.

73  : run_(rID), subRun_(inRangeOrInvalid(srID))
74 {
75  checkSane();
76 }
RunID run_
Definition: SubRunID.h:64
void checkSane()
Definition: SubRunID.h:253
SubRunNumber_t subRun_
Definition: SubRunID.h:65
SubRunNumber_t inRangeOrInvalid(SubRunNumber_t sr)
Definition: SubRunID.h:242
constexpr art::SubRunID::SubRunID ( FlushFlag  )
inlineexplicitprivatenoexcept

Definition at line 227 of file SubRunID.h.

229 {}
RunID run_
Definition: SubRunID.h:64
static constexpr RunID flushRun() noexcept
Definition: RunID.h:122
SubRunNumber_t subRun_
Definition: SubRunID.h:65
static constexpr type flush_value() noexcept
Definition: IDNumber.h:62
art::SubRunID::SubRunID ( RunID  rID,
FlushFlag   
)
inlineprivate

Definition at line 231 of file SubRunID.h.

233 {}
RunID run_
Definition: SubRunID.h:64
def move(depos, offset)
Definition: depos.py:107
SubRunNumber_t subRun_
Definition: SubRunID.h:65
static constexpr type flush_value() noexcept
Definition: IDNumber.h:62

Member Function Documentation

void art::SubRunID::checkSane ( )
inlineprivate

Definition at line 253 of file SubRunID.h.

254 {
255  if (isValid() && !run_.isValid()) {
257  << "SubRunID is not meaningful with valid subRun and invalid Run.\n";
258  }
259 }
bool isValid() const
Definition: SubRunID.h:97
RunID run_
Definition: SubRunID.h:64
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
bool isValid() const
Definition: RunID.h:70
art::SubRunID art::SubRunID::firstSubRun ( )
inlinestatic

Definition at line 153 of file SubRunID.h.

154 {
156 }
static constexpr type first() noexcept
Definition: IDNumber.h:72
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
static RunID firstRun()
Definition: RunID.h:116
art::SubRunID art::SubRunID::firstSubRun ( RunID const &  rID)
inlinestatic

Definition at line 159 of file SubRunID.h.

160 {
162 }
static constexpr type first() noexcept
Definition: IDNumber.h:72
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
constexpr art::SubRunID art::SubRunID::flushSubRun ( )
inlinestaticnoexcept

Definition at line 171 of file SubRunID.h.

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

Definition at line 177 of file SubRunID.h.

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

Definition at line 242 of file SubRunID.h.

243 {
246  << "Attempt to construct SubRunID with an invalid number.\n"
247  << "Maybe you want SubRunID::flushSubRun()?\n";
248  }
249  return sr;
250 }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static constexpr double sr
Definition: Units.h:166
static constexpr type flush_value() noexcept
Definition: IDNumber.h:62
art::SubRunID art::SubRunID::invalidSubRun ( RunID const &  rID)
inlinestatic

Definition at line 165 of file SubRunID.h.

166 {
168 }
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
static constexpr type invalid() noexcept
Definition: IDNumber.h:52
bool art::SubRunID::isFlush ( ) const
inline

Definition at line 103 of file SubRunID.h.

104 {
106 }
SubRunNumber_t subRun_
Definition: SubRunID.h:65
static constexpr type flush_value() noexcept
Definition: IDNumber.h:62
bool art::SubRunID::isValid ( ) const
inline

Definition at line 97 of file SubRunID.h.

98 {
100 }
RunID run_
Definition: SubRunID.h:64
SubRunNumber_t subRun_
Definition: SubRunID.h:65
bool isValid() const
Definition: RunID.h:70
static constexpr type invalid() noexcept
Definition: IDNumber.h:52
art::SubRunID art::SubRunID::maxSubRun ( )
inlinestatic

Definition at line 147 of file SubRunID.h.

148 {
150 }
static RunID maxRun()
Definition: RunID.h:110
static constexpr type max_natural() noexcept
Definition: IDNumber.h:67
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
art::SubRunID art::SubRunID::next ( ) const
inline

Definition at line 111 of file SubRunID.h.

112 {
113  if (!isValid()) {
115  << "cannot increment invalid subrun number.";
117  return nextRun();
118  }
119  return SubRunID(run_, subRun_ + 1);
120 }
bool isValid() const
Definition: SubRunID.h:97
RunID run_
Definition: SubRunID.h:64
static constexpr type max_natural() noexcept
Definition: IDNumber.h:67
SubRunID nextRun() const
Definition: SubRunID.h:123
SubRunNumber_t subRun_
Definition: SubRunID.h:65
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
art::SubRunID art::SubRunID::nextRun ( ) const
inline

Definition at line 123 of file SubRunID.h.

124 {
126 }
static constexpr type first() noexcept
Definition: IDNumber.h:72
RunID next() const
Definition: RunID.h:84
RunID run_
Definition: SubRunID.h:64
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
bool art::SubRunID::operator!= ( SubRunID const &  other) const
inline

Definition at line 190 of file SubRunID.h.

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

Definition at line 198 of file SubRunID.h.

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

Definition at line 210 of file SubRunID.h.

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

Definition at line 184 of file SubRunID.h.

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

Definition at line 216 of file SubRunID.h.

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

Definition at line 222 of file SubRunID.h.

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

Definition at line 129 of file SubRunID.h.

130 {
131  if (!isValid()) {
133  << "cannot decrement invalid subrun number.";
134  } else if (subRun_ == IDNumber<Level::SubRun>::first()) {
135  return previousRun();
136  }
137  return SubRunID(run_, subRun_ - 1);
138 }
static constexpr type first() noexcept
Definition: IDNumber.h:72
SubRunID previousRun() const
Definition: SubRunID.h:141
bool isValid() const
Definition: SubRunID.h:97
RunID run_
Definition: SubRunID.h:64
SubRunNumber_t subRun_
Definition: SubRunID.h:65
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
art::SubRunID art::SubRunID::previousRun ( ) const
inline

Definition at line 141 of file SubRunID.h.

142 {
144 }
RunID run_
Definition: SubRunID.h:64
static constexpr type max_natural() noexcept
Definition: IDNumber.h:67
RunID previous() const
Definition: RunID.h:97
constexpr SubRunID() noexcept
Definition: SubRunID.h:68
art::RunNumber_t art::SubRunID::run ( ) const
inline

Definition at line 85 of file SubRunID.h.

86 {
87  return run_.run();
88 }
RunNumber_t run() const
Definition: RunID.h:64
RunID run_
Definition: SubRunID.h:64
art::RunID const & art::SubRunID::runID ( ) const
inline

Definition at line 79 of file SubRunID.h.

80 {
81  return run_;
82 }
RunID run_
Definition: SubRunID.h:64
art::SubRunNumber_t art::SubRunID::subRun ( ) const
inline

Definition at line 91 of file SubRunID.h.

92 {
93  return subRun_;
94 }
SubRunNumber_t subRun_
Definition: SubRunID.h:65

Friends And Related Function Documentation

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

Member Data Documentation

RunID art::SubRunID::run_
private

Definition at line 64 of file SubRunID.h.

SubRunNumber_t art::SubRunID::subRun_
private

Definition at line 65 of file SubRunID.h.


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