MIP_SDK
v3.0.0-192-g8bd7933
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
27 template<
class T>
struct ParamType<T, typename std::enable_if<std::is_enum<T>::value, T>::type> {
static constexpr
inline auto value =
Type::ENUM; };
29 template<
class T>
struct ParamType<T, typename std::enable_if<std::is_union<T>::value, T>::type> {
static constexpr
inline auto value =
Type::UNION; };
69 template<
class Field,
class T, auto Ptr>
73 #ifdef MICROSTRAIN_HAS_OPTIONAL
89 default:
return std::nullopt;
92 #endif // MICROSTRAIN_HAS_OPTIONAL
175 default:
return nullptr;
213 return sizeof(uint8_t);
217 return sizeof(int8_t);
221 return sizeof(uint16_t);
225 return sizeof(int16_t);
229 return sizeof(uint32_t);
233 return sizeof(int32_t);
237 return sizeof(uint64_t);
241 return sizeof(int64_t);
245 return sizeof(float);
249 return sizeof(double);
271 size_t total_size = 0;
291 size_t highest_size = 0;
304 if (param_size > highest_size)
306 highest_size = param_size;
333 return alignof(char);
337 return alignof(bool);
341 return alignof(uint8_t);
345 return alignof(int8_t);
349 return alignof(uint16_t);
353 return alignof(int16_t);
357 return alignof(uint32_t);
361 return alignof(int32_t);
365 return alignof(uint64_t);
369 return alignof(int64_t);
373 return alignof(float);
377 return alignof(double);
400 size_t highest_alignment = 0;
404 return highest_alignment;
413 if (param_alignment > highest_alignment)
415 highest_alignment = param_alignment;
420 return highest_alignment;
436 const size_t align_offset = current_offset % align;
438 if (align_offset != 0)
440 current_offset += align - align_offset;
460 size_t check_offset = 0;
466 if (offset == check_offset)
471 if (offset < check_offset)
500 switch (base_param->type.type)
509 const UnionInfo* union_info =
static_cast<const UnionInfo*
>(base_param->type.infoPtr);
541 if (strcmp(param.
name, param_name) == 0)
563 #define GET_MIP_METADATA_NESTED_PARAM_INFO(MemberParameter, NestedMemberField) \
564 mip::metadata::utils::getParameterInfoForMember(mip::metadata::MetadataFor<decltype(MemberParameter)>::value, #NestedMemberField, \
565 offsetof(decltype(MemberParameter), NestedMemberField)) // Dummy entry to allow offsetof to check the member exists
578 #define GET_MIP_METADATA_PARAM_INFO(MipType, MemberField) \
579 mip::metadata::utils::getParameterInfoForMember(mip::metadata::MetadataFor<MipType>::value, #MemberField, \
580 offsetof(MipType, MemberField)) // Dummy entry to allow offsetof to check the member exists
constexpr pointer data() const noexcept
Definition: span.hpp:64
std::enable_if< isField< T >::value, T > EnableForFieldTypes
Definition: mip_descriptors.hpp:56
constexpr size_t size() const noexcept
Definition: span.hpp:66
Implementation of std::span from C++20.
Definition: span.hpp:41
A dummy struct which is used to mark bitfield objects.
Definition: mip_descriptors.hpp:61