home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / aplusplus-1.01-src.lha / GNU / src / amiga / APlusPlus-1.01 / libsource / LvObject.cxx < prev    next >
C/C++ Source or Header  |  1994-04-23  |  1KB  |  64 lines

  1. /******************************************************************************
  2.  **
  3.  **    C++ Class Library for the Amiga© system software.
  4.  **
  5.  **    Copyright (C) 1994 by Armin Vogt  **  EMail: armin@uni-paderborn.de
  6.  **    All Rights Reserved.
  7.  **
  8.  **    $Source: apphome:APlusPlus/RCS/libsource/LvObject.cxx,v $
  9.  **    $Revision: 1.3 $
  10.  **    $Date: 1994/04/23 21:01:55 $
  11.  **    $Author: Armin_Vogt $
  12.  **
  13.  ******************************************************************************/
  14.  
  15.  
  16. extern "C" {
  17. #ifdef __GNUG__
  18. #include <inline/exec.h>
  19. #endif
  20.  
  21. #ifdef __SASC
  22. #include <proto/exec.h>
  23. #endif
  24. }
  25.  
  26. #include <APlusPlus/exec/LvObject.h>
  27.  
  28. volatile static char rcs_id[] = "$Id: LvObject.cxx,v 1.3 1994/04/23 21:01:55 Armin_Vogt Exp Armin_Vogt $";
  29.  
  30.  
  31. // Living Objects depend on the AMIPROC package by Doug Walker and Steve Krueger.
  32. // At the moment it is therefore impossible to compile with GNU-C++.
  33. #ifdef __SASC
  34.  
  35. LivingObject::LivingObject()
  36. {
  37.     ap_msg = NULL;
  38. }
  39.  
  40. BOOL LivingObject::activate()
  41. {
  42.     if (ap_msg) return TRUE;
  43.     
  44.     ap_msg = AmiProc_Start((int (*)(void*))func,(void*)this);
  45.     return (ap_msg!=NULL);
  46. }
  47.  
  48. LivingObject::~LivingObject()
  49. {
  50.     AmiProc_Wait(ap_msg);
  51. }
  52.  
  53. BOOL LivingObject::isLiving()
  54. {
  55.     return (ap_msg!=NULL);
  56. }
  57.  
  58. int LivingObject::func(void *thisPtr)
  59. {
  60.     return ((LivingObject*)thisPtr)->main();
  61. }
  62.  
  63. #endif
  64.