/* * This file was generated by the SOM Compiler. * FileName: somcls.xh. * Generated using: * SOM Precompiler somipc: 2.29.1.17 * SOM Emitter emitxh: 2.47 */ #ifndef SOM_SOMClass_xh #define SOM_SOMClass_xh class SOMClass; /* * This is the SOM metaclass. That is, the instances of this class * are class objects. When the SOM environment is created an instance * of SOMClass is created and a pointer to it is placed in the external * data location (SOMClassClassData.classObject). Bindings provide the * macro _SOMClass for this expression. _SOMClass is unique in that it * is its own class object. I.e., _SOMClass == _somGetClass(_SOMClass). * SOMClass can be subclassed just like any SOM class. The subclasses * of SOMClass are new metaclasses and can generate class objects with * different implementations than those produced by _SOMClass. * * An important rule for metaclass programming is that no methods * introduced by SOMClass should ever be overridden. While this * limits the utility of metaclass programming in SOM, it guarantees * that SOM will operate correctly. Special class frameworks may be * available from IBM to alleviate this restriction. Also, the * restriction may be lifted in the future. * */ #define SOMClass_MajorVersion 1 #define SOMClass_MinorVersion 5 /* C++ SOM defs */ #include /* C++ parent defs */ #ifndef SOM_SOMObject_xh #include #endif #ifndef SOMClass_API #define SOMClass_API /* * -- The Class API */ /* * Start of bindings for IDL types */ class SOMClass; class SOMObject; #ifndef _IDL_SEQUENCE_somToken_defined #define _IDL_SEQUENCE_somToken_defined typedef struct { unsigned long _maximum; unsigned long _length; somToken *_buffer; } _IDL_SEQUENCE_somToken; #endif /* _IDL_SEQUENCE_somToken_defined */ typedef _IDL_SEQUENCE_somToken SOMClass_somTokenSequence; /* * a (generic) sequence of somTokens */ #ifndef _IDL_SEQUENCE_SOMClass_defined #define _IDL_SEQUENCE_SOMClass_defined typedef struct { unsigned long _maximum; unsigned long _length; SOMClass **_buffer; } _IDL_SEQUENCE_SOMClass; #endif /* _IDL_SEQUENCE_SOMClass_defined */ typedef _IDL_SEQUENCE_SOMClass SOMClass_SOMClassSequence; /* * a sequence of classes */ typedef struct SOMClass_somOffsetInfo { SOMClass* cls; long offset; } SOMClass_somOffsetInfo; /* * a structure to describe a class-related offset */ struct SOMClass_somOffsetInfo; #ifndef _IDL_SEQUENCE_SOMClass_somOffsetInfo_defined #define _IDL_SEQUENCE_SOMClass_somOffsetInfo_defined typedef struct { unsigned long _maximum; unsigned long _length; struct SOMClass_somOffsetInfo *_buffer; } _IDL_SEQUENCE_SOMClass_somOffsetInfo; #endif /* _IDL_SEQUENCE_SOMClass_somOffsetInfo_defined */ typedef _IDL_SEQUENCE_SOMClass_somOffsetInfo SOMClass_somOffsets; /* * a sequence of class-related offsets */ #ifndef _IDL_SEQUENCE_somId_defined #define _IDL_SEQUENCE_somId_defined typedef struct { unsigned long _maximum; unsigned long _length; somId *_buffer; } _IDL_SEQUENCE_somId; #endif /* _IDL_SEQUENCE_somId_defined */ typedef _IDL_SEQUENCE_somId SOMClass_somIdSequence; /* * a sequence of somIds */ #ifndef SOM_DONT_USE_SHORT_NAMES #ifndef SOM_DONT_USE_SHORT_NAMES #ifndef SOMTGD_somTokenSequence #ifdef somTokenSequence #undef somTokenSequence #define SOMTGD_somTokenSequence 1 #else #define somTokenSequence SOMClass_somTokenSequence #endif /* somTokenSequence */ #endif /* SOMTGD_somTokenSequence */ #endif /* SOM_DONT_USE_SHORT_NAMES */ #ifndef SOM_DONT_USE_SHORT_NAMES #ifndef SOMTGD_SOMClassSequence #ifdef SOMClassSequence #undef SOMClassSequence #define SOMTGD_SOMClassSequence 1 #else #define SOMClassSequence SOMClass_SOMClassSequence #endif /* SOMClassSequence */ #endif /* SOMTGD_SOMClassSequence */ #endif /* SOM_DONT_USE_SHORT_NAMES */ #ifndef SOMTGD_somOffsetInfo #ifdef somOffsetInfo #undef somOffsetInfo #define SOMTGD_somOffsetInfo 1 #else #define somOffsetInfo SOMClass_somOffsetInfo #endif /* somOffsetInfo */ #endif /* SOMTGD_somOffsetInfo */ #ifndef SOMTGD__IDL_SEQUENCE_somOffsetInfo #ifdef _IDL_SEQUENCE_somOffsetInfo #undef _IDL_SEQUENCE_somOffsetInfo #define SOMTGD__IDL_SEQUENCE_somOffsetInfo 1 #else #define _IDL_SEQUENCE_somOffsetInfo _IDL_SEQUENCE_SOMClass_somOffsetInfo #endif /* _IDL_SEQUENCE_somOffsetInfo */ #endif /* SOMTGD__IDL_SEQUENCE_somOffsetInfo */ #ifndef SOM_DONT_USE_SHORT_NAMES #ifndef SOMTGD_somOffsets #ifdef somOffsets #undef somOffsets #define SOMTGD_somOffsets 1 #else #define somOffsets SOMClass_somOffsets #endif /* somOffsets */ #endif /* SOMTGD_somOffsets */ #endif /* SOM_DONT_USE_SHORT_NAMES */ #ifndef SOM_DONT_USE_SHORT_NAMES #ifndef SOMTGD_somIdSequence #ifdef somIdSequence #undef somIdSequence #define SOMTGD_somIdSequence 1 #else #define somIdSequence SOMClass_somIdSequence #endif /* somIdSequence */ #endif /* SOMTGD_somIdSequence */ #endif /* SOM_DONT_USE_SHORT_NAMES */ #endif /* SOM_DONT_USE_SHORT_NAMES */ /* * End of bindings for IDL types. */ /* A procedure to create the SOMClass Class */ SOMEXTERN SOMClass * SOMLINK SOMClassNewClass( integer4 majorVersion, integer4 minorVersion); /* The API to the SOMClass class object, and the methods it introduces. */ SOMEXTERNS struct SOMClassClassDataStructure { SOMClass *classObject; somMToken somNew; somMToken somRenew; somMToken somInitClass; somMToken somClassReady; somMToken somGetName; somMToken somGetParent; somMToken somDescendedFrom; somMToken somCheckVersion; somMToken somFindMethod; somMToken somFindMethodOk; somMToken somSupportsMethod; somMToken somGetNumMethods; somMToken somGetInstanceSize; somMToken somGetInstanceOffset; somMToken somGetInstancePartSize; somMToken somGetMethodIndex; somMToken somGetNumStaticMethods; somMToken somGetPClsMtab; somMToken somGetClassMtab; somMToken somAddStaticMethod; somMToken somOverrideSMethod; somMToken somAddDynamicMethod; somMToken somcPrivate0; somMToken somGetApplyStub; somMToken somFindSMethod; somMToken somFindSMethodOk; somMToken somGetMethodDescriptor; somMToken somGetNthMethodInfo; somMToken somSetClassData; somMToken somGetClassData; somMToken somNewNoInit; somMToken somRenewNoInit; somMToken somGetInstanceToken; somMToken somGetMemberToken; somMToken somcPrivate1; somMToken somGetMethodData; somMToken somOverrideMtab; somMToken somGetMethodToken; somMToken somGetParents; somMToken somGetPClsMtabs; somMToken somInitMIClass; somMToken somGetVersionNumbers; somMToken somLookupMethod; somMToken _get_somInstanceDataOffsets; somMToken somRenewNoZero; somMToken somRenewNoInitNoZero; somMToken somAllocate; somMToken somDeallocate; somMToken somGetRdStub; somMToken somGetNthMethodData; somMToken somcPrivate2; somMToken somcPrivate3; somMToken _get_somDirectInitClasses; somMToken somcPrivate5; somMToken somcPrivate6; somMToken somcPrivate7; somMToken somcPrivate8; somMToken somcPrivate9; somMToken somcPrivate10; somMToken somcPrivate11; somMToken somcPrivate12; somMToken somDefinedMethod; somMToken somcPrivate13; somMToken somcPrivate14; somMToken somcPrivate15; somMToken somcPrivate16; somMToken somcPrivate17; somMToken somcPrivate18; somMToken somcPrivate19; somMToken somcPrivate20; somMToken _get_somDataAlignment; somMToken somcPrivate21; somMToken somcPrivate22; somMToken somcPrivate23; somMToken somcPrivate24; somMToken somcPrivate25; } SOMDLINK SOMClassClassData; #define _SOMClass SOMClassClassData.classObject /* The API to parentMtabs for SOMClass, and the instance data it introduces. */ SOMEXTERNS struct SOMClassCClassDataStructure { somMethodTabs parentMtab; somDToken instanceDataToken; } SOMDLINK SOMClassCClassData; /* * -- Typedefs for SOMClass Method Procedures */ SOMEXTERN { typedef long SOMLINK somTP_SOMClass__get_somDataAlignment(SOMClass *somSelf); typedef somTP_SOMClass__get_somDataAlignment *somTD_SOMClass__get_somDataAlignment; typedef SOMClass_somOffsets SOMLINK somTP_SOMClass__get_somInstanceDataOffsets(SOMClass *somSelf); typedef somTP_SOMClass__get_somInstanceDataOffsets *somTD_SOMClass__get_somInstanceDataOffsets; typedef SOMClass_SOMClassSequence SOMLINK somTP_SOMClass__get_somDirectInitClasses(SOMClass *somSelf); typedef somTP_SOMClass__get_somDirectInitClasses *somTD_SOMClass__get_somDirectInitClasses; typedef SOMObject* SOMLINK somTP_SOMClass_somNew(SOMClass *somSelf); typedef somTP_SOMClass_somNew *somTD_SOMClass_somNew; typedef SOMObject* SOMLINK somTP_SOMClass_somNewNoInit(SOMClass *somSelf); typedef somTP_SOMClass_somNewNoInit *somTD_SOMClass_somNewNoInit; typedef SOMObject* SOMLINK somTP_SOMClass_somRenew(SOMClass *somSelf, void* obj); typedef somTP_SOMClass_somRenew *somTD_SOMClass_somRenew; typedef SOMObject* SOMLINK somTP_SOMClass_somRenewNoInit(SOMClass *somSelf, void* obj); typedef somTP_SOMClass_somRenewNoInit *somTD_SOMClass_somRenewNoInit; typedef SOMObject* SOMLINK somTP_SOMClass_somRenewNoZero(SOMClass *somSelf, void* obj); typedef somTP_SOMClass_somRenewNoZero *somTD_SOMClass_somRenewNoZero; typedef SOMObject* SOMLINK somTP_SOMClass_somRenewNoInitNoZero(SOMClass *somSelf, void* obj); typedef somTP_SOMClass_somRenewNoInitNoZero *somTD_SOMClass_somRenewNoInitNoZero; typedef somToken SOMLINK somTP_SOMClass_somAllocate(SOMClass *somSelf, long size); typedef somTP_SOMClass_somAllocate *somTD_SOMClass_somAllocate; typedef void SOMLINK somTP_SOMClass_somDeallocate(SOMClass *somSelf, somToken memptr); typedef somTP_SOMClass_somDeallocate *somTD_SOMClass_somDeallocate; typedef void SOMLINK somTP_SOMClass_somInitClass(SOMClass *somSelf, string className, SOMClass* parentClass, long dataSize, long maxStaticMethods, long majorVersion, long minorVersion); typedef somTP_SOMClass_somInitClass *somTD_SOMClass_somInitClass; typedef void SOMLINK somTP_SOMClass_somInitMIClass(SOMClass *somSelf, long inherit_vars, string className, SOMClass_SOMClassSequence* parentClasses, long dataSize, long dataAlignment, long maxStaticMethods, long majorVersion, long minorVersion); typedef somTP_SOMClass_somInitMIClass *somTD_SOMClass_somInitMIClass; typedef somMToken SOMLINK somTP_SOMClass_somAddStaticMethod(SOMClass *somSelf, somId methodId, somId methodDescriptor, somMethodPtr method, somMethodPtr redispatchStub, somMethodPtr applyStub); typedef somTP_SOMClass_somAddStaticMethod *somTD_SOMClass_somAddStaticMethod; typedef void SOMLINK somTP_SOMClass_somAddDynamicMethod(SOMClass *somSelf, somId methodId, somId methodDescriptor, somMethodPtr method, somMethodPtr applyStub); typedef somTP_SOMClass_somAddDynamicMethod *somTD_SOMClass_somAddDynamicMethod; typedef void SOMLINK somTP_SOMClass_somOverrideSMethod(SOMClass *somSelf, somId methodId, somMethodPtr method); typedef somTP_SOMClass_somOverrideSMethod *somTD_SOMClass_somOverrideSMethod; typedef void SOMLINK somTP_SOMClass_somClassReady(SOMClass *somSelf); typedef somTP_SOMClass_somClassReady *somTD_SOMClass_somClassReady; typedef somMethodPtr SOMLINK somTP_SOMClass_somGetApplyStub(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somGetApplyStub *somTD_SOMClass_somGetApplyStub; typedef somClassDataStructure* SOMLINK somTP_SOMClass_somGetClassData(SOMClass *somSelf); typedef somTP_SOMClass_somGetClassData *somTD_SOMClass_somGetClassData; typedef void SOMLINK somTP_SOMClass_somSetClassData(SOMClass *somSelf, somClassDataStructure* cds); typedef somTP_SOMClass_somSetClassData *somTD_SOMClass_somSetClassData; typedef somMethodTab* SOMLINK somTP_SOMClass_somGetClassMtab(SOMClass *somSelf); typedef somTP_SOMClass_somGetClassMtab *somTD_SOMClass_somGetClassMtab; typedef long SOMLINK somTP_SOMClass_somGetInstanceOffset(SOMClass *somSelf); typedef somTP_SOMClass_somGetInstanceOffset *somTD_SOMClass_somGetInstanceOffset; typedef long SOMLINK somTP_SOMClass_somGetInstancePartSize(SOMClass *somSelf); typedef somTP_SOMClass_somGetInstancePartSize *somTD_SOMClass_somGetInstancePartSize; typedef long SOMLINK somTP_SOMClass_somGetInstanceSize(SOMClass *somSelf); typedef somTP_SOMClass_somGetInstanceSize *somTD_SOMClass_somGetInstanceSize; typedef somDToken SOMLINK somTP_SOMClass_somGetInstanceToken(SOMClass *somSelf); typedef somTP_SOMClass_somGetInstanceToken *somTD_SOMClass_somGetInstanceToken; typedef somDToken SOMLINK somTP_SOMClass_somGetMemberToken(SOMClass *somSelf, long memberOffset, somDToken instanceToken); typedef somTP_SOMClass_somGetMemberToken *somTD_SOMClass_somGetMemberToken; typedef boolean SOMLINK somTP_SOMClass_somGetMethodData(SOMClass *somSelf, somId methodId, somMethodData* md); typedef somTP_SOMClass_somGetMethodData *somTD_SOMClass_somGetMethodData; typedef somMethodProc* SOMLINK somTP_SOMClass_somGetRdStub(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somGetRdStub *somTD_SOMClass_somGetRdStub; typedef somId SOMLINK somTP_SOMClass_somGetMethodDescriptor(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somGetMethodDescriptor *somTD_SOMClass_somGetMethodDescriptor; typedef long SOMLINK somTP_SOMClass_somGetMethodIndex(SOMClass *somSelf, somId id); typedef somTP_SOMClass_somGetMethodIndex *somTD_SOMClass_somGetMethodIndex; typedef somMToken SOMLINK somTP_SOMClass_somGetMethodToken(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somGetMethodToken *somTD_SOMClass_somGetMethodToken; typedef string SOMLINK somTP_SOMClass_somGetName(SOMClass *somSelf); typedef somTP_SOMClass_somGetName *somTD_SOMClass_somGetName; typedef boolean SOMLINK somTP_SOMClass_somGetNthMethodData(SOMClass *somSelf, long n, somMethodData* md); typedef somTP_SOMClass_somGetNthMethodData *somTD_SOMClass_somGetNthMethodData; typedef somId SOMLINK somTP_SOMClass_somGetNthMethodInfo(SOMClass *somSelf, long n, somId* descriptor); typedef somTP_SOMClass_somGetNthMethodInfo *somTD_SOMClass_somGetNthMethodInfo; typedef long SOMLINK somTP_SOMClass_somGetNumMethods(SOMClass *somSelf); typedef somTP_SOMClass_somGetNumMethods *somTD_SOMClass_somGetNumMethods; typedef long SOMLINK somTP_SOMClass_somGetNumStaticMethods(SOMClass *somSelf); typedef somTP_SOMClass_somGetNumStaticMethods *somTD_SOMClass_somGetNumStaticMethods; typedef SOMClass* SOMLINK somTP_SOMClass_somGetParent(SOMClass *somSelf); typedef somTP_SOMClass_somGetParent *somTD_SOMClass_somGetParent; typedef SOMClass_SOMClassSequence SOMLINK somTP_SOMClass_somGetParents(SOMClass *somSelf); typedef somTP_SOMClass_somGetParents *somTD_SOMClass_somGetParents; typedef void SOMLINK somTP_SOMClass_somGetVersionNumbers(SOMClass *somSelf, long* majorVersion, long* minorVersion); typedef somTP_SOMClass_somGetVersionNumbers *somTD_SOMClass_somGetVersionNumbers; typedef boolean SOMLINK somTP_SOMClass_somFindMethod(SOMClass *somSelf, somId methodId, somMethodPtr* m); typedef somTP_SOMClass_somFindMethod *somTD_SOMClass_somFindMethod; typedef boolean SOMLINK somTP_SOMClass_somFindMethodOk(SOMClass *somSelf, somId methodId, somMethodPtr* m); typedef somTP_SOMClass_somFindMethodOk *somTD_SOMClass_somFindMethodOk; typedef somMethodPtr SOMLINK somTP_SOMClass_somFindSMethod(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somFindSMethod *somTD_SOMClass_somFindSMethod; typedef somMethodPtr SOMLINK somTP_SOMClass_somFindSMethodOk(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somFindSMethodOk *somTD_SOMClass_somFindSMethodOk; typedef somMethodPtr SOMLINK somTP_SOMClass_somLookupMethod(SOMClass *somSelf, somId methodId); typedef somTP_SOMClass_somLookupMethod *somTD_SOMClass_somLookupMethod; typedef boolean SOMLINK somTP_SOMClass_somCheckVersion(SOMClass *somSelf, long majorVersion, long minorVersion); typedef somTP_SOMClass_somCheckVersion *somTD_SOMClass_somCheckVersion; typedef boolean SOMLINK somTP_SOMClass_somDescendedFrom(SOMClass *somSelf, SOMClass* aClassObj); typedef somTP_SOMClass_somDescendedFrom *somTD_SOMClass_somDescendedFrom; typedef boolean SOMLINK somTP_SOMClass_somSupportsMethod(SOMClass *somSelf, somId mId); typedef somTP_SOMClass_somSupportsMethod *somTD_SOMClass_somSupportsMethod; typedef somMethodPtr SOMLINK somTP_SOMClass_somDefinedMethod(SOMClass *somSelf, somMToken method); typedef somTP_SOMClass_somDefinedMethod *somTD_SOMClass_somDefinedMethod; typedef void SOMLINK somTP_SOMClass_somOverrideMtab(SOMClass *somSelf); typedef somTP_SOMClass_somOverrideMtab *somTD_SOMClass_somOverrideMtab; /* * -- Typedefs for Reintroduced Wrapper Methods */ typedef void SOMLINK somTP_SOMClass_somDefaultInit(SOMClass *somSelf, som3InitCtrl* ctrl); typedef somTP_SOMClass_somDefaultInit *somTD_SOMClass_somDefaultInit; typedef void SOMLINK somTP_SOMClass_somDestruct(SOMClass *somSelf, octet doFree, som3DestructCtrl* ctrl); typedef somTP_SOMClass_somDestruct *somTD_SOMClass_somDestruct; typedef void SOMLINK somTP_SOMClass_somDefaultCopyInit(SOMClass *somSelf, som3InitCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultCopyInit *somTD_SOMClass_somDefaultCopyInit; typedef SOMClass* SOMLINK somTP_SOMClass_somDefaultAssign(SOMClass *somSelf, som3AssignCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultAssign *somTD_SOMClass_somDefaultAssign; typedef void SOMLINK somTP_SOMClass_somDefaultConstCopyInit(SOMClass *somSelf, som3InitCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultConstCopyInit *somTD_SOMClass_somDefaultConstCopyInit; typedef void SOMLINK somTP_SOMClass_somDefaultVCopyInit(SOMClass *somSelf, som3InitCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultVCopyInit *somTD_SOMClass_somDefaultVCopyInit; typedef void SOMLINK somTP_SOMClass_somDefaultConstVCopyInit(SOMClass *somSelf, som3InitCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultConstVCopyInit *somTD_SOMClass_somDefaultConstVCopyInit; typedef SOMClass* SOMLINK somTP_SOMClass_somDefaultConstAssign(SOMClass *somSelf, som3AssignCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultConstAssign *somTD_SOMClass_somDefaultConstAssign; typedef SOMClass* SOMLINK somTP_SOMClass_somDefaultVAssign(SOMClass *somSelf, som3AssignCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultVAssign *somTD_SOMClass_somDefaultVAssign; typedef SOMClass* SOMLINK somTP_SOMClass_somDefaultConstVAssign(SOMClass *somSelf, som3AssignCtrl* ctrl, SOMObject* fromObj); typedef somTP_SOMClass_somDefaultConstVAssign *somTD_SOMClass_somDefaultConstVAssign; typedef void SOMLINK somTP_SOMClass_somInit(SOMClass *somSelf); typedef somTP_SOMClass_somInit *somTD_SOMClass_somInit; typedef void SOMLINK somTP_SOMClass_somFree(SOMClass *somSelf); typedef somTP_SOMClass_somFree *somTD_SOMClass_somFree; typedef void SOMLINK somTP_SOMClass_somUninit(SOMClass *somSelf); typedef somTP_SOMClass_somUninit *somTD_SOMClass_somUninit; typedef SOMClass* SOMLINK somTP_SOMClass_somGetClass(SOMClass *somSelf); typedef somTP_SOMClass_somGetClass *somTD_SOMClass_somGetClass; typedef string SOMLINK somTP_SOMClass_somGetClassName(SOMClass *somSelf); typedef somTP_SOMClass_somGetClassName *somTD_SOMClass_somGetClassName; typedef long SOMLINK somTP_SOMClass_somGetSize(SOMClass *somSelf); typedef somTP_SOMClass_somGetSize *somTD_SOMClass_somGetSize; typedef boolean SOMLINK somTP_SOMClass_somIsA(SOMClass *somSelf, SOMClass* aClassObj); typedef somTP_SOMClass_somIsA *somTD_SOMClass_somIsA; typedef boolean SOMLINK somTP_SOMClass_somIsInstanceOf(SOMClass *somSelf, SOMClass* aClassObj); typedef somTP_SOMClass_somIsInstanceOf *somTD_SOMClass_somIsInstanceOf; typedef boolean SOMLINK somTP_SOMClass_somRespondsTo(SOMClass *somSelf, somId mId); typedef somTP_SOMClass_somRespondsTo *somTD_SOMClass_somRespondsTo; typedef boolean SOMLINK somTP_SOMClass_somDispatch(SOMClass *somSelf, somToken* retValue, somId methodId, va_list ap); typedef somTP_SOMClass_somDispatch *somTD_SOMClass_somDispatch; typedef boolean SOMLINK somTP_SOMClass_somClassDispatch(SOMClass *somSelf, SOMClass* clsObj, somToken* retValue, somId methodId, va_list ap); typedef somTP_SOMClass_somClassDispatch *somTD_SOMClass_somClassDispatch; typedef boolean SOMLINK somTP_SOMClass_somCastObj(SOMClass *somSelf, SOMClass* cls); typedef somTP_SOMClass_somCastObj *somTD_SOMClass_somCastObj; typedef boolean SOMLINK somTP_SOMClass_somResetObj(SOMClass *somSelf); typedef somTP_SOMClass_somResetObj *somTD_SOMClass_somResetObj; typedef void SOMLINK somTP_SOMClass_somDispatchV(SOMClass *somSelf, somId methodId, somId descriptor, va_list ap); typedef somTP_SOMClass_somDispatchV *somTD_SOMClass_somDispatchV; typedef long SOMLINK somTP_SOMClass_somDispatchL(SOMClass *somSelf, somId methodId, somId descriptor, va_list ap); typedef somTP_SOMClass_somDispatchL *somTD_SOMClass_somDispatchL; typedef void* SOMLINK somTP_SOMClass_somDispatchA(SOMClass *somSelf, somId methodId, somId descriptor, va_list ap); typedef somTP_SOMClass_somDispatchA *somTD_SOMClass_somDispatchA; typedef double SOMLINK somTP_SOMClass_somDispatchD(SOMClass *somSelf, somId methodId, somId descriptor, va_list ap); typedef somTP_SOMClass_somDispatchD *somTD_SOMClass_somDispatchD; typedef SOMObject* SOMLINK somTP_SOMClass_somPrintSelf(SOMClass *somSelf); typedef somTP_SOMClass_somPrintSelf *somTD_SOMClass_somPrintSelf; typedef void SOMLINK somTP_SOMClass_somDumpSelf(SOMClass *somSelf, long level); typedef somTP_SOMClass_somDumpSelf *somTD_SOMClass_somDumpSelf; typedef void SOMLINK somTP_SOMClass_somDumpSelfInt(SOMClass *somSelf, long level); typedef somTP_SOMClass_somDumpSelfInt *somTD_SOMClass_somDumpSelfInt; } #endif /* SOMClass_API */ /* * -- 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)) /* * -- The C++ Wrapper Class for SOMClass */ class SOMClass : public SOMObject { /* * This is the SOM metaclass. That is, the instances of this class * are class objects. When the SOM environment is created an instance * of SOMClass is created and a pointer to it is placed in the external * data location (SOMClassClassData.classObject). Bindings provide the * macro _SOMClass for this expression. _SOMClass is unique in that it * is its own class object. I.e., _SOMClass == _somGetClass(_SOMClass). * SOMClass can be subclassed just like any SOM class. The subclasses * of SOMClass are new metaclasses and can generate class objects with * different implementations than those produced by _SOMClass. * * An important rule for metaclass programming is that no methods * introduced by SOMClass should ever be overridden. While this * limits the utility of metaclass programming in SOM, it guarantees * that SOM will operate correctly. Special class frameworks may be * available from IBM to alleviate this restriction. Also, the * restriction may be lifted in the future. * */ public: // SOMClass::new creates the class object if necessary, and then uses somNewNoInit // to allocate memory and create the object. Initialization is in ctors. void *operator new(size_t) { if (!_SOMClass) SOMClassNewClass(SOMClass_MajorVersion,SOMClass_MinorVersion); return (void*) SOM_Resolve(_SOMClass,SOMClass,somNewNoInit) ((SOMClass *)((void*)_SOMClass)); } // SOMClass::delete uses somDestruct. void operator delete(void * obj) { if (obj && *(void**)obj) { SOM_Resolve(obj,SOMObject,somFree) ((SOMObject*)obj); } } SOMClass& operator=(SOMClass& fromObj) { this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj)); return *this; } SOMClass() { if (*(void**)this != ((somParentMtabStructPtr) (SOMClassCClassData.parentMtab))->mtab) return; ((SOMObject*)((void*)this))->somDefaultInit(0); } SOMClass(SOMClass* fromObj) { if (*(void**)this != ((somParentMtabStructPtr) (SOMClassCClassData.parentMtab))->mtab) return; ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj))); } #ifdef __IBMCPP__ #pragma info(nocnv,nopar) #endif SOMClass(const SOMClass* fromObj) { if (*(void**)this != ((somParentMtabStructPtr) (SOMClassCClassData.parentMtab))->mtab) return; ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj))); } #ifdef __IBMCPP__ #pragma info(restore) #endif /* method: _get_somDataAlignment */ long _get_somDataAlignment() { /* * The alignment required for the instance data structure * introduced by the receiving class. */ return SOM_ResolveD(this,SOMClass,SOMClass,_get_somDataAlignment) (this); } /* nonstatic method: _get_somInstanceDataOffsets */ SOMClass_somOffsets _get_somInstanceDataOffsets() { /* * A sequence of the instance data offsets for all classes used in * the derivation of the receiving class (including the receiver). */ return SOM_ResolveD(this,SOMClass,SOMClass,_get_somInstanceDataOffsets) (this); } /* nonstatic method: _get_somDirectInitClasses */ SOMClass_SOMClassSequence _get_somDirectInitClasses() { /* * The ancestors whose initializers the receiving * class wants to directly invoke. */ return SOM_ResolveD(this,SOMClass,SOMClass,_get_somDirectInitClasses) (this); } /* method: somNew */ SOMObject* somNew() { /* * Uses SOMMalloc to allocate storage for a new instance of the * receiving class, and then calls somRenewNoInitNoZero to load the * new object's method table pointer. Then somDefaultInit is called to * initialize the new object. Note: If the instance is a class object, * somInitMIClass must then be invoked to declare parents and * initialize the class's instance method table. Upon failure, NULL * is returned. */ return SOM_ResolveD(this,SOMClass,SOMClass,somNew) (this); } /* method: somNewNoInit */ SOMObject* somNewNoInit() { /* * Equivalent to somNew except that somDefaultInit is not called. */ return SOM_ResolveD(this,SOMClass,SOMClass,somNewNoInit) (this); } /* method: somRenew */ SOMObject* somRenew(void* obj) { /* * Equivalent to somNew except that storage is not allocated. * is taken as the address of the new object. */ return SOM_ResolveD(this,SOMClass,SOMClass,somRenew) (this,obj); } /* method: somRenewNoInit */ SOMObject* somRenewNoInit(void* obj) { /* * Equivalent to somRenew except that somDefaultInit is not called. */ return SOM_ResolveD(this,SOMClass,SOMClass,somRenewNoInit) (this,obj); } /* method: somRenewNoZero */ SOMObject* somRenewNoZero(void* obj) { /* * Equivalent to somRenew except that memory is not zeroed out. */ return SOM_ResolveD(this,SOMClass,SOMClass,somRenewNoZero) (this,obj); } /* method: somRenewNoInitNoZero */ SOMObject* somRenewNoInitNoZero(void* obj) { /* * The purpose of this method is to load an object's method table. * The SOM API requires that somRenewNoInitNoZero always be * called when creating a new object whose metaclass is not SOMClass. * This is because metaclasses must be guaranteed that they can use * somRenewNoInitNoZero to track object creation if this is desired. */ return SOM_ResolveD(this,SOMClass,SOMClass,somRenewNoInitNoZero) (this,obj); } /* nonstatic method: somAllocate */ somToken somAllocate(long size) { /* * Allocates memory to hold an object and returns a pointer to this memory. * This is a nonstatic method, and cannot be overridden. The default * implementation calls SOMMalloc, but a class designer can specify a * different implementation using the somallocate modifier in IDL. The * allocator takes the same parameters as this method. */ return SOM_ResolveD(this,SOMClass,SOMClass,somAllocate) (this,size); } /* nonstatic method: somDeallocate */ void somDeallocate(somToken memptr) { /* * Zeros out the method table pointer stored in the word pointed to by * memptr, and then deallocates the block of memory pointed to by memptr. * This is a nonstatic method and cannot be overridden. The default * deallocator called is SOMFree, but a class designer can specify a * different deallocator using the somdeallocate modifier in IDL. The * deallocator takes a char* (memptr) and a long (size) as arguments. */ SOM_ResolveD(this,SOMClass,SOMClass,somDeallocate) (this,memptr); } /* method: somInitClass */ void somInitClass(string className, SOMClass* parentClass, long dataSize, long maxStaticMethods, long majorVersion, long minorVersion) { /* * somInitClass is obsolete, and should no longer be used. The SOM 2.0 * kernel provides special handling for redispatch stubs in the case * of SOM 1.0 classes, and use of this method is what tells the kernel * that old-style redispatch stubs will be registered. */ SOM_ResolveD(this,SOMClass,SOMClass,somInitClass) (this,className,parentClass,dataSize,maxStaticMethods,majorVersion,minorVersion); } /* method: somInitMIClass */ void somInitMIClass(long inherit_vars, string className, SOMClass_SOMClassSequence* parentClasses, long dataSize, long dataAlignment, long maxStaticMethods, long majorVersion, long minorVersion) { /* * somInitMIClass implements the second phase of dynamic class creation: * inheritance of interface and possibly implementation (instance * variables) by suitable initialization of (a class object). * * For somInitMIClass, the inherit_vars argument controls whether abstract * or implementation inheritance is used. Inherit_vars is a 32 bit * bit-vector. Implementation is inherited from parent i iff the bit * 1<=32. * On a class-by-class basis, for each class ancestor, implementation * inheritance always takes precidence over abstract inheritance. This is * necessary to guarantee that procedures supporting parent method calls * (available on non-abstract parents) are always supported by parent * instance variables. * * is a string containing the class name. A copy is made, so * the string may be freed upon return to the caller if this is desired. * * is a SOMClassSequence containing pointers to the * parent classes. somInitMIClass makes a copy of this, so it may * be freed upon return to the caller if this is desired. * * is the space needed for the instance variables * introduced by this class. * * specifies the desired byte alignment for instance * data introduced by this class. A value of 0 selects a system-wide default; * any other argument is taken as the desired byte alignment multiple. Thus, * for example, even if a byte multiple of 8 is needed for double precision * values on a given system (so 8 is the default), a class whose instance data * doesn't require this can indicate otherwise. If A is the next memory * address available for holding instance data, the address that will be * used is A + (A mod byte-alignment). * * is the maximum number of static methods that will be * added to the initialized class using addStaticMethod. * * indicates the major version number for this * implementation of the class definition, and * indicates the minor version number. */ SOM_ResolveD(this,SOMClass,SOMClass,somInitMIClass) (this,inherit_vars,className,parentClasses,dataSize,dataAlignment,maxStaticMethods,majorVersion,minorVersion); } /* method: somAddStaticMethod */ somMToken somAddStaticMethod(somId methodId, somId methodDescriptor, somMethodPtr method, somMethodPtr redispatchStub, somMethodPtr applyStub) { /* * Adds the indicated method, creating and returning a new method token. * * is the somId for an identifier that can be used * to access signature information about the method from an interface * repository. * * is the actual method procedure for this method * * is a procedure with the same calling sequence as * that invokes somDispatch for the method. * * is a procedure used to support somApply. */ return SOM_ResolveD(this,SOMClass,SOMClass,somAddStaticMethod) (this,methodId,methodDescriptor,method,redispatchStub,applyStub); } /* method: somAddDynamicMethod */ void somAddDynamicMethod(somId methodId, somId methodDescriptor, somMethodPtr method, somMethodPtr applyStub) { /* * Adds the indicated method to the class's name lookup list. * If this happens to override a static method then this operation is * equivalent to and the and * arguments are ignored (the overridden method's values * will be used). * * is the somId for an identifier that can be used * to access signature information about the method from an interface * repository. * * is the actual method procedure for this method * * is a procedure that takes a standard variable argument * list data structure applies it to its target object by calling * with arguments derived from the data structure. Its * calling sequence is the same as the calling sequence of the * dispatch methods defined in SOMObject. This stub is used in the * support of the dispatch methods used in some classes. In classes * where the dispatch functions do not need such a function this * parameter may be null. */ SOM_ResolveD(this,SOMClass,SOMClass,somAddDynamicMethod) (this,methodId,methodDescriptor,method,applyStub); } /* method: somOverrideSMethod */ void somOverrideSMethod(somId methodId, somMethodPtr method) { /* * This method can be used instead of or * when it is known that the class' parent * class already supports this method. This call does not require the * method descriptor and stub methods that the others do. */ SOM_ResolveD(this,SOMClass,SOMClass,somOverrideSMethod) (this,methodId,method); } /* method: somClassReady */ void somClassReady() { /* * This method is invoked when all of the static initialization for * the class has been finished. The default implementation simply * registers the newly constructed class with the SOMClassMgr. */ SOM_ResolveD(this,SOMClass,SOMClass,somClassReady) (this); } /* method: somGetApplyStub */ somMethodPtr somGetApplyStub(somId methodId) { /* * Returns the apply stub associated with the specified method, * if one exists; otherwise NULL is returned. This method is obsolete, * and retained for binary compatability. In SOMr2, users never access * apply stubs directly; The function somApply is used to invoke apply * stubs. See somApply documentation for further information on apply * stubs, and see somAddStaticMethod documentation for information * on how apply stubs are registered by class implementations. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetApplyStub) (this,methodId); } /* method: somGetClassData */ somClassDataStructure* somGetClassData() { return SOM_ResolveD(this,SOMClass,SOMClass,somGetClassData) (this); } /* method: somSetClassData */ void somSetClassData(somClassDataStructure* cds) { /* * The class' pointer to the static ClassData structure. */ SOM_ResolveD(this,SOMClass,SOMClass,somSetClassData) (this,cds); } /* method: somGetClassMtab */ somMethodTab* somGetClassMtab() { /* * A pointer to the method table used by instances of this class. This * method was misnamed; it should have been called somGetInstanceMtab. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetClassMtab) (this); } /* method: somGetInstanceOffset */ long somGetInstanceOffset() { /* * Returns the offset of instance data introduced by the receiver in * an instance of the receiver. This method is obsolete and not useful in * multiple-inheritance situations. The attribute somInstanceDataOffsets * replaces this method. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstanceOffset) (this); } /* method: somGetInstancePartSize */ long somGetInstancePartSize() { /* * The size in bytes of the instance data introduced by the receiving * class. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstancePartSize) (this); } /* method: somGetInstanceSize */ long somGetInstanceSize() { /* * The total size of an instance of the receiving class. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstanceSize) (this); } /* method: somGetInstanceToken */ somDToken somGetInstanceToken() { /* * A data token that identifies the introduced portion of this class * within itself or any derived class. This token can be subsequently * passed to the run-time somDataResolve function to locate the instance * data introduced by this class in any object derived from this class. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstanceToken) (this); } /* method: somGetMemberToken */ somDToken somGetMemberToken(long memberOffset, somDToken instanceToken) { /* * Returns a data token that for the data member at offset * "memberOffset" within the introduced portion of the class identified * by instanceToken. The instance token must have been obtained from a * previous invocation of somGetInstanceToken. The returned member * token can be subsequently passed to the run-time somDataResolve * function to locate the data member. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetMemberToken) (this,memberOffset,instanceToken); } /* method: somGetMethodData */ boolean somGetMethodData(somId methodId, somMethodData* md) { /* * If a method with id is supported by the target class, * the structure pointed to by is loaded with method information * and the value 1 is returned. In this case, if the method is not * dynamic, md->method is loaded with the result of somClassResolve on * the target class for the method. If the method is not supported, * md->id is loaded with 0, and the value 0 is returned. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodData) (this,methodId,md); } /* method: somGetRdStub */ somMethodProc* somGetRdStub(somId methodId) { /* * Returns a redispatch stub for the indicated method, if possible. * If not possible (because a valid redispatch stub has not been * registered, and there is insufficient information to dynamically * construct one), then a NULL is returned. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetRdStub) (this,methodId); } /* method: somGetMethodDescriptor */ somId somGetMethodDescriptor(somId methodId) { /* * Returns the method descriptor for the indicated method. If * this object does not support the indicated method then NULL is * returned. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodDescriptor) (this,methodId); } /* method: somGetMethodIndex */ long somGetMethodIndex(somId id) { /* * Returns the index for the specified method. (A number that may * change if any methods are added or deleted to this class object or * any of its ancestors). This number is the basis for other calls to * get info about the method. Indexes start at 0. A -1 is returned if * the method cannot be found. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodIndex) (this,id); } /* method: somGetMethodToken */ somMToken somGetMethodToken(somId methodId) { /* * Returns the specified method's access token. This token can then * be passed to method resolution routines, which use the token * to select a method pointer from a method table. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodToken) (this,methodId); } /* method: somGetName */ string somGetName() { /* * This object's class name as a NULL terminated string. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetName) (this); } /* method: somGetNthMethodData */ boolean somGetNthMethodData(long n, somMethodData* md) { /* * loads *md with the method data associated with the the nth method, * or NULL if there is no such method. Returns true is successful; * false otherwise. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetNthMethodData) (this,n,md); } /* method: somGetNthMethodInfo */ somId somGetNthMethodInfo(long n, somId* descriptor) { /* * Returns the id of the th method if one exists and NULL * otherwise. * * The ordering of the methods is unpredictable, but will not change * unless some change is made to the class or one of its ancestor classes. * * See CORBA documentation for info on method descriptors. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetNthMethodInfo) (this,n,descriptor); } /* method: somGetNumMethods */ long somGetNumMethods() { /* * The number of methods currently supported by this class, * including inherited methods (both static and dynamic). */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetNumMethods) (this); } /* method: somGetNumStaticMethods */ long somGetNumStaticMethods() { /* * The number of static methods that this class has. Can * be used by a child class when initializing its method table. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetNumStaticMethods) (this); } /* method: somGetParent */ SOMClass* somGetParent() { /* * Returns the parent class of self (along its "left-hand" derivation * path), if one exists and NULL otherwise. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetParent) (this); } /* method: somGetParents */ SOMClass_SOMClassSequence somGetParents() { /* * The parent classes of self. */ return SOM_ResolveD(this,SOMClass,SOMClass,somGetParents) (this); } /* method: somGetVersionNumbers */ void somGetVersionNumbers(long* majorVersion, long* minorVersion) { /* * Returns the class' major and minor version numbers in the corresponding * output parameters. */ SOM_ResolveD(this,SOMClass,SOMClass,somGetVersionNumbers) (this,majorVersion,minorVersion); } /* method: somFindMethod */ boolean somFindMethod(somId methodId, somMethodPtr* m) { /* * Finds the method procedure associated with for this * class and sets to it. 1 (true) is returned when the * method procedure is a static method and 0 (false) is returned * when the method procedure is dynamic method. * * If the class does not support the specified method then * is set to NULL and the return value is meaningless. * */ return SOM_ResolveD(this,SOMClass,SOMClass,somFindMethod) (this,methodId,m); } /* method: somFindMethodOk */ boolean somFindMethodOk(somId methodId, somMethodPtr* m) { /* * Just like except that if the method is not * supported then an error is raised and execution is halted. */ return SOM_ResolveD(this,SOMClass,SOMClass,somFindMethodOk) (this,methodId,m); } /* method: somFindSMethod */ somMethodPtr somFindSMethod(somId methodId) { /* * Finds the indicated method, which must be a static method supported * by this class, and returns a pointer to its method procedure. * If the method is not supported by the receiver (as a static method * or at all) then a NULL pointer is returned. */ return SOM_ResolveD(this,SOMClass,SOMClass,somFindSMethod) (this,methodId); } /* method: somFindSMethodOk */ somMethodPtr somFindSMethodOk(somId methodId) { /* * Uses , and raises an error if the result is NULL. */ return SOM_ResolveD(this,SOMClass,SOMClass,somFindSMethodOk) (this,methodId); } /* method: somLookupMethod */ somMethodPtr somLookupMethod(somId methodId) { /* * Like , but without restriction to static methods. */ return SOM_ResolveD(this,SOMClass,SOMClass,somLookupMethod) (this,methodId); } /* method: somCheckVersion */ boolean somCheckVersion(long majorVersion, long minorVersion) { /* * Returns 1 (true) if the implementation of this class is * compatible with the specified major and minor version number and * false (0) otherwise. An implementation is compatible with the * specified version numbers if it has the same major version number * and a minor version number that is equal to or greater than * . The major, minor version number pair (0,0) is * considered to match any version. This method is usually called * immediately after creating the class object to verify that a * dynamically loaded class definition is compatible with a using * application. */ return SOM_ResolveD(this,SOMClass,SOMClass,somCheckVersion) (this,majorVersion,minorVersion); } /* method: somDescendedFrom */ boolean somDescendedFrom(SOMClass* aClassObj) { /* * Returns 1 (true) if is a descendent class of and * 0 (false) otherwise. Note: a class object is considered to be * descended itself for the purposes of this method. */ return SOM_ResolveD(this,SOMClass,SOMClass,somDescendedFrom) (this,aClassObj); } /* method: somSupportsMethod */ boolean somSupportsMethod(somId mId) { /* * Returns 1 (true) if the indicated method is supported by this * class and 0 (false) otherwise. */ return SOM_ResolveD(this,SOMClass,SOMClass,somSupportsMethod) (this,mId); } /* method: somDefinedMethod */ somMethodPtr somDefinedMethod(somMToken method) { /* * if the receiving class either introduces or overrides the * indicated method, then its somMethodPtr is returned, otherwise * NULL is returned. */ return SOM_ResolveD(this,SOMClass,SOMClass,somDefinedMethod) (this,method); } /* method: somOverrideMtab */ void somOverrideMtab() { /* * Overrides the method table pointers to point to the redispatch stubs. * All the methods except somDispatch methods are overriden. */ SOM_ResolveD(this,SOMClass,SOMClass,somOverrideMtab) (this); } /* * Reintroduce inherited methods */ /* initializer method: somDefaultInit */ void somDefaultInit(som3InitCtrl* ctrl) { /* * A default initializer for a SOM object. Passing a null ctrl * indicates to the receiver that its class is the class of the * object being initialized, whereby the initializer will determine * an appropriate control structure. */ SOM_ResolveD(this,SOMClass,SOMObject,somDefaultInit) (this,ctrl); } /* method: somDestruct */ void somDestruct(octet doFree, som3DestructCtrl* ctrl) { /* * The default destructor for a SOM object. A nonzero * indicates that the object storage should be freed by the * object's class (via somDeallocate) after uninitialization. * As with somDefaultInit, a null ctrl can be passed. */ SOM_ResolveD(this,SOMClass,SOMObject,somDestruct) (this,doFree,ctrl); } /* initializer method: somDefaultCopyInit */ void somDefaultCopyInit(som3InitCtrl* ctrl, SOMObject* fromObj) { /* * A default copy constructor. Use this to make copies of objects for * calling methods with "by-value" argument semantics. */ SOM_ResolveD(this,SOMClass,SOMObject,somDefaultCopyInit) (this,ctrl,fromObj); } /* method: somDefaultAssign */ SOMClass* somDefaultAssign(som3AssignCtrl* ctrl, SOMObject* fromObj) { /* * A default assignment operator. Use this to "assign" the state of one * object to another. */ return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultAssign) (this,ctrl,fromObj); } /* initializer method: somDefaultConstCopyInit */ void somDefaultConstCopyInit(som3InitCtrl* ctrl, SOMObject* fromObj) { /* * A default copy constructor that uses a const fromObj. */ SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstCopyInit) (this,ctrl,fromObj); } /* initializer method: somDefaultVCopyInit */ void somDefaultVCopyInit(som3InitCtrl* ctrl, SOMObject* fromObj) { /* * A default copy constructor that uses a volatile fromObj. */ SOM_ResolveD(this,SOMClass,SOMObject,somDefaultVCopyInit) (this,ctrl,fromObj); } /* initializer method: somDefaultConstVCopyInit */ void somDefaultConstVCopyInit(som3InitCtrl* ctrl, SOMObject* fromObj) { /* * A default copy constructor that uses a const volatile fromObj. */ SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstVCopyInit) (this,ctrl,fromObj); } /* method: somDefaultConstAssign */ SOMClass* somDefaultConstAssign(som3AssignCtrl* ctrl, SOMObject* fromObj) { /* * A default assignment operator that uses a const fromObj. */ return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstAssign) (this,ctrl,fromObj); } /* method: somDefaultVAssign */ SOMClass* somDefaultVAssign(som3AssignCtrl* ctrl, SOMObject* fromObj) { /* * A default assignment operator that uses a volatile fromObj. */ return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultVAssign) (this,ctrl,fromObj); } /* method: somDefaultConstVAssign */ SOMClass* somDefaultConstVAssign(som3AssignCtrl* ctrl, SOMObject* fromObj) { /* * A default assignment operator that uses a const volatile fromObj. */ return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstVAssign) (this,ctrl,fromObj); } /* method: somInit */ void somInit() { /* * Obsolete but still supported. Override somDefaultInit instead of somInit. */ SOM_ResolveD(this,SOMClass,SOMObject,somInit) (this); } /* method: somFree */ void somFree() { /* * Use as directed by framework implementations. */ SOM_ResolveD(this,SOMClass,SOMObject,somFree) (this); } /* method: somUninit */ void somUninit() { /* * Obsolete but still supported. Override somDestruct instead of somUninit. */ SOM_ResolveD(this,SOMClass,SOMObject,somUninit) (this); } /* method: somGetClass */ SOMClass* somGetClass() { /* * Return the receiver's class. */ return SOM_ResolveD(this,SOMClass,SOMObject,somGetClass) (this); } /* method: somGetClassName */ string somGetClassName() { /* * Return the name of the receiver's class. */ return SOM_ResolveD(this,SOMClass,SOMObject,somGetClassName) (this); } /* method: somGetSize */ long somGetSize() { /* * Return the size of the receiver. */ return SOM_ResolveD(this,SOMClass,SOMObject,somGetSize) (this); } /* method: somIsA */ boolean somIsA(SOMClass* aClassObj) { /* * Returns 1 (true) if the receiver responds to methods * introduced by , and 0 (false) otherwise. */ return SOM_ResolveD(this,SOMClass,SOMObject,somIsA) (this,aClassObj); } /* method: somIsInstanceOf */ boolean somIsInstanceOf(SOMClass* aClassObj) { /* * Returns 1 (true) if the receiver is an instance of * and 0 (false) otherwise. */ return SOM_ResolveD(this,SOMClass,SOMObject,somIsInstanceOf) (this,aClassObj); } /* method: somRespondsTo */ boolean somRespondsTo(somId mId) { /* * Returns 1 (true) if the indicated method can be invoked * on the receiver and 0 (false) otherwise. */ return SOM_ResolveD(this,SOMClass,SOMObject,somRespondsTo) (this,mId); } /* va_list method: somDispatch */ /* * This method provides a generic, class-specific dispatch mechanism. * It accepts as input a pointer to the memory area to be * loaded with the result of dispatching the method indicated by * using the arguments in . contains the object * on which the method is to be invoked as the first argument. */ /* the va_list invocation form */ boolean SOMClass_somDispatch(somToken* retValue, somId methodId, va_list ap) {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatch) (this,retValue,methodId,ap); } /* the varargs invocation form */ boolean somDispatch(somToken* retValue, somId methodId, ...) { /* * This method provides a generic, class-specific dispatch mechanism. * It accepts as input a pointer to the memory area to be * loaded with the result of dispatching the method indicated by * using the arguments in . contains the object * on which the method is to be invoked as the first argument. */ va_list ap; va_start(ap, methodId); boolean __somResult = SOM_ResolveD(this,SOMClass,SOMObject,somDispatch) (this,retValue,methodId,ap); va_end(ap); return __somResult; } /* va_list method: somClassDispatch */ /* * Like somDispatch, but method resolution for static methods is done * according to the clsObj instance method table. */ /* the va_list invocation form */ boolean SOMClass_somClassDispatch(SOMClass* clsObj, somToken* retValue, somId methodId, va_list ap) {return SOM_ResolveD(this,SOMClass,SOMObject,somClassDispatch) (this,clsObj,retValue,methodId,ap); } /* the varargs invocation form */ boolean somClassDispatch(SOMClass* clsObj, somToken* retValue, somId methodId, ...) { /* * Like somDispatch, but method resolution for static methods is done * according to the clsObj instance method table. */ va_list ap; va_start(ap, methodId); boolean __somResult = SOM_ResolveD(this,SOMClass,SOMObject,somClassDispatch) (this,clsObj,retValue,methodId,ap); va_end(ap); return __somResult; } /* method: somCastObj */ boolean somCastObj(SOMClass* cls) { /* * cast the receiving object to cls (which must be an ancestor of the * objects true class. Returns true on success. */ return SOM_ResolveD(this,SOMClass,SOMObject,somCastObj) (this,cls); } /* method: somResetObj */ boolean somResetObj() { /* * reset an object to its true class. Returns true always. */ return SOM_ResolveD(this,SOMClass,SOMObject,somResetObj) (this); } /* va_list method: somDispatchV */ /* * Obsolete. Use somDispatch instead. */ /* the va_list invocation form */ void SOMClass_somDispatchV(somId methodId, somId descriptor, va_list ap) { SOM_ResolveD(this,SOMClass,SOMObject,somDispatchV) (this,methodId,descriptor,ap); } /* the varargs invocation form */ void somDispatchV(somId methodId, somId descriptor, ...) { /* * Obsolete. Use somDispatch instead. */ va_list ap; va_start(ap, descriptor); SOM_ResolveD(this,SOMClass,SOMObject,somDispatchV) (this,methodId,descriptor,ap); va_end(ap); } /* va_list method: somDispatchL */ /* * Obsolete. Use somDispatch instead. */ /* the va_list invocation form */ long SOMClass_somDispatchL(somId methodId, somId descriptor, va_list ap) {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatchL) (this,methodId,descriptor,ap); } /* the varargs invocation form */ long somDispatchL(somId methodId, somId descriptor, ...) { /* * Obsolete. Use somDispatch instead. */ va_list ap; va_start(ap, descriptor); long __somResult = SOM_ResolveD(this,SOMClass,SOMObject,somDispatchL) (this,methodId,descriptor,ap); va_end(ap); return __somResult; } /* va_list method: somDispatchA */ /* * Obsolete. Use somDispatch instead. */ /* the va_list invocation form */ void* SOMClass_somDispatchA(somId methodId, somId descriptor, va_list ap) {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatchA) (this,methodId,descriptor,ap); } /* the varargs invocation form */ void* somDispatchA(somId methodId, somId descriptor, ...) { /* * Obsolete. Use somDispatch instead. */ va_list ap; va_start(ap, descriptor); void* __somResult = SOM_ResolveD(this,SOMClass,SOMObject,somDispatchA) (this,methodId,descriptor,ap); va_end(ap); return __somResult; } /* va_list method: somDispatchD */ /* * Obsolete. Use somDispatch instead. */ /* the va_list invocation form */ double SOMClass_somDispatchD(somId methodId, somId descriptor, va_list ap) {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatchD) (this,methodId,descriptor,ap); } /* the varargs invocation form */ double somDispatchD(somId methodId, somId descriptor, ...) { /* * Obsolete. Use somDispatch instead. */ va_list ap; va_start(ap, descriptor); double __somResult = SOM_ResolveD(this,SOMClass,SOMObject,somDispatchD) (this,methodId,descriptor,ap); va_end(ap); return __somResult; } /* method: somPrintSelf */ SOMObject* somPrintSelf() { /* * Uses to write a brief string with identifying * information about this object. The default implementation just gives * the object's class name and its address in memory. * is returned. */ return SOM_ResolveD(this,SOMClass,SOMObject,somPrintSelf) (this); } /* method: somDumpSelf */ void somDumpSelf(long level) { /* * Uses to write a detailed description of this object * and its current state. * * indicates the nesting level for describing compound objects * it must be greater than or equal to zero. All lines in the * description will be preceeded by <2*level> spaces. * * This routine only actually writes the data that concerns the object * as a whole, such as class, and uses to describe * the object's current state. This approach allows readable * descriptions of compound objects to be constructed. * * Generally it is not necessary to override this method, if it is * overriden it generally must be completely replaced. */ SOM_ResolveD(this,SOMClass,SOMObject,somDumpSelf) (this,level); } /* method: somDumpSelfInt */ void somDumpSelfInt(long level) { /* * Uses to write in the current state of this object. * Generally this method will need to be overridden. When overriding * it, begin by calling the parent class form of this method and then * write in a description of your class's instance data. This will * result in a description of all the object's instance data going * from its root ancestor class to its specific class. */ SOM_ResolveD(this,SOMClass,SOMObject,somDumpSelfInt) (this,level); } }; /* SOMClass */ #endif /* SOM_SOMClass_xh */