LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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) {}
Char_t n[5]

Member Function Documentation

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

Definition at line 126 of file PerScheduleContainer.h.

127  {
128  return data_.at(sid.id());
129  }
template<typename T>
T const& art::PerScheduleContainer< T >::at ( ScheduleID const  sid) const
inline

Definition at line 132 of file PerScheduleContainer.h.

133  {
134  return data_.at(sid.id());
135  }
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  }
template<typename T>
auto art::PerScheduleContainer< T >::end ( void  ) const
inlinenoexcept

Definition at line 60 of file PerScheduleContainer.h.

61  {
62  return data_.end();
63  }
template<typename T>
auto art::PerScheduleContainer< T >::end ( void  )
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
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Char_t n[5]
static Globals * instance()
Definition: Globals.cc:17
template<typename T>
T& art::PerScheduleContainer< T >::operator[] ( ScheduleID const  sid)
inline

Definition at line 114 of file PerScheduleContainer.h.

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

Definition at line 120 of file PerScheduleContainer.h.

121  {
122  return data_[sid.id()];
123  }
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 ( void  ) const
inline

Definition at line 30 of file PerScheduleContainer.h.

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

Member Data Documentation


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