Mantid
Loading...
Searching...
No Matches
Namespaces | Macros | Enumerations | Functions
NexusIOHelper.h File Reference
#include "MantidNexus/NexusFile.h"
#include <algorithm>
#include <boost/any.hpp>
#include <cstdint>
#include <numeric>
#include <string>
#include <utility>

Go to the source code of this file.

Namespaces

namespace  Mantid
 Helper class which provides the Collimation Length for SANS instruments.
 
namespace  Mantid::Nexus
 Header for a base Nexus::Exception.
 
namespace  Mantid::Nexus::IOHelper
 

Macros

#define RUN_NEXUSIOHELPER_FUNCTION(narrow, type, func_name, ...)
 Macro to run a function depending on the type of data in the Nexus file.
 

Enumerations

enum class  Mantid::Nexus::IOHelper::Narrowing : bool { Mantid::Nexus::IOHelper::Allow = true , Mantid::Nexus::IOHelper::Prevent = false }
 

Functions

template<typename T , Narrowing narrow = Narrowing::Prevent>
std::vector< T > Mantid::Nexus::IOHelper::readNexusSlab (Nexus::File &file, const std::string &entry, DimVector const &start, DimVector const &size)
 Opens the data group if needed, finds the data type, and calls readNexusAnySlab via the RUN_NEXUSIOHELPER_FUNCTION macro.
 
template<typename T , Narrowing narrow = Narrowing::Prevent>
void Mantid::Nexus::IOHelper::readNexusSlab (std::vector< T > &out, Nexus::File &file, const std::string &entry, DimVector const &start, DimVector const &size)
 Opens the data group if needed, finds the data type, and calls readNexusAnySlab via the RUN_NEXUSIOHELPER_FUNCTION macro.
 
template<typename T , Narrowing narrow = Narrowing::Prevent>
Mantid::Nexus::IOHelper::readNexusValue (Nexus::File &file, const std::string &entry="")
 
template<typename T , Narrowing narrow = Narrowing::Prevent>
std::vector< T > Mantid::Nexus::IOHelper::readNexusVector (Nexus::File &file, const std::string &entry="")
 Opens the data group if needed, finds the data type, computes the data size, and calls readNexusAnyVector via the RUN_NEXUSIOHELPER_FUNCTION macro.
 
template<typename T , Narrowing narrow = Narrowing::Prevent>
void Mantid::Nexus::IOHelper::readNexusVector (std::vector< T > &out, Nexus::File &file, const std::string &entry="")
 Opens the data group if needed, finds the data type, computes the data size, and calls readNexusAnyVector via the RUN_NEXUSIOHELPER_FUNCTION macro.
 

Macro Definition Documentation

◆ RUN_NEXUSIOHELPER_FUNCTION

#define RUN_NEXUSIOHELPER_FUNCTION (   narrow,
  type,
  func_name,
  ... 
)
Value:
switch (type) { \
return func_name<T, float, narrow>(__VA_ARGS__); \
return func_name<T, double, narrow>(__VA_ARGS__); \
return func_name<T, int8_t, narrow>(__VA_ARGS__); \
return func_name<T, uint8_t, narrow>(__VA_ARGS__); \
return func_name<T, int16_t, narrow>(__VA_ARGS__); \
return func_name<T, uint16_t, narrow>(__VA_ARGS__); \
return func_name<T, int32_t, narrow>(__VA_ARGS__); \
return func_name<T, uint32_t, narrow>(__VA_ARGS__); \
return func_name<T, int64_t, narrow>(__VA_ARGS__); \
return func_name<T, uint64_t, narrow>(__VA_ARGS__); \
default: \
std::string msg = "NexusIOHelper: Unknown type " + std::to_string((int)type) + " in Nexus file"; \
throw std::runtime_error(msg); \
}
static unsigned short constexpr UINT16
static unsigned short constexpr UINT64
static unsigned short constexpr INT8
static unsigned short constexpr INT64
static unsigned short constexpr INT16
static unsigned short constexpr UINT32
static unsigned short constexpr UINT8
static unsigned short constexpr INT32
static unsigned short constexpr FLOAT32
static unsigned short constexpr FLOAT64
std::string to_string(const wide_integer< Bits, Signed > &n)

Macro to run a function depending on the type of data in the Nexus file.

Definition at line 25 of file NexusIOHelper.h.