Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
hgps::input::DataSource Class Reference

Represents a data source, either a file/directory path or a URL. More...

#include <data_source.h>

Inheritance diagram for hgps::input::DataSource:
[legend]

Public Member Functions

 DataSource (std::string source)
 Create a new DataSource.
 
 DataSource (std::string source, const std::filesystem::path &root_path)
 Create a new DataSource, rebasing relative paths if needed.
 
virtual ~DataSource ()=default
 
 DataSource (const DataSource &) noexcept=default
 
 DataSource (DataSource &&) noexcept=default
 
DataSourceoperator= (const DataSource &) noexcept=default
 
DataSourceoperator= (DataSource &&) noexcept=default
 
virtual std::string compute_file_hash (const std::filesystem::path &zip_file_path) const
 Compute the checksum for the file.
 
std::filesystem::path get_data_directory () const
 Get the path to a directory containing the data.
 

Protected Attributes

std::string source_
 

Detailed Description

Represents a data source, either a file/directory path or a URL.

Constructor & Destructor Documentation

◆ DataSource() [1/4]

hgps::input::DataSource::DataSource ( std::string  source)
explicit

Create a new DataSource.

Parameters
sourceFile/directory path or URL

◆ DataSource() [2/4]

hgps::input::DataSource::DataSource ( std::string  source,
const std::filesystem::path &  root_path 
)
explicit

Create a new DataSource, rebasing relative paths if needed.

Parameters
sourceFile path or URL
root_pathPath to use as root for relative paths

◆ ~DataSource()

virtual hgps::input::DataSource::~DataSource ( )
virtualdefault

◆ DataSource() [3/4]

hgps::input::DataSource::DataSource ( const DataSource )
defaultnoexcept

◆ DataSource() [4/4]

hgps::input::DataSource::DataSource ( DataSource &&  )
defaultnoexcept

Member Function Documentation

◆ compute_file_hash()

std::string hgps::input::DataSource::compute_file_hash ( const std::filesystem::path &  zip_file_path) const
virtual

Compute the checksum for the file.

Parameters
zip_file_pathPath to zip file
Returns
The calculated checksum

Reimplemented in hgps::input::ValidatedDataSource.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_data_directory()

std::filesystem::path hgps::input::DataSource::get_data_directory ( ) const

Get the path to a directory containing the data.

This function will download, extract and validate data as needed

Returns
Path to directory containing the data
Here is the call graph for this function:

◆ operator=() [1/2]

DataSource & hgps::input::DataSource::operator= ( const DataSource )
defaultnoexcept

◆ operator=() [2/2]

DataSource & hgps::input::DataSource::operator= ( DataSource &&  )
defaultnoexcept

Member Data Documentation

◆ source_

std::string hgps::input::DataSource::source_
protected

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