LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
FileServiceProxy.h
Go to the documentation of this file.
1 #ifndef art_Framework_IO_Sources_detail_FileServiceProxy_h
2 #define art_Framework_IO_Sources_detail_FileServiceProxy_h
3 
10 
11 #include <string>
12 #include <vector>
13 
14 namespace art {
15  namespace detail {
16  class FileServiceProxy;
17  }
18 }
19 
21 public:
22  explicit FileServiceProxy(std::vector<std::string>&& fileNames,
23  size_t attempts = 5,
24  double waitBetweenAttempts = 5.0);
26 
27  std::string next();
28  void finish();
29 
30 private:
31  std::string obtainURI_();
32  std::string obtainFileFromURI_();
33 
36  struct FileEntity {
37  explicit FileEntity(size_t attempts)
38  : uri()
39  , pfn()
40  , uriStatus(FileDeliveryStatus::PENDING)
41  , ftStatus(FileTransferStatus::PENDING)
42  , attemptsRemaining(attempts)
43  {}
44  std::string uri;
45  std::string pfn;
49  } currentItem_;
50  size_t const attemptsPerPhase_;
51  double const waitBetweenAttempts_;
52 };
53 
54 inline std::string
56 {
57  finish();
58  return obtainURI_();
59 }
60 
61 #endif /* art_Framework_IO_Sources_detail_FileServiceProxy_h */
62 
63 // Local Variables:
64 // mode: c++
65 // End:
FileServiceProxy(std::vector< std::string > &&fileNames, size_t attempts=5, double waitBetweenAttempts=5.0)
ServiceHandle< FileTransfer > ft_
struct art::detail::FileServiceProxy::FileEntity currentItem_
HLT enums.
ServiceHandle< CatalogInterface > ci_