Mantid
Loading...
Searching...
No Matches
NexusFile_fwd.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "MantidNexus/DllConfig.h"
10#include <iosfwd>
11#include <map>
12#include <string>
13#include <vector>
14
15// forward declare typedefs from hdf5
16typedef int64_t hid_t;
17typedef uint64_t hsize_t;
18typedef int herr_t;
19
28enum class NXaccess : unsigned int { READ = 0x0000u, RDWR = 0x0001u, CREATE5 = 0x0002u };
29
30MANTID_NEXUS_DLL std::ostream &operator<<(std::ostream &os, const NXaccess &value);
31
37enum class NXentrytype : int { group = 0, sds = 1 };
38
45typedef struct {
46 std::string targetAddress; /* address to item to link */
47 NXentrytype linkType; /* HDF5: 0 for group link, 1 for SDS link */
48} NXlink;
49
50/*--------------------------------------------------------------------------*/
51
67class MANTID_NEXUS_DLL NXnumtype {
68public:
69 // first hexadigit: 2 = float, 1 = signed int, 0 = unsigned int, F = special
70 // second hexadigit: width in bytes
71 static unsigned short constexpr FLOAT32 = 0x24u; // 10 0100 = 0x24
72 static unsigned short constexpr FLOAT64 = 0x28u; // 10 1000 = 0x28
73 static unsigned short constexpr INT8 = 0x11u; // 01 0001 = 0x11
74 static unsigned short constexpr INT16 = 0x12u; // 01 0010 = 0x12
75 static unsigned short constexpr INT32 = 0x14u; // 01 0100 = 0x14
76 static unsigned short constexpr INT64 = 0x18u; // 01 1000 = 0x18
77 static unsigned short constexpr UINT8 = 0x01u; // 00 0001 = 0x01
78 static unsigned short constexpr UINT16 = 0x02u; // 00 0010 = 0x02
79 static unsigned short constexpr UINT32 = 0x04u; // 00 0100 = 0x04
80 static unsigned short constexpr UINT64 = 0x08u; // 00 1000 = 0x08
81 static unsigned short constexpr CHAR = 0xF0u; // 11 0000 = 0xF0
82 static unsigned short constexpr BINARY = 0xF1u; // 11 0001 = 0xF1
83 static unsigned short constexpr BAD = 0xFFu; // 11 1111 = 0xFF
84
85private:
86 int m_val;
87 static int validate_val(int const x);
88
89public:
91 NXnumtype(int const val);
92 NXnumtype &operator=(int const);
93 operator int() const;
94 operator std::string() const;
95};
96
97MANTID_NEXUS_DLL std::ostream &operator<<(std::ostream &os, const NXnumtype &value);
98
108enum class NXcompression { CHUNK, NONE, LZW, RLE, HUF };
109
110MANTID_NEXUS_DLL std::ostream &operator<<(std::ostream &os, const NXcompression &value);
111
112// forward declare
113namespace Mantid::Nexus {
114
116typedef std::vector<dimsize_t> DimVector;
117
118typedef std::pair<std::string, std::string> Entry;
119typedef std::map<std::string, std::string> Entries;
120
132
138struct AttrInfo {
142 std::size_t length;
144 std::string name;
145};
146
148class File;
149} // namespace Mantid::Nexus
150
151constexpr std::size_t NX_MAXRANK(32);
152constexpr Mantid::Nexus::dimsize_t NX_UNLIMITED(-1); // AKA max of unsigned long, equivalent to H5S_UNLIMITED
double value
The value of the point.
Definition FitMW.cpp:51
int64_t hid_t
This class defines data types which are used as part of the Nexus API.
constexpr Mantid::Nexus::dimsize_t NX_UNLIMITED(-1)
constexpr std::size_t NX_MAXRANK(32)
NXaccess
Nexus file access codes.
NXcompression
The available compression types:
int herr_t
uint64_t hsize_t
NXentrytype
Describes the type of entry in a Nexus file, either group or dataset.
MANTID_NEXUS_DLL std::ostream & operator<<(std::ostream &os, const NXaccess &value)
The primitive types published by this API.
NXnumtype(int const val)
static int validate_val(int const x)
NXnumtype & operator=(int const)
Header for a base Nexus::Exception.
std::map< std::string, std::string > Entries
std::vector< dimsize_t > DimVector
std::pair< std::string, std::string > Entry
Information about an attribute.
NXnumtype type
The primitive type for the attribute.
std::string name
The name of the attribute.
std::size_t length
The length of the attribute.
This structure holds the type and dimensions of a primative field/array.
DimVector dims
The dimensions of the file.
NXnumtype type
The primative type for the field.