home *** CD-ROM | disk | FTP | other *** search
/ ftptest.leeds.ac.uk / 2015.02.ftptest.leeds.ac.uk.tar / ftptest.leeds.ac.uk / bionet / CAE-GROUP / SCL-WIN3x / SCL.EXE / ATT_LIST.CPP < prev    next >
C/C++ Source or Header  |  1994-08-06  |  1KB  |  75 lines

  1.  
  2. /*
  3. * NIST STEP Core Class Library
  4. * clstepcore/STEPattributeList.cc
  5. * February, 1994
  6. * K. C. Morris
  7. * David Sauder
  8.  
  9. * Development of this software was funded by the United States Government,
  10. * and is not subject to copyright.
  11. */
  12.  
  13. /* $Id: STEPattributeList.cc,v 2.0.1.1 1994/04/05 16:39:35 sauderd Exp $ */
  14.  
  15. #include <att_List.h>
  16. #include <attribut.h>
  17. #include <stdlib.h>
  18.  
  19.  
  20. STEPattribute& STEPattributeList::operator [] (int n)
  21. {
  22.     int x = 0; 
  23.     STEPattribute dummy;
  24.     AttrListNode* a = (AttrListNode *)head;
  25.     if(n < EntryCount())
  26.     while (a && (x < n))
  27.     {
  28.         a = (AttrListNode *)(a->next);
  29.         x++;
  30.     }
  31.     if (a)  return *(a->attr);
  32.  
  33.     else
  34.     return dummy;
  35.     cerr << "\nERROR in STEP Core library:  " << __FILE__ <<  ":"
  36.       << __LINE__ << "\n" << _POC_ << "\n\n";
  37. }
  38.  
  39. int STEPattributeList::list_length()
  40. {
  41.     return EntryCount();
  42. }
  43.  
  44. void STEPattributeList::push(STEPattribute *a)
  45. {
  46.     AttrListNode *saln = new AttrListNode(a);
  47.     AppendNode(saln);
  48. }
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. /*
  60. STEPattributeListNode NilSTEPattributeListNode;
  61.  
  62. class init_NilSTEPattributeListNode
  63. {
  64. public:
  65.   inline init_NilSTEPattributeListNode() 
  66.   {
  67.     NilSTEPattributeListNode.tl = &NilSTEPattributeListNode;
  68.     NilSTEPattributeListNode.ref = -1;
  69.   }
  70. };
  71.  
  72. static init_NilSTEPattributeListNode NilSTEPattributeListNode_initializer;
  73.  
  74. */
  75.