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 / ObjectList.cxx < prev    next >
C/C++ Source or Header  |  1994-04-23  |  1KB  |  53 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/ObjectList.cxx,v $
  9.  **    $Revision: 1.3 $
  10.  **    $Date: 1994/04/23 21:02:13 $
  11.  **    $Author: Armin_Vogt $
  12.  **
  13.  ******************************************************************************/
  14.  
  15.  
  16. #include <APlusPlus/exec/ObjectList.h>
  17. #include <APlusPlus/environment/APPObject.h>
  18.  
  19.  
  20. volatile static char rcs_id[] = "$Id: ObjectList.cxx,v 1.3 1994/04/23 21:02:13 Armin_Vogt Exp Armin_Vogt $";
  21.  
  22.  
  23. TObjList::~TObjList()
  24.    /* Delete all traced objects at the end of the programm.
  25.    */
  26. {
  27.    FOREACHSAFE(TObjNode, this)
  28.    {
  29.       delete node;
  30.    }
  31.    NEXTSAFE
  32.    _dout("~TObjList done\n");
  33. }
  34.  
  35. ReferenceNode *ReferenceList::findObject(APTR objectptr,UBYTE objtype)
  36. {
  37.    FOREACHOF(ReferenceNode,this)
  38.       if (objectptr==NULL || node->object() == objectptr)
  39.          if (objtype==0 || node->type() == objtype) return node;
  40.  
  41.    return NULL;
  42. }
  43.  
  44. void TObjList::deleteTObj(APTR obj)
  45. {
  46.    TObjNode *node;
  47.  
  48.    if (node = (TObjNode*)findObject(obj))
  49.    {
  50.       delete node;   // remove node, free resource and free memory
  51.    }
  52. }
  53.