Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

robfrontend.h

Go to the documentation of this file.
00001 /*
00002  * robfrontend.h
00003  * 
00004  * Copyright (c) 2000-2004 by Florian Fischer (florianfischer@gmx.de)
00005  * and Martin Trautmann (martintrautmann@gmx.de) 
00006  * 
00007  * This file may be distributed and/or modified under the terms of the 
00008  * GNU General Public License version 2 as published by the Free Software 
00009  * Foundation. 
00010  * 
00011  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013  * 
00014  */
00015 
00020 #ifndef __RT_FRONTEND__
00021 #define __RT_FRONTEND__
00022 
00023 #include <rtcollect.h>
00024 #include <rtlist.h>
00025 #include <rtstring.h>
00026 
00027 using namespace lrt;
00028 
00029 #include "robmanage.h"
00030 #include "robvars.h"
00031 #include "robbase.h"
00032 
00033 namespace rt {
00034 
00035 // fwd declare
00036 class Frontend;
00037 
00040 enum FpInterpretePos {
00044         fpInterPosBefore,       
00048         fpInterPosAfter
00049 };
00050 
00052 class FrontendPlugin{
00053 public:
00056         virtual FpInterpretePos getInterpretePos() = 0;
00058         virtual String getName() = 0;
00061         virtual String getHelpText() = 0;
00067         virtual bool interpreteParams(const Array<String>& params, Array<bool>& used) = 0;
00070         virtual void fillOptions(SimOptions& options) = 0;
00075         void setActive(bool a) { active = a; }
00076         bool isActive() { return active; }
00077         virtual ~FrontendPlugin() {}
00078 
00079 protected:
00081         bool active;
00083         Frontend* parent;
00085         FrontendPlugin(Frontend* parent) : parent(parent), active(false) {}
00086 
00087 };
00088 
00090 class Frontend : public ErrorHandler{
00091 
00092 public:
00094         bool doAllAgain;
00097         virtual FrontendPlugin* findPlugin(const String& name);
00098         virtual ~Frontend();
00099 
00101         virtual void reset() {}
00103         bool interpreteParams(const Array<String>& params);
00106         virtual void fillOptions(SimOptions& options);
00108         virtual SimManager* getManager();
00109 
00110 // These are only for usage by Frontends and FrontendPlugins!
00111 public:
00113         enum FightType {
00114                 ftSingle = 0,
00115                 ftCharts = 1,
00116                 ftTop = 10,
00117                 ftTopWithOld = 11,
00118                 ftAllInOne = 30
00119         };
00121         FightType fightType;
00123         int fightTypeParam;
00126         String competitionFolder;
00127 
00129         bool noRandom;
00131         int numRepeats;
00133         String optionFile;
00135         Vector<String> files;
00136 
00137 protected:
00138 
00140         virtual void initPlugins();
00142         List<FrontendPlugin*> plugins;
00143 
00144         SimManager* manager;
00146         Frontend();
00150         virtual bool interpreteParamsImpl(const Array<String>& params, Array<bool>& used) = 0;
00151 
00152 };
00153 
00154 } // namespace
00155 
00156 #endif
00157 

This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer