Mantid
Loading...
Searching...
No Matches
ISISInstrumentDataCache.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/DllConfig.h"
14#include <filesystem>
15#include <json/value.h>
16#include <string>
17#include <utility>
18
19namespace Mantid {
20namespace API {
21
22class MANTID_API_DLL ISISInstrumentDataCache {
23public:
24 ISISInstrumentDataCache(const std::string &path) : m_dataCachePath(path) {}
25 std::string getFileParentDirectoryPath(const std::string &filename) const;
26 bool isIndexFileAvailable(std::string const &instrument) const;
27 std::vector<std::string> getRunNumbersInCache(std::string const &instrumentName) const;
28
29private:
30 std::pair<Mantid::Kernel::InstrumentInfo, std::string> validateInstrumentAndNumber(const std::string &filename) const;
31 std::filesystem::path makeIndexFilePath(const std::string &instrumentName) const;
32 std::pair<std::string, std::string> splitIntoInstrumentAndNumber(const std::string &filename) const;
33 [[nodiscard]] std::pair<std::filesystem::path, Json::Value>
34 openCacheJsonFile(const Mantid::Kernel::InstrumentInfo &instrument) const;
35 [[nodiscard]] Mantid::Kernel::InstrumentInfo getInstrumentFromName(const std::string &instName) const;
36 std::string m_dataCachePath;
37};
38} // namespace API
39} // namespace Mantid
A class that holds information about an instrument.
Helper class which provides the Collimation Length for SANS instruments.