Public Member Functions | Private Attributes | List of all members
art::PerScheduleContainer< T > Class Template Reference

#include <PerScheduleContainer.h>

Public Member Functions

 PerScheduleContainer ()=default
 
 PerScheduleContainer (ScheduleID::size_type const n)
 
bool is_valid () const
 
auto size () const
 
auto cbegin () const noexcept
 
auto begin () const noexcept
 
auto begin () noexcept
 
auto cend () const noexcept
 
auto end () const noexcept
 
auto end () noexcept
 
void reserve (ScheduleID::size_type const sz)
 
template<typename... Args>
void emplace_back (Args &&...args)
 
void resize (ScheduleID::size_type const sz)
 
auto expand_to_num_schedules ()
 
T & operator[] (ScheduleID const sid)
 
T const & operator[] (ScheduleID const sid) const
 
T & at (ScheduleID const sid)
 
T const & at (ScheduleID const sid) const
 

Private Attributes

std::vector< T > data_
 

Detailed Description

template<typename T>
class art::PerScheduleContainer< T >

Definition at line 15 of file PerScheduleContainer.h.

Constructor & Destructor Documentation

template<typename T>
art::PerScheduleContainer< T >::PerScheduleContainer ( )
default
template<typename T>
art::PerScheduleContainer< T >::PerScheduleContainer ( ScheduleID::size_type const  n)
inlineexplicit

Definition at line 21 of file PerScheduleContainer.h.

21 : data_(n) {}
std::void_t< T > n

Member Function Documentation

template<typename T>
T& art::PerScheduleContainer< T >::at ( ScheduleID const  sid)
inline

Definition at line 118 of file PerScheduleContainer.h.

119  {
120  return data_.at(sid.id());
121  }
template<typename T>
T const& art::PerScheduleContainer< T >::at ( ScheduleID const  sid) const
inline

Definition at line 124 of file PerScheduleContainer.h.

125  {
126  return data_.at(sid.id());
127  }
template<typename T>
auto art::PerScheduleContainer< T >::begin ( ) const
inlinenoexcept

Definition at line 42 of file PerScheduleContainer.h.

43  {
44  return data_.begin();
45  }
template<typename T>
auto art::PerScheduleContainer< T >::begin ( )
inlinenoexcept

Definition at line 48 of file PerScheduleContainer.h.

49  {
50  return data_.begin();
51  }
template<typename T>
auto art::PerScheduleContainer< T >::cbegin ( ) const
inlinenoexcept

Definition at line 36 of file PerScheduleContainer.h.

37  {
38  return data_.cbegin();
39  }
template<typename T>
auto art::PerScheduleContainer< T >::cend ( ) const
inlinenoexcept

Definition at line 54 of file PerScheduleContainer.h.

55  {
56  return data_.cend();
57  }
template<typename T>
template<typename... Args>
void art::PerScheduleContainer< T >::emplace_back ( Args &&...  args)
inline

Definition at line 81 of file PerScheduleContainer.h.

82  {
83  data_.emplace_back(std::forward<Args>(args)...);
84  }
static QCString args
Definition: declinfo.cpp:674
template<typename T>
auto art::PerScheduleContainer< T >::end ( ) const
inlinenoexcept

Definition at line 60 of file PerScheduleContainer.h.

61  {
62  return data_.end();
63  }
template<typename T>
auto art::PerScheduleContainer< T >::end ( )
inlinenoexcept

Definition at line 66 of file PerScheduleContainer.h.

67  {
68  return data_.end();
69  }
template<typename T>
auto art::PerScheduleContainer< T >::expand_to_num_schedules ( )
inline

Definition at line 99 of file PerScheduleContainer.h.

100  {
101  if (is_valid()) {
103  "An error occurred while calling "
104  "PerScheduleContainer::expand_to_num_schedules"}
105  << "Can only call expand_to_num_schedules when the "
106  "container is invalid.";
107  }
108  auto const n = Globals::instance()->nschedules();
109  data_.resize(n);
110  return n;
111  }
ScheduleID::size_type nschedules() const
Definition: Globals.cc:24
std::void_t< T > n
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
static Globals * instance()
Definition: Globals.cc:17
template<typename T>
bool art::PerScheduleContainer< T >::is_valid ( ) const
inline

Definition at line 24 of file PerScheduleContainer.h.

25  {
26  return !data_.empty();
27  }
template<typename T>
T& art::PerScheduleContainer< T >::operator[] ( ScheduleID const  sid)
inline

Definition at line 113 of file PerScheduleContainer.h.

113 { return data_[sid.id()]; }
template<typename T>
T const& art::PerScheduleContainer< T >::operator[] ( ScheduleID const  sid) const
inline

Definition at line 115 of file PerScheduleContainer.h.

115 { return data_[sid.id()]; }
template<typename T>
void art::PerScheduleContainer< T >::reserve ( ScheduleID::size_type const  sz)
inline

Definition at line 73 of file PerScheduleContainer.h.

74  {
75  data_.reserve(sz);
76  }
template<typename T>
void art::PerScheduleContainer< T >::resize ( ScheduleID::size_type const  sz)
inline

Definition at line 87 of file PerScheduleContainer.h.

88  {
89  if (is_valid()) {
91  "An error occurred while calling "
92  "PerScheduleContainer::expand_to_num_schedules"}
93  << "Can only call resize when the container is invalid.\n";
94  }
95  data_.resize(sz);
96  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
template<typename T>
auto art::PerScheduleContainer< T >::size ( ) const
inline

Definition at line 30 of file PerScheduleContainer.h.

31  {
32  return data_.size();
33  }

Member Data Documentation

template<typename T>
std::vector<T> art::PerScheduleContainer< T >::data_
private

Definition at line 130 of file PerScheduleContainer.h.


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