Mantid
Loading...
Searching...
No Matches
Framework
Kernel
inc
MantidKernel
BinaryStreamReader.h
Go to the documentation of this file.
1
// Mantid Repository : https://github.com/mantidproject/mantid
2
//
3
// Copyright © 2015 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
// Includes
10
//------------------------------------------------------------------------------
11
#include "MantidKernel/DllConfig.h"
12
13
#include <cstdint>
14
#include <iosfwd>
15
#include <string>
16
#include <vector>
17
18
namespace
Mantid
{
19
namespace
Kernel {
20
21
// Forward declarations
22
template
<
typename
T>
class
Matrix;
23
32
class
MANTID_KERNEL_DLL
BinaryStreamReader
{
33
public
:
35
enum class
MatrixOrdering
{ RowMajor, ColumnMajor };
36
37
BinaryStreamReader
(std::istream &istrm);
38
41
BinaryStreamReader
&
operator>>
(int16_t &
value
);
42
BinaryStreamReader
&
operator>>
(int32_t &
value
);
43
BinaryStreamReader
&
operator>>
(int64_t &
value
);
44
BinaryStreamReader
&
operator>>
(
float
&
value
);
45
BinaryStreamReader
&
operator>>
(
double
&
value
);
46
BinaryStreamReader
&
operator>>
(std::string &
value
);
47
BinaryStreamReader
&
operator>>
(uint16_t &
value
);
48
BinaryStreamReader
&
operator>>
(uint32_t &
value
);
50
53
BinaryStreamReader
&read(std::vector<int16_t> &
value
,
const
size_t
nvals);
54
BinaryStreamReader
&read(std::vector<int32_t> &
value
,
const
size_t
nvals);
55
BinaryStreamReader
&read(std::vector<int64_t> &
value
,
const
size_t
nvals);
56
BinaryStreamReader
&read(std::vector<float> &
value
,
const
size_t
nvals);
57
BinaryStreamReader
&read(std::vector<double> &
value
,
const
size_t
nvals);
58
BinaryStreamReader
&read(std::string &
value
,
const
size_t
length);
60
63
BinaryStreamReader
&read(std::vector<std::string> &
value
,
const
std::vector<int32_t> &shape, MatrixOrdering order);
64
BinaryStreamReader
&read(
Kernel::Matrix<float>
&
value
,
const
std::vector<int32_t> &shape, MatrixOrdering order);
65
BinaryStreamReader
&read(
Kernel::Matrix<double>
&
value
,
const
std::vector<int32_t> &shape, MatrixOrdering order);
67
69
void
moveStreamToPosition(
size_t
nbytes);
70
71
private
:
73
std::istream &
m_istrm
;
77
uint64_t
m_strLengthSize
;
78
};
79
80
}
// namespace Kernel
81
}
// namespace Mantid
value
double value
The value of the point.
Definition
FitMW.cpp:51
Mantid::Kernel::BinaryStreamReader
Assists with reading a binary file by providing standard overloads for the istream operators (>>) to ...
Definition
BinaryStreamReader.h:32
Mantid::Kernel::BinaryStreamReader::m_istrm
std::istream & m_istrm
Reference to the stream being read.
Definition
BinaryStreamReader.h:73
Mantid::Kernel::BinaryStreamReader::m_strLengthSize
uint64_t m_strLengthSize
The default size in bytes of the type used to encode the length of a string in the file.
Definition
BinaryStreamReader.h:77
Mantid::Kernel::BinaryStreamReader::MatrixOrdering
MatrixOrdering
Define the ordering of 2D structures in the file.
Definition
BinaryStreamReader.h:35
Mantid::Kernel::Matrix
Numerical Matrix class.
Definition
Matrix.h:42
Mantid
Helper class which provides the Collimation Length for SANS instruments.
Definition
AbsorptionCorrection.h:18
std::operator>>
constexpr wide_integer< Bits, Signed > operator>>(const wide_integer< Bits, Signed > &lhs, T2 n) noexcept
Generated by
1.9.8