LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::ScheduleID Class Reference

#include "ScheduleID.h"

Public Types

using id_type = uint16_t
 
using size_type = id_type
 

Public Member Functions

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

Static Public Member Functions

static constexpr ScheduleID first ()
 
static constexpr ScheduleID last ()
 

Private Types

enum  PremadeTypeFlag { PremadeTypeFlag::First, PremadeTypeFlag::Last }
 

Private Member Functions

constexpr ScheduleID (PremadeTypeFlag flag)
 

Static Private Member Functions

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

Private Attributes

id_type id_ {invalid_id_()}
 

Friends

template<typename T >
class PerScheduleContainer
 

Detailed Description

Definition at line 17 of file ScheduleID.h.

Member Typedef Documentation

using art::ScheduleID::id_type = uint16_t

Definition at line 22 of file ScheduleID.h.

Definition at line 25 of file ScheduleID.h.

Member Enumeration Documentation

Enumerator
First 
Last 

Definition at line 28 of file ScheduleID.h.

28 { First, Last };

Constructor & Destructor Documentation

constexpr art::ScheduleID::ScheduleID ( )
defaultnoexcept

Referenced by last().

art::ScheduleID::ScheduleID ( id_type  id)
explicit

Definition at line 11 of file ScheduleID.cc.

12  {
13  // No need to test against min_id_() since that is the smallest
14  // possible value already.
15  if (id > max_id_()) {
16  // Somebody passed us invalid_id_().
17  throw out_of_range("ScheduleID: Invalid initializer.");
18  }
19  id_ = id;
20  }
constexpr id_type id() const noexcept
Definition: ScheduleID.h:77
static constexpr id_type max_id_() noexcept
Definition: ScheduleID.h:42
art::ScheduleID::ScheduleID ( ScheduleID const &  )
defaultnoexcept
art::ScheduleID::ScheduleID ( ScheduleID &&  )
defaultnoexcept
constexpr art::ScheduleID::ScheduleID ( PremadeTypeFlag  flag)
inlineprivate

Definition at line 88 of file ScheduleID.h.

References First, max_id_(), and min_id_().

89  : id_{(flag == PremadeTypeFlag::First) ? min_id_() : max_id_()}
90  {}
static constexpr id_type max_id_() noexcept
Definition: ScheduleID.h:42
static constexpr id_type min_id_() noexcept
Definition: ScheduleID.h:37

Member Function Documentation

static constexpr id_type art::ScheduleID::invalid_id_ ( )
inlinestaticprivatenoexcept

Definition at line 32 of file ScheduleID.h.

Referenced by isValid(), and max_id_().

33  {
34  return std::numeric_limits<id_type>::max();
35  }
constexpr bool art::ScheduleID::isValid ( ) const
inlinenoexcept

Definition at line 71 of file ScheduleID.h.

References id_, and invalid_id_().

Referenced by art::detail::EngineCreator::requireValid().

72  {
73  return !(id_ == invalid_id_());
74  }
static constexpr id_type invalid_id_() noexcept
Definition: ScheduleID.h:32
static constexpr ScheduleID art::ScheduleID::last ( )
inlinestatic

Definition at line 55 of file ScheduleID.h.

References Last, operator=(), and ScheduleID().

56  {
58  }
constexpr ScheduleID() noexcept=default
static constexpr id_type art::ScheduleID::max_id_ ( )
inlinestaticprivatenoexcept

Definition at line 42 of file ScheduleID.h.

References invalid_id_().

Referenced by ScheduleID().

43  {
44  return invalid_id_() - 1;
45  }
static constexpr id_type invalid_id_() noexcept
Definition: ScheduleID.h:32
static constexpr id_type art::ScheduleID::min_id_ ( )
inlinestaticprivatenoexcept

Definition at line 37 of file ScheduleID.h.

Referenced by ScheduleID().

38  {
39  return std::numeric_limits<id_type>::min();
40  }
ScheduleID art::ScheduleID::next ( ) const

Definition at line 23 of file ScheduleID.cc.

Referenced by art::ScheduleIteration::for_each_schedule(), and id().

24  {
25  return ScheduleID(id_ + 1);
26  }
constexpr ScheduleID() noexcept=default
bool art::ScheduleID::operator< ( ScheduleID const &  other) const
noexcept

Definition at line 35 of file ScheduleID.cc.

Referenced by id().

36  {
37  return id_ < rhs.id_;
38  }
ScheduleID& art::ScheduleID::operator= ( ScheduleID const &  )
defaultnoexcept

Referenced by last().

ScheduleID& art::ScheduleID::operator= ( ScheduleID &&  )
defaultnoexcept
bool art::ScheduleID::operator== ( ScheduleID const &  other) const
noexcept

Definition at line 29 of file ScheduleID.cc.

Referenced by id().

30  {
31  return id_ == rhs.id_;
32  }

Friends And Related Function Documentation

template<typename T >
friend class PerScheduleContainer
friend

Definition at line 19 of file ScheduleID.h.

Member Data Documentation

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

Definition at line 93 of file ScheduleID.h.

Referenced by id(), and isValid().


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