Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
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
 
- Public Member Functions inherited from art::CatalogInterface
virtual ~CatalogInterface () noexcept=default
 
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::stringfileList_ {}
 
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

Definition at line 39 of file TrivialFileDelivery_service.cc.

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::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.

83  {
84  std::lock_guard sentry{mutex_};
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  {}
string art::TrivialFileDelivery::prependFileDesignation ( std::string const &  name) const
private

Definition at line 147 of file TrivialFileDelivery_service.cc.

148  {
149  std::lock_guard sentry{mutex_};
150  string ret{"file://"};
151  ret += name;
152  return ret;
153  }
static QCString name
Definition: declinfo.cpp:673

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: