Mantid
Loading...
Searching...
No Matches
Framework
PythonInterface
core
inc
MantidPythonInterface
core
Converters
ContainerDtype.h
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 +
7
#pragma once
8
9
#include <string>
10
#include <type_traits>
11
22
namespace
Mantid
{
23
namespace
PythonInterface {
24
namespace
Converters
{
25
26
// Free function to determine data type being stored in container
27
template
<
template
<
class
>
class
Container
,
typename
HeldType> std::string
dtype
(
const
Container<HeldType>
&) {
28
if
(std::is_same<HeldType, bool>::value) {
29
return
"b"
;
30
}
else
if
(std::is_integral<HeldType>::value) {
31
return
"i"
;
32
}
else
if
(std::is_floating_point<HeldType>::value) {
33
return
"f"
;
34
}
else
{
35
return
"O"
;
36
}
37
}
38
39
}
// namespace Converters
40
}
// namespace PythonInterface
41
}
// namespace Mantid
Mantid::Geometry::Container
Models a Container is used to hold a sample in the beam.
Definition
Container.h:24
Mantid::PythonInterface::Converters
Definition
CArrayToNDArray.h:13
Mantid::PythonInterface::Converters::dtype
std::string dtype(const Container< HeldType > &)
Definition
ContainerDtype.h:27
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition
AbsorptionCorrection.h:18
Generated by
1.9.8