diff -r 4c2e6bd4d2e8 -r 2365240861a2 core/sourcehook/sourcehook_impl_chookmaninfo.h --- a/core/sourcehook/sourcehook_impl_chookmaninfo.h Thu Oct 14 18:14:45 2010 -0500 +++ b/core/sourcehook/sourcehook_impl_chookmaninfo.h Sat Oct 16 23:21:58 2010 -0700 @@ -1,5 +1,5 @@ /* ======== SourceHook ======== -* Copyright (C) 2004-2008 Metamod:Source Development Team +* Copyright (C) 2004-2010 Metamod:Source Development Team * No warranties of any kind * * License: zlib/libpng @@ -46,7 +46,7 @@ }; // *** Interface *** - inline CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc); + CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc); inline bool operator==(const Descriptor &other) const; inline bool operator==(const CHookManager &other) const; @@ -60,11 +60,11 @@ inline void *GetHookFunc() const; inline HookManagerPubFunc GetPubFunc() const; - inline void Register(); - inline void Unregister(); + void Register(); + void Unregister(); - inline void IncrRef(CVfnPtr *pVfnPtr); - inline void DecrRef(CVfnPtr *pVfnPtr); + void IncrRef(CVfnPtr *pVfnPtr); + void DecrRef(CVfnPtr *pVfnPtr); List &GetVfnPtrList() { @@ -79,22 +79,11 @@ class CHookManList : public List { public: - inline CHookManager *GetHookMan(Plugin plug, HookManagerPubFunc pubFunc); - inline CHookManager *GetHookMan(CHookManager &hm); + CHookManager *GetHookMan(Plugin plug, HookManagerPubFunc pubFunc); + CHookManager *GetHookMan(CHookManager &hm); }; - // *** Implementation *** - inline CHookManager::CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc) - : m_OwnerPlugin(ownerPlugin), m_PubFunc(pubFunc), m_Version(-1) - { - // Query pubfunc - // -> Should call SetInfo and set all the other variables! - if (m_PubFunc(false, this) != 0) - { - // Error! - m_Version = -1; - } - } + // *** Implementation **/ inline CHookManager::operator bool() const { @@ -147,50 +136,6 @@ { return m_PubFunc; } - - inline void CHookManager::Register() - { - m_PubFunc(true, this); - } - - inline void CHookManager::Unregister() - { - m_PubFunc(true, NULL); - } - - inline void CHookManager::IncrRef(CVfnPtr *pVfnPtr) - { - m_VfnPtrs.push_back(pVfnPtr); - if (m_VfnPtrs.size() == 1) - Register(); - } - - inline void CHookManager::DecrRef(CVfnPtr *pVfnPtr) - { - m_VfnPtrs.remove(pVfnPtr); - if (m_VfnPtrs.empty()) - Unregister(); - } - - inline CHookManager *CHookManList::GetHookMan(Plugin plug, HookManagerPubFunc pubFunc) - { - CHookManager hm(plug, pubFunc); - return GetHookMan(hm); - } - - inline CHookManager *CHookManList::GetHookMan(CHookManager &hm) - { - iterator iter = find(hm); - if (iter == end()) - { - push_back(hm); - return &(back()); - } - else - { - return &(*iter); - } - } } }