mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 14:13:34 +08:00
Explicit virtual keyword
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user