25 throwIfFileNotExist(
char const*
fname) noexcept(
false)
30 <<
"Input file not found: " <<
fname <<
".\n";
43 void doConfigure(std::vector<std::string>
const& items)
override;
44 int doGetNextFileURI(
std::string& uri,
double& waitTime)
override;
47 void doOutputFileOpened(
std::string const& module_label)
override;
48 void doOutputModuleInitiated(
std::string const& module_label,
50 void doOutputFileClosed(
std::string const& module_label,
52 void doEventSelected(
std::string const& module_label,
55 bool doIsSearchable()
override;
56 void doRewind()
override;
62 mutable std::recursive_mutex mutex_{};
63 std::vector<std::string> fileList_{};
68 TrivialFileDelivery::TrivialFileDelivery(
73 TrivialFileDelivery::doConfigure(vector<string>
const& items)
75 std::lock_guard sentry{mutex_};
77 nextFile_ = fileList_.begin();
78 endOfFiles_ = fileList_.end();
82 TrivialFileDelivery::doGetNextFileURI(
string& uri,
double& waitTime)
84 std::lock_guard sentry{mutex_};
86 if (nextFile_ == endOfFiles_) {
91 auto pos = nextFile_->find(
"://");
92 if (
pos == string::npos) {
94 throwIfFileNotExist(nextFile_->c_str());
95 uri = prependFileDesignation(*nextFile_);
96 }
else if (nextFile_->substr(0,
pos) ==
"file") {
98 throwIfFileNotExist(nextFile_->c_str() +
pos + 3);
115 TrivialFileDelivery::doOutputFileOpened(
string const&)
119 TrivialFileDelivery::doOutputModuleInitiated(
string const&,
124 TrivialFileDelivery::doOutputFileClosed(
string const&,
string const&)
128 TrivialFileDelivery::doEventSelected(
string const&,
134 TrivialFileDelivery::doIsSearchable()
140 TrivialFileDelivery::doRewind()
142 std::lock_guard sentry{mutex_};
143 nextFile_ = fileList_.begin();
147 TrivialFileDelivery::prependFileDesignation(
string const&
name)
const 149 std::lock_guard sentry{mutex_};
150 string ret{
"file://"};
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)