AARE
Data analysis library for PSI hybrid detectors
Loading...
Searching...
No Matches
DType.hpp
Go to the documentation of this file.
1#pragma once
2#include <cstdint>
3#include <string>
4#include <typeinfo>
5
6namespace aare {
7
8enum class endian {
9#ifdef _WIN32
10 little = 0,
11 big = 1,
13#else
14 little = __ORDER_LITTLE_ENDIAN__,
15 big = __ORDER_BIG_ENDIAN__,
16 native = __BYTE_ORDER__
17#endif
18};
19
20class DType {
21 // TODO! support for non native endianess?
22 static_assert(sizeof(long) == sizeof(int64_t), "long should be 64bits");
23
24 public:
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
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:
46};
47
48} // namespace aare
Definition DType.hpp:20
TypeIndex m_type
Definition DType.hpp:45
std::string str() const
Definition DType.cpp:104
bool operator==(const DType &other) const noexcept
Definition DType.cpp:139
uint8_t bitdepth() const
Definition DType.cpp:36
bool operator!=(const DType &other) const noexcept
Definition DType.cpp:140
TypeIndex
Definition DType.hpp:25
@ ERROR
Definition DType.hpp:25
@ UINT16
Definition DType.hpp:25
@ UINT8
Definition DType.hpp:25
@ FLOAT
Definition DType.hpp:25
@ UINT64
Definition DType.hpp:25
@ DOUBLE
Definition DType.hpp:25
@ INT32
Definition DType.hpp:25
@ INT16
Definition DType.hpp:25
@ UINT32
Definition DType.hpp:25
@ INT8
Definition DType.hpp:25
@ INT64
Definition DType.hpp:25
Frame class to represent a single frame of data model class should be able to work with streams comin...
Definition CircularFifo.hpp:11
endian
Definition DType.hpp:8