Elements 6.3.3
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
DataSynchronizer.h
Go to the documentation of this file.
1
18
23
24#ifndef ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_DATASYNCHRONIZER_H_
25#define ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_DATASYNCHRONIZER_H_
26
27#include <map>
28#include <stdexcept>
29#include <string>
30
32
36
37namespace Elements {
38inline namespace Services {
39namespace DataSync {
40
47public:
48 virtual ~DownloadFailed() = default;
49 DownloadFailed(path distantFile, path localFile)
50 : std::runtime_error("Unable to download file: '" + distantFile.string() + "' as: '" + localFile.string() +
51 "'.") {}
52};
53
62
63public:
64 virtual ~DataSynchronizer() = default;
65
66 DataSynchronizer(const ConnectionConfiguration& connection, const DependencyConfiguration& dependency);
67
68 void downloadAllFiles() const;
69
70protected:
71 bool fileShouldBeWritten(path localFile) const;
72
73 bool fileAlreadyExists(path localFile) const;
74
75 void downloadOneFile(path distantFile, path localFile) const;
76
77 bool hasBeenDownloaded(path distantFile, path localFile) const;
78
79 virtual std::string createDownloadCommand(path distantFile, path localFile) const = 0;
80
81protected:
84};
85
86} // namespace DataSync
87} // namespace Services
88} // namespace Elements
89
91
92#endif // ELEMENTSSERVICES_ELEMENTSSERVICES_DATASYNC_DATASYNCHRONIZER_H_
93
defines the macros to be used for explicit export of the symbols
void downloadOneFile(path distantFile, path localFile) const
virtual std::string createDownloadCommand(path distantFile, path localFile) const =0
DataSynchronizer(const ConnectionConfiguration &connection, const DependencyConfiguration &dependency)
bool hasBeenDownloaded(path distantFile, path localFile) const
The dependency configurations holds, for each test file to be retrieved:
DownloadFailed(path distantFile, path localFile)
#define ELEMENTS_API
Dummy definitions for the backward compatibility mode.
Definition Export.h:74
Path::Item path
importing the path item from ElementsKernel
STL namespace.