diff --git a/platform/ATCmdParser.h b/platform/ATCmdParser.h index 199977d9be..6922251faa 100644 --- a/platform/ATCmdParser.h +++ b/platform/ATCmdParser.h @@ -44,7 +44,7 @@ namespace mbed { -class ATCmdParser +class ATCmdParser : private NonCopyable { private: // File handle @@ -70,11 +70,6 @@ private: }; oob *_oobs; - // Prohibiting use of of copy constructor - ATCmdParser(const ATCmdParser &); - // Prohibiting copy assignment Operator - ATCmdParser &operator=(const ATCmdParser &); - public: /** diff --git a/platform/CallChain.h b/platform/CallChain.h index d702ec89c8..42e97e6d28 100644 --- a/platform/CallChain.h +++ b/platform/CallChain.h @@ -18,6 +18,7 @@ #include "platform/Callback.h" #include "platform/mbed_toolchain.h" +#include "platform/NonCopyable.h" #include namespace mbed { @@ -65,7 +66,7 @@ namespace mbed { typedef Callback *pFunctionPointer_t; class CallChainLink; -class CallChain { +class CallChain : private NonCopyable { public: /** Create an empty chain * @@ -178,10 +179,7 @@ public: return get(i); } - /* disallow copy constructor and assignment operators */ private: - CallChain(const CallChain&); - CallChain & operator = (const CallChain&); CallChainLink *_chain; }; diff --git a/platform/FileBase.h b/platform/FileBase.h index 9a451bb9bc..5df9ef8550 100644 --- a/platform/FileBase.h +++ b/platform/FileBase.h @@ -24,6 +24,7 @@ typedef int FILEHANDLE; #include "platform/platform.h" #include "platform/SingletonPtr.h" #include "platform/PlatformMutex.h" +#include "platform/NonCopyable.h" namespace mbed { /** \addtogroup platform */ @@ -39,7 +40,7 @@ typedef enum { * @class FileBase * @ingroup platform */ -class FileBase { +class FileBase : private NonCopyable { public: FileBase(const char *name, PathType t); virtual ~FileBase(); @@ -59,8 +60,6 @@ private: FileBase *_next; const char * const _name; const PathType _path_type; - FileBase(const FileBase&); - FileBase & operator = (const FileBase&); }; } // namespace mbed diff --git a/platform/Stream.h b/platform/Stream.h index c715d64bfe..fd74b0520f 100644 --- a/platform/Stream.h +++ b/platform/Stream.h @@ -19,6 +19,7 @@ #include "platform/platform.h" #include "platform/FileLike.h" #include "platform/FileHandle.h" +#include "platform/NonCopyable.h" #include #include @@ -36,7 +37,7 @@ extern char* mbed_gets(char *s, int size, std::FILE *_file); * @note Synchronization level: Set by subclass * @ingroup platform */ -class Stream : public FileLike { +class Stream : public FileLike, private NonCopyable { public: Stream(const char *name=NULL); @@ -80,11 +81,6 @@ protected: virtual void unlock() { // Stub } - - /* disallow copy constructor and assignment operators */ -private: - Stream(const Stream&); - Stream & operator = (const Stream&); }; } // namespace mbed