ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
Public Member Functions | List of all members
daq::WorkspaceImpl Class Referencefinal

Implementation of daq::Workspace. More...

#include <workspace.hpp>

+ Inheritance diagram for daq::WorkspaceImpl:

Public Member Functions

 WorkspaceImpl (std::filesystem::path root)
 Opens or creates workspace in the specified location, using that as a root. More...
 
auto GetPath () const -> std::filesystem::path override
 
void RemoveDaq (std::string const &id) override
 Removes workspace and all containing files for DAQ without archiving it. More...
 
void ArchiveDaq (std::string const &id) override
 Archives specified DAQ without deleting any files, typically by moving files it to a specific location in the workspace. More...
 
auto LoadList () const -> std::vector< std::string > override
 
void StoreList (std::vector< std::string > const &queue) const override
 
Load/store DAQ status
auto LoadStatus (std::string const &id) const -> Status override
 
void StoreStatus (Status const &status) const override
 
Load/store Data Product specification.
auto LoadContext (std::string const &id) const -> DaqContext override
 Get file name of the data product specification stored in StoreSpecification() More...
 
void StoreContext (DaqContext const &context) const override
 Get file name of the data product specification stored in StoreSpecification() More...
 
- Public Member Functions inherited from daq::Workspace
virtual ~Workspace ()
 

Detailed Description

Implementation of daq::Workspace.

Definition at line 90 of file workspace.hpp.

Constructor & Destructor Documentation

◆ WorkspaceImpl()

daq::WorkspaceImpl::WorkspaceImpl ( std::filesystem::path  root)

Opens or creates workspace in the specified location, using that as a root.

If directory does not exist it will attempt to create it, including intermeditate parent directories and basic workspace structure:

  • <root>/in-progress/
  • <root>/archive/

If directories exist the necessary permissions for current user (rwx) is checked.

Exceptions
std::invalid_argumentif root exist and is not a directory.
std::system_errorwith permission denied if directories cannot be created or have the wrong permissions if they already exist.

Member Function Documentation

◆ ArchiveDaq()

void daq::WorkspaceImpl::ArchiveDaq ( std::string const &  id)
overridevirtual

Archives specified DAQ without deleting any files, typically by moving files it to a specific location in the workspace.

Note
Once archived OCM/DPM the ID is essentially reusable. This means that archiving duplicate IDs must be foreseen.

Implements daq::Workspace.

Definition at line 122 of file workspace.cpp.

◆ GetPath()

auto daq::WorkspaceImpl::GetPath ( ) const -> std::filesystem::path
inlineoverridevirtual
Returns
Absolute path to workspace.

Implements daq::Workspace.

Definition at line 109 of file workspace.hpp.

◆ LoadContext()

auto daq::WorkspaceImpl::LoadContext ( std::string const &  id) const -> DaqContext
overridevirtual

Get file name of the data product specification stored in StoreSpecification()

Implements daq::Workspace.

Definition at line 194 of file workspace.cpp.

◆ LoadList()

auto daq::WorkspaceImpl::LoadList ( ) const -> std::vector<std::string>
overridevirtual

Implements daq::Workspace.

Definition at line 152 of file workspace.cpp.

◆ LoadStatus()

auto daq::WorkspaceImpl::LoadStatus ( std::string const &  id) const -> Status
overridevirtual

Implements daq::Workspace.

Definition at line 174 of file workspace.cpp.

◆ RemoveDaq()

void daq::WorkspaceImpl::RemoveDaq ( std::string const &  id)
overridevirtual

Removes workspace and all containing files for DAQ without archiving it.

Workspace is e.g. removed either if user aborts a Data Acquisition or to roll back failed initialization of a workspace.

Parameters
idData Acquisition id.

Implements daq::Workspace.

Definition at line 117 of file workspace.cpp.

◆ StoreContext()

void daq::WorkspaceImpl::StoreContext ( DaqContext const &  context) const
overridevirtual

Get file name of the data product specification stored in StoreSpecification()

Implements daq::Workspace.

Definition at line 208 of file workspace.cpp.

◆ StoreList()

void daq::WorkspaceImpl::StoreList ( std::vector< std::string > const &  queue) const
overridevirtual

Implements daq::Workspace.

Definition at line 164 of file workspace.cpp.

◆ StoreStatus()

void daq::WorkspaceImpl::StoreStatus ( Status const &  status) const
overridevirtual

Implements daq::Workspace.

Definition at line 184 of file workspace.cpp.


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