mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 01:23:34 +08:00
Explicit virtual keyword
This commit is contained in:
@@ -53,13 +53,13 @@ public:
|
||||
|
||||
bool addPool(IPoolAllocator* pool);
|
||||
|
||||
void* allocate(std::size_t size);
|
||||
void deallocate(const void* ptr);
|
||||
virtual void* allocate(std::size_t size);
|
||||
virtual void deallocate(const void* ptr);
|
||||
|
||||
bool isInPool(const void* ptr) const;
|
||||
virtual bool isInPool(const void* ptr) const;
|
||||
|
||||
std::size_t getBlockSize() const;
|
||||
std::size_t getNumBlocks() const;
|
||||
virtual std::size_t getBlockSize() const;
|
||||
virtual std::size_t getNumBlocks() const;
|
||||
};
|
||||
|
||||
|
||||
@@ -86,13 +86,13 @@ public:
|
||||
|
||||
PoolAllocator();
|
||||
|
||||
void* allocate(std::size_t size);
|
||||
void deallocate(const void* ptr);
|
||||
virtual void* allocate(std::size_t size);
|
||||
virtual void deallocate(const void* ptr);
|
||||
|
||||
bool isInPool(const void* ptr) const;
|
||||
virtual bool isInPool(const void* ptr) const;
|
||||
|
||||
std::size_t getBlockSize() const { return BlockSize; }
|
||||
std::size_t getNumBlocks() const { return NumBlocks; }
|
||||
virtual std::size_t getBlockSize() const { return BlockSize; }
|
||||
virtual std::size_t getNumBlocks() const { return NumBlocks; }
|
||||
|
||||
unsigned getNumFreeBlocks() const;
|
||||
unsigned getNumUsedBlocks() const { return NumBlocks - getNumFreeBlocks(); }
|
||||
@@ -114,13 +114,13 @@ public:
|
||||
assert(max_blocks_ > 0);
|
||||
}
|
||||
|
||||
void* allocate(std::size_t size);
|
||||
void deallocate(const void* ptr);
|
||||
virtual void* allocate(std::size_t size);
|
||||
virtual void deallocate(const void* ptr);
|
||||
|
||||
bool isInPool(const void* ptr) const;
|
||||
virtual bool isInPool(const void* ptr) const;
|
||||
|
||||
std::size_t getBlockSize() const;
|
||||
std::size_t getNumBlocks() const;
|
||||
virtual std::size_t getBlockSize() const;
|
||||
virtual std::size_t getNumBlocks() const;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -34,19 +34,19 @@ class UAVCAN_EXPORT MarshalBufferProvider : public IMarshalBufferProvider
|
||||
{
|
||||
StaticTransferBuffer<MaxSize_> buf_;
|
||||
|
||||
int read(unsigned offset, uint8_t* data, unsigned len) const
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const
|
||||
{
|
||||
return buf_.read(offset, data, len);
|
||||
}
|
||||
|
||||
int write(unsigned offset, const uint8_t* data, unsigned len)
|
||||
virtual int write(unsigned offset, const uint8_t* data, unsigned len)
|
||||
{
|
||||
return buf_.write(offset, data, len);
|
||||
}
|
||||
|
||||
const uint8_t* getDataPtr() const { return buf_.getRawPtr(); }
|
||||
virtual const uint8_t* getDataPtr() const { return buf_.getRawPtr(); }
|
||||
|
||||
unsigned getDataLength() const { return buf_.getMaxWritePos(); }
|
||||
virtual unsigned getDataLength() const { return buf_.getMaxWritePos(); }
|
||||
|
||||
public:
|
||||
void reset() { buf_.reset(); }
|
||||
@@ -57,7 +57,7 @@ class UAVCAN_EXPORT MarshalBufferProvider : public IMarshalBufferProvider
|
||||
public:
|
||||
enum { MaxSize = MaxSize_ };
|
||||
|
||||
IMarshalBuffer* getBuffer(unsigned size)
|
||||
virtual IMarshalBuffer* getBuffer(unsigned size)
|
||||
{
|
||||
if (size > MaxSize)
|
||||
{
|
||||
|
||||
@@ -130,7 +130,7 @@ private:
|
||||
|
||||
void handleReceivedDataStruct(ReceivedDataStructure<ResponseType>& response);
|
||||
|
||||
void handleDeadline(MonotonicTime);
|
||||
virtual void handleDeadline(MonotonicTime);
|
||||
|
||||
public:
|
||||
explicit ServiceClient(INode& node, const Callback& callback = Callback())
|
||||
|
||||
@@ -41,7 +41,7 @@ class UAVCAN_EXPORT TimerBase : private DeadlineHandler
|
||||
{
|
||||
MonotonicDuration period_;
|
||||
|
||||
void handleDeadline(MonotonicTime current);
|
||||
virtual void handleDeadline(MonotonicTime current);
|
||||
|
||||
public:
|
||||
using DeadlineHandler::stop;
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
private:
|
||||
Callback callback_;
|
||||
|
||||
void handleTimerEvent(const TimerEvent& event)
|
||||
virtual void handleTimerEvent(const TimerEvent& event)
|
||||
{
|
||||
if (try_implicit_cast<bool>(callback_, true))
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ class UAVCAN_EXPORT GlobalTimeSyncMaster : protected LoopbackFrameListenerBase
|
||||
DataTypeID dtid_;
|
||||
bool initialized_;
|
||||
|
||||
void handleLoopbackFrame(const RxFrame& frame);
|
||||
virtual void handleLoopbackFrame(const RxFrame& frame);
|
||||
|
||||
int getNextTransferID(TransferID& tid);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ private:
|
||||
|
||||
void handleNodeStatus(const ReceivedDataStructure<protocol::NodeStatus>& msg);
|
||||
|
||||
void handleTimerEvent(const TimerEvent&);
|
||||
virtual void handleTimerEvent(const TimerEvent&);
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ class UAVCAN_EXPORT NodeStatusProvider : private TimerBase
|
||||
int publish();
|
||||
void publishWithErrorHandling();
|
||||
|
||||
void handleTimerEvent(const TimerEvent&);
|
||||
virtual void handleTimerEvent(const TimerEvent&);
|
||||
void handleGlobalDiscoveryRequest(const protocol::GlobalDiscoveryRequest&);
|
||||
void handleGetNodeInfoRequest(const protocol::GetNodeInfo::Request&, protocol::GetNodeInfo::Response& rsp);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class UAVCAN_EXPORT PanicBroadcaster : private TimerBase
|
||||
|
||||
void publishOnce();
|
||||
|
||||
void handleTimerEvent(const TimerEvent&);
|
||||
virtual void handleTimerEvent(const TimerEvent&);
|
||||
|
||||
public:
|
||||
explicit PanicBroadcaster(INode& node)
|
||||
|
||||
@@ -126,11 +126,11 @@ public:
|
||||
: map_(allocator)
|
||||
{ }
|
||||
|
||||
TransferID* accessOrCreate(const OutgoingTransferRegistryKey& key, MonotonicTime new_deadline);
|
||||
virtual TransferID* accessOrCreate(const OutgoingTransferRegistryKey& key, MonotonicTime new_deadline);
|
||||
|
||||
bool exists(DataTypeID dtid, TransferType tt) const;
|
||||
virtual bool exists(DataTypeID dtid, TransferType tt) const;
|
||||
|
||||
void cleanup(MonotonicTime ts);
|
||||
virtual void cleanup(MonotonicTime ts);
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -113,7 +113,7 @@ class UAVCAN_EXPORT DynamicTransferBufferManagerEntry
|
||||
/// Reset functionality must be implemented in a non-virtual method to call it safely from the destructor.
|
||||
void doReset();
|
||||
|
||||
void resetImpl();
|
||||
virtual void resetImpl();
|
||||
|
||||
public:
|
||||
DynamicTransferBufferManagerEntry(IPoolAllocator& allocator, uint16_t max_size)
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
IsDynamicallyAllocatable<DynamicTransferBufferManagerEntry>::check();
|
||||
}
|
||||
|
||||
~DynamicTransferBufferManagerEntry()
|
||||
virtual ~DynamicTransferBufferManagerEntry()
|
||||
{
|
||||
doReset();
|
||||
}
|
||||
@@ -134,8 +134,8 @@ public:
|
||||
static DynamicTransferBufferManagerEntry* instantiate(IPoolAllocator& allocator, uint16_t max_size);
|
||||
static void destroy(DynamicTransferBufferManagerEntry*& obj, IPoolAllocator& allocator);
|
||||
|
||||
int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
virtual int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
};
|
||||
UAVCAN_PACKED_END
|
||||
|
||||
@@ -155,8 +155,8 @@ public:
|
||||
, max_write_pos_(0)
|
||||
{ }
|
||||
|
||||
int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
virtual int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
|
||||
void reset();
|
||||
|
||||
@@ -188,15 +188,15 @@ class StaticTransferBufferManagerEntryImpl : public TransferBufferManagerEntry
|
||||
{
|
||||
StaticTransferBufferImpl buf_;
|
||||
|
||||
void resetImpl();
|
||||
virtual void resetImpl();
|
||||
|
||||
public:
|
||||
StaticTransferBufferManagerEntryImpl(uint8_t* buf, uint16_t buf_size)
|
||||
: buf_(buf, buf_size)
|
||||
{ }
|
||||
|
||||
int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
virtual int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
|
||||
bool migrateFrom(const TransferBufferManagerEntry* tbme);
|
||||
};
|
||||
@@ -265,13 +265,13 @@ public:
|
||||
, max_buf_size_(max_buf_size)
|
||||
{ }
|
||||
|
||||
~TransferBufferManagerImpl();
|
||||
virtual ~TransferBufferManagerImpl();
|
||||
|
||||
ITransferBuffer* access(const TransferBufferManagerKey& key);
|
||||
ITransferBuffer* create(const TransferBufferManagerKey& key);
|
||||
void remove(const TransferBufferManagerKey& key);
|
||||
virtual ITransferBuffer* access(const TransferBufferManagerKey& key);
|
||||
virtual ITransferBuffer* create(const TransferBufferManagerKey& key);
|
||||
virtual void remove(const TransferBufferManagerKey& key);
|
||||
virtual bool isEmpty() const;
|
||||
|
||||
bool isEmpty() const;
|
||||
unsigned getNumDynamicBuffers() const;
|
||||
unsigned getNumStaticBuffers() const;
|
||||
};
|
||||
@@ -281,7 +281,7 @@ class UAVCAN_EXPORT TransferBufferManager : public TransferBufferManagerImpl
|
||||
{
|
||||
mutable StaticTransferBufferManagerEntry<MaxBufSize> static_buffers_[NumStaticBufs];
|
||||
|
||||
StaticTransferBufferManagerEntry<MaxBufSize>* getStaticByIndex(uint16_t index) const
|
||||
virtual StaticTransferBufferManagerEntry<MaxBufSize>* getStaticByIndex(uint16_t index) const
|
||||
{
|
||||
return (index < NumStaticBufs) ? &static_buffers_[index] : NULL;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
template <uint16_t MaxBufSize>
|
||||
class UAVCAN_EXPORT TransferBufferManager<MaxBufSize, 0> : public TransferBufferManagerImpl
|
||||
{
|
||||
StaticTransferBufferManagerEntry<MaxBufSize>* getStaticByIndex(uint16_t) const
|
||||
virtual StaticTransferBufferManagerEntry<MaxBufSize>* getStaticByIndex(uint16_t) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -319,10 +319,10 @@ class UAVCAN_EXPORT TransferBufferManager<0, 0> : public ITransferBufferManager
|
||||
public:
|
||||
TransferBufferManager() { }
|
||||
TransferBufferManager(IPoolAllocator&) { }
|
||||
ITransferBuffer* access(const TransferBufferManagerKey&) { return NULL; }
|
||||
ITransferBuffer* create(const TransferBufferManagerKey&) { return NULL; }
|
||||
void remove(const TransferBufferManagerKey&) { }
|
||||
bool isEmpty() const { return true; }
|
||||
virtual ITransferBuffer* access(const TransferBufferManagerKey&) { return NULL; }
|
||||
virtual ITransferBuffer* create(const TransferBufferManagerKey&) { return NULL; }
|
||||
virtual void remove(const TransferBufferManagerKey&) { }
|
||||
virtual bool isEmpty() const { return true; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class UAVCAN_EXPORT IncomingTransfer : public ITransferBuffer
|
||||
uint8_t iface_index_;
|
||||
|
||||
/// That's a no-op, asserts in debug builds
|
||||
int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
virtual int write(unsigned offset, const uint8_t* data, unsigned len);
|
||||
|
||||
protected:
|
||||
IncomingTransfer(MonotonicTime ts_mono, UtcTime ts_utc, TransferType transfer_type,
|
||||
@@ -67,7 +67,7 @@ class UAVCAN_EXPORT SingleFrameIncomingTransfer : public IncomingTransfer
|
||||
const uint8_t payload_len_;
|
||||
public:
|
||||
explicit SingleFrameIncomingTransfer(const RxFrame& frm);
|
||||
int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -79,8 +79,8 @@ class UAVCAN_EXPORT MultiFrameIncomingTransfer : public IncomingTransfer, Noncop
|
||||
public:
|
||||
MultiFrameIncomingTransfer(MonotonicTime ts_mono, UtcTime ts_utc, const RxFrame& last_frame,
|
||||
TransferBufferAccessor& tba);
|
||||
int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
void release() { buf_acc_.remove(); }
|
||||
virtual int read(unsigned offset, uint8_t* data, unsigned len) const;
|
||||
virtual void release() { buf_acc_.remove(); }
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uavcan::MonotonicTime getMonotonic() const
|
||||
virtual uavcan::MonotonicTime getMonotonic() const
|
||||
{
|
||||
assert(this);
|
||||
const uint64_t res = monotonic;
|
||||
@@ -42,13 +42,13 @@ public:
|
||||
return uavcan::MonotonicTime::fromUSec(res);
|
||||
}
|
||||
|
||||
uavcan::UtcTime getUtc() const
|
||||
virtual uavcan::UtcTime getUtc() const
|
||||
{
|
||||
assert(this);
|
||||
return uavcan::UtcTime::fromUSec(utc);
|
||||
}
|
||||
|
||||
void adjustUtc(uavcan::UtcDuration adjustment)
|
||||
virtual void adjustUtc(uavcan::UtcDuration adjustment)
|
||||
{
|
||||
assert(this);
|
||||
const uint64_t prev_utc = utc;
|
||||
@@ -64,7 +64,7 @@ class SystemClockDriver : public uavcan::ISystemClock
|
||||
public:
|
||||
uavcan::UtcDuration utc_adjustment;
|
||||
|
||||
uavcan::MonotonicTime getMonotonic() const
|
||||
virtual uavcan::MonotonicTime getMonotonic() const
|
||||
{
|
||||
struct timespec ts;
|
||||
const int ret = clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
return uavcan::MonotonicTime::fromUSec(uint64_t(ts.tv_sec) * 1000000UL + ts.tv_nsec / 1000UL);
|
||||
}
|
||||
|
||||
uavcan::UtcTime getUtc() const
|
||||
virtual uavcan::UtcTime getUtc() const
|
||||
{
|
||||
struct timeval tv;
|
||||
const int ret = gettimeofday(&tv, NULL);
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
return uavcan::UtcTime::fromUSec(uint64_t(tv.tv_sec) * 1000000UL + tv.tv_usec) + utc_adjustment;
|
||||
}
|
||||
|
||||
void adjustUtc(uavcan::UtcDuration adjustment)
|
||||
virtual void adjustUtc(uavcan::UtcDuration adjustment)
|
||||
{
|
||||
utc_adjustment += adjustment;
|
||||
}
|
||||
|
||||
@@ -25,15 +25,15 @@ struct TestNode : public uavcan::INode
|
||||
setNodeID(self_node_id);
|
||||
}
|
||||
|
||||
void registerInternalFailure(const char* msg)
|
||||
virtual void registerInternalFailure(const char* msg)
|
||||
{
|
||||
std::cout << "TestNode internal failure: " << msg << std::endl;
|
||||
}
|
||||
|
||||
uavcan::PoolManager<1>& getAllocator() { return poolmgr; }
|
||||
uavcan::Scheduler& getScheduler() { return scheduler; }
|
||||
const uavcan::Scheduler& getScheduler() const { return scheduler; }
|
||||
uavcan::IMarshalBufferProvider& getMarshalBufferProvider() { return buffer_provider; }
|
||||
virtual uavcan::PoolManager<1>& getAllocator() { return poolmgr; }
|
||||
virtual uavcan::Scheduler& getScheduler() { return scheduler; }
|
||||
virtual const uavcan::Scheduler& getScheduler() const { return scheduler; }
|
||||
virtual uavcan::IMarshalBufferProvider& getMarshalBufferProvider() { return buffer_provider; }
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
||||
with->other = this;
|
||||
}
|
||||
|
||||
uavcan::ICanIface* getIface(uavcan::uint8_t iface_index)
|
||||
virtual uavcan::ICanIface* getIface(uavcan::uint8_t iface_index)
|
||||
{
|
||||
if (iface_index == 0)
|
||||
{
|
||||
@@ -66,9 +66,9 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uavcan::uint8_t getNumIfaces() const { return 1; }
|
||||
virtual uavcan::uint8_t getNumIfaces() const { return 1; }
|
||||
|
||||
uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime blocking_deadline)
|
||||
virtual uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime blocking_deadline)
|
||||
{
|
||||
assert(other);
|
||||
if (inout_masks.read == 1)
|
||||
@@ -86,7 +86,7 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
||||
return 0;
|
||||
}
|
||||
|
||||
uavcan::int16_t send(const uavcan::CanFrame& frame, uavcan::MonotonicTime, uavcan::CanIOFlags flags)
|
||||
virtual uavcan::int16_t send(const uavcan::CanFrame& frame, uavcan::MonotonicTime, uavcan::CanIOFlags flags)
|
||||
{
|
||||
assert(other);
|
||||
other->read_queue.push(frame);
|
||||
@@ -97,8 +97,8 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
||||
return 1;
|
||||
}
|
||||
|
||||
uavcan::int16_t receive(uavcan::CanFrame& out_frame, uavcan::MonotonicTime& out_ts_monotonic,
|
||||
uavcan::UtcTime& out_ts_utc, uavcan::CanIOFlags& out_flags)
|
||||
virtual uavcan::int16_t receive(uavcan::CanFrame& out_frame, uavcan::MonotonicTime& out_ts_monotonic,
|
||||
uavcan::UtcTime& out_ts_utc, uavcan::CanIOFlags& out_flags)
|
||||
{
|
||||
assert(other);
|
||||
out_flags = 0;
|
||||
@@ -119,9 +119,9 @@ struct PairableCanDriver : public uavcan::ICanDriver, public uavcan::ICanIface
|
||||
return 1;
|
||||
}
|
||||
|
||||
uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
|
||||
uavcan::uint16_t getNumFilters() const { return 0; }
|
||||
uavcan::uint64_t getErrorCount() const { return error_count; }
|
||||
virtual uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
|
||||
virtual uavcan::uint16_t getNumFilters() const { return 0; }
|
||||
virtual uavcan::uint64_t getErrorCount() const { return error_count; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ struct BackgroundSpinner : uavcan::TimerBase
|
||||
, spinning_node(spinning_node)
|
||||
{ }
|
||||
|
||||
void handleTimerEvent(const uavcan::TimerEvent&)
|
||||
virtual void handleTimerEvent(const uavcan::TimerEvent&)
|
||||
{
|
||||
spinning_node.spin(uavcan::MonotonicDuration::fromMSec(1));
|
||||
}
|
||||
|
||||
@@ -94,7 +94,8 @@ public:
|
||||
return frame_time.frame;
|
||||
}
|
||||
|
||||
uavcan::int16_t send(const uavcan::CanFrame& frame, uavcan::MonotonicTime tx_deadline, uavcan::CanIOFlags flags)
|
||||
virtual uavcan::int16_t send(const uavcan::CanFrame& frame, uavcan::MonotonicTime tx_deadline,
|
||||
uavcan::CanIOFlags flags)
|
||||
{
|
||||
assert(this);
|
||||
EXPECT_TRUE(writeable); // Shall never be called when not writeable
|
||||
@@ -114,8 +115,8 @@ public:
|
||||
return 1;
|
||||
}
|
||||
|
||||
uavcan::int16_t receive(uavcan::CanFrame& out_frame, uavcan::MonotonicTime& out_ts_monotonic,
|
||||
uavcan::UtcTime& out_ts_utc, uavcan::CanIOFlags& out_flags)
|
||||
virtual uavcan::int16_t receive(uavcan::CanFrame& out_frame, uavcan::MonotonicTime& out_ts_monotonic,
|
||||
uavcan::UtcTime& out_ts_utc, uavcan::CanIOFlags& out_flags)
|
||||
{
|
||||
assert(this);
|
||||
out_flags = uavcan::CanIOFlags();
|
||||
@@ -149,10 +150,10 @@ public:
|
||||
|
||||
// cppcheck-suppress unusedFunction
|
||||
// cppcheck-suppress functionConst
|
||||
uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
|
||||
virtual uavcan::int16_t configureFilters(const uavcan::CanFilterConfig*, uavcan::uint16_t) { return -1; }
|
||||
// cppcheck-suppress unusedFunction
|
||||
uavcan::uint16_t getNumFilters() const { return 0; }
|
||||
uavcan::uint64_t getErrorCount() const { return num_errors; }
|
||||
virtual uavcan::uint16_t getNumFilters() const { return 0; }
|
||||
virtual uavcan::uint64_t getErrorCount() const { return num_errors; }
|
||||
};
|
||||
|
||||
class CanDriverMock : public uavcan::ICanDriver
|
||||
@@ -168,7 +169,7 @@ public:
|
||||
, select_failure(false)
|
||||
{ }
|
||||
|
||||
uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime deadline)
|
||||
virtual uavcan::int16_t select(uavcan::CanSelectMasks& inout_masks, uavcan::MonotonicTime deadline)
|
||||
{
|
||||
assert(this);
|
||||
//std::cout << "Write/read masks: " << inout_write_iface_mask << "/" << inout_read_iface_mask << std::endl;
|
||||
@@ -222,8 +223,8 @@ public:
|
||||
return 1; // This value is not being checked anyway, it just has to be greater than zero
|
||||
}
|
||||
|
||||
uavcan::ICanIface* getIface(uavcan::uint8_t iface_index) { return &ifaces.at(iface_index); }
|
||||
uavcan::uint8_t getNumIfaces() const { return ifaces.size(); }
|
||||
virtual uavcan::ICanIface* getIface(uavcan::uint8_t iface_index) { return &ifaces.at(iface_index); }
|
||||
virtual uavcan::uint8_t getNumIfaces() const { return ifaces.size(); }
|
||||
};
|
||||
|
||||
enum FrameType { STD, EXT };
|
||||
|
||||
Reference in New Issue
Block a user