Hermes
math_element.h
Go to the documentation of this file.
1 
32 #ifndef HERMES_GEOMETRY_MATH_ELEMENT_H
33 #define HERMES_GEOMETRY_MATH_ELEMENT_H
34 
35 #include <hermes/common/defs.h>
37 
38 namespace hermes {
39 
43 template<typename NUMERIC_TYPE, u64 COMPONENT_COUNT>
44 class MathElement {
45 public:
47  static NUMERIC_TYPE numeric_data;
50  static inline constexpr u64 componentCount() { return COMPONENT_COUNT; };
53  static inline constexpr u64 numericTypeSizeInBytes() { return sizeof(NUMERIC_TYPE); };
57  return {
58  .offset = 0,
59  .field_size_in_bytes = sizeof(NUMERIC_TYPE),
60  .count = COMPONENT_COUNT,
62  .sub_regions = {},
63  .type = DataTypes::typeFrom<NUMERIC_TYPE>()
64  };
65  }
66 };
67 
68 }
69 
70 #endif //HERMES_GEOMETRY_MATH_ELEMENT_H
71 
static char default_color[6]
"\e[39m"
Definition: console_colors.h:61
Interface used by all basic geometric entities.
Definition: math_element.h:44
static constexpr u64 componentCount()
Gets the number of dimensional components.
Definition: math_element.h:50
static MemoryDumper::RegionLayout memoryDumpLayout()
Gets memory layout.
Definition: math_element.h:56
static constexpr u64 numericTypeSizeInBytes()
Gets the size in bytes of underlying data type.
Definition: math_element.h:53
static NUMERIC_TYPE numeric_data
Underlying data type.
Definition: math_element.h:47
Data type definitions.
uint64_t u64
64 bit size unsigned integer type
Definition: defs.h:89
Memory region description.
Definition: memory_dump.h:97
std::size_t offset
Layout offset in bytes.
Definition: memory_dump.h:197