ClientApp.hh

00001 /*
00002 ** Stechec project is free software; you can redistribute it and/or modify
00003 ** it under the terms of the GNU General Public License as published by
00004 ** the Free Software Foundation; either version 2 of the License, or
00005 ** (at your option) any later version.
00006 **
00007 ** The complete GNU General Public Licence Notice can be found as the
00008 ** `NOTICE' file in the root directory.
00009 **
00010 ** Copyright (C) 2006 Prologin
00011 */
00012 
00013 #ifndef CLIENTAPP_H_
00014 # define CLIENTAPP_H_
00015 
00016 # include "xml/xml_config.hh"
00017 # include "ClientCx.hh"
00018 # include "RulesLoader.hh"
00019 
00020 class BaseCRules;
00021 
00028 class ClientApp
00029 {
00030 public:
00036   ClientApp(int argc, char** argv, const std::string& cfg_def_file, const std::string& cfg_def_loc);
00037   virtual ~ClientApp();
00038 
00040   int runApp();
00041 
00043   int runChampion();
00044 
00045 private:
00046   Log log_client_; // FIXME: its destructor must be called _last_.
00047 
00048 protected:
00049   virtual void showHelp(const char* prgname);
00050   virtual void showVersion();
00051   virtual int showMenu();
00052   virtual int onPlay(bool replay) = 0;
00053 
00054   xml::XMLConfig cfg_;
00055   BaseCRules* rules_;
00056   ClientCx ccx_;
00057   RulesLoader rules_loader_;
00058 
00059 private:
00060   void parseOption();
00061   void parseConfig();
00062   void setOpt();
00063   
00064   int argc_;
00065   char** argv_;
00066 
00067   char* config_file_; 
00068   int client_gid_;    
00069 };
00070 
00071 #endif /* !CLIENTAPP_H_ */

Generated on Sat Jun 23 16:07:22 2007 for Stechec/TBT by  doxygen 1.4.7