Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::RangeSet Class Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/canvas/v3_06_01/source/canvas/Persistency/Provenance/RangeSet.h"

Public Types

using const_iterator = std::vector< EventRange >::const_iterator
 

Public Member Functions

 RangeSet (RunNumber_t)
 
 RangeSet (RunNumber_t, std::vector< EventRange > const &eventRanges)
 
RunNumber_t run () const
 
std::vector< EventRange > const & ranges () const
 
bool contains (RunNumber_t, SubRunNumber_t, EventNumber_t) const
 
bool is_valid () const
 
bool is_full_run () const
 
bool is_full_subRun () const
 
bool is_sorted () const
 
bool is_collapsed () const
 
std::string to_compact_string () const
 
bool has_disjoint_ranges () const
 
bool empty () const
 
auto begin () const
 
auto end () const
 
unsigned checksum () const
 
decltype(auto) front ()
 
decltype(auto) back ()
 
void assign_ranges (const_iterator b, const_iterator e)
 
void update (EventID const &)
 
template<typename... ARGS>
void emplace_range (ARGS &&...)
 
RangeSetcollapse ()
 
RangeSetmerge (RangeSet const &other)
 
std::pair< const_iterator, bool > split_range (SubRunNumber_t, EventNumber_t)
 
void set_run (RunNumber_t const r)
 
void sort ()
 
void clear ()
 
template<typename... ARGS>
void emplace_range (ARGS &&...args)
 

Static Public Member Functions

static RangeSet invalid ()
 
static RangeSet forRun (RunID)
 
static RangeSet forSubRun (SubRunID)
 
static constexpr unsigned invalidChecksum ()
 

Private Member Functions

 RangeSet ()=default
 
void require_not_full_run ()
 

Private Attributes

RunNumber_t run_ {IDNumber<Level::Run>::invalid()}
 
std::vector< EventRangeranges_ {}
 
bool isCollapsed_ {false}
 
unsigned checksum_ {invalidChecksum()}
 

Detailed Description

Definition at line 24 of file RangeSet.h.

Member Typedef Documentation

Definition at line 33 of file RangeSet.h.

Constructor & Destructor Documentation

art::RangeSet::RangeSet ( RunNumber_t  )
explicit
art::RangeSet::RangeSet ( RunNumber_t  ,
std::vector< EventRange > const &  eventRanges 
)
explicit
art::RangeSet::RangeSet ( )
explicitprivatedefault

Member Function Documentation

void art::RangeSet::assign_ranges ( const_iterator  b,
const_iterator  e 
)
decltype(auto) art::RangeSet::back ( )
inline

Definition at line 88 of file RangeSet.h.

References b, e, and fhicl::other.

89  {
90  return ranges_.back();
91  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
auto art::RangeSet::begin ( ) const
inline

Definition at line 70 of file RangeSet.h.

Referenced by art::ClosedRangeSetHandler::begin().

71  {
72  return ranges_.begin();
73  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
unsigned art::RangeSet::checksum ( ) const
void art::RangeSet::clear ( )
inline

Definition at line 120 of file RangeSet.h.

121  {
122  ranges_.clear();
123  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
RangeSet& art::RangeSet::collapse ( )

Referenced by art::Run::put(), and art::SubRun::put().

bool art::RangeSet::contains ( RunNumber_t  ,
SubRunNumber_t  ,
EventNumber_t   
) const
template<typename... ARGS>
void art::RangeSet::emplace_range ( ARGS &&  ...)
template<typename... ARGS>
void art::RangeSet::emplace_range ( ARGS &&...  args)

Definition at line 173 of file RangeSet.h.

References make_syst_table_plots::args.

174  {
176  ranges_.emplace_back(std::forward<ARGS>(args)...);
177  isCollapsed_ = false;
178  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
bool isCollapsed_
Definition: RangeSet.h:148
void require_not_full_run()
Definition: RangeSet.h:135
bool art::RangeSet::empty ( ) const
auto art::RangeSet::end ( ) const
inline

Definition at line 75 of file RangeSet.h.

Referenced by art::ClosedRangeSetHandler::end().

76  {
77  return ranges_.end();
78  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
static RangeSet art::RangeSet::forRun ( RunID  )
static
static RangeSet art::RangeSet::forSubRun ( SubRunID  )
static
decltype(auto) art::RangeSet::front ( )
inline

Definition at line 83 of file RangeSet.h.

84  {
85  return ranges_.front();
86  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
bool art::RangeSet::has_disjoint_ranges ( ) const
static RangeSet art::RangeSet::invalid ( )
static
static constexpr unsigned art::RangeSet::invalidChecksum ( )
inlinestatic

Definition at line 126 of file RangeSet.h.

References cet::sqlite::max().

127  {
129  }
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
bool art::RangeSet::is_collapsed ( ) const
inline

Definition at line 56 of file RangeSet.h.

References string.

57  {
58  return isCollapsed_;
59  }
bool isCollapsed_
Definition: RangeSet.h:148
bool art::RangeSet::is_full_run ( ) const

Referenced by art::Run::put().

bool art::RangeSet::is_full_subRun ( ) const

Referenced by art::SubRun::put().

bool art::RangeSet::is_sorted ( ) const
bool art::RangeSet::is_valid ( ) const
RangeSet& art::RangeSet::merge ( RangeSet const &  other)
std::vector<EventRange> const& art::RangeSet::ranges ( ) const
inline

Definition at line 42 of file RangeSet.h.

References naming_schema::contains, and art::is_valid().

43  {
44  return ranges_;
45  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
void art::RangeSet::require_not_full_run ( )
inlineprivate

Definition at line 135 of file RangeSet.h.

References art::errors::LogicError.

136  {
137  if (is_full_run())
139  "RangeSet::require_not_full_run")
140  << "\nA RangeSet created using RangeSet::forRun cannot be "
141  "modified.\n";
142  }
bool is_full_run() const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
RunNumber_t art::RangeSet::run ( ) const
inline

Definition at line 36 of file RangeSet.h.

37  {
38  return run_;
39  }
RunNumber_t run_
Definition: RangeSet.h:144
void art::RangeSet::set_run ( RunNumber_t const  r)
inline

Definition at line 108 of file RangeSet.h.

References r().

109  {
110  run_ = r;
111  }
RunNumber_t run_
Definition: RangeSet.h:144
TRandom3 r(0)
void art::RangeSet::sort ( )
inline

Definition at line 114 of file RangeSet.h.

References cet::sort_all().

115  {
117  }
std::vector< EventRange > ranges_
Definition: RangeSet.h:145
void sort_all(RandCont &)
std::pair<const_iterator, bool> art::RangeSet::split_range ( SubRunNumber_t  ,
EventNumber_t   
)
std::string art::RangeSet::to_compact_string ( ) const
void art::RangeSet::update ( EventID const &  )

Member Data Documentation

unsigned art::RangeSet::checksum_ {invalidChecksum()}
mutableprivate

Definition at line 149 of file RangeSet.h.

bool art::RangeSet::isCollapsed_ {false}
private

Definition at line 148 of file RangeSet.h.

std::vector<EventRange> art::RangeSet::ranges_ {}
private

Definition at line 145 of file RangeSet.h.

RunNumber_t art::RangeSet::run_ {IDNumber<Level::Run>::invalid()}
private

Definition at line 144 of file RangeSet.h.


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