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

#include "ScheduleID.h"

Public Types

using size_type = id_type
 

Public Member Functions

constexpr ScheduleID ()=default
 
 ScheduleID (id_type id)
 
constexpr bool isValid () const
 
constexpr id_type id () const
 
ScheduleID next () const
 
bool operator== (ScheduleID const &other) const
 
bool operator< (ScheduleID const &other) const
 

Static Public Member Functions

static ScheduleID first ()
 
static ScheduleID last ()
 

Private Types

using id_type = uint16_t
 

Static Private Member Functions

static constexpr id_type min_id_ ()
 
static constexpr id_type max_id_ ()
 
static constexpr id_type invalid_id_ ()
 

Private Attributes

id_type id_ {invalid_id_()}
 

Detailed Description

Definition at line 20 of file ScheduleID.h.

Member Typedef Documentation

using art::ScheduleID::id_type = uint16_t
private

Definition at line 22 of file ScheduleID.h.

Definition at line 27 of file ScheduleID.h.

Constructor & Destructor Documentation

constexpr art::ScheduleID::ScheduleID ( )
default

Referenced by next().

art::ScheduleID::ScheduleID ( id_type  id)
inlineexplicit

Definition at line 57 of file ScheduleID.h.

References max_id_().

58  : id_{(id < min_id_() || id > max_id_()) ?
59  throw std::out_of_range("art::ScheduleID: Invalid initializer.") :
60  id}
61 {}
static constexpr id_type max_id_()
Definition: ScheduleID.h:112

Member Function Documentation

constexpr art::ScheduleID::id_type art::ScheduleID::invalid_id_ ( )
inlinestaticprivate

Definition at line 118 of file ScheduleID.h.

References max.

Referenced by isValid(), and max_id_().

119 {
121 }
Int_t max
Definition: plot.C:27
constexpr bool art::ScheduleID::isValid ( ) const
inline

Definition at line 64 of file ScheduleID.h.

References id_, and invalid_id_().

65 {
66  return !(id_ == invalid_id_());
67 }
static constexpr id_type invalid_id_()
Definition: ScheduleID.h:118
art::ScheduleID art::ScheduleID::last ( )
inlinestatic

Definition at line 88 of file ScheduleID.h.

References max_id_().

89 {
90  return ScheduleID{max_id_()};
91 }
static constexpr id_type max_id_()
Definition: ScheduleID.h:112
constexpr ScheduleID()=default
constexpr art::ScheduleID::id_type art::ScheduleID::max_id_ ( )
inlinestaticprivate

Definition at line 112 of file ScheduleID.h.

References invalid_id_().

Referenced by last(), and ScheduleID().

113 {
114  return invalid_id_() - 1;
115 }
static constexpr id_type invalid_id_()
Definition: ScheduleID.h:118
constexpr art::ScheduleID::id_type art::ScheduleID::min_id_ ( )
inlinestaticprivate

Definition at line 106 of file ScheduleID.h.

References min.

Referenced by first().

107 {
109 }
Int_t min
Definition: plot.C:26
art::ScheduleID art::ScheduleID::next ( ) const
inline

Definition at line 76 of file ScheduleID.h.

References id_, and ScheduleID().

77 {
78  return ScheduleID(id_ + 1);
79 }
constexpr ScheduleID()=default
bool art::ScheduleID::operator< ( ScheduleID const &  other) const
inline

Definition at line 100 of file ScheduleID.h.

References id_.

101 {
102  return id_ < other.id_;
103 }
bool art::ScheduleID::operator== ( ScheduleID const &  other) const
inline

Definition at line 94 of file ScheduleID.h.

References id_.

95 {
96  return id_ == other.id_;
97 }

Member Data Documentation

id_type art::ScheduleID::id_ {invalid_id_()}
private

Definition at line 54 of file ScheduleID.h.

Referenced by id(), isValid(), next(), operator<(), and operator==().


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