object oriented programming : class application

Posted HEIS老妖

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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的主要内容,如果未能解决你的问题,请参考以下文章

oriention object

Object Oriented Programming

Object-oriented programming

OO(object oriented面向对象)

Process-oriented vs. Object-oriented

MQF Object Oriented Programming