process.h

Go to the documentation of this file.
00001 /*******************************************************************\
00002 
00003                    SESAME project software license
00004 
00005               Copyright (C) 2002 University of Amsterdam
00006 
00007     This program is free software; you can redistribute it and/or
00008      modify it under the terms of the GNU General Public License
00009     as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015              GNU General Public License for more details.
00016 
00017   You should have received a copy of the GNU General Public License
00018      along with this program; if not, write to the Free Software
00019       Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00020                            02111-1307, USA.
00021 
00022       For information regarding the SESAME software project see
00023               http://sesamesim.sourceforge.net or email
00024                     jcofflan@users.sourceforge.net
00025 
00026 \*******************************************************************/
00027 
00028 #ifndef PROCESS_H
00029 #define PROCESS_H
00030 
00031 #include "id.h"
00032 #include <iostream>
00033 #include <string>
00034 using namespace std;
00035 
00036 class ProcessLoader;
00037 
00038 class Process : public Id {
00039   int argc;
00040   char **argv;
00041   ProcessLoader *processLoader;
00042 
00043  public:
00044   Process(const Id& n);
00045 
00046   virtual void main(ProcessLoader *processLoader);
00047   void setArgs(int argc, char **argv)
00048   {this->argc = argc; this->argv = argv;}
00049   void printWorkload(std::ostream &o) {}
00050 
00051   int getArgc() const {return argc;}
00052   char **getArgv() const {return argv;}
00053   std::string getFullName() const;
00054   ProcessLoader *getLoader() const {return processLoader;}
00055   
00056   yapiObject_t getYAPIType() {return yapiProcess;}
00057   virtual void dumpYML(std::ostream &stream, int tablevel);
00058 
00059  protected:
00060   virtual const char* type() const {return "Process";}
00061 
00062   Id id(const char*);
00063   virtual void main() = 0;
00064   void execute(const char *instr);
00065 };
00066 
00067 #endif

Generated on Wed Apr 5 20:57:45 2006 for Sesame by  doxygen 1.4.6