首页 > 代码库 > object oriented programming : class application
object oriented programming : class application
class Thread_Sync; class Critical; class Info; class Info{Info(std::string str):m_info(str){} private: std::string m_info;}; // a process need: { pre-run();run();post-run();mutex for threads, running previlledge} #define APPL_DECLARE_APP( YourAppClass ) class YourAppClass : public Application { public: YourAppClass(int argc, const char * argv[]) : Application(argc, argv) {}; virtual int Main(int argc, ArgvType argv); }; // provide a main() runtine #define APPL_DEFINE_MAIN( YourAppClass ) int main(int argc, const char * argv[]) { a YourAppClass theApp(argc, argv); return(theApp.Run()); } class Application { public: virtual ~Application(); int Run(){if(Startup() && Main(argc,argv)&& Shutdown()) { return true;} return false;) static Application & TheApp(); bool SetProcessPriority(int priority); protected: Application(int argc, const char * argv[]); virtual int Startup(); virtual int Main(int argc, char ** argv) { return 1; } virtual int Shutdown(); private: Critical* m_pGuard; Info * m_info;int m_priority; int m_argc;char ** m_argv; static Application * pInstance; };
object oriented programming : class application
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。