core/sourcehook/sourcehook_impl_chookmaninfo.h
changeset 739 968e67c7780c
parent 733 2365240861a2
     1.1 --- a/core/sourcehook/sourcehook_impl_chookmaninfo.h	Fri Dec 17 22:20:10 2010 -0500
     1.2 +++ b/core/sourcehook/sourcehook_impl_chookmaninfo.h	Fri Dec 17 22:22:44 2010 -0500
     1.3 @@ -1,5 +1,5 @@
     1.4  /* ======== SourceHook ========
     1.5 -* Copyright (C) 2004-2008 Metamod:Source Development Team
     1.6 +* Copyright (C) 2004-2010 Metamod:Source Development Team
     1.7  * No warranties of any kind
     1.8  *
     1.9  * License: zlib/libpng
    1.10 @@ -46,7 +46,7 @@
    1.11  			};
    1.12  
    1.13  			// *** Interface ***
    1.14 -			inline CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc);
    1.15 +			CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc);
    1.16  
    1.17  			inline bool operator==(const Descriptor &other) const;
    1.18  			inline bool operator==(const CHookManager &other) const;
    1.19 @@ -60,11 +60,11 @@
    1.20  			inline void *GetHookFunc() const;
    1.21  			inline HookManagerPubFunc GetPubFunc() const;
    1.22  
    1.23 -			inline void Register();
    1.24 -			inline void Unregister();
    1.25 +			void Register();
    1.26 +			void Unregister();
    1.27  
    1.28 -			inline void IncrRef(CVfnPtr *pVfnPtr);
    1.29 -			inline void DecrRef(CVfnPtr *pVfnPtr);
    1.30 +			void IncrRef(CVfnPtr *pVfnPtr);
    1.31 +			void DecrRef(CVfnPtr *pVfnPtr);
    1.32  
    1.33  			List<CVfnPtr*> &GetVfnPtrList()
    1.34  			{
    1.35 @@ -79,22 +79,11 @@
    1.36  		class CHookManList : public List<CHookManager>
    1.37  		{
    1.38  		public:
    1.39 -			inline CHookManager *GetHookMan(Plugin plug, HookManagerPubFunc pubFunc);
    1.40 -			inline CHookManager *GetHookMan(CHookManager &hm);
    1.41 +			CHookManager *GetHookMan(Plugin plug, HookManagerPubFunc pubFunc);
    1.42 +			CHookManager *GetHookMan(CHookManager &hm);
    1.43  		};
    1.44  
    1.45 -		// *** Implementation ***
    1.46 -		inline CHookManager::CHookManager(Plugin ownerPlugin, HookManagerPubFunc pubFunc)
    1.47 -			: m_OwnerPlugin(ownerPlugin), m_PubFunc(pubFunc), m_Version(-1)
    1.48 -		{
    1.49 -			// Query pubfunc
    1.50 -			//  -> Should call SetInfo and set all the other variables!
    1.51 -			if (m_PubFunc(false, this) != 0)
    1.52 -			{
    1.53 -				// Error!
    1.54 -				m_Version = -1;
    1.55 -			}
    1.56 -		}
    1.57 +		// *** Implementation **/
    1.58  
    1.59  		inline CHookManager::operator bool() const
    1.60  		{
    1.61 @@ -147,50 +136,6 @@
    1.62  		{
    1.63  			return m_PubFunc;
    1.64  		}
    1.65 -
    1.66 -		inline void CHookManager::Register()
    1.67 -		{
    1.68 -			m_PubFunc(true, this);
    1.69 -		}
    1.70 -
    1.71 -		inline void CHookManager::Unregister()
    1.72 -		{
    1.73 -			m_PubFunc(true, NULL);
    1.74 -		}
    1.75 -
    1.76 -		inline void CHookManager::IncrRef(CVfnPtr *pVfnPtr)
    1.77 -		{
    1.78 -			m_VfnPtrs.push_back(pVfnPtr);
    1.79 -			if (m_VfnPtrs.size() == 1)
    1.80 -				Register();
    1.81 -		}
    1.82 -
    1.83 -		inline void CHookManager::DecrRef(CVfnPtr *pVfnPtr)
    1.84 -		{
    1.85 -			m_VfnPtrs.remove(pVfnPtr);
    1.86 -			if (m_VfnPtrs.empty())
    1.87 -				Unregister();
    1.88 -		}
    1.89 -
    1.90 -		inline CHookManager *CHookManList::GetHookMan(Plugin plug, HookManagerPubFunc pubFunc)
    1.91 -		{
    1.92 -			CHookManager hm(plug, pubFunc);
    1.93 -			return GetHookMan(hm);
    1.94 -		}
    1.95 -
    1.96 -		inline CHookManager *CHookManList::GetHookMan(CHookManager &hm)
    1.97 -		{
    1.98 -			iterator iter = find(hm);
    1.99 -			if (iter == end())
   1.100 -			{
   1.101 -				push_back(hm);
   1.102 -				return &(back());
   1.103 -			}
   1.104 -			else
   1.105 -			{
   1.106 -				return &(*iter);
   1.107 -			}
   1.108 -		}
   1.109  	}
   1.110  }
   1.111