33#include <NDEVR/BaseValues.h>
34#include <NDEVR/Vector.h>
35#include <NDEVR/BufferBase.h>
36#include <NDEVR/TypeInfo.h>
37#include <NDEVR/Angle.h>
45 template<
class t_type_a,
class t_type_b>
46 void assign(t_type_a& a,
const t_type_b& b)
55 template<
class t_type_a>
56 void assign(t_type_a& a,
const t_type_a& b)
65 template<u
int01 t_dim_a,
class t_type_a, u
int01 t_dim_b,
class t_type_b>
68 a = b.template as<t_dim_a, t_type_a>();
75 template<
class t_type_a, u
int01 t_dim_b,
class t_type_b>
85 template<
class t_type_a>
86 void assign(t_type_a& a,
const char* b)
97 template<u
int01 t_dim_a,
class t_type_a, u
int01 t_dim_b,
class t_type_b>
109 template<
class t_type_a, u
int01 t_dim_b,
class t_type_b>
149 template<
class t_type>
151 : m_pointer(reinterpret_cast<t_pointer*>(&value))
160 template<
class t_
object_type>
175 : m_pointer(reference.m_pointer)
177 memcpy(m_bits, reference.m_bits,
sizeof(m_bits));
184 template<
class t_type>
185 constexpr void set(
const t_type& value)
187 m_flag(m_bits, value);
194 template<
class t_type>
213 template<
class t_type>
223 template<
class t_type>
232 template<
class t_type>
233 constexpr operator t_type()
const
241 template<
class t_type>
254 template<
class t_type>
257 lib_assert(m_bits->vector_size != 0,
"Not yet ready");
269 template<
class t_type>
272 if (m_bits[level].is_number)
274 if (m_bits[level].is_unsigned)
276 switch (m_bits[level].byte_size)
278 case 1:
assign(value, *(m_pointer->_uint01 + index));
break;
279 case 2:
assign(value, *(m_pointer->_uint02 + index));
break;
280 case 4:
assign(value, *(m_pointer->_uint04 + index));
break;
281 case 8:
assign(value, *(m_pointer->_uint08 + index));
break;
286 if (m_bits[level].is_float)
288 switch (m_bits[level].byte_size)
290 case 4:
assign(value, *(m_pointer->_fltp04 + index));
break;
291 case 8:
assign(value, *(m_pointer->_fltp08 + index));
break;
296 switch (m_bits[level].byte_size)
298 case 1:
assign(value, *(m_pointer->_sint01 + index));
break;
299 case 2:
assign(value, *(m_pointer->_sint02 + index));
break;
300 case 4:
assign(value, *(m_pointer->_sint04 + index));
break;
301 case 8:
assign(value, *(m_pointer->_sint08 + index));
break;
306 else if (m_bits[level].is_string)
308 assign(value, (m_pointer->_char + index));
314 t_pointer*
const m_pointer;
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
Stores information about a type, relevant for certain templated functions.
constexpr VariableReference & operator=(const VariableReference &)
Copy assignment operator.
t_type get() const
Retrieves the referenced value converted to the requested type.
void fillInfoTable(const ObjectInfo< t_object_type > &, uint01 level)
Recursively populates the type info table for the referenced variable, descending into Vector sub-typ...
constexpr bool operator!=(const t_type &b) const
Inequality operator.
void get(t_type &value, uint04 level, uint04 index) const
Retrieves the referenced value into an output variable, using the type hierarchy level and element in...
constexpr VariableReference(t_type &value)
Constructs a VariableReference from a typed variable, storing a pointer to the variable and populatin...
constexpr bool operator==(const t_type &b) const
Equality operator.
constexpr void set(const t_type &value)
Sets the referenced variable to the given value.
void getSingle(t_type &value, uint04 level, uint04 index) const
Reads a single scalar value from the referenced memory by interpreting the raw pointer according to t...
VariableReference(const VariableReference &reference)
Copy constructor.
constexpr VariableReference & operator=(const t_type &b)
Assignment operator.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
uint16_t uint02
-Defines an alias representing a 2 byte, unsigned integer -Can represent exact integer values 0 throu...
constexpr std::enable_if<!ObjectInfo< t_type >::Buffer, TypeInfo >::type GetTypeInfo()
Constructs a TypeInfo for a non-buffer type at compile time using ObjectInfo traits.
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
int16_t sint02
-Defines an alias representing a 2 byte, signed integer.
int32_t sint04
-Defines an alias representing a 4 byte, signed integer.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
void assign(t_type_a &a, const t_type_b &b)
Assigns a value of one type to a variable of another type using a cast.
int8_t sint01
-Defines an alias representing a 1 byte, signed integer.
int64_t sint08
-Defines an alias representing an 8 byte, signed integer -Can represent exact integer values -9223372...
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.
Information about the object.