home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / gnu / aplusplus-1.01-src.lha / src / amiga / aplusplus-1.01 / include / aplusplus / exec / LvObject.h < prev    next >
C/C++ Source or Header  |  1994-07-07  |  2KB  |  54 lines

  1. #ifndef APP_LvObject_H
  2. #define APP_LvObject_H
  3. #include <APlusPlus/exec/AmiProc.h>    // by Doug Walker and Steve Krueger
  4. /******************************************************************************
  5.  **
  6.  **    C++ Class Library for the Amiga© system software.
  7.  **
  8.  **    Copyright (C) 1994 by Armin Vogt  **  EMail: armin@uni-paderborn.de
  9.  **    All Rights Reserved.
  10.  **
  11.  **    $VER: apphome:APlusPlus/exec/LvObject.h 1.04 (04.05.94) $
  12.  **    
  13.  ******************************************************************************/
  14.  
  15.  
  16. /****************************************************************************************
  17.       » class LivingObject «    virtual base class
  18.     
  19.     Each Living object runs on its own task and has its main procedure which can be
  20.     overwritten easily in derived classes. Within this main procedure all kinds of objects
  21.     may be created, also objects that have static data since each living object gets its
  22.     private near data section. The object starts its 'life' at the moment of creation 
  23.     and ceases from existence with the destruction.
  24.     
  25.     
  26.     Any access to the object should be done via semaphores or inter process communications.
  27.      
  28.     This class takes advantage of the AmiProc package by Doug Walker and Steve Krueger
  29.     that allows creating several child tasks with their personal copy of the near data
  30.     section. 
  31.     AMIPROC Copyright (c) 1994 Steve Krueger and Doug Walker
  32.  
  33.  ****************************************************************************************/
  34.  
  35. class LivingObject
  36. {
  37.     private:
  38.         struct AmiProcMsg *ap_msg;        
  39.         static int func(void *);
  40.         
  41.    protected:
  42.         virtual int main()=0;    // overwrite to make your own object main loop
  43.         
  44.     public:
  45.         LivingObject();        // create object on its own task. Start it with activate()
  46.         ~LivingObject();        // terminate the LivingObject (waits for self termination)
  47.         
  48.         BOOL activate();        // bring the object task to life
  49.         BOOL isLiving();        // check for life signs (not implemented)
  50.  
  51. };
  52.  
  53. #endif
  54.