home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ODCtr.cpp
-
- Contains: Implementation of ODCtr
-
- Owned by: Vincent Lo
-
- Copyright: © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <3> 6/6/96 jpa T10020: Fixed uninitialized-IText variable
- warnings.
- <6> 10/8/95 TJ Fixes Recomended by Refball
- <5> 8/3/95 RR #1257260: Collapse B classes. Remove
- somInit methods. Don't call IsInitialized
- or SubclassResponsibility
- <4> 5/26/95 VL 1251403: Multithreading naming support.
- <3> 9/23/94 VL 1184166: ContainerName is ODIText now.
- 1184272: ContainerID is now a sequence of
- octets.
- <2> 7/7/94 VL Added SubClassResponsibility.
- <1> 6/28/94 VL first checked in
-
- To Do:
- In Progress:
-
- */
-
- #define ODContainer_Class_Source
- #include <ODCtr.xih>
-
- #ifndef _ITEXT_
- #include <IText.h>
- #endif
-
- #ifndef _BARRAY_
- #include <BArray.h>
- #endif
-
- SOM_Scope ODStorageSystem* SOMLINK ODContainerGetStorageSystem(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerGetStorageSystem");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- return kODNULL;
- }
-
- SOM_Scope ODContainerID SOMLINK ODContainerGetID(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerGetID");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
-
- // The following lines are used to pacify the compiler.
- // They should never be executed.
- ODByteArray ba = {0,0,kODNULL};
- return ba;
- }
-
- SOM_Scope ODContainerName SOMLINK ODContainerGetName(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerGetName");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
-
- // The following lines are used to pacify the compiler.
- // They should never be executed.
- ODContainerName name;
- InitIText(&name);
- return name;
- }
-
- SOM_Scope void SOMLINK ODContainerSetName(ODContainer *somSelf, Environment *ev,
- ODContainerName* name)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerSetName");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- }
-
- /*
- * private by convention
- */
-
- SOM_Scope ODDocument* SOMLINK ODContainerAcquireDocument(ODContainer *somSelf, Environment *ev,
- ODDocumentID id)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerAcquireDocument");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- return kODNULL;
- }
-
- SOM_Scope void SOMLINK ODContainerInitContainer(ODContainer *somSelf, Environment *ev,
- ODStorageSystem* system,
- ODContainerID* id)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerInitContainer");
-
- SOM_TRY
- somSelf->InitRefCntObject(ev);
- SOM_CATCH_ALL
- SOM_ENDTRY
- }
-
- SOM_Scope ODContainer* SOMLINK ODContainerCreate(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerCreate");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
-
- return somSelf;
- }
-
- SOM_Scope ODContainer* SOMLINK ODContainerOpen(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerOpen");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- return somSelf;
- }
-
- SOM_Scope ODContainer* SOMLINK ODContainerClose(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerClose");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- return somSelf;
- }
-
- SOM_Scope ODContainer* SOMLINK ODContainerReleaseDocument(ODContainer *somSelf, Environment *ev,
- ODDocument* document)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerReleaseDocument");
-
- WARN("A subclass should have overridden this method!");
- ODSetSOMException(ev,kODErrSubClassResponsibility, "SubClass Responsibility");
- return somSelf;
- }
-
- SOM_Scope void SOMLINK ODContainersomUninit(ODContainer *somSelf)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainersomUninit");
-
- ODContainer_parent_ODRefCntObject_somUninit(somSelf);
- }
-
- SOM_Scope void SOMLINK ODContainerAcquire(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerAcquire");
-
- ODContainer_parent_ODRefCntObject_Acquire(somSelf,ev);
- }
-
- SOM_Scope void SOMLINK ODContainerRelease(ODContainer *somSelf, Environment *ev)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerRelease");
-
- ODContainer_parent_ODRefCntObject_Release(somSelf,ev);
- }
-
- SOM_Scope ODSize SOMLINK ODContainerPurge(ODContainer *somSelf, Environment *ev,
- ODSize size)
- {
- /* ODContainerData *somThis = ODContainerGetData(somSelf); */
- ODContainerMethodDebug("ODContainer","ODContainerPurge");
-
- // dh - Wrapped purge call in a SOM_TRY block.
-
- ODSize purgeSize = 0; ODVolatile( purgeSize );
-
- SOM_TRY
-
- purgeSize = (ODContainer_parent_ODRefCntObject_Purge(somSelf,ev,size));;
-
- SOM_CATCH_ALL
- WARN("Error %ld trying to purge in ODNameSpaceManagerPurge",ErrorCode());
- SetErrorCode(kODNoError); // dh - Eat the exception; Purge should not
- // propagate it because clients function
- // fine whether memory was purged or not.
- SOM_ENDTRY
-
- return purgeSize;
- }
-