home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / c / appsource.lha / APlusPlus / libsource / PriorityList.cxx < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-29  |  1.2 KB  |  47 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:RCS/libsource/PriorityList.cxx,v $
  9.  **   $Revision: 1.6 $
  10.  **   $Date: 1994/07/27 11:51:25 $
  11.  **   $Author: Armin_Vogt $
  12.  **
  13.  ******************************************************************************/
  14.  
  15.  
  16. #include <APlusPlus/exec/PriorityList.h>
  17.  
  18.  
  19. static const char rcs_id[] = "$Id: PriorityList.cxx,v 1.6 1994/07/27 11:51:25 Armin_Vogt Exp Armin_Vogt $";
  20.  
  21.  
  22. PriorityNode::PriorityNode(const UBYTE* name,UBYTE type) : NodeC(name,type)
  23. {
  24. }
  25.  
  26. PriorityList::PriorityList(UBYTE type) : ListC(type)
  27. {
  28. }
  29.  
  30. BYTE PriorityList::internalEnqueue(PriorityNode *node,BYTE pri)
  31. {
  32.    BYTE old_pri;
  33.  
  34.    old_pri = node->priority();
  35.    ((NodeC*)node)->setPriority(pri); // GCC 2.5.4. understands setPriority() to be private!?
  36.    ListC::enqueue(node);
  37.  
  38.    return old_pri;
  39. }
  40. BYTE PriorityList::internalChangePri(PriorityNode *node,BYTE pri)
  41. {
  42.    // be carefull, membership of the node is not checked here, therefore this is internal only!
  43.    Remove((struct Node*)node);
  44.    return internalEnqueue(node,pri);
  45. }
  46.  
  47.