mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 06:43:34 +08:00
DataTypeSignature
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <cassert>
|
||||
#include <stdint.h>
|
||||
#include <algorithm>
|
||||
#include <uavcan/internal/transport/crc.hpp>
|
||||
|
||||
namespace uavcan
|
||||
{
|
||||
@@ -60,6 +61,30 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class DataTypeSignature
|
||||
{
|
||||
uint64_t value_;
|
||||
|
||||
void mixin64(uint64_t x);
|
||||
|
||||
DataTypeSignature() : value_(0) { }
|
||||
|
||||
public:
|
||||
static DataTypeSignature zero() { return DataTypeSignature(); }
|
||||
|
||||
explicit DataTypeSignature(uint64_t value) : value_(value) { }
|
||||
|
||||
void extend(DataTypeSignature dts);
|
||||
|
||||
TransferCRC toTransferCRC() const;
|
||||
|
||||
uint64_t get() const { return value_; }
|
||||
|
||||
bool operator==(DataTypeSignature rhs) const { return value_ == rhs.value_; }
|
||||
bool operator!=(DataTypeSignature rhs) const { return !operator==(rhs); }
|
||||
};
|
||||
|
||||
|
||||
struct DataTypeHash
|
||||
{
|
||||
enum { NumBytes = 16 };
|
||||
|
||||
Reference in New Issue
Block a user