LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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 
4 // ===========================================================================
5 // TrivialFileDelivery
6 //
7 // Class for service that returns a URI -- in this ad-hoc case, always
8 // just a file:// URI to an existing file -- when asked for a next
9 // input file. (The list of files to "deliver" is specified at c'tor
10 // time, from input source parameters in the configuration file --
11 // when SAM has a real concrete FileDelivery class, it will be
12 // figuring out file URIs from the dataset requested.) This inherits
13 // from the art::CatalogInterface base class. Eventually, SAMProtocol
14 // will replace this class; this ad-hoc concrete class is meant as an
15 // early-testing scaffold.
16 // ===========================================================================
17 
23 #include "fhiclcpp/ParameterSet.h"
24 #include <string>
25 
26 namespace art {
27  class TrivialFileDelivery;
28 }
29 
30 namespace art {
32  public:
33  // configuration
34  struct Config {
35  };
37 
38  // ctor -- the services factory will expect this signature
39  TrivialFileDelivery(Parameters const& config);
40 
41  private:
42  // Classes inheriting this interface must provide the following methods:
43  void doConfigure(std::vector<std::string> const& items) override;
44  int doGetNextFileURI(std::string& uri, double& waitTime) override;
45  void doUpdateStatus(std::string const& uri,
46  FileDisposition status) override;
47  void doOutputFileOpened(std::string const& module_label) override;
48  void doOutputModuleInitiated(std::string const& module_label,
49  fhicl::ParameterSet const& pset) override;
50  void doOutputFileClosed(std::string const& module_label,
51  std::string const& file) override;
52  void doEventSelected(std::string const& module_label,
53  EventID const& event_id,
54  HLTGlobalStatus const& acceptance_info) override;
55  bool doIsSearchable() override;
56  void doRewind() override;
57 
58  // helper functions
59  std::vector<std::string> extractFileListFromPset(
60  fhicl::ParameterSet const& pset);
61  std::string prependFileDesignation(std::string const& name) const;
62 
63  // class data
64  std::vector<std::string> fileList{};
67  };
68 } // end of namespace art
69 
72  LEGACY)
73 #endif /* art_Framework_Services_Optional_TrivialFileDelivery_h */
74 
75 // Local Variables:
76 // mode: c++
77 // End:
void doConfigure(std::vector< std::string > const &items) override
void doOutputFileOpened(std::string const &module_label) override
std::vector< std::string > extractFileListFromPset(fhicl::ParameterSet const &pset)
FileDisposition
std::vector< std::string >::const_iterator nextFile
std::string prependFileDesignation(std::string const &name) const
intermediate_table::const_iterator const_iterator
void doOutputModuleInitiated(std::string const &module_label, fhicl::ParameterSet const &pset) override
TrivialFileDelivery(Parameters const &config)
std::vector< std::string >::const_iterator endOfFiles
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
TFile * file
HLT enums.
int doGetNextFileURI(std::string &uri, double &waitTime) override
void doUpdateStatus(std::string const &uri, FileDisposition status) override
std::vector< std::string > fileList
#define DECLARE_ART_SERVICE_INTERFACE_IMPL(svc, iface, scope)