home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWStream / SLASinks.xh < prev    next >
Encoding:
Text File  |  1996-09-16  |  4.7 KB  |  223 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SLASinks.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *     File:        SLASinks.idl
  13.  * 
  14.  *     Contains:    Interface for abstract sink classes
  15.  * 
  16.  *     Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  17.  * 
  18.  */
  19.  
  20.  
  21. #ifndef SOM_FW_OSink_xh
  22. #define SOM_FW_OSink_xh
  23.  
  24. class FW_OSink;
  25.  
  26. #define FW_OSink_MajorVersion 1
  27. #define FW_OSink_MinorVersion 0
  28.  
  29. /*
  30.  * Passthru lines: File: "C.xh", "before"
  31.  */
  32.  
  33.  
  34. /* C++ SOM defs */
  35. #include <somcls.xh>
  36. #include <somcm.xh>
  37.  
  38. /* C++ parent defs */
  39. #ifndef SOM_SOMObject_xh
  40. #include <somobj.xh>
  41. #endif
  42.  
  43. #ifndef FW_OSink_API
  44. #define FW_OSink_API
  45. /*
  46.  * -- The Class API
  47.  */
  48.  
  49. /*
  50.  * Start of user-defined types:
  51.  */
  52. class SOMClass;
  53. class SOMObject;
  54. class FW_OSink;
  55.  
  56. /*
  57.  * End of user-defined types.
  58.  */
  59.  
  60. #ifdef OLDIBMSOMAPISUPPORT
  61. #define FW_OSinkCClassData FW_OSinkClassData
  62. #define FW_OSinkNewClass(major,minor) somNewVersionedClassReference(FW_OSink,major,minor)
  63. #endif
  64.  
  65. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  66. #define FW_OSinkMetaClass SOMClass
  67.  
  68. #if PRAGMA_ALIGN_SUPPORTED
  69. #  pragma options align=power
  70. #endif
  71.  
  72. /* The API to the FW_OSink class object, and the methods it introduces. */
  73. SOMEXTERN struct FW_OSinkClassDataStructure {
  74. #ifdef OLDIBMSOMAPISUPPORT
  75.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  76. #else
  77.     long zero;
  78. #endif
  79.     somStaticClassInfo *sci;
  80.     somDToken        instanceDataToken;
  81.     long reserved [3];
  82.     somMToken somInit;
  83.     somMToken somUninit;
  84.     somMToken GetReadableBytes;
  85.     somMToken Read;
  86.     somMToken GetWritableBytes;
  87.     somMToken Write;
  88. } SOMDLINK FW_OSinkClassData;
  89.  
  90. #if PRAGMA_ALIGN_SUPPORTED
  91. #  pragma options align=reset
  92. #endif
  93.  
  94. #if !defined(FW_OSink_Class_Source) && !defined(SOM_Module_slasinks_Source)
  95. #if PRAGMA_IMPORT_SUPPORTED
  96. #pragma import list FW_OSinkClassData
  97. #endif
  98. #endif
  99.  
  100.  
  101. /*
  102.  * -- Typedefs and inline method declarations for left path inherited methods
  103.  * -- are omitted because this compilation had -museinheritedmethods in effect
  104.  */
  105.  
  106.  
  107. /*
  108.  * -- Typedefs for FW_OSink Method Procedures
  109.  */
  110. SOMEXTERN {
  111. typedef long   (* SOMLINK somTD_FW_OSink_GetReadableBytes)(FW_OSink *somSelf, Environment *ev);
  112. typedef void   (* SOMLINK somTD_FW_OSink_Read)(FW_OSink *somSelf, Environment *ev,
  113.         void* destination,
  114.         long count);
  115. typedef long   (* SOMLINK somTD_FW_OSink_GetWritableBytes)(FW_OSink *somSelf, Environment *ev);
  116. typedef void   (* SOMLINK somTD_FW_OSink_Write)(FW_OSink *somSelf, Environment *ev,
  117.         void* source,
  118.         long count);
  119. }
  120.  
  121. #endif /* FW_OSink_API */
  122.  
  123.  
  124. /*
  125.  * -- This emitter treats Method Tokens as Thunks by default.
  126.  * -- Use the sc modifier "nothunks" to change this default
  127.  */
  128. #undef somresolve_
  129. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  130.  
  131. /*
  132.  * -- The C++ Wrapper Class for FW_OSink
  133.  */
  134. class FW_OSink : public SOMObject
  135. {
  136. public:
  137.  
  138. // FW_OSink::new registers use of the class object, and then uses somNew
  139. // to allocate memory and load the object method table pointer. 
  140. void *operator new(size_t size)
  141. {
  142.     SOM_IgnoreWarning(size);
  143.     // Allocate memory using the default allocator for FW_OSink, and
  144.     // clear mem & set method table pointer, call basic initialization
  145. #ifdef SOMCHKNULL
  146.     void * __somResult = (void *)
  147.       somNewObject(FW_OSink);
  148.     SOMCHKNULL(__somResult);
  149.     return __somResult;
  150. #else
  151.     return (void*) somNewObject(FW_OSink);
  152. #endif
  153. }
  154.  
  155. // FW_OSink::delete uses the default deallocator for the object's class.
  156. void operator delete(void * obj)
  157. {
  158.     if (obj) {
  159.         SOM_Resolve(obj,SOMObject,somFree)
  160.            ( (SOMObject*) obj );
  161.     }
  162. }
  163.  
  164. /* method: GetReadableBytes */
  165. long   GetReadableBytes(Environment *ev)
  166. {
  167.    #ifdef SOMCHKEXCEPT
  168.    long __somResult = 
  169.       SOM_ResolveD(this,FW_OSink,FW_OSink,GetReadableBytes)
  170.     (this,ev);
  171.       SOMCHKEXCEPT;
  172.    return __somResult;
  173. #else
  174.    return SOM_ResolveD(this,FW_OSink,FW_OSink,GetReadableBytes)
  175.     (this,ev);
  176. #endif
  177. }
  178.  
  179. /* method: Read */
  180. void   Read(Environment *ev,
  181.         void* destination,
  182.         long count)
  183. {
  184.    SOM_ResolveD(this,FW_OSink,FW_OSink,Read)
  185.     (this,ev,destination,count);
  186. #ifdef SOMCHKEXCEPT
  187.       SOMCHKEXCEPT;
  188. #endif
  189. }
  190.  
  191. /* method: GetWritableBytes */
  192. long   GetWritableBytes(Environment *ev)
  193. {
  194.    #ifdef SOMCHKEXCEPT
  195.    long __somResult = 
  196.       SOM_ResolveD(this,FW_OSink,FW_OSink,GetWritableBytes)
  197.     (this,ev);
  198.       SOMCHKEXCEPT;
  199.    return __somResult;
  200. #else
  201.    return SOM_ResolveD(this,FW_OSink,FW_OSink,GetWritableBytes)
  202.     (this,ev);
  203. #endif
  204. }
  205.  
  206. /* method: Write */
  207. void   Write(Environment *ev,
  208.         void* source,
  209.         long count)
  210. {
  211.    SOM_ResolveD(this,FW_OSink,FW_OSink,Write)
  212.     (this,ev,source,count);
  213. #ifdef SOMCHKEXCEPT
  214.       SOMCHKEXCEPT;
  215. #endif
  216. }
  217.  
  218. };   /* FW_OSink */
  219.  
  220.  
  221.  
  222. #endif       /* SOM_FW_OSink_xh */
  223.