mirror of https://github.com/ARMmbed/mbed-os.git
platform: Tag classes DirHandle, FileHandle, FileLike, FileSystemHandle, FileSystemLike, LocalFileHandle, LocalFileSystem and PlatformMutex as non copyable.
This avoid unwanted copy of these type which is a programming error.pull/4594/head
parent
4f7943860a
commit
dcbcf64830
|
@ -19,6 +19,7 @@
|
|||
#include <stdint.h>
|
||||
#include "platform/platform.h"
|
||||
#include "platform/FileHandle.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
namespace mbed {
|
||||
/** \addtogroup platform */
|
||||
|
@ -41,7 +42,7 @@ namespace mbed {
|
|||
* @note Synchronization level: Set by subclass
|
||||
* @ingroup platform
|
||||
*/
|
||||
class DirHandle {
|
||||
class DirHandle : private NonCopyable<DirHandle> {
|
||||
public:
|
||||
virtual ~DirHandle() {}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ typedef int FILEHANDLE;
|
|||
#include "Callback.h"
|
||||
#include "platform/mbed_poll.h"
|
||||
#include "platform/platform.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
namespace mbed {
|
||||
/** \addtogroup platform */
|
||||
|
@ -37,7 +38,7 @@ namespace mbed {
|
|||
* @note Synchronization level: Set by subclass
|
||||
* @ingroup platform
|
||||
*/
|
||||
class FileHandle {
|
||||
class FileHandle : private NonCopyable<FileHandle> {
|
||||
public:
|
||||
virtual ~FileHandle() {}
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "platform/mbed_toolchain.h"
|
||||
#include "platform/FileBase.h"
|
||||
#include "platform/FileHandle.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
namespace mbed {
|
||||
/** \addtogroup platform */
|
||||
|
@ -31,7 +32,7 @@ namespace mbed {
|
|||
* @note Synchronization level: Set by subclass
|
||||
* @ingroup platform
|
||||
*/
|
||||
class FileLike : public FileHandle, public FileBase {
|
||||
class FileLike : public FileHandle, public FileBase, private NonCopyable<FileLike> {
|
||||
public:
|
||||
/** Constructor FileLike
|
||||
*
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "platform/FileBase.h"
|
||||
#include "platform/FileHandle.h"
|
||||
#include "platform/DirHandle.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
namespace mbed {
|
||||
/** \addtogroup drivers */
|
||||
|
@ -35,7 +36,7 @@ namespace mbed {
|
|||
*
|
||||
* @note Synchronization level: Set by subclass
|
||||
*/
|
||||
class FileSystemHandle {
|
||||
class FileSystemHandle : private NonCopyable<FileSystemHandle> {
|
||||
public:
|
||||
/** FileSystemHandle lifetime
|
||||
*/
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "platform/FileSystemHandle.h"
|
||||
#include "platform/FileHandle.h"
|
||||
#include "platform/DirHandle.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
namespace mbed {
|
||||
/** \addtogroup platform */
|
||||
|
@ -35,7 +36,7 @@ namespace mbed {
|
|||
* @note Synchronization level: Set by subclass
|
||||
* @ingroup platform
|
||||
*/
|
||||
class FileSystemLike : public FileSystemHandle, public FileBase {
|
||||
class FileSystemLike : public FileSystemHandle, public FileBase, private NonCopyable<FileSystemLike> {
|
||||
public:
|
||||
/** FileSystemLike lifetime
|
||||
*/
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "platform/FileSystemLike.h"
|
||||
#include "platform/PlatformMutex.h"
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
namespace mbed {
|
||||
/** \addtogroup platform */
|
||||
|
@ -34,7 +35,7 @@ FILEHANDLE local_file_open(const char* name, int flags);
|
|||
* @class LocalFileHandle
|
||||
* @ingroup platform
|
||||
*/
|
||||
class LocalFileHandle : public FileHandle {
|
||||
class LocalFileHandle : public FileHandle, private NonCopyable<LocalFileHandle> {
|
||||
|
||||
public:
|
||||
LocalFileHandle(FILEHANDLE fh);
|
||||
|
@ -98,7 +99,7 @@ protected:
|
|||
* not exit, you will need to hold down reset on the mbed Microcontroller to be able to see the drive again!
|
||||
* @ingroup platform
|
||||
*/
|
||||
class LocalFileSystem : public FileSystemLike {
|
||||
class LocalFileSystem : public FileSystemLike, private NonCopyable<LocalFileSystem> {
|
||||
// No modifiable state
|
||||
|
||||
public:
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#ifndef PLATFORM_MUTEX_H
|
||||
#define PLATFORM_MUTEX_H
|
||||
|
||||
#include "platform/NonCopyable.h"
|
||||
|
||||
#ifdef MBED_CONF_RTOS_PRESENT
|
||||
#include "rtos/Mutex.h"
|
||||
typedef rtos::Mutex PlatformMutex;
|
||||
|
@ -25,7 +27,7 @@ typedef rtos::Mutex PlatformMutex;
|
|||
/** A stub mutex for when an RTOS is not present
|
||||
* @ingroup platform
|
||||
*/
|
||||
class PlatformMutex {
|
||||
class PlatformMutex : private mbed::NonCopyable<PlatformMutex> {
|
||||
public:
|
||||
PlatformMutex() {
|
||||
// Stub
|
||||
|
|
Loading…
Reference in New Issue