Mantid
Loading...
Searching...
No Matches
FacilityInfo.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8#include <boost/python/class.hpp>
9#include <boost/python/copy_const_reference.hpp>
10#include <boost/python/register_ptr_to_python.hpp>
11
14using namespace boost::python;
15
17
18 register_ptr_to_python<FacilityInfo *>();
19
20 class_<FacilityInfo>("FacilityInfo", no_init)
21 .def("name", &FacilityInfo::name, arg("self"), return_value_policy<copy_const_reference>(),
22 "Returns name of the facility as definined in the Facilities.xml "
23 "file")
24 .def("__str__", &FacilityInfo::name, arg("self"), return_value_policy<copy_const_reference>(),
25 "Returns name of the facility as definined in the Facilities.xml "
26 "file")
27 .def("zeroPadding", &FacilityInfo::zeroPadding, arg("self"), "Returns default zero padding for this facility")
28 .def("delimiter", &FacilityInfo::delimiter, arg("self"), return_value_policy<copy_const_reference>(),
29 "Returns the delimiter between the instrument name and the run "
30 "number.")
31 .def("extensions", &FacilityInfo::extensions, arg("self"),
32 "Returns the list of file extensions that are considered as "
33 "instrument data files.")
34 .def("preferredExtension", &FacilityInfo::preferredExtension, arg("self"),
35 return_value_policy<copy_const_reference>(), "Returns the extension that is preferred for this facility")
36 .def("timezone", &FacilityInfo::timezone, arg("self"), return_value_policy<copy_const_reference>(),
37 "Returns the timezone appropriate for the facility. If there is not "
38 "a timezone specified this returns an empty string.")
39 .def("archiveSearch", &FacilityInfo::archiveSearch, arg("self"), return_value_policy<copy_const_reference>(),
40 "Return the archive search interface names")
41 .def("instruments", (const std::vector<InstrumentInfo> &(FacilityInfo::*)() const) & FacilityInfo::instruments,
42 arg("self"), return_value_policy<copy_const_reference>(),
43 "Returns a list of instruments of this facility as defined in the "
44 "Facilities.xml file")
45 .def("instruments",
46 (std::vector<InstrumentInfo>(FacilityInfo::*)(const std::string &) const) & FacilityInfo::instruments,
47 (arg("self"), arg("technique")), "Returns a list of instruments of given technique")
48 .def("instrument", &FacilityInfo::instrument, (arg("self"), arg("instrumentName")),
49 return_value_policy<copy_const_reference>(), "Returns the instrument with the given name");
50}
void export_FacilityInfo()
A class that holds information about a facility.
Definition: FacilityInfo.h:36
const std::vector< std::string > extensions() const
Returns a list of file extensions.
Definition: FacilityInfo.h:48
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
const std::vector< std::string > & archiveSearch() const
Return the archive search interface names.
Definition: FacilityInfo.h:56
const std::string & name() const
Return the name of the facility.
Definition: FacilityInfo.h:41
const InstrumentInfo & instrument(std::string iName="") const
Returns instruments with given name.
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.