Namespaces | |
are_close_impl_ | |
dynamic_node_id_server | |
Typedefs | |
typedef char | _alignment_check_for_MEM_POOL_BLOCK_SIZE[((MemPoolBlockSize &(MemPoolAlignment - 1))==0) ? 1 :-1] |
typedef uint16_t | CanIOFlags |
typedef BooleanType< false > | FalseType |
typedef std::int16_t | int16_t |
typedef std::int32_t | int32_t |
typedef std::int64_t | int64_t |
typedef std::int8_t | int8_t |
typedef TimerEventForwarder< std::function< void(const TimerEvent &event)> > | Timer |
typedef BooleanType< true > | TrueType |
typedef std::uint16_t | uint16_t |
typedef std::uint32_t | uint32_t |
typedef std::uint64_t | uint64_t |
typedef std::uint8_t | uint8_t |
Enumerations | |
enum | { MaxCanIfaces = 3 } |
enum | ArrayMode { ArrayModeStatic, ArrayModeDynamic } |
enum | CastMode { CastModeSaturate, CastModeTruncate } |
enum | DataTypeKind { DataTypeKindService, DataTypeKindMessage } |
enum | Signedness { SignednessUnsigned, SignednessSigned } |
enum | TailArrayOptimizationMode { TailArrayOptDisabled, TailArrayOptEnabled } |
enum | TransferType { TransferTypeServiceResponse = 0, TransferTypeServiceRequest = 1, TransferTypeMessageBroadcast = 2 } |
Functions | |
template<typename L , typename R > | |
UAVCAN_EXPORT bool | areClose (const L &left, const R &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< double, double > (const double &left, const double &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< double, float > (const double &left, const float &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< double, long double > (const double &left, const long double &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< float, double > (const float &left, const double &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< float, float > (const float &left, const float &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< float, long double > (const float &left, const long double &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< long double, double > (const long double &left, const double &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< long double, float > (const long double &left, const float &right) |
template<> | |
UAVCAN_EXPORT bool | areClose< long double, long double > (const long double &left, const long double &right) |
template<typename T > | |
UAVCAN_EXPORT bool | areFloatsClose (T a, T b, const T &absolute_epsilon, const T &relative_epsilon) |
template<typename T > | |
UAVCAN_EXPORT bool | areFloatsExactlyEqual (const T &left, const T &right) |
void | bitarrayCopy (const unsigned char *src_org, std::size_t src_offset, std::size_t src_len, unsigned char *dst_org, std::size_t dst_offset) |
template<int OFFSET, int WIDTH> | |
static uint32_t | bitpack (uint32_t field) |
template<int OFFSET, int WIDTH> | |
static uint32_t | bitunpack (uint32_t val) |
static int | configureCanAcceptanceFilters (INode &node, CanAcceptanceFilterConfigurator::AnonymousMessages mode=CanAcceptanceFilterConfigurator::AcceptAnonymousMessages) |
template<typename InputIt , typename OutputIt > | |
UAVCAN_EXPORT OutputIt | copy (InputIt first, InputIt last, OutputIt result) |
template<typename InputIt1 , typename InputIt2 > | |
UAVCAN_EXPORT bool | equal (InputIt1 first1, InputIt1 last1, InputIt2 first2) |
template<typename ForwardIt , typename T > | |
UAVCAN_EXPORT void | fill (ForwardIt first, ForwardIt last, const T &value) |
template<typename OutputIt , typename T > | |
UAVCAN_EXPORT void | fill_n (OutputIt first, std::size_t n, const T &value) |
static DataTypeKind | getDataTypeKindForTransferType (const TransferType tt) |
template<typename T > | |
bool | getSignBit (T arg) |
UAVCAN_EXPORT void | handleFatalError (const char *msg) |
template<typename T > | |
UAVCAN_EXPORT bool | isCloseToZero (const T &x) |
template<> | |
UAVCAN_EXPORT bool | isCloseToZero< double > (const double &x) |
template<> | |
UAVCAN_EXPORT bool | isCloseToZero< float > (const float &x) |
template<> | |
UAVCAN_EXPORT bool | isCloseToZero< long double > (const long double &x) |
template<typename T > | |
bool | isFinite (T arg) |
template<typename T > | |
bool | isInfinity (T arg) |
template<typename T > | |
bool | isNaN (T arg) |
template<typename InputIt1 , typename InputIt2 > | |
UAVCAN_EXPORT bool | lexicographical_compare (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) |
template<typename T > | |
const UAVCAN_EXPORT T & | max (const T &a, const T &b) |
template<typename T > | |
const UAVCAN_EXPORT T & | min (const T &a, const T &b) |
template<typename R , typename T , ArrayMode ArrayMode, unsigned MaxSize> | |
UAVCAN_EXPORT EnableIf<!IsSameType< R, Array< T, ArrayMode, MaxSize > >::Result, bool >::Type | operator!= (const R &rhs, const Array< T, ArrayMode, MaxSize > &lhs) |
OStream & | operator<< (OStream &s, char x) |
OStream & | operator<< (OStream &s, const char *x) |
OStream & | operator<< (OStream &s, double x) |
OStream & | operator<< (OStream &s, float x) |
OStream & | operator<< (OStream &s, int x) |
OStream & | operator<< (OStream &s, long double x) |
OStream & | operator<< (OStream &s, long long x) |
OStream & | operator<< (OStream &s, long x) |
OStream & | operator<< (OStream &s, OStream &(*manip)(OStream &)) |
OStream & | operator<< (OStream &s, short x) |
OStream & | operator<< (OStream &s, unsigned int x) |
OStream & | operator<< (OStream &s, unsigned long long x) |
OStream & | operator<< (OStream &s, unsigned long x) |
OStream & | operator<< (OStream &s, unsigned short x) |
template<typename Stream , std::size_t NumBits> | |
Stream & | operator<< (Stream &s, const BitSet< NumBits > &x) |
template<typename Stream , typename D > | |
UAVCAN_EXPORT Stream & | operator<< (Stream &s, const DurationBase< D > &d) |
template<typename Stream , typename DataType > | |
static Stream & | operator<< (Stream &s, const ReceivedDataStructure< DataType > &rds) |
template<typename Stream , typename DataType > | |
static Stream & | operator<< (Stream &s, const ServiceCallResult< DataType > &scr) |
template<typename Stream , typename T , typename D > | |
UAVCAN_EXPORT Stream & | operator<< (Stream &s, const TimeBase< T, D > &t) |
template<typename R , typename T , ArrayMode ArrayMode, unsigned MaxSize> | |
UAVCAN_EXPORT EnableIf<!IsSameType< R, Array< T, ArrayMode, MaxSize > >::Result, bool >::Type | operator== (const R &rhs, const Array< T, ArrayMode, MaxSize > &lhs) |
int | snprintf (char *out, std::size_t maxlen, const char *format,...) |
Variables | |
static const CanIOFlags | CanIOFlagAbortOnError = 2 |
static const CanIOFlags | CanIOFlagLoopback = 1 |
template<unsigned Value> | |
struct UAVCAN_EXPORT | CompileTimeIntSqrt |
class UAVCAN_EXPORT | Dispatcher |
static const unsigned | FloatComparisonEpsilonMult = 10 |
static const unsigned | GuaranteedPayloadLenPerFrame = 7 |
Guaranteed for all transfers, all CAN standards. More... | |
static const unsigned | MaxCanAcceptanceFilters = 32 |
Default that should be OK for any platform. More... | |
static const unsigned | MemPoolAlignment = 16 |
static const unsigned | MemPoolBlockSize = 64 |
Safe default that should be OK for any platform. More... | |
static const uint8_t | NumDataTypeKinds = 2 |
template<typename T > | |
struct UAVCAN_EXPORT | NumericTraits |
static const uint8_t | NumTransferTypes = 3 |
class UAVCAN_EXPORT | Scheduler |
template<bool Condition, typename TrueType , typename FalseType > | |
struct UAVCAN_EXPORT | Select |
template<bool Value> | |
struct UAVCAN_EXPORT | StaticAssert |
class UAVCAN_EXPORT | TimerBase |
class UAVCAN_EXPORT | TransferCRC |
template<typename T > | |
class UAVCAN_EXPORT | YamlStreamer |
typedef char uavcan::_alignment_check_for_MEM_POOL_BLOCK_SIZE[((MemPoolBlockSize &(MemPoolAlignment - 1))==0) ? 1 :-1] |
Definition at line 237 of file libuavcan/libuavcan/include/uavcan/build_config.hpp.
typedef uint16_t uavcan::CanIOFlags |
Special IO flags.
CanIOFlagLoopback - Send the frame back to RX with true TX timestamps.
CanIOFlagAbortOnError - Abort transmission on first bus error instead of retransmitting. This does not affect the case of arbitration loss, in which case the retransmission will work as usual. This flag is used together with anonymous messages which allows to implement CSMA bus access. Read the spec for details.
Definition at line 140 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
typedef BooleanType<false> uavcan::FalseType |
Definition at line 132 of file templates.hpp.
typedef std::int16_t uavcan::int16_t |
typedef std::int32_t uavcan::int32_t |
typedef std::int64_t uavcan::int64_t |
typedef std::int8_t uavcan::int8_t |
typedef TimerEventForwarder<std::function<void (const TimerEvent& event)> > uavcan::Timer |
typedef BooleanType<true> uavcan::TrueType |
Definition at line 131 of file templates.hpp.
typedef std::uint16_t uavcan::uint16_t |
typedef std::uint32_t uavcan::uint32_t |
typedef std::uint64_t uavcan::uint64_t |
typedef std::uint8_t uavcan::uint8_t |
anonymous enum |
This limit is defined by the specification.
Enumerator | |
---|---|
MaxCanIfaces |
Definition at line 19 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
enum uavcan::ArrayMode |
enum uavcan::CastMode |
Read the specs to learn more about cast modes.
Enumerator | |
---|---|
CastModeSaturate | |
CastModeTruncate |
Definition at line 17 of file type_util.hpp.
enum uavcan::DataTypeKind |
Enumerator | |
---|---|
DataTypeKindService | |
DataTypeKindMessage |
Definition at line 19 of file data_type.hpp.
enum uavcan::Signedness |
Enumerator | |
---|---|
SignednessUnsigned | |
SignednessSigned |
Definition at line 17 of file integer_spec.hpp.
Read the specs to learn more about tail array optimizations.
Enumerator | |
---|---|
TailArrayOptDisabled | |
TailArrayOptEnabled |
Definition at line 22 of file type_util.hpp.
enum uavcan::TransferType |
Enumerator | |
---|---|
TransferTypeServiceResponse | |
TransferTypeServiceRequest | |
TransferTypeMessageBroadcast |
Definition at line 18 of file transfer.hpp.
|
inline |
Generic fuzzy comparison function.
This function properly handles floating point comparison, including mixed floating point type comparison, e.g. float with long double.
Two objects of types A and B will be fuzzy comparable if either method is defined:
Call areClose(A, B) will be dispatched as follows:
Alternatively, a custom behavior can be implemented via template specialization.
See also: UAVCAN_FLOAT_COMPARISON_EPSILON_MULT.
Examples: areClose(1.0, 1.0F) --> true areClose(1.0, 1.0F + std::numeric_limits<float>::epsilon()) --> true areClose(1.0, 1.1) --> false areClose("123", std::string("123")) --> true (using std::string's operator ==) areClose(inf, inf) --> true areClose(inf, -inf) --> false areClose(nan, nan) --> false (any comparison with nan returns false) areClose(123, "123") --> compilation error: operator == is not defined
Definition at line 158 of file comparison.hpp.
|
inline |
Definition at line 177 of file comparison.hpp.
|
inline |
Definition at line 203 of file comparison.hpp.
|
inline |
Definition at line 224 of file comparison.hpp.
|
inline |
Definition at line 196 of file comparison.hpp.
|
inline |
Definition at line 169 of file comparison.hpp.
|
inline |
Definition at line 210 of file comparison.hpp.
|
inline |
Definition at line 231 of file comparison.hpp.
|
inline |
Definition at line 217 of file comparison.hpp.
|
inline |
Definition at line 185 of file comparison.hpp.
|
inline |
This function performs fuzzy comparison of two floating point numbers. Type of T can be either float, double or long double. For details refer to http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ See also: UAVCAN_FLOAT_COMPARISON_EPSILON_MULT.
Definition at line 31 of file comparison.hpp.
|
inline |
Exact comparison of two floats that suppresses the compiler warnings.
Definition at line 18 of file comparison.hpp.
void uavcan::bitarrayCopy | ( | const unsigned char * | src_org, |
std::size_t | src_offset, | ||
std::size_t | src_len, | ||
unsigned char * | dst_org, | ||
std::size_t | dst_offset | ||
) |
This function implements fast copy of unaligned bit arrays. It isn't part of the library API, so it is not exported.
src_org | Source array |
src_offset | Bit offset of the first source byte |
src_len | Number of bits to copy |
dst_org | Destination array |
dst_offset | Bit offset of the first destination byte |
Definition at line 12 of file uc_bit_array_copy.cpp.
Definition at line 103 of file uc_frame.cpp.
Definition at line 26 of file uc_frame.cpp.
UAVCAN_EXPORT To uavcan::coerceOrFallback | ( | const From & | from | ) |
If possible, performs an implicit cast from the type From to the type To. If the cast is not possible, returns a default constructed object of the type To.
Definition at line 184 of file templates.hpp.
UAVCAN_EXPORT To uavcan::coerceOrFallback | ( | const From & | from, |
const To & | default_ | ||
) |
If possible, performs an implicit cast from the type From to the type To. If the cast is not possible, returns default_ of type To.
Definition at line 172 of file templates.hpp.
|
inlinestatic |
This function is a shortcut for CanAcceptanceFilterConfigurator. It allows to compute filter configuration and then apply it in just one step. It implements only the most common use case; if you have special requirements, use CanAcceptanceFilterConfigurator directly.
node | Refer to CanAcceptanceFilterConfigurator constructor for explanation. |
mode | Refer to CanAcceptanceFilterConfigurator::computeConfiguration() for explanation. |
Definition at line 154 of file can_acceptance_filter_configurator.hpp.
UAVCAN_EXPORT OutputIt uavcan::copy | ( | InputIt | first, |
InputIt | last, | ||
OutputIt | result | ||
) |
Replacement for std::copy(..)
Definition at line 238 of file templates.hpp.
UAVCAN_EXPORT bool uavcan::equal | ( | InputIt1 | first1, |
InputIt1 | last1, | ||
InputIt2 | first2 | ||
) |
Replacement for std::equal(..)
Definition at line 324 of file templates.hpp.
UAVCAN_EXPORT void uavcan::fill | ( | ForwardIt | first, |
ForwardIt | last, | ||
const T & | value | ||
) |
Replacement for std::fill(..)
Definition at line 254 of file templates.hpp.
UAVCAN_EXPORT void uavcan::fill_n | ( | OutputIt | first, |
std::size_t | n, | ||
const T & | value | ||
) |
Replacement for std::fill_n(..)
Definition at line 268 of file templates.hpp.
|
inlinestatic |
Definition at line 28 of file data_type.hpp.
|
inline |
Replacement for std::signbit(). Note that direct float comparison (==, !=) is intentionally avoided.
Definition at line 545 of file templates.hpp.
void uavcan::handleFatalError | ( | const char * | msg | ) |
Fatal error handler. Behavior:
Definition at line 20 of file uc_error.cpp.
|
inline |
Comparison against zero. Helps to compare a floating point number against zero if the exact type is unknown. For non-floating point types performs exact comparison against integer zero.
Definition at line 243 of file comparison.hpp.
|
inline |
Definition at line 257 of file comparison.hpp.
|
inline |
Definition at line 250 of file comparison.hpp.
|
inline |
Definition at line 264 of file comparison.hpp.
|
inline |
Replacement for std::isfinite(). Note that direct float comparison (==, !=) is intentionally avoided.
Definition at line 531 of file templates.hpp.
|
inline |
Replacement for std::isinf(). Note that direct float comparison (==, !=) is intentionally avoided.
Definition at line 517 of file templates.hpp.
|
inline |
Replacement for std::isnan(). Note that direct float comparison (==, !=) is intentionally avoided.
Definition at line 501 of file templates.hpp.
UAVCAN_EXPORT bool uavcan::lexicographical_compare | ( | InputIt1 | first1, |
InputIt1 | last1, | ||
InputIt2 | first2, | ||
InputIt2 | last2 | ||
) |
Replacement for std::lexicographical_compare(..)
Definition at line 301 of file templates.hpp.
const UAVCAN_EXPORT T& uavcan::max | ( | const T & | a, |
const T & | b | ||
) |
Replacement for std::max(..)
Definition at line 291 of file templates.hpp.
const UAVCAN_EXPORT T& uavcan::min | ( | const T & | a, |
const T & | b | ||
) |
Replacement for std::min(..)
Definition at line 281 of file templates.hpp.
|
inline |
Definition at line 56 of file ostream.hpp.
Definition at line 57 of file ostream.hpp.
Definition at line 53 of file ostream.hpp.
Definition at line 54 of file ostream.hpp.
Definition at line 46 of file ostream.hpp.
Definition at line 52 of file ostream.hpp.
Definition at line 40 of file ostream.hpp.
Definition at line 43 of file ostream.hpp.
Definition at line 59 of file ostream.hpp.
Definition at line 49 of file ostream.hpp.
Definition at line 47 of file ostream.hpp.
Definition at line 41 of file ostream.hpp.
Definition at line 44 of file ostream.hpp.
Definition at line 50 of file ostream.hpp.
Stream& uavcan::operator<< | ( | Stream & | s, |
const BitSet< NumBits > & | x | ||
) |
Definition at line 178 of file bitset.hpp.
UAVCAN_EXPORT Stream& uavcan::operator<< | ( | Stream & | s, |
const DurationBase< D > & | d | ||
) |
|
static |
This operator neatly prints the data structure prepended with extra data from the transport layer. The extra data will be represented as YAML comment.
Definition at line 85 of file generic_subscriber.hpp.
|
static |
This operator neatly prints the service call result prepended with extra data like Server Node ID. The extra data will be represented as YAML comment.
Definition at line 97 of file service_client.hpp.
UAVCAN_EXPORT Stream& uavcan::operator<< | ( | Stream & | s, |
const TimeBase< T, D > & | t | ||
) |
|
inline |
These operators will only be enabled if rhs and lhs are different types. This precondition allows to work-around the ambiguity arising from the scope containing two definitions: one here and the others in Array<>. Refer to https://github.com/UAVCAN/libuavcan/issues/55 for more info.
|
inline |
Wrapper over the standard snprintf(). This wrapper is needed because different standards and different implementations of C++ do not agree whether snprintf() should be defined in std:: or in ::. The solution is to use 'using namespace std' hack inside the wrapper, so the compiler will be able to pick whatever definition is available in the standard library. Alternatively, the user's application can provide a custom implementation of uavcan::snprintf().
|
static |
Definition at line 142 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
|
static |
Definition at line 141 of file libuavcan/libuavcan/include/uavcan/driver/can.hpp.
struct UAVCAN_EXPORT uavcan::CompileTimeIntSqrt |
Compile time square root for integers. Useful for operations on square matrices.
Definition at line 215 of file templates.hpp.
Definition at line 21 of file dispatcher.hpp.
|
static |
Float comparison precision. For details refer to: http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ https://code.google.com/p/googletest/source/browse/trunk/include/gtest/internal/gtest-internal.h
Definition at line 262 of file libuavcan/libuavcan/include/uavcan/build_config.hpp.
|
static |
Guaranteed for all transfers, all CAN standards.
Definition at line 16 of file transfer.hpp.
|
static |
Default that should be OK for any platform.
Maximum number of CAN acceptance filters available on the platform
Definition at line 273 of file libuavcan/libuavcan/include/uavcan/build_config.hpp.
|
static |
Definition at line 234 of file libuavcan/libuavcan/include/uavcan/build_config.hpp.
|
static |
Safe default that should be OK for any platform.
Memory pool block size.
The default of 64 bytes should be OK for any target arch up to AMD64 and any compiler.
The library leverages compile-time checks to ensure that all types that are subject to dynamic allocation fit this size, otherwise compilation fails.
For platforms featuring small pointer width (16..32 bits), UAVCAN_MEM_POOL_BLOCK_SIZE can often be safely reduced to 56 or even 48 bytes, which leads to lower memory footprint.
Note that the pool block size shall be aligned at biggest alignment of the target platform (detected and checked automatically at compile time).
Definition at line 228 of file libuavcan/libuavcan/include/uavcan/build_config.hpp.
|
static |
Definition at line 25 of file data_type.hpp.
struct UAVCAN_EXPORT uavcan::NumericTraits |
Numeric traits, like std::numeric_limits<>
Definition at line 342 of file templates.hpp.
|
static |
Definition at line 25 of file transfer.hpp.
Definition at line 15 of file scheduler.hpp.
struct UAVCAN_EXPORT uavcan::Select |
Compile-time type selection (Alexandrescu)
Definition at line 80 of file templates.hpp.
struct UAVCAN_EXPORT uavcan::StaticAssert |
Usage: StaticAssert<expression>::check();
Definition at line 29 of file templates.hpp.
Definition at line 17 of file data_type.hpp.
class UAVCAN_EXPORT uavcan::YamlStreamer |
Streams a given value into YAML string. Please see the specializations.
Definition at line 84 of file type_util.hpp.