home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / som / somk / c / tp / ll.idl < prev    next >
Encoding:
Text File  |  1996-01-24  |  3.2 KB  |  142 lines

  1. /*
  2.  *    %Z% %I% %W% %G% %U% [%H% %T%] (c)IBM Corp. 1992
  3.  */
  4.  
  5. // This file was generated by the SOM Compiler.
  6. // FileName: ll.id2.
  7. // Generated using:
  8. //     SOM Precompiler spc: 6.9
  9. //     SOM Emitter emitidl.dll: 6.8
  10.  
  11. //  This class is adapted from the book
  12. //    Class Construction in C and C++, Object Oriented Fundamentals
  13. //    by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  14. //  Reprinted with permission.
  15.  
  16. #ifndef ll_idl
  17. #define ll_idl
  18.  
  19. #include "bt.idl"
  20.  
  21. interface link;
  22.  
  23. interface linkedList : baseType
  24. {
  25.   baseType llHead();
  26.   
  27.   // Make the head of the list the current link, and
  28.   // return its contents.
  29.  
  30.   baseType llTail();
  31.   
  32.   // Make the tail of the list the current link, and
  33.   // returns its contents.
  34.  
  35.   long llLength();
  36.   
  37.   // Return the number of links is the list.
  38.  
  39.   void llSetMax(in long newMax);
  40.   
  41.   // Set the maximum number of links the list can contain.
  42.  
  43.   long llLeft();
  44.   
  45.   // Return the number of links that can still be added to the
  46.   // list.
  47.  
  48.   baseType llNext();
  49.   
  50.   // Make the link after current the new current link, and
  51.   // return its contents.
  52.  
  53.   baseType llPrevious();
  54.   
  55.   // Make the link before current the new current link, and
  56.   // return its contents.
  57.  
  58.   baseType llRetrieve();
  59.   
  60.   // Return the contents of the current link.
  61.  
  62.   baseType llReplace(in baseType newElement);
  63.   
  64.   // Replace the contents of the current list but this new
  65.   // element, and return a pointer to the new contents.
  66.  
  67.   baseType llPromoteTail();
  68.   
  69.   // Move the tail link to the head of the list, and return
  70.   // its contents.
  71.  
  72.   baseType llAddHead(in baseType newElement);
  73.   
  74.   // Add a link containing this new Element to the head of the
  75.   // list, and return a pointer to the new Element.
  76.  
  77.   baseType llAddTail(in baseType newElement);
  78.   
  79.   // Add a link containing this new Element to the tail of the
  80.   // list, and return a pointer to the new Element.
  81.  
  82.   baseType llRemoveHead();
  83.   
  84.   // Delete the link at the head of the list.
  85.  
  86.   long llIsTail();
  87.   
  88.   // Returns TRUE if the current link is the head of the list,
  89.   // FALSE otherwise.
  90.  
  91.   void llFreeContents();
  92.   
  93.   // Frees the entire list, including the contents of each link.
  94.  
  95.   void llTrace(inout FILE output);
  96.   
  97.   // Trace the linkedList, useful for debugging.
  98.  
  99.  
  100.  
  101. #ifdef __SOMIDL__
  102.   implementation {
  103.  
  104.     releaseorder: llHead,llTail,llLength,llSetMax,llLeft,llNext,llPrevious, 
  105.                   llRetrieve,llReplace,llPromoteTail,llAddHead,llAddTail, 
  106.                   llRemoveHead,llIsTail,llFreeContents,llTrace;
  107.  
  108.     //# Class Modifiers
  109.     callstyle = oidl;
  110.     local; 
  111.     filestem = ll;
  112.  
  113.     passthru C_h =      "#include \"bt.h\""
  114. "#include <stdio.h>";
  115.  
  116.  
  117.     //# Internal Instance Variables
  118.     long max;                      
  119.     long nlinks;                   
  120.     link currentLink;             
  121.     link headLink;                
  122.     link tailLink;                
  123.  
  124.     //# Method Modifiers
  125.     print: override;
  126.     somInit: override;
  127.     somUninit: override;
  128.     somDumpSelfInt: override;
  129.  
  130.     //# Data Modifiers
  131.     max: ;
  132.     nlinks: ;
  133.     currentLink: ;
  134.     headLink: ;
  135.     tailLink: ;
  136.  
  137.   };
  138. #endif /* __SOMIDL__ */
  139. };
  140.  
  141. #endif  /* ll_idl */
  142.