ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Public Types | Public Member Functions | List of all members
daq::dpm::SourceResolver Class Reference

Provides location of fits source file. More...

#include <sourceResolver.hpp>

Classes

struct  SourceFile
 

Public Types

using Mapping = std::map< SourceFile, std::string >
 

Public Member Functions

 SourceResolver ()=default
 Initialize resolver with no content. More...
 
 SourceResolver (Mapping mapping)
 
void Add (SourceFile const &source, std::filesystem::path const &path)
 Adds path so it is resolved using source_name and location. More...
 
auto Resolve (SourceFile const &source) const -> std::filesystem::path
 Resolves local file that was previously added with Add(). More...
 
auto GetMapping () const noexcept -> Mapping const &
 Get native representation of source mapping for serialization. More...
 
void SetMapping (Mapping mapping) noexcept
 

Detailed Description

Provides location of fits source file.

Definition at line 27 of file sourceResolver.hpp.

Member Typedef Documentation

◆ Mapping

using daq::dpm::SourceResolver::Mapping = std::map<SourceFile, std::string>

Definition at line 48 of file sourceResolver.hpp.

Constructor & Destructor Documentation

◆ SourceResolver() [1/2]

daq::dpm::SourceResolver::SourceResolver ( )
default

Initialize resolver with no content.

◆ SourceResolver() [2/2]

daq::dpm::SourceResolver::SourceResolver ( Mapping  mapping)
explicit

Definition at line 22 of file sourceResolver.cpp.

Member Function Documentation

◆ Add()

void daq::dpm::SourceResolver::Add ( SourceResolver::SourceFile const &  source,
std::filesystem::path const &  path 
)

Adds path so it is resolved using source_name and location.

Parameters
sourceSource file.
pathLocal path to a file source_name and source will be resolved to.

Definition at line 25 of file sourceResolver.cpp.

◆ GetMapping()

auto daq::dpm::SourceResolver::GetMapping ( ) const -> Mapping const&
noexcept

Get native representation of source mapping for serialization.

Definition at line 42 of file sourceResolver.cpp.

◆ Resolve()

auto daq::dpm::SourceResolver::Resolve ( SourceResolver::SourceFile const &  source) const -> std::filesystem::path

Resolves local file that was previously added with Add().

Parameters
sourceSource file.
Returns
Local path to a file source_name and source resolved to.
Exceptions
SourceNotFoundif source cannot be resolved.

Definition at line 30 of file sourceResolver.cpp.

◆ SetMapping()

void daq::dpm::SourceResolver::SetMapping ( Mapping  mapping)
noexcept

Definition at line 46 of file sourceResolver.cpp.


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