#include <scalar_codec.hpp>
Public Member Functions | |
template<unsigned BitLen, typename T > | |
int | decode (T &value) |
template<unsigned BitLen, typename T > | |
int | encode (const T value) |
ScalarCodec (BitStream &stream) | |
Private Member Functions | |
int | decodeBytesImpl (uint8_t *bytes, unsigned bitlen) |
int | encodeBytesImpl (uint8_t *bytes, unsigned bitlen) |
template<unsigned BitLen, typename T > | |
void | validate () |
Static Private Member Functions | |
template<unsigned BitLen, typename T > | |
static EnableIf<((sizeof(T) *8)==BitLen)>::Type | clearExtraBits (T &) |
template<unsigned BitLen, typename T > | |
static EnableIf<((sizeof(T) *8) > BitLen)>::Type | clearExtraBits (T &value) |
template<unsigned BitLen, unsigned Size> | |
static EnableIf<(BitLen<=8)>::Type | convertByteOrder (uint8_t(&)[Size]) |
template<unsigned BitLen, unsigned Size> | |
static EnableIf<(BitLen > 8)>::Type | convertByteOrder (uint8_t(&bytes)[Size]) |
template<unsigned BitLen, typename T > | |
static EnableIf<!static_cast< bool >NumericTraits< T >::IsSigned)||((sizeof(T) *8)==BitLen)>::Type | fixTwosComplement (T &) |
template<unsigned BitLen, typename T > | |
static EnableIf< static_cast< bool >NumericTraits< T >::IsSigned) &&((sizeof(T) *8) > BitLen)>::Type | fixTwosComplement (T &value) |
static void | swapByteOrder (uint8_t *bytes, unsigned len) |
Private Attributes | |
BitStream & | stream_ |
This class implements fast encoding/decoding of primitive type scalars into/from bit arrays. It uses the compile-time type information to eliminate run-time operations where possible.
Definition at line 20 of file scalar_codec.hpp.
|
inlineexplicit |
Definition at line 85 of file scalar_codec.hpp.
|
inlinestaticprivate |
Definition at line 71 of file scalar_codec.hpp.
|
inlinestaticprivate |
Definition at line 64 of file scalar_codec.hpp.
|
inlinestaticprivate |
Definition at line 45 of file scalar_codec.hpp.
|
inlinestaticprivate |
Definition at line 28 of file scalar_codec.hpp.
int uavcan::ScalarCodec::decode | ( | T & | value | ) |
Definition at line 114 of file scalar_codec.hpp.
Definition at line 32 of file uc_scalar_codec.cpp.
int uavcan::ScalarCodec::encode | ( | const T | value | ) |
Definition at line 99 of file scalar_codec.hpp.
Definition at line 21 of file uc_scalar_codec.cpp.
|
inlinestaticprivate |
Definition at line 60 of file scalar_codec.hpp.
|
inlinestaticprivate |
Definition at line 49 of file scalar_codec.hpp.
|
staticprivate |
Definition at line 10 of file uc_scalar_codec.cpp.
|
inlineprivate |
Definition at line 74 of file scalar_codec.hpp.
|
private |
Definition at line 22 of file scalar_codec.hpp.