Fixposition SDK 0.0.0-heads/main-0-gfaec355
Collection of c++ libraries and apps for use with Fixposition products
Loading...
Searching...
No Matches
fpsdk::common::types Namespace Reference

Common types. More...

Classes

class  NoCopyNoMove
 Base class to prevent copy or move. More...
 

Functions

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value, T>::type>
constexpr std::underlying_type< T >::type EnumToVal (T enum_val)
 Convert enum class constant to the underlying integral type value.
 
template<typename T >
constexpr std::size_t NumOf (const T &arr)
 Get number of elements in array variable.
 
template<typename T >
constexpr std::size_t NumOf ()
 Get number of elements in array type.
 

Detailed Description

Common types.

Function Documentation

◆ EnumToVal()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value, T>::type>
std::underlying_type< T >::type fpsdk::common::types::EnumToVal ( T enum_val)
constexpr

Convert enum class constant to the underlying integral type value.

Template Parameters
TThe enum class type
Parameters
[in]enum_valThe enum constant
Returns
the integral value of the enum constant as the value of the underlying type

Definition at line 47 of file types.hpp.

Referenced by fpsdk::common::gnss::GnssSvNrBandSignalToSatSig(), and fpsdk::common::gnss::GnssSvNrToSat().

◆ NumOf() [1/2]

template<typename T >
std::size_t fpsdk::common::types::NumOf ( const T & arr)
constexpr

Get number of elements in array variable.

Template Parameters
TArray type
Parameters
[in]arrThe array
Returns
the number of elements in arr
std::array<int, 5> a5;
const std::size_t n6 = NumOf(a6); // = 5, same as a.size(), but works compile-time
int a3[3];
const std::size_t n3 = NumOf(a3); // = 3, works compile-time
constexpr std::size_t NumOf()
Get number of elements in array type.
Definition types.hpp:86

Definition at line 68 of file types.hpp.

◆ NumOf() [2/2]

template<typename T >
std::size_t fpsdk::common::types::NumOf ( )
constexpr

Get number of elements in array type.

Template Parameters
TArray type
Returns
the number of elements in the array
using Arr5 = std::array<int, 5>;
const std::size_t n6 = NumOf<Arr5>(); // = 5, works compile-time

Definition at line 86 of file types.hpp.