mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Remove virtual where it makes no sense
This commit actually saves memory, since some classes no longer contain a pointer to their vtable! git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1300 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
4
Buffer.h
4
Buffer.h
@@ -17,7 +17,7 @@ using std::vector;
|
||||
class CBufLine {
|
||||
public:
|
||||
CBufLine(const CString& sPre, const CString& sPost, bool bIncNick);
|
||||
virtual ~CBufLine();
|
||||
~CBufLine();
|
||||
void GetLine(const CString& sTarget, CString& sRet) const;
|
||||
|
||||
const CString& GetPre() const { return m_sPre; }
|
||||
@@ -38,7 +38,7 @@ protected:
|
||||
class CBuffer : private vector<CBufLine> {
|
||||
public:
|
||||
CBuffer(unsigned int uLineCount = 100);
|
||||
virtual ~CBuffer();
|
||||
~CBuffer();
|
||||
|
||||
int AddLine(const CString& sPre, const CString& sPost, bool bIncNick = true);
|
||||
/// Same as AddLine, but if there is already a line with sPre it is replaced.
|
||||
|
||||
2
Chan.h
2
Chan.h
@@ -51,7 +51,7 @@ public:
|
||||
} EModes;
|
||||
|
||||
CChan(const CString& sName, CUser* pUser, bool bInConfig);
|
||||
virtual ~CChan();
|
||||
~CChan();
|
||||
|
||||
void Reset();
|
||||
bool WriteConfig(CFile& File);
|
||||
|
||||
6
Client.h
6
Client.h
@@ -39,9 +39,9 @@ public:
|
||||
virtual void AcceptLogin(CUser& User) = 0;
|
||||
virtual void RefuseLogin(const CString& sReason) = 0;
|
||||
|
||||
virtual const CString& GetUsername() const { return m_sUsername; }
|
||||
virtual const CString& GetPassword() const { return m_sPassword; }
|
||||
virtual const CString& GetRemoteIP() const { return m_sRemoteIP; }
|
||||
const CString& GetUsername() const { return m_sUsername; }
|
||||
const CString& GetPassword() const { return m_sPassword; }
|
||||
const CString& GetRemoteIP() const { return m_sRemoteIP; }
|
||||
|
||||
private:
|
||||
CString m_sUsername;
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
CFile();
|
||||
CFile(const CString& sLongName);
|
||||
CFile(int iFD, const CString& sLongName);
|
||||
virtual ~CFile();
|
||||
~CFile();
|
||||
|
||||
enum EOptions {
|
||||
F_Read = O_RDONLY,
|
||||
@@ -147,11 +147,11 @@ public:
|
||||
m_eSortAttr = CFile::FA_Name;
|
||||
}
|
||||
|
||||
virtual ~CDir() {
|
||||
~CDir() {
|
||||
CleanUp();
|
||||
}
|
||||
|
||||
virtual void CleanUp() {
|
||||
void CleanUp() {
|
||||
for (unsigned int a = 0; a < size(); a++) {
|
||||
delete (*this)[a];
|
||||
}
|
||||
|
||||
2
MD5.h
2
MD5.h
@@ -30,7 +30,7 @@ public:
|
||||
CMD5();
|
||||
CMD5(const string& sText);
|
||||
CMD5(const char* szText, uint32 nTextLen);
|
||||
virtual ~CMD5();
|
||||
~CMD5();
|
||||
|
||||
operator string() const
|
||||
{
|
||||
|
||||
112
Modules.h
112
Modules.h
@@ -171,7 +171,7 @@ public:
|
||||
m_sName = sName;
|
||||
m_sPath = sPath;
|
||||
}
|
||||
virtual ~CModInfo() {}
|
||||
~CModInfo() {}
|
||||
|
||||
bool operator < (const CModInfo& Info) const {
|
||||
return (GetName() < Info.GetName());
|
||||
@@ -369,68 +369,68 @@ private:
|
||||
class CModules : public vector<CModule*> {
|
||||
public:
|
||||
CModules();
|
||||
virtual ~CModules();
|
||||
~CModules();
|
||||
|
||||
void SetUser(CUser* pUser) { m_pUser = pUser; }
|
||||
void SetClient(CClient* pClient) { m_pClient = pClient; }
|
||||
|
||||
void UnloadAll();
|
||||
|
||||
virtual bool OnBoot(); // Return false to abort
|
||||
virtual bool OnPreRehash();
|
||||
virtual bool OnPostRehash();
|
||||
virtual bool OnIRCDisconnected();
|
||||
virtual bool OnIRCConnected();
|
||||
virtual bool OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName);
|
||||
virtual bool OnBroadcast(CString& sMessage);
|
||||
bool OnBoot(); // Return false to abort
|
||||
bool OnPreRehash();
|
||||
bool OnPostRehash();
|
||||
bool OnIRCDisconnected();
|
||||
bool OnIRCConnected();
|
||||
bool OnIRCRegistration(CString& sPass, CString& sNick, CString& sIdent, CString& sRealName);
|
||||
bool OnBroadcast(CString& sMessage);
|
||||
|
||||
virtual bool OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize);
|
||||
bool OnDCCUserSend(const CNick& RemoteNick, unsigned long uLongIP, unsigned short uPort, const CString& sFile, unsigned long uFileSize);
|
||||
|
||||
virtual bool OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange);
|
||||
virtual bool OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
virtual bool OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
virtual bool OnVoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
virtual bool OnDevoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
virtual bool OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs);
|
||||
virtual bool OnMode(const CNick& OpNick, CChan& Channel, char uMode, const CString& sArg, bool bAdded, bool bNoChange);
|
||||
bool OnChanPermission(const CNick& OpNick, const CNick& Nick, CChan& Channel, unsigned char uMode, bool bAdded, bool bNoChange);
|
||||
bool OnOp(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
bool OnDeop(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
bool OnVoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
bool OnDevoice(const CNick& OpNick, const CNick& Nick, CChan& Channel, bool bNoChange);
|
||||
bool OnRawMode(const CNick& OpNick, CChan& Channel, const CString& sModes, const CString& sArgs);
|
||||
bool OnMode(const CNick& OpNick, CChan& Channel, char uMode, const CString& sArg, bool bAdded, bool bNoChange);
|
||||
|
||||
virtual bool OnRaw(CString& sLine);
|
||||
bool OnRaw(CString& sLine);
|
||||
|
||||
virtual bool OnStatusCommand(CString& sCommand);
|
||||
virtual bool OnModCommand(const CString& sCommand);
|
||||
virtual bool OnModNotice(const CString& sMessage);
|
||||
virtual bool OnModCTCP(const CString& sMessage);
|
||||
bool OnStatusCommand(CString& sCommand);
|
||||
bool OnModCommand(const CString& sCommand);
|
||||
bool OnModNotice(const CString& sMessage);
|
||||
bool OnModCTCP(const CString& sMessage);
|
||||
|
||||
virtual bool OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans);
|
||||
virtual bool OnNick(const CNick& Nick, const CString& sNewNick, const vector<CChan*>& vChans);
|
||||
virtual bool OnKick(const CNick& Nick, const CString& sOpNick, CChan& Channel, const CString& sMessage);
|
||||
virtual bool OnJoin(const CNick& Nick, CChan& Channel);
|
||||
virtual bool OnPart(const CNick& Nick, CChan& Channel);
|
||||
bool OnQuit(const CNick& Nick, const CString& sMessage, const vector<CChan*>& vChans);
|
||||
bool OnNick(const CNick& Nick, const CString& sNewNick, const vector<CChan*>& vChans);
|
||||
bool OnKick(const CNick& Nick, const CString& sOpNick, CChan& Channel, const CString& sMessage);
|
||||
bool OnJoin(const CNick& Nick, CChan& Channel);
|
||||
bool OnPart(const CNick& Nick, CChan& Channel);
|
||||
|
||||
virtual bool OnClientLogin();
|
||||
virtual bool OnClientDisconnect();
|
||||
virtual bool OnUserRaw(CString& sLine);
|
||||
virtual bool OnUserCTCPReply(CString& sTarget, CString& sMessage);
|
||||
virtual bool OnUserCTCP(CString& sTarget, CString& sMessage);
|
||||
virtual bool OnUserAction(CString& sTarget, CString& sMessage);
|
||||
virtual bool OnUserMsg(CString& sTarget, CString& sMessage);
|
||||
virtual bool OnUserNotice(CString& sTarget, CString& sMessage);
|
||||
virtual bool OnUserJoin(CString& sChannel, CString& sKey);
|
||||
virtual bool OnUserPart(CString& sChannel, CString& sMessage);
|
||||
virtual bool OnUserTopic(CString& sChannel, CString& sTopic);
|
||||
virtual bool OnUserTopicRequest(CString& sChannel);
|
||||
bool OnClientLogin();
|
||||
bool OnClientDisconnect();
|
||||
bool OnUserRaw(CString& sLine);
|
||||
bool OnUserCTCPReply(CString& sTarget, CString& sMessage);
|
||||
bool OnUserCTCP(CString& sTarget, CString& sMessage);
|
||||
bool OnUserAction(CString& sTarget, CString& sMessage);
|
||||
bool OnUserMsg(CString& sTarget, CString& sMessage);
|
||||
bool OnUserNotice(CString& sTarget, CString& sMessage);
|
||||
bool OnUserJoin(CString& sChannel, CString& sKey);
|
||||
bool OnUserPart(CString& sChannel, CString& sMessage);
|
||||
bool OnUserTopic(CString& sChannel, CString& sTopic);
|
||||
bool OnUserTopicRequest(CString& sChannel);
|
||||
|
||||
virtual bool OnCTCPReply(CNick& Nick, CString& sMessage);
|
||||
virtual bool OnPrivCTCP(CNick& Nick, CString& sMessage);
|
||||
virtual bool OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
virtual bool OnPrivAction(CNick& Nick, CString& sMessage);
|
||||
virtual bool OnChanAction(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
virtual bool OnPrivMsg(CNick& Nick, CString& sMessage);
|
||||
virtual bool OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
virtual bool OnPrivNotice(CNick& Nick, CString& sMessage);
|
||||
virtual bool OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
virtual bool OnTopic(CNick& Nick, CChan& Channel, CString& sTopic);
|
||||
virtual bool OnTimerAutoJoin(CChan& Channel);
|
||||
bool OnCTCPReply(CNick& Nick, CString& sMessage);
|
||||
bool OnPrivCTCP(CNick& Nick, CString& sMessage);
|
||||
bool OnChanCTCP(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
bool OnPrivAction(CNick& Nick, CString& sMessage);
|
||||
bool OnChanAction(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
bool OnPrivMsg(CNick& Nick, CString& sMessage);
|
||||
bool OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
bool OnPrivNotice(CNick& Nick, CString& sMessage);
|
||||
bool OnChanNotice(CNick& Nick, CChan& Channel, CString& sMessage);
|
||||
bool OnTopic(CNick& Nick, CChan& Channel, CString& sTopic);
|
||||
bool OnTimerAutoJoin(CChan& Channel);
|
||||
|
||||
CModule* FindModule(const CString& sModule) const;
|
||||
bool LoadModule(const CString& sModule, const CString& sArgs, CUser* pUser, CString& sRetMsg, bool bFake = false);
|
||||
@@ -463,13 +463,13 @@ private:
|
||||
class CGlobalModules : public CModules {
|
||||
public:
|
||||
CGlobalModules() : CModules() {}
|
||||
virtual ~CGlobalModules() {}
|
||||
~CGlobalModules() {}
|
||||
|
||||
virtual bool OnConfigLine(const CString& sName, const CString& sValue, CUser* pUser, CChan* pChan);
|
||||
virtual bool OnDeleteUser(CUser& User);
|
||||
virtual void OnClientConnect(CClient* pClient, const CString& sHost, unsigned short uPort);
|
||||
virtual bool OnLoginAttempt(CSmartPtr<CAuthBase> Auth);
|
||||
virtual void OnFailedLogin(const CString& sUsername, const CString& sRemoteIP);
|
||||
bool OnConfigLine(const CString& sName, const CString& sValue, CUser* pUser, CChan* pChan);
|
||||
bool OnDeleteUser(CUser& User);
|
||||
void OnClientConnect(CClient* pClient, const CString& sHost, unsigned short uPort);
|
||||
bool OnLoginAttempt(CSmartPtr<CAuthBase> Auth);
|
||||
void OnFailedLogin(const CString& sUsername, const CString& sRemoteIP);
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
2
Nick.h
2
Nick.h
@@ -26,7 +26,7 @@ class CNick
|
||||
public:
|
||||
CNick();
|
||||
CNick(const CString& sNick);
|
||||
virtual ~CNick();
|
||||
~CNick();
|
||||
|
||||
void Reset();
|
||||
void Parse(const CString& sNickMask);
|
||||
|
||||
2
Server.h
2
Server.h
@@ -14,7 +14,7 @@
|
||||
class CServer {
|
||||
public:
|
||||
CServer(const CString& sName, unsigned short uPort = 6667, const CString& sPass = "", bool bSSL = false);
|
||||
virtual ~CServer();
|
||||
~CServer();
|
||||
|
||||
const CString& GetName() const;
|
||||
unsigned short GetPort() const;
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
m_eEscapeTo = CString::EASCII;
|
||||
}
|
||||
|
||||
virtual ~CTemplateOptions() {}
|
||||
~CTemplateOptions() {}
|
||||
|
||||
void Parse(const CString& sLine);
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
m_pvRows = pRows;
|
||||
}
|
||||
|
||||
virtual ~CTemplateLoopContext() {}
|
||||
~CTemplateLoopContext() {}
|
||||
|
||||
// Setters
|
||||
void SetName(const CString& s) { m_sName = s; }
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
CTemplate() : MCString(), m_spOptions(new CTemplateOptions) {}
|
||||
CTemplate(const CString& sFileName) : MCString(), m_sFileName(sFileName), m_spOptions(new CTemplateOptions) {}
|
||||
CTemplate(const CSmartPtr<CTemplateOptions>& Options) : MCString(), m_spOptions(Options) {}
|
||||
virtual ~CTemplate();
|
||||
~CTemplate();
|
||||
|
||||
bool SetFile(const CString& sFileName);
|
||||
bool Print(ostream& oOut = cout);
|
||||
|
||||
2
User.h
2
User.h
@@ -32,7 +32,7 @@ class CServer;
|
||||
class CUser {
|
||||
public:
|
||||
CUser(const CString& sUserName);
|
||||
virtual ~CUser();
|
||||
~CUser();
|
||||
|
||||
bool PrintLine(CFile& File, const CString& sName, const CString& sValue);
|
||||
bool WriteConfig(CFile& File);
|
||||
|
||||
2
Utils.h
2
Utils.h
@@ -41,7 +41,7 @@ static const char g_HexDigits[] = "0123456789abcdef";
|
||||
class CUtils {
|
||||
public:
|
||||
CUtils();
|
||||
virtual ~CUtils();
|
||||
~CUtils();
|
||||
|
||||
static CString GetIP(unsigned long addr);
|
||||
static unsigned long GetLongIP(const CString& sIP);
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
CString(const char* c) : string(c) {}
|
||||
CString(const char* c, size_t l) : string(c, l) {}
|
||||
CString(const string& s) : string(s) {}
|
||||
virtual ~CString() {}
|
||||
~CString() {}
|
||||
|
||||
inline unsigned char* strnchr(const unsigned char* src, unsigned char c, unsigned int iMaxBytes, unsigned char* pFill = NULL, unsigned int* piCount = NULL) const;
|
||||
int CaseCmp(const CString& s, unsigned long uLen = CString::npos) const;
|
||||
|
||||
16
znc.h
16
znc.h
@@ -27,7 +27,7 @@ public:
|
||||
CSockManager() : TSocketManager<Csock>() {}
|
||||
virtual ~CSockManager() {}
|
||||
|
||||
virtual bool ListenHost(u_short iPort, const CString& sSockName, const CString& sBindHost, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
bool ListenHost(u_short iPort, const CString& sSockName, const CString& sBindHost, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
CSListener L(iPort, sBindHost);
|
||||
|
||||
L.SetSockName(sSockName);
|
||||
@@ -44,11 +44,11 @@ public:
|
||||
return Listen(L, pcSock);
|
||||
}
|
||||
|
||||
virtual bool ListenAll(u_short iPort, const CString& sSockName, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
bool ListenAll(u_short iPort, const CString& sSockName, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
return ListenHost(iPort, sSockName, "", isSSL, iMaxConns, pcSock, iTimeout, bIsIPv6);
|
||||
}
|
||||
|
||||
virtual u_short ListenRand(const CString& sSockName, const CString& sBindHost, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
u_short ListenRand(const CString& sSockName, const CString& sBindHost, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
unsigned short uPort = 0;
|
||||
CSListener L(0, sBindHost);
|
||||
|
||||
@@ -68,11 +68,11 @@ public:
|
||||
return uPort;
|
||||
}
|
||||
|
||||
virtual u_short ListenAllRand(const CString& sSockName, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
u_short ListenAllRand(const CString& sSockName, int isSSL = false, int iMaxConns = SOMAXCONN, Csock *pcSock = NULL, u_int iTimeout = 0, bool bIsIPv6 = false) {
|
||||
return(ListenRand(sSockName, "", isSSL, iMaxConns, pcSock, iTimeout, bIsIPv6));
|
||||
}
|
||||
|
||||
virtual bool Connect(const CString& sHostname, u_short iPort , const CString& sSockName, int iTimeout = 60, bool isSSL = false, const CString& sBindHost = "", Csock *pcSock = NULL) {
|
||||
bool Connect(const CString& sHostname, u_short iPort , const CString& sSockName, int iTimeout = 60, bool isSSL = false, const CString& sBindHost = "", Csock *pcSock = NULL) {
|
||||
CSConnection C(sHostname, iPort, iTimeout);
|
||||
|
||||
C.SetSockName(sSockName);
|
||||
@@ -90,7 +90,7 @@ class CConnectUserTimer;
|
||||
class CZNC {
|
||||
public:
|
||||
CZNC();
|
||||
virtual ~CZNC();
|
||||
~CZNC();
|
||||
|
||||
void DeleteUsers();
|
||||
int Loop();
|
||||
@@ -223,7 +223,7 @@ protected:
|
||||
class CRealListener : public Csock {
|
||||
public:
|
||||
CRealListener() : Csock() {}
|
||||
~CRealListener() {}
|
||||
virtual ~CRealListener() {}
|
||||
|
||||
virtual bool ConnectionFrom(const CString& sHost, unsigned short uPort) {
|
||||
DEBUG_ONLY(cout << GetSockName() << " == ConnectionFrom(" << sHost << ", " << uPort << ")" << endl);
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
m_pListener = NULL;
|
||||
}
|
||||
|
||||
virtual ~CListener() {
|
||||
~CListener() {
|
||||
if (m_pListener)
|
||||
CZNC::Get().GetManager().DelSockByAddr(m_pListener);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user