LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::TrivialFileDelivery Class Reference
Inheritance diagram for art::TrivialFileDelivery:
art::CatalogInterface

Classes

struct  Config
 

Public Types

using Parameters = ServiceTable< Config >
 

Public Member Functions

 TrivialFileDelivery (Parameters const &config)
 
void doConfigure (std::vector< std::string > const &items) override
 
int doGetNextFileURI (std::string &uri, double &waitTime) override
 
void doUpdateStatus (std::string const &uri, FileDisposition status) override
 
void doOutputFileOpened (std::string const &module_label) override
 
void doOutputModuleInitiated (std::string const &module_label, fhicl::ParameterSet const &pset) override
 
void doOutputFileClosed (std::string const &module_label, std::string const &file) override
 
void doEventSelected (std::string const &module_label, EventID const &event_id, HLTGlobalStatus const &acceptance_info) override
 
bool doIsSearchable () override
 
void doRewind () override
 
void configure (std::vector< std::string > const &items)
 
int getNextFileURI (std::string &uri, double &waitTime)
 
void updateStatus (std::string const &uri, FileDisposition status)
 
void outputFileClosed (std::string const &module_label, std::string const &fileFQname)
 
void outputFileOpened (std::string const &module_label)
 
void outputModuleInitiated (std::string const &module_label, fhicl::ParameterSet const &pset)
 
void eventSelected (std::string const &module_label, EventID const &event_id, HLTGlobalStatus const &acceptance_info)
 
bool isSearchable ()
 
void rewind ()
 

Private Member Functions

std::string prependFileDesignation (std::string const &name) const
 

Private Attributes

std::recursive_mutex mutex_ {}
 
std::vector< std::string > fileList_ {}
 
std::vector< std::string >::const_iterator nextFile_ {fileList_.cbegin()}
 
std::vector< std::string >::const_iterator endOfFiles_ {fileList_.cend()}
 

Detailed Description

Definition at line 36 of file TrivialFileDelivery_service.cc.

Member Typedef Documentation

Constructor & Destructor Documentation

art::TrivialFileDelivery::TrivialFileDelivery ( TrivialFileDelivery::Parameters const &  config)

Definition at line 68 of file TrivialFileDelivery_service.cc.

70  {}

Member Function Documentation

void art::CatalogInterface::configure ( std::vector< std::string > const &  items)
inlineinherited

Definition at line 65 of file CatalogInterface.h.

References art::CatalogInterface::doConfigure().

66  {
67  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
68  doConfigure(items);
69  }
virtual void doConfigure(std::vector< std::string > const &item)=0
void art::TrivialFileDelivery::doConfigure ( std::vector< std::string > const &  items)
overridevirtual

Implements art::CatalogInterface.

Definition at line 73 of file TrivialFileDelivery_service.cc.

74  {
75  std::lock_guard sentry{mutex_};
76  fileList_ = items;
77  nextFile_ = fileList_.begin();
78  endOfFiles_ = fileList_.end();
79  }
std::vector< std::string > fileList_
std::vector< std::string >::const_iterator endOfFiles_
std::vector< std::string >::const_iterator nextFile_
void art::TrivialFileDelivery::doEventSelected ( std::string const &  module_label,
EventID const &  event_id,
HLTGlobalStatus const &  acceptance_info 
)
overridevirtual

Implements art::CatalogInterface.

Definition at line 128 of file TrivialFileDelivery_service.cc.

131  {}
int art::TrivialFileDelivery::doGetNextFileURI ( std::string &  uri,
double &  waitTime 
)
overridevirtual

Implements art::CatalogInterface.

Definition at line 82 of file TrivialFileDelivery_service.cc.

References art::detail::FDS::NO_MORE_FILES, and SUCCESS.

83  {
84  std::lock_guard sentry{mutex_};
85  FileDeliveryStatus stat;
86  if (nextFile_ == endOfFiles_) {
88  return stat;
89  }
90  // Look for protocol.
91  auto pos = nextFile_->find("://");
92  if (pos == string::npos) {
93  // Bare filename.
94  throwIfFileNotExist(nextFile_->c_str());
96  } else if (nextFile_->substr(0, pos) == "file") {
97  // file://
98  throwIfFileNotExist(nextFile_->c_str() + pos + 3);
99  uri = *nextFile_;
100  } else {
101  // Unknown URI.
102  uri = *nextFile_;
103  }
104  waitTime = 0.0;
106  ++nextFile_;
107  return stat;
108  }
std::string prependFileDesignation(std::string const &name) const
std::vector< std::string >::const_iterator endOfFiles_
std::vector< std::string >::const_iterator nextFile_
bool art::TrivialFileDelivery::doIsSearchable ( )
overridevirtual

Implements art::CatalogInterface.

Definition at line 134 of file TrivialFileDelivery_service.cc.

135  {
136  return true;
137  }
void art::TrivialFileDelivery::doOutputFileClosed ( std::string const &  module_label,
std::string const &  file 
)
overridevirtual

Implements art::CatalogInterface.

Definition at line 124 of file TrivialFileDelivery_service.cc.

125  {}
void art::TrivialFileDelivery::doOutputFileOpened ( std::string const &  module_label)
overridevirtual

Implements art::CatalogInterface.

Definition at line 115 of file TrivialFileDelivery_service.cc.

116  {}
void art::TrivialFileDelivery::doOutputModuleInitiated ( std::string const &  module_label,
fhicl::ParameterSet const &  pset 
)
overridevirtual

Implements art::CatalogInterface.

Definition at line 119 of file TrivialFileDelivery_service.cc.

121  {}
void art::TrivialFileDelivery::doRewind ( )
overridevirtual

Implements art::CatalogInterface.

Definition at line 140 of file TrivialFileDelivery_service.cc.

141  {
142  std::lock_guard sentry{mutex_};
143  nextFile_ = fileList_.begin();
144  }
std::vector< std::string > fileList_
std::vector< std::string >::const_iterator nextFile_
void art::TrivialFileDelivery::doUpdateStatus ( std::string const &  uri,
FileDisposition  status 
)
overridevirtual

Implements art::CatalogInterface.

Definition at line 111 of file TrivialFileDelivery_service.cc.

112  {}
void art::CatalogInterface::eventSelected ( std::string const &  module_label,
EventID const &  event_id,
HLTGlobalStatus const &  acceptance_info 
)
inlineinherited

Definition at line 109 of file CatalogInterface.h.

References art::CatalogInterface::doEventSelected().

112  {
113  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
114  doEventSelected(module_label, event_id, acceptance_info);
115  }
virtual void doEventSelected(std::string const &module_label, EventID const &event_id, HLTGlobalStatus const &acceptance_info)=0
int art::CatalogInterface::getNextFileURI ( std::string &  uri,
double &  waitTime 
)
inlineinherited

Definition at line 72 of file CatalogInterface.h.

References art::CatalogInterface::doGetNextFileURI().

73  {
74  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
75  return doGetNextFileURI(uri, waitTime);
76  }
virtual int doGetNextFileURI(std::string &uri, double &waitTime)=0
bool art::CatalogInterface::isSearchable ( )
inlineinherited

Definition at line 118 of file CatalogInterface.h.

References art::CatalogInterface::doIsSearchable().

119  {
120  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
121  return doIsSearchable();
122  }
virtual bool doIsSearchable()=0
void art::CatalogInterface::outputFileClosed ( std::string const &  module_label,
std::string const &  fileFQname 
)
inlineinherited

Definition at line 86 of file CatalogInterface.h.

References art::CatalogInterface::doOutputFileClosed().

88  {
89  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
90  doOutputFileClosed(module_label, fileFQname);
91  }
virtual void doOutputFileClosed(std::string const &module_label, std::string const &fileFQname)=0
void art::CatalogInterface::outputFileOpened ( std::string const &  module_label)
inlineinherited

Definition at line 94 of file CatalogInterface.h.

References art::CatalogInterface::doOutputFileOpened().

95  {
96  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
97  doOutputFileOpened(module_label);
98  }
virtual void doOutputFileOpened(std::string const &module_label)=0
void art::CatalogInterface::outputModuleInitiated ( std::string const &  module_label,
fhicl::ParameterSet const &  pset 
)
inlineinherited

Definition at line 101 of file CatalogInterface.h.

References art::CatalogInterface::doOutputModuleInitiated().

103  {
104  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
105  doOutputModuleInitiated(module_label, pset);
106  }
virtual void doOutputModuleInitiated(std::string const &module_label, fhicl::ParameterSet const &pset)=0
string art::TrivialFileDelivery::prependFileDesignation ( std::string const &  name) const
private

Definition at line 147 of file TrivialFileDelivery_service.cc.

References DECLARE_ART_SERVICE_INTERFACE_IMPL, DEFINE_ART_SERVICE_INTERFACE_IMPL, and art::SHARED.

148  {
149  std::lock_guard sentry{mutex_};
150  string ret{"file://"};
151  ret += name;
152  return ret;
153  }
void art::CatalogInterface::rewind ( )
inlineinherited

Definition at line 125 of file CatalogInterface.h.

References DECLARE_ART_SERVICE_INTERFACE, art::CatalogInterface::doRewind(), and art::SHARED.

126  {
127  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
128  doRewind();
129  }
virtual void doRewind()=0
void art::CatalogInterface::updateStatus ( std::string const &  uri,
FileDisposition  status 
)
inlineinherited

Definition at line 79 of file CatalogInterface.h.

References art::CatalogInterface::doUpdateStatus().

80  {
81  HEP_CONCURRENCY_ASSERT_ONLY_ONE_THREAD();
82  doUpdateStatus(uri, status);
83  }
virtual void doUpdateStatus(std::string const &uri, FileDisposition status)=0

Member Data Documentation

std::vector<std::string>::const_iterator art::TrivialFileDelivery::endOfFiles_ {fileList_.cend()}
private

Definition at line 65 of file TrivialFileDelivery_service.cc.

std::vector<std::string> art::TrivialFileDelivery::fileList_ {}
private

Definition at line 63 of file TrivialFileDelivery_service.cc.

std::recursive_mutex art::TrivialFileDelivery::mutex_ {}
mutableprivate

Definition at line 62 of file TrivialFileDelivery_service.cc.

std::vector<std::string>::const_iterator art::TrivialFileDelivery::nextFile_ {fileList_.cbegin()}
private

Definition at line 64 of file TrivialFileDelivery_service.cc.


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