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

#include "ClosingCriteria.h"

Classes

struct  Config
 
struct  Defaults
 

Public Member Functions

 ~ClosingCriteria ()
 
 ClosingCriteria ()
 
 ClosingCriteria (Config const &fp)
 
 ClosingCriteria (FileProperties const &fp, std::string const &granularity)
 
FileProperties const & fileProperties () const
 
Granularity granularity () const
 
bool should_close (FileProperties const &) const
 

Private Attributes

FileProperties closingCriteria_
 
Granularity granularity_
 

Detailed Description

Definition at line 69 of file ClosingCriteria.h.

Constructor & Destructor Documentation

art::ClosingCriteria::~ClosingCriteria ( )
default

Referenced by art::operator<<().

art::ClosingCriteria::ClosingCriteria ( )

Definition at line 232 of file ClosingCriteria.cc.

References granularity_, art::ClosingCriteria::Defaults::granularity_default(), and art::Granularity::value().

233  : closingCriteria_{}
235  {}
static BT value(std::string const &spec)
FileProperties closingCriteria_
static constexpr char const * granularity_default()
art::ClosingCriteria::ClosingCriteria ( Config const &  fp)

Definition at line 242 of file ClosingCriteria.cc.

References closingCriteria_, art::ClosingCriteria::Config::granularity, art::ClosingCriteria::Config::maxAge, art::ClosingCriteria::Config::maxEvents, art::ClosingCriteria::Config::maxInputFiles, art::ClosingCriteria::Config::maxRuns, art::ClosingCriteria::Config::maxSize, and art::ClosingCriteria::Config::maxSubRuns.

243  : ClosingCriteria{FileProperties{c.maxEvents(),
244  c.maxSubRuns(),
245  c.maxRuns(),
246  c.maxInputFiles(),
247  c.maxSize(),
248  chrono::seconds{c.maxAge()}},
249  c.granularity()}
250  {
251  auto const& cc = closingCriteria_;
252  config_require(cc.nEvents() > 0, "maxEvents must be greater than 0.");
253  config_require(cc.nSubRuns() > 0, "maxSubRuns must be greater than 0.");
254  config_require(cc.nRuns() > 0, "maxRuns must be greater than 0.");
255  config_require(cc.nInputFiles() > 0,
256  "maxInputFiles must be greater than 0.");
257  config_require(cc.size() > 0, "maxSize must be greater than 0 KiB.");
258  config_require(cc.age() > decltype(cc.age())::zero(),
259  "maxAge must be greater than 0 seconds.");
260  }
second seconds
Alias for common language habits.
Definition: spacetime.h:85
FileProperties closingCriteria_
art::ClosingCriteria::ClosingCriteria ( FileProperties const &  fp,
std::string const &  granularity 
)

Definition at line 237 of file ClosingCriteria.cc.

References granularity(), granularity_, and art::Granularity::value().

240  {}
Granularity granularity() const
static BT value(std::string const &spec)
FILE * fp
Definition: plot.C:34
FileProperties closingCriteria_

Member Function Documentation

FileProperties const & art::ClosingCriteria::fileProperties ( ) const

Definition at line 263 of file ClosingCriteria.cc.

References closingCriteria_.

264  {
265  return closingCriteria_;
266  }
FileProperties closingCriteria_
Granularity art::ClosingCriteria::granularity ( ) const

Definition at line 269 of file ClosingCriteria.cc.

References granularity_.

Referenced by ClosingCriteria().

270  {
271  return granularity_;
272  }
bool art::ClosingCriteria::should_close ( FileProperties const &  fp) const

Definition at line 275 of file ClosingCriteria.cc.

References art::FileProperties::age(), closingCriteria_, art::FileProperties::nEvents(), art::FileProperties::nInputFiles(), art::FileProperties::nRuns(), art::FileProperties::nSubRuns(), and art::FileProperties::size().

276  {
277  return (fp.size() >= closingCriteria_.size()) ||
278  (fp.nEvents() >= closingCriteria_.nEvents()) ||
279  (fp.nSubRuns() >= closingCriteria_.nSubRuns()) ||
280  (fp.nRuns() >= closingCriteria_.nRuns()) ||
281  (fp.nInputFiles() >= closingCriteria_.nInputFiles()) ||
282  (fp.age() >= closingCriteria_.age());
283  }
unsigned nEvents() const
unsigned nSubRuns() const
unsigned nInputFiles() const
unsigned nRuns() const
std::chrono::seconds age() const
FILE * fp
Definition: plot.C:34
FileProperties closingCriteria_
unsigned size() const

Member Data Documentation

FileProperties art::ClosingCriteria::closingCriteria_
private

Definition at line 144 of file ClosingCriteria.h.

Referenced by ClosingCriteria(), fileProperties(), and should_close().

Granularity art::ClosingCriteria::granularity_
private

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