Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::API::ISISInstrumentDataCache Class Reference

#include <ISISInstrumentDataCache.h>

Public Member Functions

std::string getFileParentDirectoryPath (const std::string &filename) const
 
std::vector< std::string > getRunNumbersInCache (std::string const &instrumentName) const
 Get a vector of the run numbers' files present in the given instrument's data cache.
 
bool isIndexFileAvailable (std::string const &instrument) const
 Check if the data cache index file is available on the current system for a given instrument.
 
 ISISInstrumentDataCache (const std::string &path)
 

Private Member Functions

Mantid::Kernel::InstrumentInfo getInstrumentFromName (const std::string &instName) const
 
std::filesystem::path makeIndexFilePath (const std::string &instrumentName) const
 
std::pair< std::filesystem::path, Json::Value > openCacheJsonFile (const Mantid::Kernel::InstrumentInfo &instrument) const
 Open the Json file and return the path and the opened file object.
 
std::pair< std::string, std::string > splitIntoInstrumentAndNumber (const std::string &filename) const
 
std::pair< Mantid::Kernel::InstrumentInfo, std::string > validateInstrumentAndNumber (const std::string &filename) const
 

Private Attributes

std::string m_dataCachePath
 

Detailed Description

Definition at line 22 of file ISISInstrumentDataCache.h.

Constructor & Destructor Documentation

◆ ISISInstrumentDataCache()

Mantid::API::ISISInstrumentDataCache::ISISInstrumentDataCache ( const std::string &  path)
inline

Definition at line 24 of file ISISInstrumentDataCache.h.

Member Function Documentation

◆ getFileParentDirectoryPath()

std::string ISISInstrumentDataCache::getFileParentDirectoryPath ( const std::string &  filename) const

◆ getInstrumentFromName()

InstrumentInfo ISISInstrumentDataCache::getInstrumentFromName ( const std::string &  instName) const
private

◆ getRunNumbersInCache()

std::vector< std::string > ISISInstrumentDataCache::getRunNumbersInCache ( std::string const &  instrumentName) const

Get a vector of the run numbers' files present in the given instrument's data cache.

Parameters
instrumentNameThe instrument to get run numbers for.
Returns
A vector containing the run numbers that can be accessed from the data cache.

Definition at line 49 of file ISISInstrumentDataCache.cpp.

References getInstrumentFromName(), and openCacheJsonFile().

◆ isIndexFileAvailable()

bool ISISInstrumentDataCache::isIndexFileAvailable ( std::string const &  instrumentName) const

Check if the data cache index file is available on the current system for a given instrument.

Parameters
instrumentNameThe instrument to find the index file for.
Returns
if there is an index file (and therefore instrument data cache) on the system.

Definition at line 135 of file ISISInstrumentDataCache.cpp.

References makeIndexFilePath().

◆ makeIndexFilePath()

std::filesystem::path ISISInstrumentDataCache::makeIndexFilePath ( const std::string &  instrumentName) const
private

◆ openCacheJsonFile()

std::pair< std::filesystem::path, Json::Value > ISISInstrumentDataCache::openCacheJsonFile ( const Mantid::Kernel::InstrumentInfo instrument) const
private

Open the Json file and return the path and the opened file object.

Parameters
instrumentThe instrument to open the index file for.
Returns
A pair containing the path and the contents of the json file.
Exceptions
std::invalid_argumentif the file could not be found.

Definition at line 61 of file ISISInstrumentDataCache.cpp.

References Mantid::Kernel::Logger::debug(), Mantid::API::g_log, makeIndexFilePath(), Mantid::Kernel::InstrumentInfo::name(), and Mantid::Kernel::InstrumentInfo::shortName().

Referenced by getFileParentDirectoryPath(), and getRunNumbersInCache().

◆ splitIntoInstrumentAndNumber()

std::pair< std::string, std::string > ISISInstrumentDataCache::splitIntoInstrumentAndNumber ( const std::string &  filename) const
private

Definition at line 116 of file ISISInstrumentDataCache.cpp.

Referenced by validateInstrumentAndNumber().

◆ validateInstrumentAndNumber()

std::pair< InstrumentInfo, std::string > ISISInstrumentDataCache::validateInstrumentAndNumber ( const std::string &  filename) const
private

Member Data Documentation

◆ m_dataCachePath

std::string Mantid::API::ISISInstrumentDataCache::m_dataCachePath
private

Definition at line 36 of file ISISInstrumentDataCache.h.

Referenced by makeIndexFilePath().


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