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 / FWRefCnt / SLRefCnt.cpp < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.0 KB  |  104 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLRefCnt.cpp
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWFound.hpp"
  11.  
  12. #ifndef FWDEBUG_H
  13. #include "FWDebug.h"
  14. #endif
  15.  
  16. #ifndef FWODEXCE_H
  17. #include "FWODExce.h"
  18. #endif
  19.  
  20.  
  21. /*
  22.  *  This file was generated by the SOM Compiler.
  23.  *  Generated using: 
  24.  *      SOM Emitter emitxtm.dll: 2.33
  25.  */
  26.  
  27. #ifdef FW_BUILD_MAC
  28. #pragma segment FWStream
  29. #endif
  30.  
  31. #define FW_ORefCount_Class_Source
  32. #include "SLRefCnt.xih"
  33.  
  34. //----------------------------------------------------------------------------------------
  35. //    FW_ORefCountAcquire
  36. //----------------------------------------------------------------------------------------
  37.  
  38. SOM_Scope void  SOMLINK FW_ORefCountAcquire(FW_ORefCount *somSelf, Environment *)
  39. {
  40.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  41.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountAcquire");
  42.  
  43.     somThis->fRefCount++;
  44. }
  45.  
  46.  
  47. //----------------------------------------------------------------------------------------
  48. //    FW_ORefCountRelease
  49. //----------------------------------------------------------------------------------------
  50.  
  51. SOM_Scope long  SOMLINK FW_ORefCountRelease(FW_ORefCount *somSelf, Environment *)
  52. {
  53.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  54.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountRelease");
  55.  
  56.     FW_ASSERT(somThis->fRefCount != 0);
  57.     return --somThis->fRefCount;
  58. }
  59.  
  60.  
  61. //----------------------------------------------------------------------------------------
  62. //    FW_ORefCountGetRefCount
  63. //----------------------------------------------------------------------------------------
  64.  
  65. SOM_Scope long  SOMLINK FW_ORefCountGetRefCount(FW_ORefCount *somSelf, Environment *)
  66. {
  67.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  68.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountGetRefCount");
  69.  
  70.     return somThis->fRefCount;
  71. }
  72.  
  73.  
  74. //----------------------------------------------------------------------------------------
  75. //    FW_ORefCountsomInit
  76. //----------------------------------------------------------------------------------------
  77.  
  78. SOM_Scope void  SOMLINK FW_ORefCountsomInit(FW_ORefCount *somSelf)
  79. {
  80.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  81.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountsomInit");
  82.  
  83. //    FW_ORefCount_parent_SOMObject_somInit(somSelf);
  84.     somThis->fRefCount = 0;
  85. }
  86.  
  87.  
  88. //----------------------------------------------------------------------------------------
  89. //    FW_ORefCountsomUninit
  90. //----------------------------------------------------------------------------------------
  91.  
  92. SOM_Scope void  SOMLINK FW_ORefCountsomUninit(FW_ORefCount *somSelf)
  93. {
  94. FW_UNUSED(somSelf);
  95. #ifdef FW_DEBUG
  96.     FW_ORefCountData *somThis = FW_ORefCountGetData(somSelf);
  97. #endif
  98.  
  99.     FW_ORefCountMethodDebug("FW_ORefCount","FW_ORefCountsomUninit");
  100.     
  101.     FW_ASSERT(somThis->fRefCount == 0);
  102. //    FW_ORefCount_parent_SOMObject_somUninit(somSelf);
  103. }
  104.