mirror of https://github.com/ARMmbed/mbed-os.git
Replace NonCopyable in CAN inheritance.
This commit moves the deletion of copy constructor and copy assignment operators to the `mbed::interface::can` class, where both `mbed::CAN` and `mbed::interface::CAN` inherit enum types from. This allows `NonCopyable` to be removed from the inheritance list.pull/14336/head
parent
d79446c0da
commit
d39a4168ec
|
@ -25,7 +25,6 @@
|
||||||
#include "hal/can_api.h"
|
#include "hal/can_api.h"
|
||||||
#include "platform/Callback.h"
|
#include "platform/Callback.h"
|
||||||
#include "platform/PlatformMutex.h"
|
#include "platform/PlatformMutex.h"
|
||||||
#include "platform/NonCopyable.h"
|
|
||||||
|
|
||||||
namespace mbed {
|
namespace mbed {
|
||||||
|
|
||||||
|
@ -39,9 +38,9 @@ namespace mbed {
|
||||||
*/
|
*/
|
||||||
class CAN
|
class CAN
|
||||||
#ifdef FEATURE_EXPERIMENTAL_API
|
#ifdef FEATURE_EXPERIMENTAL_API
|
||||||
final : public interface::CAN, private NonCopyable<CAN>
|
final : public interface::CAN
|
||||||
#else
|
#else
|
||||||
: private NonCopyable<CAN>, public interface::can
|
: public interface::can
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -145,8 +145,12 @@ struct can {
|
||||||
protected:
|
protected:
|
||||||
can() = default;
|
can() = default;
|
||||||
~can() = default;
|
~can() = default;
|
||||||
can(const can &) = default;
|
|
||||||
can &operator=(const can &) = default;
|
public:
|
||||||
|
|
||||||
|
/* Copy constructor and copy assignment operators will be deleted in subclasses as well */
|
||||||
|
can(const can &) = delete;
|
||||||
|
can &operator=(const can &) = delete;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue