IODA Bundle
FileCollector.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2013 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 /// \file FileCollector.h
12 /// Piotr Kuchta - ECMWF Feb 12
13 
14 #ifndef FileCollector_H
15 #define FileCollector_H
16 
17 #include "eckit/memory/NonCopyable.h"
18 #include "eckit/io/MultiHandle.h"
19 
20 class FileMapper;
21 
22 class FileCollector : private eckit::NonCopyable {
23 public:
24 
25  FileCollector(const FileMapper&, eckit::MultiHandle&);
26  virtual ~FileCollector();
27 
28  void findFiles(const std::vector<std::string>&, const std::map<std::string,std::vector<std::string> >&);
29 
30  void prestage(const std::map<std::string,std::vector<std::string> >&, const std::string& fileName);
31 
32  std::vector<std::string> foundFiles() const;
33  std::vector<eckit::PathName> foundFilesAsPathNames() const;
34 
35  static std::string expandTilde(const std::string& s);
36 
37 protected:
38  virtual void collectFile(const std::map<std::string,std::vector<std::string> >&, const std::map<std::string,std::string>& values);
39 
40 private:
41  void product(size_t k, const std::vector<std::string>& keywords, const std::map<std::string,std::vector<std::string> >&, const std::map<std::string,std::string>&);
42  std::string prestageScriptPath(const std::map<std::string, std::vector<std::string> >&r) const;
43 
45  eckit::MultiHandle& multiHandle_;
46  std::vector<std::string> allFound_;
47 };
48 
49 #endif
virtual ~FileCollector()
std::vector< std::string > foundFiles() const
void product(size_t k, const std::vector< std::string > &keywords, const std::map< std::string, std::vector< std::string > > &, const std::map< std::string, std::string > &)
std::vector< std::string > allFound_
Definition: FileCollector.h:46
void findFiles(const std::vector< std::string > &, const std::map< std::string, std::vector< std::string > > &)
std::vector< eckit::PathName > foundFilesAsPathNames() const
virtual void collectFile(const std::map< std::string, std::vector< std::string > > &, const std::map< std::string, std::string > &values)
const FileMapper & mapper_
Definition: FileCollector.h:44
static std::string expandTilde(const std::string &s)
std::string prestageScriptPath(const std::map< std::string, std::vector< std::string > > &r) const
eckit::MultiHandle & multiHandle_
Definition: FileCollector.h:45
void prestage(const std::map< std::string, std::vector< std::string > > &, const std::string &fileName)
FileCollector(const FileMapper &, eckit::MultiHandle &)