Elements  5.12.0
A C++ base framework for the Euclid Software.
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ElementsServices::DataSync::DataSynchronizer Class Referenceabstract

Base class to synchronize test data. More...

#include <DataSynchronizer.h>

Inheritance diagram for ElementsServices::DataSync::DataSynchronizer:
[legend]
Collaboration diagram for ElementsServices::DataSync::DataSynchronizer:
[legend]

Public Member Functions

virtual ~DataSynchronizer ()=default
 
 DataSynchronizer (const ConnectionConfiguration &connection, const DependencyConfiguration &dependency)
 
void downloadAllFiles () const
 

Protected Member Functions

bool fileShouldBeWritten (path localFile) const
 
bool fileAlreadyExists (path localFile) const
 
void downloadOneFile (path distantFile, path localFile) const
 
bool hasBeenDownloaded (path distantFile, path localFile) const
 
virtual std::string createDownloadCommand (path distantFile, path localFile) const =0
 

Protected Attributes

ConnectionConfiguration m_connection
 
std::map< path, pathm_fileMap
 

Detailed Description

Base class to synchronize test data.

Child classes should provide their synchronization command line.

Definition at line 65 of file DataSynchronizer.h.

Constructor & Destructor Documentation

◆ ~DataSynchronizer()

virtual ElementsServices::DataSync::DataSynchronizer::~DataSynchronizer ( )
virtualdefault

◆ DataSynchronizer()

ElementsServices::DataSync::DataSynchronizer::DataSynchronizer ( const ConnectionConfiguration connection,
const DependencyConfiguration dependency 
)

Definition at line 28 of file DataSynchronizer.cpp.

Member Function Documentation

◆ createDownloadCommand()

virtual std::string ElementsServices::DataSync::DataSynchronizer::createDownloadCommand ( path  distantFile,
path  localFile 
) const
protectedpure virtual

◆ downloadAllFiles()

void ElementsServices::DataSync::DataSynchronizer::downloadAllFiles ( ) const

Definition at line 34 of file DataSynchronizer.cpp.

References downloadOneFile(), fileShouldBeWritten(), and m_fileMap.

Here is the call graph for this function:

◆ downloadOneFile()

void ElementsServices::DataSync::DataSynchronizer::downloadOneFile ( path  distantFile,
path  localFile 
) const
protected

Definition at line 55 of file DataSynchronizer.cpp.

References createDownloadCommand(), ElementsServices::DataSync::createLocalDirOf(), hasBeenDownloaded(), and ElementsServices::DataSync::runCommandAndCaptureOutErr().

Referenced by downloadAllFiles().

Here is the call graph for this function:

◆ fileAlreadyExists()

bool ElementsServices::DataSync::DataSynchronizer::fileAlreadyExists ( path  localFile) const
protected

Definition at line 51 of file DataSynchronizer.cpp.

Referenced by fileShouldBeWritten().

◆ fileShouldBeWritten()

bool ElementsServices::DataSync::DataSynchronizer::fileShouldBeWritten ( path  localFile) const
protected

Definition at line 44 of file DataSynchronizer.cpp.

References fileAlreadyExists(), m_connection, and ElementsServices::DataSync::ConnectionConfiguration::overwritingAllowed().

Referenced by downloadAllFiles().

Here is the call graph for this function:

◆ hasBeenDownloaded()

bool ElementsServices::DataSync::DataSynchronizer::hasBeenDownloaded ( path  distantFile,
path  localFile 
) const
protected

Definition at line 66 of file DataSynchronizer.cpp.

Referenced by downloadOneFile().

Member Data Documentation

◆ m_connection

ConnectionConfiguration ElementsServices::DataSync::DataSynchronizer::m_connection
protected

◆ m_fileMap

std::map<path, path> ElementsServices::DataSync::DataSynchronizer::m_fileMap
protected

Definition at line 98 of file DataSynchronizer.h.

Referenced by downloadAllFiles().


The documentation for this class was generated from the following files: