Mantid
Loading...
Searching...
No Matches
FacilityInfo.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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//----------------------------------------------------------------------
13#include "MantidKernel/DllConfig.h"
15#ifndef Q_MOC_RUN
16#include <memory>
17#endif
18#include <string>
19#include <vector>
20
21//----------------------------------------------------------------------
22// Forward declarations
23//----------------------------------------------------------------------
24namespace Poco {
25namespace XML {
26class Element;
27}
28} // namespace Poco
29
30namespace Mantid {
31namespace Kernel {
32
36class MANTID_KERNEL_DLL FacilityInfo {
37public:
38 explicit FacilityInfo(const Poco::XML::Element *elem);
39
41 const std::string &name() const { return m_name; }
42
44 int zeroPadding() const { return m_zeroPadding; }
46 const std::string &delimiter() const { return m_delimiter; }
48 const std::vector<std::string> extensions() const { return m_extensions; }
50 const std::string &preferredExtension() const { return m_extensions.front(); }
51
53 const std::string &timezone() const { return m_timezone; }
54
56 const std::vector<std::string> &archiveSearch() const { return m_archiveSearch; }
58 const std::vector<InstrumentInfo> &instruments() const { return m_instruments; }
60 std::vector<InstrumentInfo> instruments(const std::string &tech) const;
62 const InstrumentInfo &instrument(std::string iName = "") const;
63
65 const CatalogInfo &catalogInfo() const { return m_catalogs; }
66
68 bool noFilePrefix() const { return m_noFilePrefix; }
69
71 size_t multiFileLimit() const { return m_multiFileLimit; }
72
73private:
74 void fillZeroPadding(const Poco::XML::Element *elem);
75 void fillDelimiter(const Poco::XML::Element *elem);
76 void fillExtensions(const Poco::XML::Element *elem);
77 void fillArchiveNames(const Poco::XML::Element *elem);
78 void fillTimezone(const Poco::XML::Element *elem);
79 void fillInstruments(const Poco::XML::Element *elem);
80 void fillHTTPProxy(const Poco::XML::Element *elem);
81 void fillNoFilePrefix(const Poco::XML::Element *elem);
82 void fillMultiFileLimit(const Poco::XML::Element *elem);
83
85 void addExtension(const std::string &ext);
86
88 const std::string m_name;
89 std::string m_timezone;
91 std::string m_delimiter;
92 std::vector<std::string> m_extensions;
93 std::vector<std::string> m_archiveSearch;
94 std::vector<InstrumentInfo> m_instruments;
97};
98
99} // namespace Kernel
100} // namespace Mantid
A class that holds information about catalogs.
Definition: CatalogInfo.h:31
A class that holds information about a facility.
Definition: FacilityInfo.h:36
std::vector< std::string > m_extensions
file extensions in order of preference
Definition: FacilityInfo.h:92
const std::vector< std::string > extensions() const
Returns a list of file extensions.
Definition: FacilityInfo.h:48
size_t multiFileLimit() const
Returns the multiple file limit.
Definition: FacilityInfo.h:71
std::string m_timezone
Timezone designation in pytz.
Definition: FacilityInfo.h:89
int zeroPadding() const
Returns default zero padding for this facility.
Definition: FacilityInfo.h:44
const std::string & preferredExtension() const
Returns the preferred file extension.
Definition: FacilityInfo.h:50
const std::vector< InstrumentInfo > & instruments() const
Returns a list of instruments of this facility.
Definition: FacilityInfo.h:58
CatalogInfo m_catalogs
Gain access to the catalogInfo class.
Definition: FacilityInfo.h:87
const std::vector< std::string > & archiveSearch() const
Return the archive search interface names.
Definition: FacilityInfo.h:56
const std::string m_name
facility name
Definition: FacilityInfo.h:88
bool m_noFilePrefix
flag indicating if prefix is required in file names
Definition: FacilityInfo.h:95
const CatalogInfo & catalogInfo() const
Returns the catalogInfo class.
Definition: FacilityInfo.h:65
int m_zeroPadding
default zero padding for this facility
Definition: FacilityInfo.h:90
bool noFilePrefix() const
Returns a bool indicating whether prefix is required in file names.
Definition: FacilityInfo.h:68
std::vector< std::string > m_archiveSearch
names of the archive search interface
Definition: FacilityInfo.h:93
std::vector< InstrumentInfo > m_instruments
list of instruments of this facility
Definition: FacilityInfo.h:94
size_t m_multiFileLimit
the multiple file limit
Definition: FacilityInfo.h:96
void fillHTTPProxy(const Poco::XML::Element *elem)
const std::string & name() const
Return the name of the facility.
Definition: FacilityInfo.h:41
std::string m_delimiter
default delimiter between instrument name and run number
Definition: FacilityInfo.h:91
const std::string & delimiter() const
Returns the default delimiter between instrument name and run number.
Definition: FacilityInfo.h:46
const std::string & timezone() const
Returns the time zone designation compatible with pytz.
Definition: FacilityInfo.h:53
A class that holds information about an instrument.
Helper class which provides the Collimation Length for SANS instruments.
Definition: Algorithm.h:30