Delete unneeded constructors and assignment operators (#2309)

This commit is contained in:
Andrew Gaul 2023-09-06 23:52:10 +09:00 committed by GitHub
parent fa3a472c6b
commit 3d73d5a687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 53 additions and 0 deletions

View File

@ -69,6 +69,10 @@ class AdditionalHeader
protected: protected:
AdditionalHeader(); AdditionalHeader();
~AdditionalHeader(); ~AdditionalHeader();
AdditionalHeader(const AdditionalHeader&) = delete;
AdditionalHeader(AdditionalHeader&&) = delete;
AdditionalHeader& operator=(const AdditionalHeader&) = delete;
AdditionalHeader& operator=(AdditionalHeader&&) = delete;
public: public:
// Reference singleton // Reference singleton

View File

@ -41,7 +41,9 @@ class AutoLock
private: private:
AutoLock(const AutoLock&) = delete; AutoLock(const AutoLock&) = delete;
AutoLock(AutoLock&&) = delete;
AutoLock& operator=(const AutoLock&) = delete; AutoLock& operator=(const AutoLock&) = delete;
AutoLock& operator=(AutoLock&&) = delete;
public: public:
explicit AutoLock(pthread_mutex_t* pmutex, Type type = NONE); explicit AutoLock(pthread_mutex_t* pmutex, Type type = NONE);

View File

@ -201,6 +201,10 @@ class S3fsCurl
// constructor/destructor // constructor/destructor
explicit S3fsCurl(bool ahbe = false); explicit S3fsCurl(bool ahbe = false);
~S3fsCurl(); ~S3fsCurl();
S3fsCurl(const S3fsCurl&) = delete;
S3fsCurl(S3fsCurl&&) = delete;
S3fsCurl& operator=(const S3fsCurl&) = delete;
S3fsCurl& operator=(S3fsCurl&&) = delete;
private: private:
// class methods // class methods

View File

@ -40,6 +40,10 @@ class CurlHandlerPool
{ {
assert(maxHandlers > 0); assert(maxHandlers > 0);
} }
CurlHandlerPool(const CurlHandlerPool&) = delete;
CurlHandlerPool(CurlHandlerPool&&) = delete;
CurlHandlerPool& operator=(const CurlHandlerPool&) = delete;
CurlHandlerPool& operator=(CurlHandlerPool&&) = delete;
bool Init(); bool Init();
bool Destroy(); bool Destroy();

View File

@ -44,7 +44,9 @@ class AutoFdEntity
private: private:
AutoFdEntity(const AutoFdEntity&) = delete; AutoFdEntity(const AutoFdEntity&) = delete;
AutoFdEntity(AutoFdEntity&&) = delete;
AutoFdEntity& operator=(const AutoFdEntity&) = delete; AutoFdEntity& operator=(const AutoFdEntity&) = delete;
AutoFdEntity& operator=(AutoFdEntity&&) = delete;
public: public:
AutoFdEntity(); AutoFdEntity();

View File

@ -102,6 +102,10 @@ class FdEntity
explicit FdEntity(const char* tpath = nullptr, const char* cpath = nullptr); explicit FdEntity(const char* tpath = nullptr, const char* cpath = nullptr);
~FdEntity(); ~FdEntity();
FdEntity(const FdEntity&) = delete;
FdEntity(FdEntity&&) = delete;
FdEntity& operator=(const FdEntity&) = delete;
FdEntity& operator=(FdEntity&&) = delete;
void Close(int fd); void Close(int fd);
bool IsOpen() const { return (-1 != physical_fd); } bool IsOpen() const { return (-1 != physical_fd); }

View File

@ -92,6 +92,10 @@ class PseudoFdInfo
public: public:
explicit PseudoFdInfo(int fd = -1, int open_flags = 0); explicit PseudoFdInfo(int fd = -1, int open_flags = 0);
~PseudoFdInfo(); ~PseudoFdInfo();
PseudoFdInfo(const PseudoFdInfo&) = delete;
PseudoFdInfo(PseudoFdInfo&&) = delete;
PseudoFdInfo& operator=(const PseudoFdInfo&) = delete;
PseudoFdInfo& operator=(PseudoFdInfo&&) = delete;
int GetPhysicalFd() const { return physical_fd; } int GetPhysicalFd() const { return physical_fd; }
int GetPseudoFd() const { return pseudo_fd; } int GetPseudoFd() const { return pseudo_fd; }

View File

@ -45,6 +45,10 @@ class PseudoFdManager
PseudoFdManager(); PseudoFdManager();
~PseudoFdManager(); ~PseudoFdManager();
PseudoFdManager(const PseudoFdManager&) = delete;
PseudoFdManager(PseudoFdManager&&) = delete;
PseudoFdManager& operator=(const PseudoFdManager&) = delete;
PseudoFdManager& operator=(PseudoFdManager&&) = delete;
int GetUnusedMinPseudoFd() const; int GetUnusedMinPseudoFd() const;
int CreatePseudoFd(); int CreatePseudoFd();

View File

@ -42,6 +42,10 @@ class UntreatedParts
public: public:
UntreatedParts(); UntreatedParts();
~UntreatedParts(); ~UntreatedParts();
UntreatedParts(const UntreatedParts&) = delete;
UntreatedParts(UntreatedParts&&) = delete;
UntreatedParts& operator=(const UntreatedParts&) = delete;
UntreatedParts& operator=(UntreatedParts&&) = delete;
bool empty(); bool empty();

View File

@ -41,6 +41,11 @@ class Semaphore
} }
dispatch_release(sem); dispatch_release(sem);
} }
Semaphore(const Semaphore&) = delete;
Semaphore(Semaphore&&) = delete;
Semaphore& operator=(const Semaphore&) = delete;
Semaphore& operator=(Semaphore&&) = delete;
void wait() { dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); } void wait() { dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER); }
bool try_wait() bool try_wait()
{ {

View File

@ -159,6 +159,10 @@ class S3fsCred
S3fsCred(); S3fsCred();
~S3fsCred(); ~S3fsCred();
S3fsCred(const S3fsCred&) = delete;
S3fsCred(S3fsCred&&) = delete;
S3fsCred& operator=(const S3fsCred&) = delete;
S3fsCred& operator=(S3fsCred&&) = delete;
bool IsIBMIAMAuth() const { return is_ibm_iam_auth; } bool IsIBMIAMAuth() const { return is_ibm_iam_auth; }

View File

@ -140,6 +140,10 @@ class S3fsLog
explicit S3fsLog(); explicit S3fsLog();
~S3fsLog(); ~S3fsLog();
S3fsLog(const S3fsLog&) = delete;
S3fsLog(S3fsLog&&) = delete;
S3fsLog& operator=(const S3fsLog&) = delete;
S3fsLog& operator=(S3fsLog&&) = delete;
}; };
//------------------------------------------------------------------- //-------------------------------------------------------------------

View File

@ -49,6 +49,10 @@ class S3fsSignals
S3fsSignals(); S3fsSignals();
~S3fsSignals(); ~S3fsSignals();
S3fsSignals(const S3fsSignals&) = delete;
S3fsSignals(S3fsSignals&&) = delete;
S3fsSignals& operator=(const S3fsSignals&) = delete;
S3fsSignals& operator=(S3fsSignals&&) = delete;
bool InitUsr1Handler(); bool InitUsr1Handler();
bool DestroyUsr1Handler(); bool DestroyUsr1Handler();

View File

@ -80,6 +80,10 @@ class ThreadPoolMan
explicit ThreadPoolMan(int count = 1); explicit ThreadPoolMan(int count = 1);
~ThreadPoolMan(); ~ThreadPoolMan();
ThreadPoolMan(const ThreadPoolMan&) = delete;
ThreadPoolMan(ThreadPoolMan&&) = delete;
ThreadPoolMan& operator=(const ThreadPoolMan&) = delete;
ThreadPoolMan& operator=(ThreadPoolMan&&) = delete;
bool IsExit() const; bool IsExit() const;
void SetExitFlag(bool exit_flag); void SetExitFlag(bool exit_flag);