home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / som / somk / c / tp / link.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-24  |  3.7 KB  |  144 lines

  1.  
  2. /*
  3.  *  This file was generated by the SOM Compiler.
  4.  *  Generated using:
  5.  *     SOM incremental update: 10.9
  6.  */
  7.  
  8.  
  9. #ifndef lint
  10. static char *sccsid = "%Z% %I% %W% %G% %U% [%H% %T%] (c)IBM Corp. 1992";
  11. #endif
  12.  
  13. /*
  14.  * This class is adapted from the book
  15.  *   Class Construction in C and C++, Object Oriented Fundamentals
  16.  *   by Roger Sessions, Copyright (c) 1992 Prentice Hall.
  17.  * Reprinted with permission.
  18.  */
  19.  
  20. #define link_Class_Source
  21. #if defined(_WIN32)
  22. #include "statcls.h"
  23. #endif
  24. #include "link.ih"
  25.  
  26. /* ************************************************************ */
  27. SOM_Scope void SOMLINK somInit(link * somSelf)
  28. {
  29.     linkData *somThis = linkGetData(somSelf);
  30.     linkMethodDebug("link", "somInit");
  31.     parent_somInit(somSelf);
  32.  
  33.     _next = 0;
  34.     _previous = 0;
  35.     _contents = 0;
  36. }
  37.  
  38. /* ************************************************************ */
  39.  
  40. /*
  41.  * SOM_Scope void SOMLINK somDumpSelfInt(link * somSelf,
  42.  *                        int level)
  43.  */
  44.  
  45. /*
  46.  * The prototype for somDumpSelfInt was replaced by the following prototype:
  47.  */
  48. SOM_Scope void  SOMLINK somDumpSelfInt(link *somSelf,
  49.         long level)
  50. {
  51.     linkData *somThis = linkGetData(somSelf);
  52.     linkMethodDebug("link", "somDumpSelfInt");
  53.     parent_somDumpSelfInt(somSelf, level);
  54. }
  55.  
  56. /* ************************************************************ */
  57. /*
  58.  *  Set the next pointer on target link to new link.
  59.  */
  60.  
  61. SOM_Scope void SOMLINK linkSetNext(link * somSelf,
  62.                     link * nextLink)
  63. {
  64.     linkData *somThis = linkGetData(somSelf);
  65.     linkMethodDebug("link", "linkSetNext");
  66.     _next = nextLink;
  67. }
  68.  
  69. /* ************************************************************ */
  70. /*
  71.  *  Set the previous pointer on target link to new link.
  72.  */
  73.  
  74. SOM_Scope void SOMLINK linkSetPrevious(link * somSelf,
  75.                     link * nextLink)
  76. {
  77.     linkData *somThis = linkGetData(somSelf);
  78.     linkMethodDebug("link", "linkSetPrevious");
  79.     _previous = nextLink;
  80. }
  81.  
  82. /* ************************************************************ */
  83. /*
  84.  *  Set the contents pointer on target link to new object.
  85.  */
  86.  
  87. SOM_Scope void SOMLINK linkSetContents(link * somSelf,
  88.                     baseType * newContents)
  89. {
  90.     linkData *somThis = linkGetData(somSelf);
  91.     linkMethodDebug("link", "linkSetContents");
  92.     _contents = newContents;
  93. }
  94.  
  95. /* ************************************************************ */
  96. /*
  97.  *  Get the next link after the target link.
  98.  */
  99.  
  100. SOM_Scope link *SOMLINK linkGetNext(link * somSelf)
  101. {
  102.     linkData *somThis = linkGetData(somSelf);
  103.     linkMethodDebug("link", "linkGetNext");
  104.     return (_next);
  105. }
  106.  
  107. /* ************************************************************ */
  108. /*
  109.  *  Get the previous link before the target link.
  110.  */
  111.  
  112. SOM_Scope link *SOMLINK linkGetPrevious(link * somSelf)
  113. {
  114.     linkData *somThis = linkGetData(somSelf);
  115.     linkMethodDebug("link", "linkGetPrevious");
  116.     return (_previous);
  117. }
  118.  
  119. /* ************************************************************ */
  120. /*
  121.  *  Get the contents of the target link.
  122.  */
  123.  
  124. SOM_Scope baseType *SOMLINK linkGetContents(link * somSelf)
  125. {
  126.     linkData *somThis = linkGetData(somSelf);
  127.     linkMethodDebug("link", "linkGetContents");
  128.     return (_contents);
  129. }
  130.  
  131. /* ************************************************************ */
  132. SOM_Scope void SOMLINK print(link * somSelf,
  133.                   FILE * outputFile)
  134. {
  135.     linkData *somThis = linkGetData(somSelf);
  136.     linkMethodDebug("link", "print");
  137.     fprintf(outputFile, "\n");
  138.     fprintf(outputFile, "    Link\n");
  139.     fprintf(outputFile, "    self: %x \n", somSelf);
  140.     fprintf(outputFile, "    next: %x \n", _next);
  141.     fprintf(outputFile, "previous: %x\n", _previous);
  142.     fprintf(outputFile, "contents: %x\n", _contents);
  143. }
  144.