📄 warplugin.h
字号:
/** Base class for plugins*/#ifndef WAR_PLUGIN_H#define WAR_PLUGIN_H/* SYSTEM INCLUDES *//* PROJECT INCLUDES */#ifndef WAR_SMART_POINTER_H# include "WarSmartPointer.h"#endif#ifndef WAR_PTR_WRAPPER_H# include "WarPtrWrapper.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarPlugin : public WarSmartPointer{public: // LIFECYCLE /** * Default constructor. */ WarPlugin() {} // OPERATORS // OPERATIONS // CALLBACK // ACCESS // INQUIRYprotected: ~WarPlugin() {}private:};/* NB: Must be called with args in bracets * * WAR_RUN_PLUGINS(FooClass, (arg)) return */#define WAR_PLUGINS_BEGINPRC(baseclass, type, args)\try\{\ std::list<WarPtrWrapper<baseclass##_##type> >& \ ref = (std::list<WarPtrWrapper<baseclass##_##type> >&)\ WarPluginSupport<baseclass>::GetPlugins(baseclass##_##type::GetId());\ for (std::list<WarPtrWrapper<baseclass##_##type> >::iterator\ P = ref.begin()\ ; P != ref.end()\ ; P++)\ {\ (*P)->OnProcess args ;\ }\}\catch(WarException& e)\{\ switch(e.LocalError())\ {\ case WAR_ERR_PLUGIN_NONEXT:\ break;\ case WAR_ERR_PLUGIN_DONE:\ /* Default if called by WAR_PLUGINS_BEGINPRC is to throw!*/#define WAR_PLUGIN_ENDPRC()\ default:\ throw(e);\ }\}#define WAR_RUN_PLUGINS(baseclass, type, args)\ WAR_PLUGINS_BEGINPRC(baseclass, type, args) return;\ WAR_PLUGIN_ENDPRC()/* INLINE METHODS *//* EXTERNAL REFERENCES */typedef WarPtrWrapper<WarPlugin> war_plugin_ptr_t;typedef std::list<war_plugin_ptr_t> war_plugin_list_t;#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_PLUGIN_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -