AARE
Data analysis library for PSI hybrid detectors
Loading...
Searching...
No Matches
core
include
aare
core
DType.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <cstdint>
3
#include <string>
4
#include <typeinfo>
5
6
namespace
aare
{
7
8
enum class
endian
{
9
#ifdef _WIN32
10
little
= 0,
11
big
= 1,
12
native
=
little
13
#else
14
little
= __ORDER_LITTLE_ENDIAN__,
15
big
= __ORDER_BIG_ENDIAN__,
16
native
= __BYTE_ORDER__
17
#endif
18
};
19
20
class
DType
{
21
// TODO! support for non native endianess?
22
static_assert
(
sizeof
(long) ==
sizeof
(int64_t),
"long should be 64bits"
);
23
24
public
:
25
enum
TypeIndex
{
INT8
,
UINT8
,
INT16
,
UINT16
,
INT32
,
UINT32
,
INT64
,
UINT64
,
FLOAT
,
DOUBLE
,
ERROR
};
26
27
uint8_t
bitdepth
()
const
;
28
29
explicit
DType
(
const
std::type_info &t);
30
explicit
DType
(std::string_view sv);
31
32
// not explicit to allow conversions form enum to DType
33
DType
(
DType::TypeIndex
ti);
34
35
bool
operator==
(
const
DType
&other)
const
noexcept
;
36
bool
operator!=
(
const
DType
&other)
const
noexcept
;
37
bool
operator==
(
const
std::type_info &t)
const
;
38
bool
operator!=
(
const
std::type_info &t)
const
;
39
40
// bool operator==(DType::TypeIndex ti) const;
41
// bool operator!=(DType::TypeIndex ti) const;
42
std::string
str
()
const
;
43
44
private
:
45
TypeIndex
m_type
{
TypeIndex::ERROR
};
46
};
47
48
}
// namespace aare
aare::DType
Definition
DType.hpp:20
aare::DType::m_type
TypeIndex m_type
Definition
DType.hpp:45
aare::DType::str
std::string str() const
Definition
DType.cpp:104
aare::DType::operator==
bool operator==(const DType &other) const noexcept
Definition
DType.cpp:139
aare::DType::bitdepth
uint8_t bitdepth() const
Definition
DType.cpp:36
aare::DType::operator!=
bool operator!=(const DType &other) const noexcept
Definition
DType.cpp:140
aare::DType::TypeIndex
TypeIndex
Definition
DType.hpp:25
aare::DType::ERROR
@ ERROR
Definition
DType.hpp:25
aare::DType::UINT16
@ UINT16
Definition
DType.hpp:25
aare::DType::UINT8
@ UINT8
Definition
DType.hpp:25
aare::DType::FLOAT
@ FLOAT
Definition
DType.hpp:25
aare::DType::UINT64
@ UINT64
Definition
DType.hpp:25
aare::DType::DOUBLE
@ DOUBLE
Definition
DType.hpp:25
aare::DType::INT32
@ INT32
Definition
DType.hpp:25
aare::DType::INT16
@ INT16
Definition
DType.hpp:25
aare::DType::UINT32
@ UINT32
Definition
DType.hpp:25
aare::DType::INT8
@ INT8
Definition
DType.hpp:25
aare::DType::INT64
@ INT64
Definition
DType.hpp:25
aare
Frame class to represent a single frame of data model class should be able to work with streams comin...
Definition
CircularFifo.hpp:11
aare::endian
endian
Definition
DType.hpp:8
aare::endian::native
@ native
aare::endian::little
@ little
aare::endian::big
@ big
Generated by
1.9.7