Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Euclid::XYDataset::CachedProvider Class Reference

The CachedProvider wraps another XYDatasetProvider and keeps in memory the results, so following calls are cheaper. More...

#include <CachedProvider.h>

Inheritance diagram for Euclid::XYDataset::CachedProvider:
Inheritance graph
[legend]
Collaboration diagram for Euclid::XYDataset::CachedProvider:
Collaboration graph
[legend]

Public Member Functions

virtual ~CachedProvider ()=default
 Destructor.
 
 CachedProvider (std::shared_ptr< XYDatasetProvider > provider)
 
std::vector< QualifiedNamelistContents (const std::string &group) override
 Virtual function to list all files contents in the "group" path.
 
std::unique_ptr< XYDatasetgetDataset (const QualifiedName &qualified_name) override
 Virtual function for getting from a qualified name the dataset of XYDataset type.
 
std::string getParameter (const QualifiedName &qualified_name, const std::string &key_word) override
 
- Public Member Functions inherited from Euclid::XYDataset::XYDatasetProvider
virtual ~XYDatasetProvider ()=default
 

Private Attributes

std::shared_ptr< XYDatasetProviderm_provider
 
std::map< std::string, std::vector< QualifiedName > > m_list_cache
 
std::map< QualifiedName, std::unique_ptr< XYDataset > > m_dataset
 

Detailed Description

The CachedProvider wraps another XYDatasetProvider and keeps in memory the results, so following calls are cheaper.

Definition at line 44 of file CachedProvider.h.

Constructor & Destructor Documentation

◆ ~CachedProvider()

virtual Euclid::XYDataset::CachedProvider::~CachedProvider ( )
virtualdefault

Destructor.

◆ CachedProvider()

Euclid::XYDataset::CachedProvider::CachedProvider ( std::shared_ptr< XYDatasetProvider provider)
explicit

Definition at line 29 of file CachedProvider.cpp.

Member Function Documentation

◆ getDataset()

std::unique_ptr< XYDataset > Euclid::XYDataset::CachedProvider::getDataset ( const QualifiedName qualified_name)
overridevirtual

Virtual function for getting from a qualified name the dataset of XYDataset type.

Parameters
qualified_nameQualified name of the dataset
Returns
A unique pointer of XYDataset type to the dataset

Implements Euclid::XYDataset::XYDatasetProvider.

Definition at line 40 of file CachedProvider.cpp.

References m_dataset, m_provider, std::make_pair(), and std::move().

Here is the call graph for this function:

◆ getParameter()

std::string Euclid::XYDataset::CachedProvider::getParameter ( const QualifiedName qualified_name,
const std::string key_word 
)
overridevirtual

Implements Euclid::XYDataset::XYDatasetProvider.

Definition at line 52 of file CachedProvider.cpp.

References m_provider.

◆ listContents()

std::vector< QualifiedName > Euclid::XYDataset::CachedProvider::listContents ( const std::string group)
overridevirtual

Virtual function to list all files contents in the "group" path.

let's take the following example. if you have a group sets to "A/B/C" and under the "C" repository there is the following structure : C/file1 C/file2 C/D/file3 etc... then the vector of strings returned will contain the following elements: vector[0] = "A/B/C/file1" vector[1] = "A/B/C/file2" vector[3] = "A/B/C/D/file3" etc... Note: The empty string for the group means the root group

Parameters
groupName of the dataset group
Returns
A vector of the qualified names of all datasets inside the given group (recursively)

Implements Euclid::XYDataset::XYDatasetProvider.

Definition at line 31 of file CachedProvider.cpp.

References std::vector< T >::insert(), m_list_cache, m_provider, and std::make_pair().

Here is the call graph for this function:

Member Data Documentation

◆ m_dataset

std::map<QualifiedName, std::unique_ptr<XYDataset> > Euclid::XYDataset::CachedProvider::m_dataset
private

Definition at line 93 of file CachedProvider.h.

Referenced by getDataset().

◆ m_list_cache

std::map<std::string, std::vector<QualifiedName> > Euclid::XYDataset::CachedProvider::m_list_cache
private

Definition at line 92 of file CachedProvider.h.

Referenced by listContents().

◆ m_provider

std::shared_ptr<XYDatasetProvider> Euclid::XYDataset::CachedProvider::m_provider
private

Definition at line 91 of file CachedProvider.h.

Referenced by getDataset(), getParameter(), and listContents().


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