Alexandria  2.16
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:
[legend]
Collaboration diagram for Euclid::XYDataset::CachedProvider:
[legend]

Public Member Functions

virtual ~CachedProvider ()=default
 Destructor. More...
 
 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. More...
 
std::unique_ptr< XYDatasetgetDataset (const QualifiedName &qualified_name) override
 Virtual function for getting from a qualified name the dataset of XYDataset type. More...
 
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
< XYDatasetProvider
m_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

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

Destructor.

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

Definition at line 30 of file CachedProvider.cpp.

Member Function Documentation

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 46 of file CachedProvider.cpp.

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

Here is the call graph for this function:

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

Implements Euclid::XYDataset::XYDatasetProvider.

Definition at line 58 of file CachedProvider.cpp.

References m_provider.

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 36 of file CachedProvider.cpp.

References m_list_cache, m_provider, and std::make_pair().

Here is the call graph for this function:

Member Data Documentation

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

Definition at line 95 of file CachedProvider.h.

Referenced by getDataset().

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

Definition at line 94 of file CachedProvider.h.

Referenced by listContents().

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

Definition at line 93 of file CachedProvider.h.

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


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