home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v5.zip / TOOLKT21 / CPLUS / OS2H / WPPTR.XH < prev    next >
Text File  |  1993-05-03  |  4KB  |  181 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: wpptr.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitxh: 1.11
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Module Header
  13.  * 
  14.  *  Module Name: WPPTR
  15.  * 
  16.  *  OS/2 Presentation Manager Workplace class definitions
  17.  * 
  18.  *  Copyright (c) International Business Machines Corporation 1991, 1992
  19.  * 
  20.  */
  21.  
  22. #ifndef wpptr_xh
  23. #define wpptr_xh
  24. class WPPointer;
  25.  
  26. #define WPPointer_MajorVersion 1
  27. #define WPPointer_MinorVersion 2
  28.  
  29. /* C++ som defs */
  30. #include <somcls.xh>
  31.  
  32. /* C++ parent def */
  33. #ifndef wpdataf_xh
  34. #include "wpdataf.xh"
  35. #endif
  36.  
  37. #ifndef WPPointer_API
  38. #define WPPointer_API
  39. /*
  40.  * The Class API
  41.  */
  42.  
  43. /* A procedure to create the WPPointer Class */
  44. SOMEXTERN SOMClass * SOMLINK WPPointerNewClass(
  45.         integer4 majorVersion,
  46.         integer4 minorVersion);
  47.  
  48. /* A macro to return the WPPointer class object */
  49. class M_WPPointer;
  50. #define _WPPointer ((M_WPPointer*)WPPointerClassData.classObject)
  51.  
  52. /* The static interface to WPPointer and its instances */
  53. SOMEXTERN struct WPPointerClassDataStructure {
  54.     SOMClass *classObject;
  55. } WPPointerClassData;
  56.  
  57. /*
  58.  * -- Typedefs for Procedures that support WPPointer Methods
  59.  */
  60. extern "C" {
  61. }
  62.  
  63.  
  64. #endif /* WPPointer_API */
  65.  
  66.  
  67. /*
  68.  * -- The C++ Wrapper Class for WPPointer
  69.  */
  70. class WPPointer : public WPDataFile
  71. {
  72. public:
  73.  
  74. void *operator new(size_t size)
  75. {
  76.    (void) size;
  77.    if (!WPPointerClassData.classObject) 
  78.       WPPointerNewClass(WPPointer_MajorVersion,WPPointer_MinorVersion);
  79.    return (void *)
  80.       ((somTD_SOMClass_somNew)
  81.       somResolve(SOM_TestCls((SOMAny *)(WPPointerClassData.classObject),
  82.                              SOMClassClassData.classObject),
  83.                  SOMClassClassData.somNew))
  84.          ((SOMClass*)(WPPointerClassData.classObject));
  85. }
  86.  
  87. void operator delete(void * obj)
  88. {
  89.    ((SOMObject *)obj)->somFree();
  90. }
  91.  
  92.  
  93. };   /* WPPointer */
  94.  
  95.  
  96.  
  97. #endif       /* wpptr_xh */
  98.  
  99. /*
  100.  * This file was generated by the SOM Compiler.
  101.  * FileName: wpptr.xh.
  102.  * Generated using:
  103.  *     SOM Precompiler spc: 1.22
  104.  *     SOM Emitter emitxh: 1.11
  105.  */
  106. #ifndef wpptr_mxh
  107. #define wpptr_mxh
  108. class M_WPPointer;
  109.  
  110. #define M_WPPointer_MajorVersion 1
  111. #define M_WPPointer_MinorVersion 2
  112.  
  113. /* C++ som defs */
  114. #include <somcls.xh>
  115.  
  116. /* C++ parent def */
  117. #ifndef wpdataf_xh
  118. #include "wpdataf.xh"
  119. #endif
  120.  
  121. #ifndef M_WPPointer_API
  122. #define M_WPPointer_API
  123. /*
  124.  * The Class API
  125.  */
  126.  
  127. /* A procedure to create the M_WPPointer Class */
  128. SOMEXTERN SOMClass * SOMLINK M_WPPointerNewClass(
  129.         integer4 majorVersion,
  130.         integer4 minorVersion);
  131.  
  132. /* A macro to return the M_WPPointer class object */
  133. #define _M_WPPointer ((SOMClass*)M_WPPointerClassData.classObject)
  134.  
  135. /* The static interface to M_WPPointer and its instances */
  136. SOMEXTERN struct M_WPPointerClassDataStructure {
  137.     SOMClass *classObject;
  138. } M_WPPointerClassData;
  139.  
  140. /*
  141.  * -- Typedefs for Procedures that support M_WPPointer Methods
  142.  */
  143. extern "C" {
  144. }
  145.  
  146.  
  147. #endif /* M_WPPointer_API */
  148.  
  149.  
  150. /*
  151.  * -- The C++ Wrapper Class for M_WPPointer
  152.  */
  153. class M_WPPointer : public M_WPDataFile
  154. {
  155. public:
  156.  
  157. void *operator new(size_t size)
  158. {
  159.    (void) size;
  160.    if (!M_WPPointerClassData.classObject) 
  161.       M_WPPointerNewClass(M_WPPointer_MajorVersion,M_WPPointer_MinorVersion);
  162.    return (void *)
  163.       ((somTD_SOMClass_somNew)
  164.       somResolve(SOM_TestCls((SOMAny *)(M_WPPointerClassData.classObject),
  165.                              SOMClassClassData.classObject),
  166.                  SOMClassClassData.somNew))
  167.          ((SOMClass*)(M_WPPointerClassData.classObject));
  168. }
  169.  
  170. void operator delete(void * obj)
  171. {
  172.    ((SOMObject *)obj)->somFree();
  173. }
  174.  
  175.  
  176. };   /* M_WPPointer */
  177.  
  178.  
  179.  
  180. #endif       /* wpptr_mxh */
  181.