TrivialFileDelivery.h
Go to the documentation of this file.
1 #ifndef art_Framework_Services_Optional_TrivialFileDelivery_h
2 #define art_Framework_Services_Optional_TrivialFileDelivery_h
3 // vim: set sw=2 expandtab :
4 
5 // ===========================================================================
6 // TrivialFileDelivery
7 //
8 // Class for service that returns a URI -- in this ad-hoc case, always
9 // just a file:// URI to an existing file -- when asked for a next
10 // input file. (The list of files to "deliver" is specified at c'tor
11 // time, from input source parameters in the configuration file --
12 // when SAM has a real concrete FileDelivery class, it will be
13 // figuring out file URIs from the dataset requested.) This inherits
14 // from the art::CatalogInterface base class. Eventually, SAMProtocol
15 // will replace this class; this ad-hoc concrete class is meant as an
16 // early-testing scaffold.
17 // ===========================================================================
18 
23 #include "fhiclcpp/ParameterSet.h"
24 #include "hep_concurrency/RecursiveMutex.h"
25 
26 #include <string>
27 #include <vector>
28 
29 namespace art {
30 
32  public:
33  struct Config {};
35 
37 
38  void doConfigure(std::vector<std::string> const& items) override;
39  int doGetNextFileURI(std::string& uri, double& waitTime) override;
40  void doUpdateStatus(std::string const& uri,
41  FileDisposition status) override;
42  void doOutputFileOpened(std::string const& module_label) override;
43  void doOutputModuleInitiated(std::string const& module_label,
44  fhicl::ParameterSet const& pset) override;
45  void doOutputFileClosed(std::string const& module_label,
46  std::string const& file) override;
47  void doEventSelected(std::string const& module_label,
48  EventID const& event_id,
49  HLTGlobalStatus const& acceptance_info) override;
50  bool doIsSearchable() override;
51  void doRewind() override;
52 
53  private:
55 
56  // Protects all data members.
57  mutable hep::concurrency::RecursiveMutex mutex_{
58  "art::TrivialFileDelivery::mutex_"};
59  std::vector<std::string> fileList_{};
62  };
63 
64 } // namespace art
65 
68  SHARED)
69 
70 #endif /* art_Framework_Services_Optional_TrivialFileDelivery_h */
71 
72 // Local Variables:
73 // mode: c++
74 // End:
static QCString name
Definition: declinfo.cpp:673
void doConfigure(std::vector< std::string > const &items) override
void doOutputFileOpened(std::string const &module_label) override
FileDisposition
std::string string
Definition: nybbler.cc:12
DECLARE_ART_SERVICE_INTERFACE_IMPL(MySharedService, art::test::MyServiceInterface, SHARED) DEFINE_ART_SERVICE_INTERFACE_IMPL(MySharedService
intermediate_table::const_iterator const_iterator
std::string prependFileDesignation(std::string const &name) const
std::vector< std::string > fileList_
hep::concurrency::RecursiveMutex mutex_
void doOutputModuleInitiated(std::string const &module_label, fhicl::ParameterSet const &pset) override
static Config * config
Definition: config.cpp:1054
TrivialFileDelivery(Parameters const &config)
void doOutputFileClosed(std::string const &module_label, std::string const &file) override
std::vector< std::string >::const_iterator endOfFiles_
void doEventSelected(std::string const &module_label, EventID const &event_id, HLTGlobalStatus const &acceptance_info) override
int doGetNextFileURI(std::string &uri, double &waitTime) override
void doUpdateStatus(std::string const &uri, FileDisposition status) override
std::vector< std::string >::const_iterator nextFile_