core/sm_globals.h
author Borja Ferrer <faluco@alliedmods.net>
Thu Jan 11 01:11:24 2007 +0000 (2007-01-11)
changeset 281 830ca16e6d84
parent 252 ce166c465bad
child 324 e23aca731e37
permissions -rw-r--r--
logger gets initialized now
     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 
    46 	/**
    47 	* @brief Called after SourceMod is completely shutted down
    48 	*/
    49 	virtual void OnSourceModAllShutdown()
    50 	{
    51 	}
    52 private:
    53 	SMGlobalClass *m_pGlobalClassNext;
    54 	static SMGlobalClass *head;
    55 };
    56 
    57 extern ISourcePawnEngine *g_pSourcePawn;
    58 extern IVirtualMachine *g_pVM;
    59 extern IdentityToken_t *g_pCoreIdent;
    60 
    61 #include "sm_autonatives.h"
    62 
    63 #endif //_INCLUDE_SOURCEMOD_GLOBALS_H_