
/*
 * This file was generated by the SOM Compiler.
 * FileName: \odwin\h\PSTOBJ.h.
 * Generated using:
 *     SOM Precompiler somipc: 2.29.1.3
 *     SOM Emitter emith.dll: 2.41
 */

/*
 * 
 *  Theory of Operation
 * 
 * 
 *   This file defines class ODPersistentObject.  This class is the common base
 *   class for all OpenDoc classes whose objects require persistent storage.
 * 
 *  Classes defined in this interface
 * 
 */


#ifndef SOM_ODPersistentObject_h
#define SOM_ODPersistentObject_h


#include <som.h>

/*
 * -- This emitter treats Method Tokens as Thunks by default.
 * -- Use the sc modifier "nothunks" to change this default
 */
#undef somresolve_
#define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))



/*
 * Define class data structures as resolution macros
 */
#define ODPersistentObjectClassData (*resolve_ODPersistentObjectClassData())
#define ODPersistentObjectCClassData (*resolve_ODPersistentObjectCClassData())

/*
 * Define the class name as an object type
 */
#ifndef ODPersistentObject
#define ODPersistentObject SOMObject
#endif
#include <RefCtObj.h>

/*
 * Start of user-defined types:
 */
#ifndef SOMClass
    #define SOMClass SOMObject
#endif /* SOMClass */
#ifndef ODObject
    #define ODObject SOMObject
#endif /* ODObject */
#ifndef ODExtension
    #define ODExtension SOMObject
#endif /* ODExtension */
#ifndef ODRefCntObject
    #define ODRefCntObject SOMObject
#endif /* ODRefCntObject */
#ifndef ODPersistentObject
    #define ODPersistentObject SOMObject
#endif /* ODPersistentObject */
#ifndef ODStorageUnit
    #define ODStorageUnit SOMObject
#endif /* ODStorageUnit */
#ifndef ODFrame
    #define ODFrame SOMObject
#endif /* ODFrame */

/*
 * End of user-defined types.
 */

#define ODPersistentObject_MajorVersion 0
#define ODPersistentObject_MinorVersion 0

/*
 * External name shortening if required
 */
#ifdef SOM_USE_SHORT_EXTERNAL_NAMES
#define ODPersistentObjectNewClass c
#define ODPersistentObjectClassData d
#define ODPersistentObjectCClassData x
#endif /* SOM_USE_SHORT_EXTERNAL_NAMES */
/*--------------Migration------------*/
#define ODPersistentObject_classObj ODPersistentObjectClassData.classObject
#define _ODPersistentObject ODPersistentObject_classObj

/*
 * Declare the class creation procedure
 */
SOMEXTERN SOMClass * SOMLINK ODPersistentObjectNewClass(integer4 somntmajorVersion,
		integer4 somntminorVersion);

/*
 * Declare the class data structure
 */
SOMEXTERN struct ODPersistentObjectClassDataStructure {
	SOMClass *classObject;
	somMToken InitPersistentObject;
	somMToken InitPersistentObjectFromStorage;
	somMToken ReleaseAll;
	somMToken Externalize;
	somMToken GetStorageUnit;
	somMToken GetID;
	somMToken CloneInto;
}  _ODPersistentObjectClassData;
SOMEXTERN struct ODPersistentObjectClassDataStructure * SOMLINK resolve_ODPersistentObjectClassData(void);

/*
 * Declare the C specific class data structure
 */
SOMEXTERN struct ODPersistentObjectCClassDataStructure {
	somMethodTabs parentMtab;
	somDToken instanceDataToken;
}  _ODPersistentObjectCClassData;
SOMEXTERN struct ODPersistentObjectCClassDataStructure * SOMLINK resolve_ODPersistentObjectCClassData(void);

/*
 * New and Renew macros for ODPersistentObject
 */
#define ODPersistentObjectNew() \
   (_somNew(_ODPersistentObject ? _ODPersistentObject : ODPersistentObjectNewClass(ODPersistentObject_MajorVersion, ODPersistentObject_MinorVersion)))
#define ODPersistentObjectRenew(buf) \
   (_somRenew(_ODPersistentObject ? _ODPersistentObject : ODPersistentObjectNewClass(ODPersistentObject_MajorVersion, ODPersistentObject_MinorVersion), buf))

/*
 * Override method: somInit
 */
#define ODPersistentObject_somInit(somSelf) \
	SOMObject_somInit(somSelf)

/*
 * Override method: somUninit
 */
#define ODPersistentObject_somUninit(somSelf) \
	SOMObject_somUninit(somSelf)

/*
 * New Method: InitPersistentObject
 */
typedef void   (SOMLINK * somTD_ODPersistentObject_InitPersistentObject)(ODPersistentObject *somSelf, Environment *ev,
		ODStorageUnit* storageUnit);
#define somMD_ODPersistentObject_InitPersistentObject "::ODPersistentObject::InitPersistentObject"
#define ODPersistentObject_InitPersistentObject(somSelf,ev,storageUnit) \
    (SOM_Resolve(somSelf, ODPersistentObject, InitPersistentObject) \
	(somSelf,ev,storageUnit))
#ifndef SOMGD_InitPersistentObject
    #if (defined(_InitPersistentObject) || defined(__InitPersistentObject))
        #undef _InitPersistentObject
        #undef __InitPersistentObject
        #define SOMGD_InitPersistentObject 1
    #else
        #define _InitPersistentObject ODPersistentObject_InitPersistentObject
    #endif /* _InitPersistentObject */
#endif /* SOMGD_InitPersistentObject */

/*
 * New Method: InitPersistentObjectFromStorage
 */
typedef void   (SOMLINK * somTD_ODPersistentObject_InitPersistentObjectFromStorage)(ODPersistentObject *somSelf, Environment *ev,
		ODStorageUnit* storageUnit);
#define somMD_ODPersistentObject_InitPersistentObjectFromStorage "::ODPersistentObject::InitPersistentObjectFromStorage"
#define ODPersistentObject_InitPersistentObjectFromStorage(somSelf,ev,storageUnit) \
    (SOM_Resolve(somSelf, ODPersistentObject, InitPersistentObjectFromStorage) \
	(somSelf,ev,storageUnit))
#ifndef SOMGD_InitPersistentObjectFromStorage
    #if (defined(_InitPersistentObjectFromStorage) || defined(__InitPersistentObjectFromStorage))
        #undef _InitPersistentObjectFromStorage
        #undef __InitPersistentObjectFromStorage
        #define SOMGD_InitPersistentObjectFromStorage 1
    #else
        #define _InitPersistentObjectFromStorage ODPersistentObject_InitPersistentObjectFromStorage
    #endif /* _InitPersistentObjectFromStorage */
#endif /* SOMGD_InitPersistentObjectFromStorage */

/*
 * New Method: ReleaseAll
 */
typedef void   (SOMLINK * somTD_ODPersistentObject_ReleaseAll)(ODPersistentObject *somSelf, Environment *ev);
#define somMD_ODPersistentObject_ReleaseAll "::ODPersistentObject::ReleaseAll"
#define ODPersistentObject_ReleaseAll(somSelf,ev) \
    (SOM_Resolve(somSelf, ODPersistentObject, ReleaseAll) \
	(somSelf,ev))
#ifndef SOMGD_ReleaseAll
    #if (defined(_ReleaseAll) || defined(__ReleaseAll))
        #undef _ReleaseAll
        #undef __ReleaseAll
        #define SOMGD_ReleaseAll 1
    #else
        #define _ReleaseAll ODPersistentObject_ReleaseAll
    #endif /* _ReleaseAll */
#endif /* SOMGD_ReleaseAll */

/*
 * New Method: Externalize
 */
typedef void   (SOMLINK * somTD_ODPersistentObject_Externalize)(ODPersistentObject *somSelf, Environment *ev);
#define somMD_ODPersistentObject_Externalize "::ODPersistentObject::Externalize"
#define ODPersistentObject_Externalize(somSelf,ev) \
    (SOM_Resolve(somSelf, ODPersistentObject, Externalize) \
	(somSelf,ev))
#ifndef SOMGD_Externalize
    #if (defined(_Externalize) || defined(__Externalize))
        #undef _Externalize
        #undef __Externalize
        #define SOMGD_Externalize 1
    #else
        #define _Externalize ODPersistentObject_Externalize
    #endif /* _Externalize */
#endif /* SOMGD_Externalize */

/*
 * New Method: GetStorageUnit
 */
typedef ODStorageUnit*   (SOMLINK * somTD_ODPersistentObject_GetStorageUnit)(ODPersistentObject *somSelf, Environment *ev);
#define somMD_ODPersistentObject_GetStorageUnit "::ODPersistentObject::GetStorageUnit"
#define ODPersistentObject_GetStorageUnit(somSelf,ev) \
    (SOM_Resolve(somSelf, ODPersistentObject, GetStorageUnit) \
	(somSelf,ev))
#ifndef SOMGD_GetStorageUnit
    #if (defined(_GetStorageUnit) || defined(__GetStorageUnit))
        #undef _GetStorageUnit
        #undef __GetStorageUnit
        #define SOMGD_GetStorageUnit 1
    #else
        #define _GetStorageUnit ODPersistentObject_GetStorageUnit
    #endif /* _GetStorageUnit */
#endif /* SOMGD_GetStorageUnit */

/*
 * New Method: GetID
 */
typedef ODID   (SOMLINK * somTD_ODPersistentObject_GetID)(ODPersistentObject *somSelf, Environment *ev);
#define somMD_ODPersistentObject_GetID "::ODPersistentObject::GetID"
#define ODPersistentObject_GetID(somSelf,ev) \
    (SOM_Resolve(somSelf, ODPersistentObject, GetID) \
	(somSelf,ev))
#ifndef SOMGD_GetID
    #if (defined(_GetID) || defined(__GetID))
        #undef _GetID
        #undef __GetID
        #define SOMGD_GetID 1
    #else
        #define _GetID ODPersistentObject_GetID
    #endif /* _GetID */
#endif /* SOMGD_GetID */

/*
 * New Method: CloneInto
 */
typedef void   (SOMLINK * somTD_ODPersistentObject_CloneInto)(ODPersistentObject *somSelf, Environment *ev,
		ODDraftKey key,
		ODStorageUnit* toSU,
		ODFrame* scope);
#define somMD_ODPersistentObject_CloneInto "::ODPersistentObject::CloneInto"
#define ODPersistentObject_CloneInto(somSelf,ev,key,toSU,scope) \
    (SOM_Resolve(somSelf, ODPersistentObject, CloneInto) \
	(somSelf,ev,key,toSU,scope))
#ifndef SOMGD_CloneInto
    #if (defined(_CloneInto) || defined(__CloneInto))
        #undef _CloneInto
        #undef __CloneInto
        #define SOMGD_CloneInto 1
    #else
        #define _CloneInto ODPersistentObject_CloneInto
    #endif /* _CloneInto */
#endif /* SOMGD_CloneInto */
#ifndef SOM_DONT_USE_INHERITED_MACROS
#define ODPersistentObject_InitRefCntObject ODRefCntObject_InitRefCntObject
#define ODPersistentObject_IncrementRefCount ODRefCntObject_IncrementRefCount
#define ODPersistentObject_Release ODRefCntObject_Release
#define ODPersistentObject_GetRefCount ODRefCntObject_GetRefCount
#define ODPersistentObject_InitObject ODObject_InitObject
#define ODPersistentObject_IsInitialized ODObject_IsInitialized
#define ODPersistentObject_HasExtension ODObject_HasExtension
#define ODPersistentObject_GetExtension ODObject_GetExtension
#define ODPersistentObject_ReleaseExtension ODObject_ReleaseExtension
#define ODPersistentObject_Purge ODObject_Purge
#define ODPersistentObject_IsEqualTo ODObject_IsEqualTo
#define ODPersistentObject_SubClassResponsibility ODObject_SubClassResponsibility
#define ODPersistentObject_somDefaultInit SOMObject_somDefaultInit
#define ODPersistentObject_somDestruct SOMObject_somDestruct
#define ODPersistentObject_somDefaultCopyInit SOMObject_somDefaultCopyInit
#define ODPersistentObject_somDefaultAssign SOMObject_somDefaultAssign
#define ODPersistentObject_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
#define ODPersistentObject_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
#define ODPersistentObject_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
#define ODPersistentObject_somDefaultConstAssign SOMObject_somDefaultConstAssign
#define ODPersistentObject_somDefaultVAssign SOMObject_somDefaultVAssign
#define ODPersistentObject_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
#define ODPersistentObject_somFree SOMObject_somFree
#define ODPersistentObject_somGetClass SOMObject_somGetClass
#define ODPersistentObject_somGetClassName SOMObject_somGetClassName
#define ODPersistentObject_somGetSize SOMObject_somGetSize
#define ODPersistentObject_somIsA SOMObject_somIsA
#define ODPersistentObject_somIsInstanceOf SOMObject_somIsInstanceOf
#define ODPersistentObject_somRespondsTo SOMObject_somRespondsTo
#define ODPersistentObject_somDispatch SOMObject_somDispatch
#define ODPersistentObject_somClassDispatch SOMObject_somClassDispatch
#define ODPersistentObject_somCastObj SOMObject_somCastObj
#define ODPersistentObject_somResetObj SOMObject_somResetObj
#define ODPersistentObject_somDispatchV SOMObject_somDispatchV
#define ODPersistentObject_somDispatchL SOMObject_somDispatchL
#define ODPersistentObject_somDispatchA SOMObject_somDispatchA
#define ODPersistentObject_somDispatchD SOMObject_somDispatchD
#define ODPersistentObject_somPrintSelf SOMObject_somPrintSelf
#define ODPersistentObject_somDumpSelf SOMObject_somDumpSelf
#define ODPersistentObject_somDumpSelfInt SOMObject_somDumpSelfInt
#endif /* SOM_DONT_USE_INHERITED_MACROS */

#endif       /* SOM_ODPersistentObject_h */
