mirror of https://github.com/ARMmbed/mbed-os.git
Add virtual destructor to classes
Add a virtual destructor to classes which have a virtual lock and unlock. Remove the virtual qualifier from functions in InterruptManager since this class cannot be extended.pull/1910/head
parent
95c83935ac
commit
58d15f3007
|
|
@ -103,6 +103,10 @@ public:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
virtual ~AnalogIn() {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void lock() {
|
virtual void lock() {
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,10 @@ public:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
virtual ~AnalogOut() {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void lock() {
|
virtual void lock() {
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,10 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void unlock(void);
|
virtual void unlock(void);
|
||||||
|
|
||||||
|
virtual ~I2C() {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
|
||||||
#if DEVICE_I2C_ASYNCH
|
#if DEVICE_I2C_ASYNCH
|
||||||
|
|
||||||
/** Start non-blocking I2C transfer.
|
/** Start non-blocking I2C transfer.
|
||||||
|
|
|
||||||
|
|
@ -113,14 +113,13 @@ public:
|
||||||
*/
|
*/
|
||||||
bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq);
|
bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq);
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void lock();
|
|
||||||
virtual void unlock();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
InterruptManager();
|
InterruptManager();
|
||||||
~InterruptManager();
|
~InterruptManager();
|
||||||
|
|
||||||
|
void lock();
|
||||||
|
void unlock();
|
||||||
|
|
||||||
// We declare the copy contructor and the assignment operator, but we don't
|
// We declare the copy contructor and the assignment operator, but we don't
|
||||||
// implement them. This way, if someone tries to copy/assign our instance,
|
// implement them. This way, if someone tries to copy/assign our instance,
|
||||||
// he will get an error at compile time.
|
// he will get an error at compile time.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue