core/sm_globals.h
author David Anderson <dvander@alliedmods.net>
Sat Dec 30 07:23:17 2006 +0000 (2006-12-30)
changeset 233 968f92668138
parent 229 7819a42069e4
child 252 ce166c465bad
permissions -rw-r--r--
added automatic native registration
added string include file
renamed typeutil and its functions
redid a bunch of the string natives
string natives now register
     1 #ifndef _INCLUDE_SOURCEMOD_GLOBALS_H_
     2 #define _INCLUDE_SOURCEMOD_GLOBALS_H_
     3 
     4 /**
     5  * @file Contains global headers that most files in SourceMod will need.
     6  */
     7 
     8 #include <sp_vm_types.h>
     9 #include <sp_vm_api.h>
    10 #include "sm_platform.h"
    11 #include "interfaces/IShareSys.h"
    12 
    13 using namespace SourcePawn;
    14 using namespace SourceMod;
    15 
    16 /** 
    17  * @brief Any class deriving from this will be automatically initiated/shutdown by SourceMod
    18  */
    19 class SMGlobalClass
    20 {
    21 	friend class SourceModBase;
    22 public:
    23 	SMGlobalClass();
    24 public:
    25 	/**
    26 	 * @brief Called when SourceMod is initially loading
    27 	 */
    28 	virtual void OnSourceModStartup(bool late)
    29 	{
    30 	}
    31 
    32 	/**
    33 	 * @brief Called after all global classes have initialized
    34 	 */
    35 	virtual void OnSourceModAllInitialized()
    36 	{
    37 	}
    38 
    39 	/**
    40 	 * @brief Called when SourceMod is shutting down
    41 	 */
    42 	virtual void OnSourceModShutdown()
    43 	{
    44 	}
    45 private:
    46 	SMGlobalClass *m_pGlobalClassNext;
    47 	static SMGlobalClass *head;
    48 };
    49 
    50 extern ISourcePawnEngine *g_pSourcePawn;
    51 extern IVirtualMachine *g_pVM;
    52 
    53 #include "sm_autonatives.h"
    54 
    55 #endif //_INCLUDE_SOURCEMOD_GLOBALS_H_