sourcehook/sourcehook_impl_ciface.h
author Pavol Marko <pavolmarko@gmail.com>
Sun Nov 11 18:51:56 2007 +0000 (2007-11-11)
branchhookman_autogen
changeset 459 53e363661d53
parent 381 8eded451c936
child 491 698397d072e2
permissions -rw-r--r--
Added test for big vtable indices
Improved testevents.h
     1 /* ======== SourceHook ========
     2 * Copyright (C) 2004-2007 Metamod:Source Development Team
     3 * No warranties of any kind
     4 *
     5 * License: zlib/libpng
     6 *
     7 * Author(s): Pavol "PM OnoTo" Marko
     8 * ============================
     9 */
    10 
    11 #ifndef __SOURCEHOOK_IMPL_CIFACE_H__
    12 #define __SOURCEHOOK_IMPL_CIFACE_H__
    13 
    14 #include "sh_list.h"
    15 
    16 namespace SourceHook
    17 {
    18 	namespace Impl
    19 	{
    20 		class CIface
    21 		{
    22 			// *** Data ***
    23 			void *m_Ptr;
    24 
    25 			List<CHook> m_PreHooks;
    26 			List<CHook> m_PostHooks;
    27 		public:
    28 
    29 			// *** Descriptor ***
    30 			typedef void* Descriptor;
    31 
    32 			// *** Interface ***
    33 			inline CIface(void *ptr);
    34 			inline bool operator==(const Descriptor &other);
    35 			inline void *GetPtr() const;
    36 			inline List<CHook> &GetPreHookList();
    37 			inline List<CHook> &GetPostHookList();
    38 			inline const List<CHook> &GetPreHookList() const;
    39 			inline const List<CHook> &GetPostHookList() const;
    40 		};
    41 
    42 		// *** Implementation ***
    43 		inline CIface::CIface(void *ptr)
    44 			: m_Ptr(ptr)
    45 		{
    46 		}
    47 
    48 		inline bool CIface::operator==(const Descriptor &other)
    49 		{
    50 			return m_Ptr == other;
    51 		}
    52 
    53 		inline void *CIface::GetPtr() const
    54 		{
    55 			return m_Ptr;
    56 		}
    57 
    58 		inline List<CHook> &CIface::GetPreHookList()
    59 		{
    60 			return m_PreHooks;
    61 		}
    62 
    63 		inline List<CHook> &CIface::GetPostHookList()
    64 		{
    65 			return m_PostHooks;
    66 		}
    67 
    68 		inline const List<CHook> &CIface::GetPreHookList() const
    69 		{
    70 			return m_PreHooks;
    71 		}
    72 
    73 		inline const List<CHook> &CIface::GetPostHookList() const
    74 		{
    75 			return m_PostHooks;
    76 		}
    77 	}
    78 }
    79 
    80 #endif
    81