Classes | Public Types | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
uavcan::IntegerSpec< BitLen_, Signedness, CastMode > Class Template Reference

#include <integer_spec.hpp>

Classes

struct  LimitsImpl64
 
struct  LimitsImplGeneric
 

Public Types

enum  { IsSigned = Signedness == SignednessSigned }
 
enum  { BitLen = BitLen_ }
 
enum  { MinBitLen = BitLen }
 
enum  { MaxBitLen = BitLen }
 
enum  { IsPrimitive = 1 }
 
typedef Select<(BitLen<=8), typename Select< IsSigned, int8_t, uint8_t >::Result, typename Select<(BitLen<=16), typename Select< IsSigned, int16_t, uint16_t >::Result, typename Select<(BitLen<=32), typename Select< IsSigned, int32_t, uint32_t >::Result, typename Select<(BitLen<=64), typename Select< IsSigned, int64_t, uint64_t >::Result, ErrorNoSuchInteger >::Result >::Result >::Result >::Result StorageType
 
typedef IntegerSpec< BitLen, SignednessUnsigned, CastMode >::StorageType UnsignedStorageType
 

Static Public Member Functions

static int decode (StorageType &out_value, ScalarCodec &codec, TailArrayOptimizationMode)
 
static int encode (StorageType value, ScalarCodec &codec, TailArrayOptimizationMode)
 
static void extendDataTypeSignature (DataTypeSignature &)
 
static UnsignedStorageType mask ()
 
static StorageType max ()
 
static StorageType min ()
 

Private Types

typedef Select<(BitLen==64), LimitsImpl64, LimitsImplGeneric >::Result Limits
 

Private Member Functions

 IntegerSpec ()
 

Static Private Member Functions

static void saturate (StorageType &value)
 
static void truncate (StorageType &value)
 
static void validate ()
 

Detailed Description

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
class uavcan::IntegerSpec< BitLen_, Signedness, CastMode >

This template will be used for signed and unsigned integers more than 1 bit long. There are explicit specializations for booleans below.

Definition at line 24 of file integer_spec.hpp.

Member Typedef Documentation

◆ Limits

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
typedef Select<(BitLen == 64), LimitsImpl64, LimitsImplGeneric>::Result uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::Limits
private

Definition at line 76 of file integer_spec.hpp.

◆ StorageType

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
typedef Select<(BitLen <= 8), typename Select<IsSigned, int8_t, uint8_t>::Result, typename Select<(BitLen <= 16), typename Select<IsSigned, int16_t, uint16_t>::Result, typename Select<(BitLen <= 32), typename Select<IsSigned, int32_t, uint32_t>::Result, typename Select<(BitLen <= 64), typename Select<IsSigned, int64_t, uint64_t>::Result, ErrorNoSuchInteger>::Result>::Result>::Result>::Result uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::StorageType

Definition at line 39 of file integer_spec.hpp.

◆ UnsignedStorageType

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
typedef IntegerSpec<BitLen, SignednessUnsigned, CastMode>::StorageType uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::UnsignedStorageType

Definition at line 41 of file integer_spec.hpp.

Member Enumeration Documentation

◆ anonymous enum

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
anonymous enum
Enumerator
IsSigned 

Definition at line 29 of file integer_spec.hpp.

◆ anonymous enum

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
anonymous enum
Enumerator
BitLen 

Definition at line 30 of file integer_spec.hpp.

◆ anonymous enum

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
anonymous enum
Enumerator
MinBitLen 

Definition at line 31 of file integer_spec.hpp.

◆ anonymous enum

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
anonymous enum
Enumerator
MaxBitLen 

Definition at line 32 of file integer_spec.hpp.

◆ anonymous enum

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
anonymous enum
Enumerator
IsPrimitive 

Definition at line 33 of file integer_spec.hpp.

Constructor & Destructor Documentation

◆ IntegerSpec()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::IntegerSpec ( )
private

Member Function Documentation

◆ decode()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static int uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::decode ( StorageType out_value,
ScalarCodec codec,
TailArrayOptimizationMode   
)
inlinestatic

Definition at line 125 of file integer_spec.hpp.

◆ encode()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static int uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::encode ( StorageType  value,
ScalarCodec codec,
TailArrayOptimizationMode   
)
inlinestatic

Definition at line 110 of file integer_spec.hpp.

◆ extendDataTypeSignature()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static void uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::extendDataTypeSignature ( DataTypeSignature )
inlinestatic

Definition at line 131 of file integer_spec.hpp.

◆ mask()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static UnsignedStorageType uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::mask ( )
inlinestatic

Definition at line 108 of file integer_spec.hpp.

◆ max()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static StorageType uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::max ( )
inlinestatic

Definition at line 106 of file integer_spec.hpp.

◆ min()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static StorageType uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::min ( )
inlinestatic

Definition at line 107 of file integer_spec.hpp.

◆ saturate()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static void uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::saturate ( StorageType value)
inlinestaticprivate

Definition at line 78 of file integer_spec.hpp.

◆ truncate()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static void uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::truncate ( StorageType value)
inlinestaticprivate

Definition at line 94 of file integer_spec.hpp.

◆ validate()

template<unsigned BitLen_, Signedness Signedness, CastMode CastMode>
static void uavcan::IntegerSpec< BitLen_, Signedness, CastMode >::validate ( )
inlinestaticprivate

Definition at line 96 of file integer_spec.hpp.


The documentation for this class was generated from the following file:


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04