1 /* ======== SourceHook ========
2 * Copyright (C) 2004-2007 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): Pavol "PM OnoTo" Marko
8 * ============================
11 #ifndef __SOURCEHOOK_IMPL_CHOOK_H__
12 #define __SOURCEHOOK_IMPL_CHOOK_H__
22 int m_ThisPointerOffset;
23 ISHDelegate *m_pHandler;
32 int m_ThisPointerOffset;
33 ISHDelegate *m_pHandler;
35 Descriptor(Plugin ownerPlugin, int thisPtrOffset, ISHDelegate *pHandler)
36 : m_OwnerPlugin(ownerPlugin), m_ThisPointerOffset(thisPtrOffset),
43 inline CHook(Plugin ownerPlugin, int thisPtrOffset, ISHDelegate *pHandler, int hookid, bool paused=false);
44 inline bool operator==(const Descriptor &other) const;
45 inline bool operator==(int hookid) const;
46 inline Plugin GetOwnerPlugin() const;
47 inline int GetThisPointerOffset() const;
48 inline ISHDelegate *GetHandler() const;
49 inline void SetPaused(bool value);
50 inline bool IsPaused() const;
51 inline int GetID() const;
54 // *** Implementation ***
55 inline CHook::CHook(Plugin ownerPlugin, int thisPtrOffset, ISHDelegate *pHandler, int hookid, bool paused)
56 : m_OwnerPlugin(ownerPlugin), m_ThisPointerOffset(thisPtrOffset),
57 m_pHandler(pHandler), m_HookID(hookid), m_Paused(paused)
61 inline bool CHook::operator==(const Descriptor &other) const
63 return m_OwnerPlugin == other.m_OwnerPlugin
64 && m_ThisPointerOffset == other.m_ThisPointerOffset
65 && m_pHandler == other.m_pHandler;
68 inline bool CHook::operator==(int hookid) const
70 return m_HookID == hookid;
73 inline Plugin CHook::GetOwnerPlugin() const
78 inline int CHook::GetThisPointerOffset() const
80 return m_ThisPointerOffset;
83 inline ISHDelegate *CHook::GetHandler() const
88 inline void CHook::SetPaused(bool value)
93 inline bool CHook::IsPaused() const
98 inline int CHook::GetID() const