Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | List of all members
art::detail::RangeSetInfo Struct Reference

#include <RangeSetInfo.h>

Public Member Functions

 RangeSetInfo (RunNumber_t const r, std::vector< EventRange > &&ers)
 
bool is_invalid () const
 
void update (RangeSetInfo &&rsi, bool compact)
 

Static Public Member Functions

static RangeSetInfo invalid ()
 

Public Attributes

RunNumber_t run {IDNumber<Level::Run>::invalid()}
 
std::vector< EventRangeranges {}
 

Private Member Functions

 RangeSetInfo ()=default
 

Detailed Description

Definition at line 22 of file RangeSetInfo.h.

Constructor & Destructor Documentation

art::detail::RangeSetInfo::RangeSetInfo ( RunNumber_t const  r,
std::vector< EventRange > &&  ers 
)
explicit

Definition at line 4 of file RangeSetInfo.cc.

6  : run{r}, ranges{std::move(ers)}
7 {}
std::vector< EventRange > ranges
Definition: RangeSetInfo.h:35
art::detail::RangeSetInfo::RangeSetInfo ( )
privatedefault

Member Function Documentation

static RangeSetInfo art::detail::RangeSetInfo::invalid ( )
inlinestatic

Definition at line 28 of file RangeSetInfo.h.

29  {
30  return RangeSetInfo{};
31  }
bool art::detail::RangeSetInfo::is_invalid ( ) const

Definition at line 10 of file RangeSetInfo.cc.

11 {
13 }
static constexpr type invalid() noexcept
Definition: IDNumber.h:82
void art::detail::RangeSetInfo::update ( RangeSetInfo &&  rsi,
bool  compact 
)

Definition at line 16 of file RangeSetInfo.cc.

17 {
18  if (run != rsi.run) {
20  << "Cannot merge two ranges-of-validity with different run numbers: "
21  << run << " vs. " << rsi.run << '\n'
22  << "Please contact artists@fnal.gov.";
23  }
24 
25  // If full range-set information is to be retained (the
26  // default), then append the accumulated ranges into the
27  // already-existing container. Bail out early.
28  if (!compact) {
29  std::move(rsi.ranges.begin(), rsi.ranges.end(), std::back_inserter(ranges));
30  return;
31  }
32 
33  // For compact ranges
34  for (auto&& range : rsi.ranges) {
35  auto const subRunN = range.subRun();
36  // If compact option is chosen, there will be *at most*
37  // one entry in the 'ranges' container that corresponds to
38  // this subrun.
39  auto found =
40  std::find_if(begin(ranges), end(ranges), [subRunN](auto const& er) {
41  return er.subRun() == subRunN;
42  });
43  if (found == end(ranges)) {
44  ranges.push_back(std::move(range));
45  continue;
46  }
47 
49  auto const ebegin = std::min(found->begin(), range.begin());
50  auto const eend = std::max(found->end(), range.end());
51  *found = EventRange{subRunN, ebegin, eend};
52  }
53 }
std::vector< EventRange > ranges
Definition: RangeSetInfo.h:35
void throw_if_not_disjoint(RunNumber_t const rn, EventRange const &left, EventRange const &right) noexcept(false)
Definition: RangeSet.cc:454
auto begin(Data< Value > const &data)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:57
end
Definition: test.py:8

Member Data Documentation

std::vector<EventRange> art::detail::RangeSetInfo::ranges {}

Definition at line 35 of file RangeSetInfo.h.

RunNumber_t art::detail::RangeSetInfo::run {IDNumber<Level::Run>::invalid()}

Definition at line 34 of file RangeSetInfo.h.


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