UCProcess.h

Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2002-2004 The Pentagram team
00003 
00004 This program is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU General Public License
00006 as published by the Free Software Foundation; either version 2
00007 of the License, or (at your option) any later version.
00008 
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 GNU General Public License for more details.
00013 
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017 */
00018 
00019 #ifndef UCPROCESS_H
00020 #define UCPROCESS_H
00021 
00022 #include <list>
00023 #include "Process.h"
00024 #include "UCStack.h"
00025 
00026 class Usecode;
00027 class IDataSource;
00028 class ODataSource;
00029 
00030 
00031 // probably won't inherit from Process directly in the future
00032 class UCProcess : public Process
00033 {
00034         friend class UCMachine;
00035         friend class Kernel;
00036 public:
00037         UCProcess();
00038         UCProcess(uint16 classid_, uint16 offset_, uint32 this_ptr = 0,
00039                           int thissize = 0, const uint8* args = 0, int argsize = 0);
00040     ~UCProcess();
00041 
00042         // p_dynamic_cast stuff
00043         ENABLE_RUNTIME_CLASSTYPE();
00044 
00045         virtual bool run(const uint32 framenum);
00046 
00047         virtual void terminate();
00048 
00049         void freeOnTerminate(uint16 index, int type);
00050 
00051         void setReturnValue(uint32 retval) { temp32 = retval; }
00052 
00054         virtual void dumpInfo();
00055 
00056         bool loadData(IDataSource* ids, uint32 version);
00057 protected:
00058         virtual void saveData(ODataSource* ods);
00059 
00060         void load(uint16 classid_, uint16 offset_, uint32 this_ptr = 0,
00061                           int thissize = 0, const uint8* args = 0, int argsize = 0);
00062         void call(uint16 classid_, uint16 offset_);
00063         bool ret();
00064 
00065         // stack base pointer
00066         uint16 bp;
00067 
00068         Usecode* usecode;
00069 
00070         uint16 classid;
00071         uint16 ip;
00072 
00073         uint32 temp32;
00074 
00075         // data stack
00076         UCStack stack;
00077 
00078         // "Free Me" list
00079         std::list<std::pair<uint16, int> > freeonterminate;
00080 };
00081 
00082 #endif

Generated on Fri Jul 27 22:27:50 2007 for pentagram by  doxygen 1.4.7