home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc Source Code / Storage / Bento / CMCtr.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-22  |  21.2 KB  |  664 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        CMCtr.cpp
  3.  
  4.     Contains:    Implementation of ODBentoContainer class.
  5.  
  6.     Owned by:    Vincent Lo
  7.  
  8.     Copyright:    © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <26>    10/24/95    jpa        1293441: DM/VL: Bento memory reserve &
  13.                                     fatal container err & don't throw in
  14.                                     Release.
  15.         <25>     10/8/95    TJ        Fixes Recomended by Refball
  16.         <24>     9/29/95    TJ        Made Changes for MAC SOM
  17.         <23>     8/21/95    VL        1278330, 1278315: Error code cleanup.
  18.         <22>      8/3/95    RR        #1257260: Collapse B classes. Remove
  19.                                     somInit methods. Don't call IsInitialized
  20.                                     or SubclassResponsibility
  21.         <21>     7/21/95    VL        1270320: Dispose _fID. Return a copy of the
  22.                                     ID in GetID.
  23.         <20>     5/26/95    VL        1251403: Multithreading naming support.
  24.         <19>     5/25/95    jpa        Fixed usage of ODDebug. [1253321]
  25.         <18>     5/11/95    DM        #1246524, #1246529:
  26.                                     ValueNameSpaceGetEntry() must pass through
  27.                                     the value allocated.
  28.         <17>     5/11/95    VL        1238421: Implemented Purge.
  29.         <16>      4/7/95    EL        1225905: Add GetModDate and SetModDate.
  30.         <15>     3/23/95    VL        1230357: Implemented Purge.
  31.         <14>      3/9/95    VL        1225504: Fixed Document ref-counting
  32.                                     problem.
  33.         <13>     2/10/95    VL        1205627: Added GetTargetContainer.
  34.         <12>      2/2/95    CG        #1195019:  ValueNameSpace entries are now
  35.                                     copied in and out instead of pointers being
  36.                                     passed around.
  37.         <11>     1/31/95    EL        1195846: allow clearing of the dirty flag.
  38.         <10>     1/23/95    CG        #1195019: ValueNameSpace methods now take
  39.                                     ODByteArray parameter instead of ODPtr.
  40.          <9>    11/14/94    VL        1188257: Use Bento errors in BenotDef.h.
  41.          <8>    10/12/94    VL        Fixed problem introduced in the last
  42.                                     checkin.
  43.          <7>     9/29/94    RA        1189812: Mods for 68K build.
  44.          <6>     9/23/94    VL        1184272: ContainerID is now a sequence of
  45.                                     octets. 1184166: ContainerName is ODIText
  46.                                     now.
  47.          <5>      9/5/94    VL        1184871: Used Renew to remove dependency on
  48.                                     default heap.
  49.          <4>      8/5/94    VL        1171603: Added GetCMSession.
  50.          <3>      8/3/94    VL        1153123: Storage to ODStor.
  51.          <2>      7/7/94    VL        Commented out use of ODRecoverHeapID.
  52.          <1>     6/30/94    CC        first checked in
  53.          <0>     6/27/94    SV        SOMverted
  54.          <2>     4/13/94    VL        1157028: StorageM.h does not include
  55.                                     CMAPI.h anymore, so GetCMSession returns
  56.                                     ODULong.
  57.          <1>     3/25/94    VL        first checked in
  58.          <3>     3/24/94    VL        #1147173, #1144732: Created Bento-specific
  59.                                     Container Suite classes (uses CMDocument).
  60.          <2>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  61.                                     #1150864.
  62.         <15>      2/8/94    VL        Correct capitalization and <> for includes.
  63.         <14>      2/8/94    VL        Use new exception macros.
  64.         <13>      2/4/94    VL        Moved to PPC Header and code cleanup.
  65.         <12>     1/12/94    VL        Init changes.
  66.         <11>     12/3/93    TÇ        Stop including ODError.h, it is included
  67.                                     as ErrorDef.h inside Except.h
  68.         <10>    11/23/93    VL        Made Bento Container Pool-aware.
  69.          <8>     8/20/93    VL        Implemented GetName and SetName.
  70.          <7>      8/6/93    VL        fContainer should be fCMContainer.
  71.          <6>     7/30/93    VL        ODContainerName* should be
  72.                                     ODContainerName.
  73.          <5>     7/29/93    VL        AcquireDocument should check whether a
  74.                                     ODDocument is created already.
  75.          <4>      7/6/93    VL        ODContainerName should be
  76.                                     ODContainerName*.
  77.          <3>     6/30/93    VL        Used fDocument.
  78.          <2>     6/22/93    VL        Used RefCount from ODRefCntObject.
  79.          <1>     6/15/93    VL        first checked in
  80.  
  81.     To Do:
  82.     To Do:
  83.     In Progress:
  84.         
  85. */
  86.  
  87. #define ODBentoContainer_Class_Source
  88.  
  89. #define VARIABLE_MACROS
  90.  
  91. #include <CMCtr.xih>
  92.  
  93. #ifndef _PLFMDEF_
  94. #include "PlfmDef.h"
  95. #endif
  96.  
  97. #ifndef _ODTYPES_
  98. #include "ODTypes.h"
  99. #endif
  100.  
  101. #ifndef SOM_ODStorageSystem_xh
  102. #include <ODStor.xh>
  103. #endif
  104.  
  105. #ifndef SOM_ODDocument_xh
  106. #include <Document.xh>
  107. #endif
  108.  
  109. #ifndef SOM_CMDocument_xh
  110. #include <CMDoc.xh>
  111. #endif
  112.  
  113. #ifndef SOM_ODSession_xh
  114. #include <ODSessn.xh>
  115. #endif
  116.  
  117. #ifndef _SESSHDR_
  118. #include "SessHdr.h"        // for sessionRoutinesMetahandler
  119. #endif
  120.  
  121. #ifndef __CM_API__
  122. #include "CMAPI.h"
  123. #endif
  124.  
  125. #ifndef _BENTOHDR_
  126. #include "BentoHdr.h"
  127. #endif
  128.  
  129. #ifndef _EXCEPT_
  130. #include "Except.h"
  131. #endif
  132.  
  133. #ifndef SOM_Module_OpenDoc_Errors_defined 
  134. #include <ErrorDef.xh>
  135. #endif
  136.  
  137. #ifndef _ODNEW_
  138. #include <ODNew.h>
  139. #endif
  140.  
  141. #ifndef SOM_ODNameSpaceManager_xh
  142. #include <NmSpcMg.xh>
  143. #endif
  144.  
  145. #ifndef SOM_ODValueNameSpace_xh
  146. #include <ValueNS.xh>
  147. #endif
  148.  
  149. #ifdef DebugRefCount
  150. #include <stdio.h>
  151. #endif
  152.  
  153. #ifndef _ITEXT_
  154. #include <IText.h>
  155. #endif
  156.  
  157. #ifndef _BARRAY_
  158. #include <BArray.h>
  159. #endif
  160.  
  161. #ifndef _BENTODEF_
  162. #include "BentoDef.h"
  163. #endif
  164.  
  165. #ifndef _ODMEMORY_
  166. #include "ODMemory.h"    // Adkins -- added
  167. #endif
  168.  
  169. #ifndef _ODDEBUG_
  170. #include "ODDebug.h"    // Adkins -- added
  171. #endif
  172.  
  173. #ifndef _NMSPCUTL_
  174. #include <NmSpcUtl.h>
  175. #endif
  176.  
  177.  
  178. #pragma segment BentoCtr
  179.  
  180. //==============================================================================
  181. // Constants
  182. //==============================================================================
  183.  
  184. const ODISOStr    kODContainerSuitesNameSpace = "OpenDoc:Apple:Macintosh:Container Suites";
  185. const ODISOStr    kODBentoContainerSuite = "OpenDoc:Apple:Macintosh:Container Suite:Bento";
  186. #define kODExpectedNumOfContainerSuites 10
  187.  
  188. //==============================================================================
  189. // ODBentoContainer
  190. //==============================================================================
  191.  
  192. //------------------------------------------------------------------------------
  193. // ODBentoContainer: GetStorageSystem
  194. //------------------------------------------------------------------------------
  195.  
  196. SOM_Scope ODStorageSystem*  SOMLINK ODBentoContainerGetStorageSystem(ODBentoContainer *somSelf, Environment *ev)
  197. {
  198.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  199.     ODBentoContainerMethodDebug("ODBentoContainer","GetStorageSystem");
  200.  
  201.     return _fStorageSystem;
  202. }
  203.  
  204. //------------------------------------------------------------------------------
  205. // ODBentoContainer: GetID
  206. //------------------------------------------------------------------------------
  207.  
  208. SOM_Scope ODContainerID  SOMLINK ODBentoContainerGetID(ODBentoContainer *somSelf, Environment *ev)
  209. {
  210.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  211.     ODBentoContainerMethodDebug("ODBentoContainer","GetID");
  212.  
  213.     ODContainerID id;
  214.     
  215.     SOM_TRY
  216.     
  217.     id = CopyByteArrayStruct(_fID);
  218.     
  219.     SOM_CATCH_ALL
  220.     SOM_ENDTRY
  221.     return id;
  222. }
  223.  
  224. //------------------------------------------------------------------------------
  225. // ODBentoContainer: GetName
  226. //------------------------------------------------------------------------------
  227.  
  228. SOM_Scope ODContainerName  SOMLINK ODBentoContainerGetName(ODBentoContainer *somSelf, Environment *ev)
  229. {
  230.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  231.     ODBentoContainerMethodDebug("ODBentoContainer","GetName");
  232.  
  233.     WARN("A subclass should have overridden this method!");
  234.     ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
  235.     ODContainerName dummy;
  236.     return dummy;
  237. }
  238.  
  239. //------------------------------------------------------------------------------
  240. // ODBentoContainer: SetName
  241. //------------------------------------------------------------------------------
  242.  
  243. SOM_Scope void  SOMLINK ODBentoContainerSetName(ODBentoContainer *somSelf, Environment *ev,
  244.         ODContainerName* name)
  245. {
  246.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  247.     ODBentoContainerMethodDebug("ODBentoContainer","SetName");
  248.     
  249.     WARN("A subclass should have overridden this method!");
  250.     ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
  251. }
  252.  
  253. //------------------------------------------------------------------------------
  254. // ODBentoContainer: AcquireDocument
  255. //------------------------------------------------------------------------------
  256.  
  257. SOM_Scope ODDocument*  SOMLINK ODBentoContainerAcquireDocument(ODBentoContainer *somSelf, Environment *ev,
  258.         ODDocumentID id)
  259. {
  260.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  261.     ODBentoContainerMethodDebug("ODBentoContainer","AcquireDocument");
  262.  
  263.     SOM_CATCH return (ODDocument*) kODNULL;
  264.  
  265.     if (_fDocument == kODNULL) {
  266.     
  267.         SOMClass*    cmDocClass = somNewClassReference(CMDocument);
  268.         ODULong        size = cmDocClass->somGetInstanceSize();
  269.         ODPtr        buffer = ODNewPtr(size, somSelf->GetHeap(ev));
  270.         ODDocument*    document = (ODDocument*) cmDocClass->somRenew(buffer);
  271.         somReleaseClassReference ( cmDocClass );
  272.         
  273.         if (document != kODNULL) 
  274.         {
  275.             document->InitDocument(ev, somSelf, id);
  276.             _fDocument = document;
  277.         }
  278.     }
  279.     else {
  280.         if (_fDocument->GetID(ev) != id)
  281.             THROW(kODErrDocumentDoesNotExist);
  282.         _fDocument->Acquire(ev);
  283.     }            
  284.  
  285.     return _fDocument;
  286. }
  287.  
  288. //------------------------------------------------------------------------------
  289. // ODBentoContainer: Acquire
  290. //------------------------------------------------------------------------------
  291.  
  292. SOM_Scope void  SOMLINK ODBentoContainerAcquire(ODBentoContainer *somSelf, Environment *ev)
  293. {
  294.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  295.     ODBentoContainerMethodDebug("ODBentoContainer","Acquire");
  296.  
  297.     SOM_CATCH return;
  298.  
  299.     ODBentoContainer_parent_ODContainer_Acquire(somSelf, ev);
  300. }
  301.  
  302. //------------------------------------------------------------------------------
  303. // ODBentoContainer: Release
  304. //------------------------------------------------------------------------------
  305.  
  306. SOM_Scope void  SOMLINK ODBentoContainerRelease(ODBentoContainer *somSelf, Environment *ev)
  307. {
  308.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  309.     ODBentoContainerMethodDebug("ODBentoContainer","Release");
  310.     
  311.     SOM_TRY
  312.  
  313.     ODBentoContainer_parent_ODContainer_Release(somSelf, ev);
  314.  
  315.     if (somSelf->GetRefCount(ev) == 0) {
  316.         somSelf->GetStorageSystem(ev)->ReleaseContainer(ev, somSelf);
  317.     }
  318.     
  319.     SOM_CATCH_ALL
  320.     
  321.         ODError err = ErrorCode();
  322.  
  323.         WARN("Error occurred in ODContainer::Release: %d %s", err, ErrorMessage() ?ErrorMessage() :"");
  324.  
  325. //        if (err == kODErrBentoErr)
  326. //            SetErrorCode(kODErrFatalContainerError);
  327. //        else if (err != kODErrFatalContainerError)
  328.             SetErrorCode(kODNoError);
  329.  
  330.     SOM_ENDTRY
  331. }
  332.  
  333. //------------------------------------------------------------------------------
  334. // ODBentoContainer: ~ODBentoContainer
  335. //------------------------------------------------------------------------------
  336.  
  337. SOM_Scope void  SOMLINK ODBentoContainersomUninit(ODBentoContainer *somSelf)
  338. {
  339.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  340.     ODBentoContainerMethodDebug("ODBentoContainer","somUninit");
  341.  
  342. #ifdef DebugRefCount
  343.     printf("~ODBentoContainer %x RefCount %d\n", this, somSelf->GetRefCount(ev));
  344.     fflush(stdout);
  345. #endif
  346.  
  347.     Environment*    ev = somGetGlobalEnvironment();
  348.     
  349.     if (_fDocument != kODNULL) {
  350. #if ODDebug
  351.         if (_fDocument->GetRefCount(ev) != 0)
  352.             WARN("Document not ref-counted properly.");
  353. #endif
  354.         delete _fDocument;
  355.         _fDocument = kODNULL;
  356.     }
  357.  
  358.     if (_fID)
  359.     {
  360.         ODDisposePtr(_fID->_buffer);
  361.         ODDisposePtr(_fID);
  362.     }
  363.     
  364.     ODBentoContainer_parent_ODContainer_somUninit(somSelf);
  365. }
  366.  
  367. //------------------------------------------------------------------------------
  368. // ODBentoContainer: InitContainer
  369. //------------------------------------------------------------------------------
  370.  
  371. #define kODcmAllocReserveSize (16 * 1204)
  372.  
  373. SOM_Scope void  SOMLINK ODBentoContainerInitContainer(ODBentoContainer *somSelf, Environment *ev,
  374.         ODStorageSystem* storage, ODContainerID* id)
  375. {
  376.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  377.     ODBentoContainerMethodDebug("ODBentoContainer","InitContainer");
  378.  
  379.     SOM_CATCH return;
  380.  
  381.     /* Moved from somInit. SOM itself sets fields to zero
  382.     _fStorageSystem = kODNULL;
  383.     _fID = 0;
  384.     _fDocument = kODNULL;
  385.     _fDirty = kODFalse;
  386.     _fHeap = kDefaultHeapID;
  387.     */
  388.     
  389.     _fStorageSystem = storage;
  390.     if (_fStorageSystem == kODNULL)
  391.         THROW(kODErrIllegalNullStorageSystemInput);
  392.  
  393.     ODBentoContainer_parent_ODContainer_InitContainer(somSelf, ev, storage, id);
  394.  
  395.     _fID = CopyByteArray(id);
  396.     _fHeap = ODRecoverHeapID(somSelf);
  397.     
  398.     ODSession*    session = _fStorageSystem->GetSession(ev);
  399.     ODNameSpaceManager* nameSpaceManager = session->GetNameSpaceManager(ev);
  400.     WASSERTM(nameSpaceManager != kODNULL, "No Name Space Manager");
  401.         
  402.     ODValueNameSpace* nameSpace = (ODValueNameSpace*) nameSpaceManager->HasNameSpace(ev, kODContainerSuitesNameSpace);
  403.     if (nameSpace == kODNULL) {
  404.         nameSpace = (ODValueNameSpace*) nameSpaceManager->CreateNameSpace(ev,
  405.                                             kODContainerSuitesNameSpace,
  406.                                             kODNULL,
  407.                                             kODExpectedNumOfContainerSuites,
  408.                                             kODNSDataTypeODValue);
  409.     }
  410.     
  411.     CMSession  cmSession = kODNULL;
  412.     if (nameSpace->Exists(ev, kODBentoContainerSuite) == kODFalse) {
  413.         ODSessionRefCon* sessionRefCon = new(somSelf->GetHeap(ev)) ODSessionRefCon;
  414.         
  415. #ifdef ODDebugBentoSize
  416.         {
  417.             memset(sessionRefCon, 0, sizeof(ODSessionRefCon));
  418.             SOM_TraceLevel = kODTrue;
  419.         }
  420. #endif        
  421.  
  422.         sessionRefCon->container = kODNULL;
  423.         sessionRefCon->heap = somSelf->GetHeap(ev);
  424.         sessionRefCon->cmAllocReserveBlock = kODNULL; // init to null in case alloc fails
  425.         sessionRefCon->cmAllocReserveSize = kODcmAllocReserveSize;
  426.         sessionRefCon->cmAllocReserveBlock = ODNewPtr(kODcmAllocReserveSize, sessionRefCon->heap);
  427.         
  428.         cmSession = CMStartSession(sessionRoutinesMetahandler, sessionRefCon);
  429.         ValueNameSpaceRegister( nameSpace, ev,
  430.                                 kODBentoContainerSuite,
  431.                                 (ODPtr)&cmSession,
  432.                                 sizeof(CMSession));
  433.     }
  434.     else {
  435.         CMSession* cmSessionPtr;
  436.         ODULong length = 0;
  437.         if (ValueNameSpaceGetEntry(nameSpace, ev, kODBentoContainerSuite, 
  438.                               (ODPtr*) &cmSessionPtr, &length))
  439.         {
  440.             cmSession = *cmSessionPtr;
  441.             ODDeleteObject( cmSessionPtr );
  442.         }
  443.         
  444.         WASSERTM(length == sizeof(CMSession), "No CMSession");
  445.     }
  446.     _fCMSession = cmSession;
  447. }
  448.  
  449. //------------------------------------------------------------------------------
  450. // ODBentoContainer: Create
  451. //------------------------------------------------------------------------------
  452.  
  453. SOM_Scope ODContainer*  SOMLINK ODBentoContainerCreate(ODBentoContainer *somSelf, Environment *ev)
  454. {
  455.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  456.     ODBentoContainerMethodDebug("ODBentoContainer","Create");
  457.  
  458.     WARN("A subclass should have overridden this method!");
  459.     ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
  460.     
  461.     return somSelf;
  462. }
  463.  
  464. //------------------------------------------------------------------------------
  465. // ODBentoContainer: Open
  466. //------------------------------------------------------------------------------
  467.  
  468. SOM_Scope ODContainer*  SOMLINK ODBentoContainerOpen(ODBentoContainer *somSelf, Environment *ev)
  469. {
  470.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  471.     ODBentoContainerMethodDebug("ODBentoContainer","Open");
  472.  
  473.     WARN("A subclass should have overridden this method!");
  474.     ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
  475.  
  476.     return somSelf;
  477. }
  478.  
  479. //------------------------------------------------------------------------------
  480. // ODBentoContainer: Close
  481. //------------------------------------------------------------------------------
  482.  
  483. SOM_Scope ODContainer*  SOMLINK ODBentoContainerClose(ODBentoContainer *somSelf, Environment *ev)
  484. {
  485.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  486.     ODBentoContainerMethodDebug("ODBentoContainer","Close");
  487.  
  488.     SOM_CATCH return (ODContainer*) kODNULL;
  489.  
  490.     return somSelf;
  491. }
  492.  
  493. //------------------------------------------------------------------------------
  494. // ODBentoContainer: Purge
  495. //------------------------------------------------------------------------------
  496.  
  497. SOM_Scope ODSize  SOMLINK ODBentoContainerPurge(ODBentoContainer *somSelf, Environment *ev,
  498.         ODSize size)
  499. {
  500.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  501.     ODBentoContainerMethodDebug("ODBentoContainer","Purge");
  502.     
  503.     ODSize    purgedSize = 0; ODVolatile( purgedSize );
  504.     
  505.     SOM_TRY
  506.  
  507.         purgedSize = parent_Purge(somSelf, ev, size);
  508.         if (_fDocument != kODNULL)
  509.             purgedSize += _fDocument->Purge(ev, size);
  510.     
  511.     SOM_CATCH_ALL
  512.         WARN("Error %ld trying to purge in ODBentoContainerPurge",ErrorCode());
  513.         SetErrorCode(kODNoError);        // Eat the exception; Purge should not 
  514.                                         // propagate it because clients function
  515.                                         // fine whether memory was purged or not.
  516.     SOM_ENDTRY
  517.     
  518.     return purgedSize;
  519. }
  520.  
  521. //------------------------------------------------------------------------------
  522. // ODBentoContainer: ReleaseDocument
  523. //------------------------------------------------------------------------------
  524.  
  525. SOM_Scope ODContainer*  SOMLINK ODBentoContainerReleaseDocument(ODBentoContainer *somSelf, Environment *ev,
  526.         ODDocument* document)
  527. {
  528.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  529.     ODBentoContainerMethodDebug("ODBentoContainer","ReleaseDocument");
  530.  
  531.     return somSelf;
  532. }
  533.  
  534. //------------------------------------------------------------------------------
  535. // ODBentoContainer: GetCMContainer
  536. //------------------------------------------------------------------------------
  537.  
  538. SOM_Scope CMContainer  SOMLINK ODBentoContainerGetCMContainer(ODBentoContainer *somSelf, Environment *ev)
  539. {
  540.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  541.     ODBentoContainerMethodDebug("ODBentoContainer","ODBentoContainerGetCMContainer");
  542.  
  543.     WARN("A subclass should have overridden this method!");
  544.     ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
  545.  
  546.     return (CMContainer) kODNULL;
  547. }
  548.  
  549. //------------------------------------------------------------------------------
  550. // ODBentoContainer: GetHandlers
  551. //------------------------------------------------------------------------------
  552.  
  553. SOM_Scope ODBentoHandlers*  SOMLINK ODBentoContainerGetHandlers(ODBentoContainer *somSelf, Environment *ev)
  554. {
  555.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  556.     ODBentoContainerMethodDebug("ODBentoContainer","ODBentoContainerGetHandlers");
  557.  
  558.     WARN("A subclass should have overridden this method!");
  559.     ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
  560.  
  561.     return (ODBentoHandlers*) kODNULL;
  562. }
  563.  
  564. //------------------------------------------------------------------------------
  565. // ODBentoContainer: GetDirtyFlag
  566. //------------------------------------------------------------------------------
  567.  
  568. SOM_Scope ODBoolean  SOMLINK ODBentoContainerGetDirtyFlag(ODBentoContainer *somSelf, Environment *ev)
  569. {
  570.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  571.     ODBentoContainerMethodDebug("ODBentoContainer","GetDirtyFlag");
  572.  
  573.     return _fDirty;
  574. }
  575.  
  576. //------------------------------------------------------------------------------
  577. // ODBentoContainer: SetDirtyFlag
  578. //------------------------------------------------------------------------------
  579.  
  580. SOM_Scope void  SOMLINK ODBentoContainerSetDirtyFlag(ODBentoContainer *somSelf, Environment *ev, ODBoolean flag)
  581. {
  582.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  583.     ODBentoContainerMethodDebug("ODBentoContainer","SetDirtyFlag");
  584.  
  585.     _fDirty = flag;
  586. }
  587.  
  588.  
  589. //------------------------------------------------------------------------------
  590. // ODBentoContainer: GetHeap
  591. //------------------------------------------------------------------------------
  592.  
  593. SOM_Scope ODMemoryHeapID  SOMLINK ODBentoContainerGetHeap(ODBentoContainer *somSelf, Environment *ev)
  594. {
  595.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  596.     ODBentoContainerMethodDebug("ODBentoContainer","GetHeap");
  597.  
  598.     return _fHeap;
  599. }
  600.  
  601. //------------------------------------------------------------------------------
  602. // ODBentoContainer: GetCMSession
  603. //------------------------------------------------------------------------------
  604.  
  605. SOM_Scope CMSession  SOMLINK ODBentoContainerGetCMSession(ODBentoContainer *somSelf, Environment *ev)
  606. {
  607.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  608.     ODBentoContainerMethodDebug("ODBentoContainer","GetHeap");
  609.  
  610.     if (_fCMSession == kODNULL)
  611.         ODSetSOMException(ev,kODErrBentoNoSession);
  612.         
  613.     return _fCMSession;
  614. }
  615.  
  616. //------------------------------------------------------------------------------
  617. // ODBentoContainer: GetTargetContainer
  618. //------------------------------------------------------------------------------
  619.  
  620. SOM_Scope ODBentoContainer*  SOMLINK ODBentoContainerGetTargetContainer(ODBentoContainer *somSelf, Environment *ev)
  621. {
  622. //   ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  623.     ODBentoContainerMethodDebug("ODBentoContainer","GetTargetContainer");
  624.  
  625.     return kODNULL;
  626. }
  627.  
  628. //------------------------------------------------------------------------------
  629. // ODBentoContainer: GetTargetDocument
  630. //------------------------------------------------------------------------------
  631.  
  632. SOM_Scope CMDocument*  SOMLINK ODBentoContainerGetTargetDocument(ODBentoContainer *somSelf, Environment *ev)
  633. {
  634. //   ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  635.     ODBentoContainerMethodDebug("ODBentoContainer","GetTargetDocument");
  636.  
  637.     return kODNULL;
  638. }
  639.  
  640. //------------------------------------------------------------------------------
  641. // ODBentoContainer: GetModDate
  642. //------------------------------------------------------------------------------
  643.  
  644. SOM_Scope ODTime SOMLINK ODBentoContainerGetModDate(ODBentoContainer *somSelf, Environment *ev)
  645. {
  646.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  647.     ODBentoContainerMethodDebug("ODBentoContainer","GetModDate");
  648.  
  649.     return _fModDate;
  650. }
  651.  
  652. //------------------------------------------------------------------------------
  653. // ODBentoContainer: SetModDate
  654. //------------------------------------------------------------------------------
  655.  
  656. SOM_Scope void SOMLINK ODBentoContainerSetModDate(ODBentoContainer *somSelf, Environment *ev, ODTime timer)
  657. {
  658.     ODBentoContainerData *somThis = ODBentoContainerGetData(somSelf);
  659.     ODBentoContainerMethodDebug("ODBentoContainer","SetModDate");
  660.  
  661.     _fModDate = timer;
  662. }
  663.  
  664.