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

robinstr.h

Go to the documentation of this file.
00001 /*
00002  * robinstr.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_INSTR__
00021 #define __RT_INSTR__
00022 
00023 #include <rtcollect.h>
00024 #include <rtstring.h>
00025 
00026 #include "robvars.h" // everyone include this!
00027 #include "robbase.h"
00028 
00029 using namespace lrt;
00030 
00031 // abstract base class Instr is in robbase.h
00032 namespace rt {
00033 
00034 /*******/
00035 /* DIE */
00036 /*******/
00037 
00038 class InstrDie : public Instr{
00039 
00040 public:
00041 
00042   virtual ExecReturnType exec(Task* task);
00043 
00044   String getName();
00045 
00046   InstrDie(const Globals& glob);
00047   ~InstrDie();
00048 };
00049 
00050 /********/
00051 /* MOVE */
00052 /********/
00053 
00054 class InstrMove : public Instr{
00055 
00056 public:
00057 
00058   virtual rint getNumCycles(Task* task);
00059   virtual ExecReturnType exec(Task* task);
00060 
00061   String getName();
00062 
00063   InstrMove(const Globals& glob);
00064   ~InstrMove();
00065 };
00066 
00067 /********/
00068 /* TURN */
00069 /********/
00070 
00071 class InstrTurn : public Instr{
00072 
00073 public:
00074 
00075   virtual ExecReturnType exec(Task* task);
00076 
00077   String getName();
00078 
00079   InstrTurn(const Globals& glob, const Array<Op>& ops);
00080 
00081   ~InstrTurn();
00082 };
00083 
00084 /********/
00085 /* SCAN */
00086 /********/
00087 
00088 class InstrScan : public Instr{
00089 
00090 public:
00091 
00092   rint getNumCycles(Task* task);
00093   virtual ExecReturnType exec(Task* task);
00094 
00095   String getName();
00096 
00097   InstrScan(const Globals& glob, const Array<Op>& ops);
00098   ~InstrScan();
00099 };
00100 
00101 /***********/
00102 /* FarScan */
00103 /***********/
00104 
00105 class InstrFarscan : public Instr{
00106 
00107 public:
00108 
00109   rint getNumCycles(Task* task);
00110   virtual ExecReturnType exec(Task* task);
00111 
00112   String getName();
00113 
00114   InstrFarscan(const Globals& glob, const Array<Op>& ops);
00115   ~InstrFarscan();
00116 };
00117 
00118 /*******/
00119 /* SET */
00120 /*******/
00121 
00122 class InstrSet : public Instr{
00123 
00124 public:
00125 
00126   virtual ExecReturnType exec(Task* task);
00127 
00128   String getName();
00129 
00130   InstrSet(const Globals& glob, const Array<Op>& ops);
00131   ~InstrSet();
00132 };
00133 
00134 /*******/
00135 /* MIN */
00136 /*******/
00137 
00138 class InstrMin : public Instr{
00139 
00140 public:
00141 
00142   virtual ExecReturnType exec(Task* task);
00143 
00144   String getName();
00145 
00146   InstrMin(const Globals& glob, const Array<Op>& ops);
00147   ~InstrMin();
00148 };
00149 
00150 
00151 /*******/
00152 /* MAX */
00153 /*******/
00154 
00155 class InstrMax : public Instr{
00156 
00157 public:
00158 
00159   virtual ExecReturnType exec(Task* task);
00160 
00161   String getName();
00162 
00163   InstrMax(const Globals& glob, const Array<Op>& ops);
00164   ~InstrMax();
00165 };
00166 
00167 
00168 /*******/
00169 /* ADD */
00170 /*******/
00171 
00172 class InstrAdd : public Instr{
00173 
00174 public:
00175 
00176   virtual ExecReturnType exec(Task* task);
00177 
00178   String getName();
00179 
00180   InstrAdd(const Globals& glob, const Array<Op>& ops);
00181   ~InstrAdd();
00182 };
00183 
00184 
00185 /*******/
00186 /* SUB */
00187 /*******/
00188 
00189 class InstrSub : public Instr{
00190 
00191 public:
00192   virtual ExecReturnType exec(Task* task);
00193 
00194   String getName();
00195   InstrSub(const Globals& glob, const Array<Op>& ops);
00196   ~InstrSub();
00197 };
00198 
00199 
00200 /*******/
00201 /* MUL */
00202 /*******/
00203 
00204 class InstrMul : public Instr{
00205 
00206 public:
00207   virtual ExecReturnType exec(Task* task);
00208 
00209   String getName();
00210 
00211   InstrMul(const Globals& glob, const Array<Op>& ops);
00212   ~InstrMul();
00213 };
00214 
00215 
00216 /*******/
00217 /* DIV */
00218 /*******/
00219 
00220 class InstrDiv : public Instr{
00221 
00222 public:
00223   virtual ExecReturnType exec(Task* task);
00224 
00225   String getName();
00226 
00227   InstrDiv(const Globals& glob, const Array<Op>& ops);
00228   ~InstrDiv();
00229 };
00230 
00231 
00232 /*******/
00233 /* MOD */
00234 /*******/
00235 
00236 class InstrMod : public Instr{
00237 
00238 public:
00239   virtual ExecReturnType exec(Task* task);
00240 
00241   String getName();
00242 
00243   InstrMod(const Globals& glob, const Array<Op>& ops);
00244   ~InstrMod();
00245 };
00246 
00247 
00248 /*********/
00249 /* TRANS */
00250 /*********/
00251 
00252 class InstrTrans : public Instr{
00253 
00254 public:
00255   virtual rint getNumCycles(Task* task);
00256   virtual ExecReturnType exec(Task* task);
00257 
00258   String getName();
00259 
00260   InstrTrans(const Globals& glob, const Array<Op>& ops);
00261   ~InstrTrans();
00262 };
00263 
00264 /**********/
00265 /* RTRANS */
00266 /**********/
00267 
00268 class InstrRtrans : public Instr{
00269 
00270 public:
00271   virtual rint getNumCycles(Task* task);
00272   virtual ExecReturnType exec(Task* task);
00273 
00274   String getName();
00275 
00276   InstrRtrans(const Globals& glob, const Array<Op>& ops);
00277   ~InstrRtrans();
00278 };
00279 
00280 /*********/
00281 /* AJUMP */
00282 /*********/
00283 
00284 class InstrAjump : public Instr{
00285 
00286 public:
00287   virtual ExecReturnType exec(Task* task);
00288 
00289   String getName();
00290 
00291   InstrAjump(const Globals& glob, const Array<Op>& ops);
00292   ~InstrAjump();
00293 };
00294 
00295 
00296 /********/
00297 /* JUMP */
00298 /********/
00299 
00300 class InstrJump : public Instr{
00301 
00302 public:
00303   virtual ExecReturnType exec(Task* task);
00304 
00305   String getName();
00306 
00307   InstrJump(const Globals& glob, const Array<Op>& ops);
00308   ~InstrJump();
00309 };
00310 
00311 
00312 /*********/
00313 /* BJUMP */
00314 /*********/
00315 
00316 class InstrBjump : public Instr{
00317 
00318 public:
00319   virtual ExecReturnType exec(Task* task);
00320 
00321   String getName();
00322 
00323   InstrBjump(const Globals& glob, const Array<Op>& ops);
00324   ~InstrBjump();
00325 };
00326 
00327 
00328 /*********/
00329 /* SLEEP */
00330 /*********/
00331 
00332 class InstrSleep : public Instr{
00333 
00334 public:
00335   virtual rint getNumCycles(Task* task);
00336   virtual ExecReturnType exec(Task* task);
00337   virtual TimingMode getTimingMode();
00338 
00339   String getName();
00340 
00341   InstrSleep(const Globals& glob, const Array<Op>& ops);
00342   ~InstrSleep();
00343 };
00344 
00345 
00346 /********/
00347 /* COMP */
00348 /********/
00349 
00350 class InstrComp : public Instr{
00351 
00352 public:
00353   virtual ExecReturnType exec(Task* task);
00354 
00355   String getName();
00356 
00357   InstrComp(const Globals& glob, const Array<Op>& ops);
00358   ~InstrComp();
00359 };
00360 
00361 
00362 /*********/
00363 /* NCOMP */
00364 /*********/
00365 
00366 class InstrNcomp : public Instr{
00367 
00368 public:
00369   virtual ExecReturnType exec(Task* task);
00370 
00371   String getName();
00372 
00373   InstrNcomp(const Globals& glob, const Array<Op>& ops);
00374   ~InstrNcomp();
00375 };
00376 
00377 
00378 /*********/
00379 /* LCOMP */
00380 /*********/
00381 
00382 class InstrLcomp : public Instr{
00383 
00384 public:
00385   virtual ExecReturnType exec(Task* task);
00386 
00387   String getName();
00388 
00389   InstrLcomp(const Globals& glob, const Array<Op>& ops);
00390   ~InstrLcomp();
00391 };
00392 
00393 
00394 /*********/
00395 /* GCOMP */
00396 /*********/
00397 
00398 class InstrGcomp : public Instr{
00399 
00400 public:
00401   virtual ExecReturnType exec(Task* task);
00402 
00403   String getName();
00404 
00405   InstrGcomp(const Globals& glob, const Array<Op>& ops);
00406   ~InstrGcomp();
00407 };
00408 
00409 
00410 /**********/
00411 /* CREATE */
00412 /**********/
00413 
00414 class InstrCreate : public Instr{
00415 
00416 public:
00417   virtual rint getNumCycles(Task* task);
00418   virtual ExecReturnType exec(Task* task);
00419 
00420   String getName();
00421 
00422   InstrCreate(const Globals& glob, const Array<Op>& ops);
00423   ~InstrCreate();
00424 };
00425 
00426 /**********/
00427 /* RANDOM */
00428 /**********/
00429 
00430 class InstrRandom : public Instr{
00431 
00432 public:
00433   virtual ExecReturnType exec(Task* task);
00434 
00435   String getName();
00436 
00437   InstrRandom(const Globals& glob, const Array<Op>& ops);
00438   ~InstrRandom();
00439 };
00440 
00442 
00443 /*********/
00444 /* BREAK */
00445 /*********/
00446 
00447 class InstrBreak : public Instr{
00448 
00449 public:
00450   virtual ExecReturnType exec(Task* task);
00451 
00452   String getName();
00453 
00454   InstrBreak(const Globals& glob);
00455   ~InstrBreak();
00456 };
00457 
00458 /*********/
00459 /* INIT  */
00460 /*********/
00461 
00462 class InstrInit : public Instr{
00463 
00464 public:
00465   virtual ExecReturnType exec(Task* task);
00466 
00467   String getName();
00468 
00469   InstrInit(const Globals& glob, const Array<Op>& ops);
00470   ~InstrInit();
00471 };
00472 
00473 /*********/
00474 /* SEIZE */
00475 /*********/
00476 
00477 class InstrSeize : public Instr{
00478 
00479 public:
00480   virtual ExecReturnType exec(Task* task);
00481 
00482   String getName();
00483 
00484   InstrSeize(const Globals& glob);
00485   ~InstrSeize();
00486 };
00487 
00488 /**********/
00489 /* RESUME */
00490 /**********/
00491 
00492 class InstrResume : public Instr{
00493 
00494 public:
00495   virtual ExecReturnType exec(Task* task);
00496 
00497   String getName();
00498 
00499   InstrResume(const Globals& glob);
00500   ~InstrResume();
00501 };
00502 
00503 /********/
00504 /* QUIT */
00505 /********/
00506 
00507 class InstrQuit : public Instr{
00508 
00509 public:
00510   virtual ExecReturnType exec(Task* task);
00511 
00512   String getName();
00513 
00514   InstrQuit(const Globals& glob);
00515   ~InstrQuit();
00516 };
00517 
00518 
00519 
00520 
00521 
00522 } // namespace
00523 
00524 
00525 #endif
00526 

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