extensions/threader/extension.h
author David Anderson <dvander@alliedmods.net>
Fri Jan 19 04:35:56 2007 +0000 (2007-01-19)
changeset 322 d0d1fd080035
child 373 bf3335acefdd
permissions -rw-r--r--
initial import of threading extension
     1 #ifndef _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
     2 #define _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
     3 
     4 #include "smsdk_ext.h"
     5 
     6 /**
     7  * @brief Sample implementation of the SDK Extension.
     8  * Note: Uncomment one of the pre-defined virtual functions in order to use it.
     9  */
    10 class Sample : public SDKExtension
    11 {
    12 public:
    13 	/**
    14 	 * @brief This is called after the initial loading sequence has been processed.
    15 	 *
    16 	 * @param error		Error message buffer.
    17 	 * @param err_max	Size of error message buffer.
    18 	 * @param late		Whether or not the module was loaded after map load.
    19 	 * @return			True to succeed loading, false to fail.
    20 	 */
    21 	virtual bool SDK_OnLoad(char *error, size_t err_max, bool late);
    22 	
    23 	/**
    24 	 * @brief This is called right before the extension is unloaded.
    25 	 */
    26 	//virtual void SDK_OnUnload();
    27 
    28 	/**
    29 	 * @brief This is called once all known extensions have been loaded.
    30 	 * Note: It is is a good idea to add natives here, if any are provided.
    31 	 */
    32 	//virtual void SDK_OnAllLoaded();
    33 
    34 	/**
    35 	 * @brief Called when the pause state is changed.
    36 	 */
    37 	//virtual void SDK_OnPauseChange(bool paused);
    38 
    39 	/**
    40 	 * @brief this is called when Core wants to know if your extension is working.
    41 	 *
    42 	 * @param error		Error message buffer.
    43 	 * @param err_max	Size of error message buffer.
    44 	 * @return			True if working, false otherwise.
    45 	 */
    46 	//virtual void QueryRunning(char *error, size_t maxlength);
    47 public:
    48 #if defined SMEXT_CONF_METAMOD
    49 	/**
    50 	 * Read smext_base.h for documentation on these.
    51 	 */
    52 
    53 	//virtual bool SDK_OnMetamodLoad(char *error, size_t err_max, bool late);
    54 	//virtual bool SDK_OnMetamodUnload(char *error, size_t err_max);
    55 	//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t err_max);
    56 #endif
    57 };
    58 
    59 #endif //_INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_