Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Process.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_Process_h_
00003 #define INCLUDED_Process_h_
00004 
00005 #include "IPC/ProcessID.h"
00006 #include <string>
00007 
00008 class RCRegion;
00009 
00010 //! Represents a common interface for each process being run
00011 class Process {
00012 public:
00013   Process(ProcessID::ProcessID_t pid, const std::string& pname);
00014   virtual ~Process();
00015   virtual void start() { doStart(); }
00016   virtual void stop() { doStop(); }
00017   virtual void run();
00018 
00019   static const char* getName() { return ProcessID::getIDStr(); }
00020   static Process * getCurrent() { return procs[ProcessID::getID()]; }
00021   
00022   virtual void statusReport(std::ostream& os);
00023   static bool statusReport(RCRegion* msg);
00024 
00025 protected:
00026   virtual void doStart() {}
00027   virtual void doStop() {}
00028   static Process* procs[ProcessID::NumProcesses];
00029   
00030 private:
00031   Process(const Process&);            //!< don't call
00032   Process& operator=(const Process&); //!< don't call
00033 };
00034 
00035 /*! @file
00036  * @brief 
00037  * @author ejt (Creator)
00038  */
00039 
00040 #endif

Tekkotsu Hardware Abstraction Layer 5.1CVS
Generated Mon May 9 05:01:39 2016 by Doxygen 1.6.3