diff --git a/include/znc/Chan.h b/include/znc/Chan.h index 3c5a957d..5605548e 100644 --- a/include/znc/Chan.h +++ b/include/znc/Chan.h @@ -59,6 +59,9 @@ public: CChan(const CString& sName, CIRCNetwork* pNetwork, bool bInConfig, CConfig *pConfig = NULL); ~CChan(); + CChan(const CChan&) = delete; + CChan& operator=(const CChan&) = delete; + void Reset(); CConfig ToConfig() const; void Clone(CChan& chan); diff --git a/include/znc/Client.h b/include/znc/Client.h index fc75c60c..175192c6 100644 --- a/include/znc/Client.h +++ b/include/znc/Client.h @@ -39,6 +39,9 @@ public: virtual ~CAuthBase() {} + CAuthBase(const CAuthBase&) = delete; + CAuthBase& operator=(const CAuthBase&) = delete; + virtual void SetLoginInfo(const CString& sUsername, const CString& sPassword, CZNCSock* pSock) { m_sUsername = sUsername; @@ -74,6 +77,9 @@ public: CClientAuth(CClient* pClient, const CString& sUsername, const CString& sPassword); virtual ~CClientAuth() {} + CClientAuth(const CClientAuth&) = delete; + CClientAuth& operator=(const CClientAuth&) = delete; + void Invalidate() { m_pClient = NULL; CAuthBase::Invalidate(); } void AcceptedLogin(CUser& User); void RefusedLogin(const CString& sReason); @@ -108,6 +114,9 @@ public: virtual ~CClient(); + CClient(const CClient&) = delete; + CClient& operator=(const CClient&) = delete; + void SendRequiredPasswordNotice(); void AcceptLogin(CUser& User); void RefuseLogin(const CString& sReason); diff --git a/include/znc/IRCNetwork.h b/include/znc/IRCNetwork.h index 42e49dc1..5f66a8fc 100644 --- a/include/znc/IRCNetwork.h +++ b/include/znc/IRCNetwork.h @@ -44,6 +44,9 @@ public: CIRCNetwork(CUser *pUser, const CIRCNetwork& Network); ~CIRCNetwork(); + CIRCNetwork(const CIRCNetwork&) = delete; + CIRCNetwork& operator=(const CIRCNetwork&) = delete; + enum { JOIN_FREQUENCY = 30, /** How long must an IRC connection be idle before ZNC sends a ping */ diff --git a/include/znc/IRCSock.h b/include/znc/IRCSock.h index d9af1b01..098a8c1c 100644 --- a/include/znc/IRCSock.h +++ b/include/znc/IRCSock.h @@ -36,6 +36,9 @@ public: CIRCSock(CIRCNetwork* pNetwork); virtual ~CIRCSock(); + CIRCSock(const CIRCSock&) = delete; + CIRCSock& operator=(const CIRCSock&) = delete; + typedef enum { // These values must line up with their position in the CHANMODE argument to raw 005 ListArg = 0, diff --git a/include/znc/Listener.h b/include/znc/Listener.h index 78a7120d..dc021cce 100644 --- a/include/znc/Listener.h +++ b/include/znc/Listener.h @@ -44,6 +44,9 @@ public: ~CListener(); + CListener(const CListener&) = delete; + CListener& operator=(const CListener&) = delete; + // Getters bool IsSSL() const { return m_bSSL; } EAddrType GetAddrType() const { return m_eAddr; } diff --git a/include/znc/Modules.h b/include/znc/Modules.h index f963f4c7..0a9ad3c3 100644 --- a/include/znc/Modules.h +++ b/include/znc/Modules.h @@ -142,6 +142,9 @@ public: virtual ~CTimer(); + CTimer(const CTimer&) = delete; + CTimer& operator=(const CTimer&) = delete; + // Setters void SetModule(CModule* p); void SetDescription(const CString& s); @@ -191,6 +194,9 @@ public: } virtual ~CModuleJob(); + CModuleJob(const CModuleJob&) = delete; + CModuleJob& operator=(const CModuleJob&) = delete; + // Getters CModule* GetModule() const { return m_pModule; } const CString& GetName() const { return m_sName; } @@ -354,6 +360,9 @@ public: const CString& sDataDir); virtual ~CModule(); + CModule(const CModule&) = delete; + CModule& operator=(const CModule&) = delete; + /** This enum is just used for return from module hooks. Based on this * return, ZNC then decides what to do with the event which caused the * module hook. @@ -1127,6 +1136,9 @@ public: CModules(); ~CModules(); + CModules(const CModules&) = default; + CModules& operator=(const CModules&) = default; + void SetUser(CUser* pUser) { m_pUser = pUser; } void SetNetwork(CIRCNetwork* pNetwork) { m_pNetwork = pNetwork; } void SetClient(CClient* pClient) { m_pClient = pClient; } diff --git a/include/znc/Nick.h b/include/znc/Nick.h index c17a3329..6d03d55e 100644 --- a/include/znc/Nick.h +++ b/include/znc/Nick.h @@ -33,6 +33,9 @@ public: CNick(const CString& sNick); ~CNick(); + CNick(const CNick&) = default; + CNick& operator=(const CNick&) = default; + void Reset(); void Parse(const CString& sNickMask); CString GetHostMask() const; diff --git a/include/znc/Socket.h b/include/znc/Socket.h index 9ad3cdb7..34222da5 100644 --- a/include/znc/Socket.h +++ b/include/znc/Socket.h @@ -197,6 +197,9 @@ public: CSocket(CModule* pModule, const CString& sHostname, unsigned short uPort, int iTimeout = 60); virtual ~CSocket(); + CSocket(const CSocket&) = delete; + CSocket& operator=(const CSocket&) = delete; + using Csock::Connect; using Csock::Listen; diff --git a/include/znc/Template.h b/include/znc/Template.h index 3519e7ab..c22a9c9e 100644 --- a/include/znc/Template.h +++ b/include/znc/Template.h @@ -83,6 +83,9 @@ public: virtual ~CTemplateLoopContext() {} + CTemplateLoopContext(const CTemplateLoopContext&) = default; + CTemplateLoopContext& operator=(const CTemplateLoopContext&) = default; + // Setters void SetHasData(bool b = true) { m_bHasData = b; } void SetName(const CString& s) { m_sName = s; } @@ -132,6 +135,9 @@ public: virtual ~CTemplate(); + CTemplate(const CTemplate& other) = default; + CTemplate& operator=(const CTemplate& other) = default; + //! Class for implementing custom tags in subclasses void AddTagHandler(std::shared_ptr spTagHandler) { m_vspTagHandlers.push_back(spTagHandler); diff --git a/include/znc/User.h b/include/znc/User.h index fb1f52a1..4b27f86c 100644 --- a/include/znc/User.h +++ b/include/znc/User.h @@ -39,6 +39,9 @@ public: CUser(const CString& sUserName); ~CUser(); + CUser(const CUser&) = delete; + CUser& operator=(const CUser&) = delete; + bool ParseConfig(CConfig* Config, CString& sError); // TODO refactor this diff --git a/include/znc/WebModules.h b/include/znc/WebModules.h index 947cac9f..bd860ef8 100644 --- a/include/znc/WebModules.h +++ b/include/znc/WebModules.h @@ -47,6 +47,9 @@ public: CWebSession(const CString& sId, const CString& sIP); ~CWebSession(); + CWebSession(const CWebSession&) = delete; + CWebSession& operator=(const CWebSession&) = delete; + const CString& GetId() const { return m_sId; } const CString& GetIP() const { return m_sIP; } CUser* GetUser() const { return m_pUser; } diff --git a/include/znc/znc.h b/include/znc/znc.h index cf2326e3..7622f8d4 100644 --- a/include/znc/znc.h +++ b/include/znc/znc.h @@ -37,6 +37,9 @@ public: CZNC(); ~CZNC(); + CZNC(const CZNC&) = delete; + CZNC& operator=(const CZNC&) = delete; + enum ConfigState { ECONFIG_NOTHING, ECONFIG_NEED_REHASH,