home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / somcls.xh < prev    next >
Text File  |  1999-02-22  |  60KB  |  1,899 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: somcls.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. #ifndef SOM_SOMClass_xh
  11. #define SOM_SOMClass_xh
  12.  
  13. class SOMClass;
  14.  
  15. /*
  16.  *   This is the SOM metaclass.  That is, the instances of this class
  17.  *   are class objects.  When the SOM environment is created an instance
  18.  *   of SOMClass is created and a pointer to it is placed in the external
  19.  *   data location (SOMClassClassData.classObject). Bindings provide the
  20.  *   macro _SOMClass for this expression. _SOMClass is unique in that it
  21.  *   is its own class object. I.e., _SOMClass == _somGetClass(_SOMClass).
  22.  *   SOMClass can be subclassed just like any SOM class. The subclasses
  23.  *   of SOMClass are new metaclasses and can generate class objects with
  24.  *   different implementations than those produced by _SOMClass.
  25.  * 
  26.  *   An important rule for metaclass programming is that no methods
  27.  *   introduced by SOMClass should ever be overridden. While this
  28.  *   limits the utility of metaclass programming in SOM, it guarantees
  29.  *   that SOM will operate correctly. Special class frameworks may be
  30.  *   available from IBM to alleviate this restriction. Also, the
  31.  *   restriction may be lifted in the future.
  32.  * 
  33.  */
  34.  
  35. #define SOMClass_MajorVersion 1
  36. #define SOMClass_MinorVersion 5
  37.  
  38. /* C++ SOM defs */
  39. #include <som.xh>
  40.  
  41. /* C++ parent defs */
  42. #ifndef SOM_SOMObject_xh
  43. #include <somobj.xh>
  44. #endif
  45.  
  46. #ifndef SOMClass_API
  47. #define SOMClass_API
  48. /*
  49.  * -- The Class API
  50.  */
  51.  
  52. /*
  53.  * Start of bindings for IDL types
  54.  */
  55.  
  56. class SOMClass;
  57. class SOMObject;
  58. #ifndef _IDL_SEQUENCE_somToken_defined
  59. #define _IDL_SEQUENCE_somToken_defined
  60. typedef struct {
  61.     unsigned long _maximum;
  62.     unsigned long _length;
  63.     somToken *_buffer;
  64. } _IDL_SEQUENCE_somToken;
  65. #endif /* _IDL_SEQUENCE_somToken_defined */ 
  66. typedef
  67. _IDL_SEQUENCE_somToken SOMClass_somTokenSequence;
  68. /*
  69.  *  a (generic) sequence of somTokens
  70.  */
  71.  
  72. #ifndef _IDL_SEQUENCE_SOMClass_defined
  73. #define _IDL_SEQUENCE_SOMClass_defined
  74. typedef struct {
  75.     unsigned long _maximum;
  76.     unsigned long _length;
  77.     SOMClass **_buffer;
  78. } _IDL_SEQUENCE_SOMClass;
  79. #endif /* _IDL_SEQUENCE_SOMClass_defined */ 
  80. typedef
  81. _IDL_SEQUENCE_SOMClass SOMClass_SOMClassSequence;
  82. /*
  83.  *  a sequence of classes
  84.  */
  85.  
  86. typedef
  87. struct SOMClass_somOffsetInfo {
  88. SOMClass* cls;
  89. long  offset;
  90. } SOMClass_somOffsetInfo;
  91. /*
  92.  *  a structure to describe a class-related offset
  93.  */
  94.  
  95. struct SOMClass_somOffsetInfo;
  96. #ifndef _IDL_SEQUENCE_SOMClass_somOffsetInfo_defined
  97. #define _IDL_SEQUENCE_SOMClass_somOffsetInfo_defined
  98. typedef struct {
  99.     unsigned long _maximum;
  100.     unsigned long _length;
  101.     struct SOMClass_somOffsetInfo *_buffer;
  102. } _IDL_SEQUENCE_SOMClass_somOffsetInfo;
  103. #endif /* _IDL_SEQUENCE_SOMClass_somOffsetInfo_defined */ 
  104. typedef
  105. _IDL_SEQUENCE_SOMClass_somOffsetInfo SOMClass_somOffsets;
  106. /*
  107.  *  a sequence of class-related offsets
  108.  */
  109.  
  110. #ifndef _IDL_SEQUENCE_somId_defined
  111. #define _IDL_SEQUENCE_somId_defined
  112. typedef struct {
  113.     unsigned long _maximum;
  114.     unsigned long _length;
  115.     somId *_buffer;
  116. } _IDL_SEQUENCE_somId;
  117. #endif /* _IDL_SEQUENCE_somId_defined */ 
  118. typedef
  119. _IDL_SEQUENCE_somId SOMClass_somIdSequence;
  120. /*
  121.  *  a sequence of somIds
  122.  */
  123.  
  124.  
  125. #ifndef SOM_DONT_USE_SHORT_NAMES
  126.  
  127. #ifndef SOM_DONT_USE_SHORT_NAMES
  128. #ifndef SOMTGD_somTokenSequence
  129.     #ifdef somTokenSequence
  130.         #undef somTokenSequence
  131.         #define SOMTGD_somTokenSequence 1
  132.     #else
  133.         #define somTokenSequence SOMClass_somTokenSequence
  134.     #endif /* somTokenSequence */
  135. #endif /* SOMTGD_somTokenSequence */
  136. #endif /* SOM_DONT_USE_SHORT_NAMES */
  137.  
  138. #ifndef SOM_DONT_USE_SHORT_NAMES
  139. #ifndef SOMTGD_SOMClassSequence
  140.     #ifdef SOMClassSequence
  141.         #undef SOMClassSequence
  142.         #define SOMTGD_SOMClassSequence 1
  143.     #else
  144.         #define SOMClassSequence SOMClass_SOMClassSequence
  145.     #endif /* SOMClassSequence */
  146. #endif /* SOMTGD_SOMClassSequence */
  147. #endif /* SOM_DONT_USE_SHORT_NAMES */
  148. #ifndef SOMTGD_somOffsetInfo
  149.     #ifdef somOffsetInfo
  150.         #undef somOffsetInfo
  151.         #define SOMTGD_somOffsetInfo 1
  152.     #else
  153.         #define somOffsetInfo SOMClass_somOffsetInfo
  154.     #endif /* somOffsetInfo */
  155. #endif /* SOMTGD_somOffsetInfo */
  156. #ifndef SOMTGD__IDL_SEQUENCE_somOffsetInfo
  157.     #ifdef _IDL_SEQUENCE_somOffsetInfo
  158.         #undef _IDL_SEQUENCE_somOffsetInfo
  159.         #define SOMTGD__IDL_SEQUENCE_somOffsetInfo 1
  160.     #else
  161.         #define _IDL_SEQUENCE_somOffsetInfo _IDL_SEQUENCE_SOMClass_somOffsetInfo
  162.     #endif /* _IDL_SEQUENCE_somOffsetInfo */
  163. #endif /* SOMTGD__IDL_SEQUENCE_somOffsetInfo */
  164.  
  165. #ifndef SOM_DONT_USE_SHORT_NAMES
  166. #ifndef SOMTGD_somOffsets
  167.     #ifdef somOffsets
  168.         #undef somOffsets
  169.         #define SOMTGD_somOffsets 1
  170.     #else
  171.         #define somOffsets SOMClass_somOffsets
  172.     #endif /* somOffsets */
  173. #endif /* SOMTGD_somOffsets */
  174. #endif /* SOM_DONT_USE_SHORT_NAMES */
  175.  
  176. #ifndef SOM_DONT_USE_SHORT_NAMES
  177. #ifndef SOMTGD_somIdSequence
  178.     #ifdef somIdSequence
  179.         #undef somIdSequence
  180.         #define SOMTGD_somIdSequence 1
  181.     #else
  182.         #define somIdSequence SOMClass_somIdSequence
  183.     #endif /* somIdSequence */
  184. #endif /* SOMTGD_somIdSequence */
  185. #endif /* SOM_DONT_USE_SHORT_NAMES */
  186. #endif /* SOM_DONT_USE_SHORT_NAMES */
  187.  
  188. /*
  189.  * End of bindings for IDL types.
  190.  */
  191.  
  192. /* A procedure to create the SOMClass Class */
  193. SOMEXTERN SOMClass * SOMLINK SOMClassNewClass(
  194.         integer4 majorVersion,
  195.         integer4 minorVersion);
  196.  
  197. /* The API to the SOMClass class object, and the methods it introduces. */
  198. SOMEXTERN struct SOMClassClassDataStructure {
  199.     SOMClass *classObject;
  200.     somMToken somNew;
  201.     somMToken somRenew;
  202.     somMToken somInitClass;
  203.     somMToken somClassReady;
  204.     somMToken somGetName;
  205.     somMToken somGetParent;
  206.     somMToken somDescendedFrom;
  207.     somMToken somCheckVersion;
  208.     somMToken somFindMethod;
  209.     somMToken somFindMethodOk;
  210.     somMToken somSupportsMethod;
  211.     somMToken somGetNumMethods;
  212.     somMToken somGetInstanceSize;
  213.     somMToken somGetInstanceOffset;
  214.     somMToken somGetInstancePartSize;
  215.     somMToken somGetMethodIndex;
  216.     somMToken somGetNumStaticMethods;
  217.     somMToken somGetPClsMtab;
  218.     somMToken somGetClassMtab;
  219.     somMToken somAddStaticMethod;
  220.     somMToken somOverrideSMethod;
  221.     somMToken somAddDynamicMethod;
  222.     somMToken somcPrivate0;
  223.     somMToken somGetApplyStub;
  224.     somMToken somFindSMethod;
  225.     somMToken somFindSMethodOk;
  226.     somMToken somGetMethodDescriptor;
  227.     somMToken somGetNthMethodInfo;
  228.     somMToken somSetClassData;
  229.     somMToken somGetClassData;
  230.     somMToken somNewNoInit;
  231.     somMToken somRenewNoInit;
  232.     somMToken somGetInstanceToken;
  233.     somMToken somGetMemberToken;
  234.     somMToken somcPrivate1;
  235.     somMToken somGetMethodData;
  236.     somMToken somOverrideMtab;
  237.     somMToken somGetMethodToken;
  238.     somMToken somGetParents;
  239.     somMToken somGetPClsMtabs;
  240.     somMToken somInitMIClass;
  241.     somMToken somGetVersionNumbers;
  242.     somMToken somLookupMethod;
  243.     somMToken _get_somInstanceDataOffsets;
  244.     somMToken somRenewNoZero;
  245.     somMToken somRenewNoInitNoZero;
  246.     somMToken somAllocate;
  247.     somMToken somDeallocate;
  248.     somMToken somGetRdStub;
  249.     somMToken somGetNthMethodData;
  250.     somMToken somcPrivate2;
  251.     somMToken somcPrivate3;
  252.     somMToken _get_somDirectInitClasses;
  253.     somMToken somcPrivate5;
  254.     somMToken somcPrivate6;
  255.     somMToken somcPrivate7;
  256.     somMToken somcPrivate8;
  257.     somMToken somcPrivate9;
  258.     somMToken somcPrivate10;
  259.     somMToken somcPrivate11;
  260.     somMToken somcPrivate12;
  261.     somMToken somDefinedMethod;
  262.     somMToken somcPrivate13;
  263.     somMToken somcPrivate14;
  264.     somMToken somcPrivate15;
  265.     somMToken somcPrivate16;
  266.     somMToken somcPrivate17;
  267.     somMToken somcPrivate18;
  268.     somMToken somcPrivate19;
  269.     somMToken somcPrivate20;
  270.     somMToken _get_somDataAlignment;
  271.     somMToken somcPrivate21;
  272.     somMToken somcPrivate22;
  273.     somMToken somcPrivate23;
  274.     somMToken somcPrivate24;
  275.     somMToken somcPrivate25;
  276. } SOMDLINK SOMClassClassData;
  277. #define _SOMClass SOMClassClassData.classObject
  278.  
  279. /* The API to parentMtabs for SOMClass, and the instance data it introduces. */
  280. SOMEXTERN struct SOMClassCClassDataStructure {
  281.     somMethodTabs parentMtab;
  282.     somDToken              instanceDataToken;
  283. } SOMDLINK SOMClassCClassData;
  284.  
  285. /*
  286.  * -- Typedefs for SOMClass Method Procedures
  287.  */
  288. SOMEXTERN {
  289. typedef long   SOMLINK somTP_SOMClass__get_somDataAlignment(SOMClass *somSelf);
  290. typedef somTP_SOMClass__get_somDataAlignment *somTD_SOMClass__get_somDataAlignment;
  291. typedef SOMClass_somOffsets   SOMLINK somTP_SOMClass__get_somInstanceDataOffsets(SOMClass *somSelf);
  292. typedef somTP_SOMClass__get_somInstanceDataOffsets *somTD_SOMClass__get_somInstanceDataOffsets;
  293. typedef SOMClass_SOMClassSequence   SOMLINK somTP_SOMClass__get_somDirectInitClasses(SOMClass *somSelf);
  294. typedef somTP_SOMClass__get_somDirectInitClasses *somTD_SOMClass__get_somDirectInitClasses;
  295. typedef SOMObject*   SOMLINK somTP_SOMClass_somNew(SOMClass *somSelf);
  296. typedef somTP_SOMClass_somNew *somTD_SOMClass_somNew;
  297. typedef SOMObject*   SOMLINK somTP_SOMClass_somNewNoInit(SOMClass *somSelf);
  298. typedef somTP_SOMClass_somNewNoInit *somTD_SOMClass_somNewNoInit;
  299. typedef SOMObject*   SOMLINK somTP_SOMClass_somRenew(SOMClass *somSelf, 
  300.         void* obj);
  301. typedef somTP_SOMClass_somRenew *somTD_SOMClass_somRenew;
  302. typedef SOMObject*   SOMLINK somTP_SOMClass_somRenewNoInit(SOMClass *somSelf, 
  303.         void* obj);
  304. typedef somTP_SOMClass_somRenewNoInit *somTD_SOMClass_somRenewNoInit;
  305. typedef SOMObject*   SOMLINK somTP_SOMClass_somRenewNoZero(SOMClass *somSelf, 
  306.         void* obj);
  307. typedef somTP_SOMClass_somRenewNoZero *somTD_SOMClass_somRenewNoZero;
  308. typedef SOMObject*   SOMLINK somTP_SOMClass_somRenewNoInitNoZero(SOMClass *somSelf, 
  309.         void* obj);
  310. typedef somTP_SOMClass_somRenewNoInitNoZero *somTD_SOMClass_somRenewNoInitNoZero;
  311. typedef somToken   SOMLINK somTP_SOMClass_somAllocate(SOMClass *somSelf, 
  312.         long size);
  313. typedef somTP_SOMClass_somAllocate *somTD_SOMClass_somAllocate;
  314. typedef void   SOMLINK somTP_SOMClass_somDeallocate(SOMClass *somSelf, 
  315.         somToken memptr);
  316. typedef somTP_SOMClass_somDeallocate *somTD_SOMClass_somDeallocate;
  317. typedef void   SOMLINK somTP_SOMClass_somInitClass(SOMClass *somSelf, 
  318.         string className, 
  319.         SOMClass* parentClass, 
  320.         long dataSize, 
  321.         long maxStaticMethods, 
  322.         long majorVersion, 
  323.         long minorVersion);
  324. typedef somTP_SOMClass_somInitClass *somTD_SOMClass_somInitClass;
  325. typedef void   SOMLINK somTP_SOMClass_somInitMIClass(SOMClass *somSelf, 
  326.         long inherit_vars, 
  327.         string className, 
  328.         SOMClass_SOMClassSequence* parentClasses, 
  329.         long dataSize, 
  330.         long dataAlignment, 
  331.         long maxStaticMethods, 
  332.         long majorVersion, 
  333.         long minorVersion);
  334. typedef somTP_SOMClass_somInitMIClass *somTD_SOMClass_somInitMIClass;
  335. typedef somMToken   SOMLINK somTP_SOMClass_somAddStaticMethod(SOMClass *somSelf, 
  336.         somId methodId, 
  337.         somId methodDescriptor, 
  338.         somMethodPtr method, 
  339.         somMethodPtr redispatchStub, 
  340.         somMethodPtr applyStub);
  341. typedef somTP_SOMClass_somAddStaticMethod *somTD_SOMClass_somAddStaticMethod;
  342. typedef void   SOMLINK somTP_SOMClass_somAddDynamicMethod(SOMClass *somSelf, 
  343.         somId methodId, 
  344.         somId methodDescriptor, 
  345.         somMethodPtr method, 
  346.         somMethodPtr applyStub);
  347. typedef somTP_SOMClass_somAddDynamicMethod *somTD_SOMClass_somAddDynamicMethod;
  348. typedef void   SOMLINK somTP_SOMClass_somOverrideSMethod(SOMClass *somSelf, 
  349.         somId methodId, 
  350.         somMethodPtr method);
  351. typedef somTP_SOMClass_somOverrideSMethod *somTD_SOMClass_somOverrideSMethod;
  352. typedef void   SOMLINK somTP_SOMClass_somClassReady(SOMClass *somSelf);
  353. typedef somTP_SOMClass_somClassReady *somTD_SOMClass_somClassReady;
  354. typedef somMethodPtr   SOMLINK somTP_SOMClass_somGetApplyStub(SOMClass *somSelf, 
  355.         somId methodId);
  356. typedef somTP_SOMClass_somGetApplyStub *somTD_SOMClass_somGetApplyStub;
  357. typedef somClassDataStructure*   SOMLINK somTP_SOMClass_somGetClassData(SOMClass *somSelf);
  358. typedef somTP_SOMClass_somGetClassData *somTD_SOMClass_somGetClassData;
  359. typedef void   SOMLINK somTP_SOMClass_somSetClassData(SOMClass *somSelf, 
  360.         somClassDataStructure* cds);
  361. typedef somTP_SOMClass_somSetClassData *somTD_SOMClass_somSetClassData;
  362. typedef somMethodTab*   SOMLINK somTP_SOMClass_somGetClassMtab(SOMClass *somSelf);
  363. typedef somTP_SOMClass_somGetClassMtab *somTD_SOMClass_somGetClassMtab;
  364. typedef long   SOMLINK somTP_SOMClass_somGetInstanceOffset(SOMClass *somSelf);
  365. typedef somTP_SOMClass_somGetInstanceOffset *somTD_SOMClass_somGetInstanceOffset;
  366. typedef long   SOMLINK somTP_SOMClass_somGetInstancePartSize(SOMClass *somSelf);
  367. typedef somTP_SOMClass_somGetInstancePartSize *somTD_SOMClass_somGetInstancePartSize;
  368. typedef long   SOMLINK somTP_SOMClass_somGetInstanceSize(SOMClass *somSelf);
  369. typedef somTP_SOMClass_somGetInstanceSize *somTD_SOMClass_somGetInstanceSize;
  370. typedef somDToken   SOMLINK somTP_SOMClass_somGetInstanceToken(SOMClass *somSelf);
  371. typedef somTP_SOMClass_somGetInstanceToken *somTD_SOMClass_somGetInstanceToken;
  372. typedef somDToken   SOMLINK somTP_SOMClass_somGetMemberToken(SOMClass *somSelf, 
  373.         long memberOffset, 
  374.         somDToken instanceToken);
  375. typedef somTP_SOMClass_somGetMemberToken *somTD_SOMClass_somGetMemberToken;
  376. typedef boolean   SOMLINK somTP_SOMClass_somGetMethodData(SOMClass *somSelf, 
  377.         somId methodId, 
  378.         somMethodData* md);
  379. typedef somTP_SOMClass_somGetMethodData *somTD_SOMClass_somGetMethodData;
  380. typedef somMethodProc*   SOMLINK somTP_SOMClass_somGetRdStub(SOMClass *somSelf, 
  381.         somId methodId);
  382. typedef somTP_SOMClass_somGetRdStub *somTD_SOMClass_somGetRdStub;
  383. typedef somId   SOMLINK somTP_SOMClass_somGetMethodDescriptor(SOMClass *somSelf, 
  384.         somId methodId);
  385. typedef somTP_SOMClass_somGetMethodDescriptor *somTD_SOMClass_somGetMethodDescriptor;
  386. typedef long   SOMLINK somTP_SOMClass_somGetMethodIndex(SOMClass *somSelf, 
  387.         somId id);
  388. typedef somTP_SOMClass_somGetMethodIndex *somTD_SOMClass_somGetMethodIndex;
  389. typedef somMToken   SOMLINK somTP_SOMClass_somGetMethodToken(SOMClass *somSelf, 
  390.         somId methodId);
  391. typedef somTP_SOMClass_somGetMethodToken *somTD_SOMClass_somGetMethodToken;
  392. typedef string   SOMLINK somTP_SOMClass_somGetName(SOMClass *somSelf);
  393. typedef somTP_SOMClass_somGetName *somTD_SOMClass_somGetName;
  394. typedef boolean   SOMLINK somTP_SOMClass_somGetNthMethodData(SOMClass *somSelf, 
  395.         long n, 
  396.         somMethodData* md);
  397. typedef somTP_SOMClass_somGetNthMethodData *somTD_SOMClass_somGetNthMethodData;
  398. typedef somId   SOMLINK somTP_SOMClass_somGetNthMethodInfo(SOMClass *somSelf, 
  399.         long n, 
  400.         somId* descriptor);
  401. typedef somTP_SOMClass_somGetNthMethodInfo *somTD_SOMClass_somGetNthMethodInfo;
  402. typedef long   SOMLINK somTP_SOMClass_somGetNumMethods(SOMClass *somSelf);
  403. typedef somTP_SOMClass_somGetNumMethods *somTD_SOMClass_somGetNumMethods;
  404. typedef long   SOMLINK somTP_SOMClass_somGetNumStaticMethods(SOMClass *somSelf);
  405. typedef somTP_SOMClass_somGetNumStaticMethods *somTD_SOMClass_somGetNumStaticMethods;
  406. typedef SOMClass*   SOMLINK somTP_SOMClass_somGetParent(SOMClass *somSelf);
  407. typedef somTP_SOMClass_somGetParent *somTD_SOMClass_somGetParent;
  408. typedef SOMClass_SOMClassSequence   SOMLINK somTP_SOMClass_somGetParents(SOMClass *somSelf);
  409. typedef somTP_SOMClass_somGetParents *somTD_SOMClass_somGetParents;
  410. typedef void   SOMLINK somTP_SOMClass_somGetVersionNumbers(SOMClass *somSelf, 
  411.         long* majorVersion, 
  412.         long* minorVersion);
  413. typedef somTP_SOMClass_somGetVersionNumbers *somTD_SOMClass_somGetVersionNumbers;
  414. typedef boolean   SOMLINK somTP_SOMClass_somFindMethod(SOMClass *somSelf, 
  415.         somId methodId, 
  416.         somMethodPtr* m);
  417. typedef somTP_SOMClass_somFindMethod *somTD_SOMClass_somFindMethod;
  418. typedef boolean   SOMLINK somTP_SOMClass_somFindMethodOk(SOMClass *somSelf, 
  419.         somId methodId, 
  420.         somMethodPtr* m);
  421. typedef somTP_SOMClass_somFindMethodOk *somTD_SOMClass_somFindMethodOk;
  422. typedef somMethodPtr   SOMLINK somTP_SOMClass_somFindSMethod(SOMClass *somSelf, 
  423.         somId methodId);
  424. typedef somTP_SOMClass_somFindSMethod *somTD_SOMClass_somFindSMethod;
  425. typedef somMethodPtr   SOMLINK somTP_SOMClass_somFindSMethodOk(SOMClass *somSelf, 
  426.         somId methodId);
  427. typedef somTP_SOMClass_somFindSMethodOk *somTD_SOMClass_somFindSMethodOk;
  428. typedef somMethodPtr   SOMLINK somTP_SOMClass_somLookupMethod(SOMClass *somSelf, 
  429.         somId methodId);
  430. typedef somTP_SOMClass_somLookupMethod *somTD_SOMClass_somLookupMethod;
  431. typedef boolean   SOMLINK somTP_SOMClass_somCheckVersion(SOMClass *somSelf, 
  432.         long majorVersion, 
  433.         long minorVersion);
  434. typedef somTP_SOMClass_somCheckVersion *somTD_SOMClass_somCheckVersion;
  435. typedef boolean   SOMLINK somTP_SOMClass_somDescendedFrom(SOMClass *somSelf, 
  436.         SOMClass* aClassObj);
  437. typedef somTP_SOMClass_somDescendedFrom *somTD_SOMClass_somDescendedFrom;
  438. typedef boolean   SOMLINK somTP_SOMClass_somSupportsMethod(SOMClass *somSelf, 
  439.         somId mId);
  440. typedef somTP_SOMClass_somSupportsMethod *somTD_SOMClass_somSupportsMethod;
  441. typedef somMethodPtr   SOMLINK somTP_SOMClass_somDefinedMethod(SOMClass *somSelf, 
  442.         somMToken method);
  443. typedef somTP_SOMClass_somDefinedMethod *somTD_SOMClass_somDefinedMethod;
  444. typedef void   SOMLINK somTP_SOMClass_somOverrideMtab(SOMClass *somSelf);
  445. typedef somTP_SOMClass_somOverrideMtab *somTD_SOMClass_somOverrideMtab;
  446.  
  447. /*
  448.  * -- Typedefs for Reintroduced Wrapper Methods
  449.  */
  450. typedef void   SOMLINK somTP_SOMClass_somDefaultInit(SOMClass *somSelf, 
  451.         som3InitCtrl* ctrl);
  452. typedef somTP_SOMClass_somDefaultInit *somTD_SOMClass_somDefaultInit;
  453. typedef void   SOMLINK somTP_SOMClass_somDestruct(SOMClass *somSelf, 
  454.         octet doFree, 
  455.         som3DestructCtrl* ctrl);
  456. typedef somTP_SOMClass_somDestruct *somTD_SOMClass_somDestruct;
  457. typedef void   SOMLINK somTP_SOMClass_somDefaultCopyInit(SOMClass *somSelf, 
  458.         som3InitCtrl* ctrl, 
  459.         SOMObject* fromObj);
  460. typedef somTP_SOMClass_somDefaultCopyInit *somTD_SOMClass_somDefaultCopyInit;
  461. typedef SOMClass*   SOMLINK somTP_SOMClass_somDefaultAssign(SOMClass *somSelf, 
  462.         som3AssignCtrl* ctrl, 
  463.         SOMObject* fromObj);
  464. typedef somTP_SOMClass_somDefaultAssign *somTD_SOMClass_somDefaultAssign;
  465. typedef void   SOMLINK somTP_SOMClass_somDefaultConstCopyInit(SOMClass *somSelf, 
  466.         som3InitCtrl* ctrl, 
  467.         SOMObject* fromObj);
  468. typedef somTP_SOMClass_somDefaultConstCopyInit *somTD_SOMClass_somDefaultConstCopyInit;
  469. typedef void   SOMLINK somTP_SOMClass_somDefaultVCopyInit(SOMClass *somSelf, 
  470.         som3InitCtrl* ctrl, 
  471.         SOMObject* fromObj);
  472. typedef somTP_SOMClass_somDefaultVCopyInit *somTD_SOMClass_somDefaultVCopyInit;
  473. typedef void   SOMLINK somTP_SOMClass_somDefaultConstVCopyInit(SOMClass *somSelf, 
  474.         som3InitCtrl* ctrl, 
  475.         SOMObject* fromObj);
  476. typedef somTP_SOMClass_somDefaultConstVCopyInit *somTD_SOMClass_somDefaultConstVCopyInit;
  477. typedef SOMClass*   SOMLINK somTP_SOMClass_somDefaultConstAssign(SOMClass *somSelf, 
  478.         som3AssignCtrl* ctrl, 
  479.         SOMObject* fromObj);
  480. typedef somTP_SOMClass_somDefaultConstAssign *somTD_SOMClass_somDefaultConstAssign;
  481. typedef SOMClass*   SOMLINK somTP_SOMClass_somDefaultVAssign(SOMClass *somSelf, 
  482.         som3AssignCtrl* ctrl, 
  483.         SOMObject* fromObj);
  484. typedef somTP_SOMClass_somDefaultVAssign *somTD_SOMClass_somDefaultVAssign;
  485. typedef SOMClass*   SOMLINK somTP_SOMClass_somDefaultConstVAssign(SOMClass *somSelf, 
  486.         som3AssignCtrl* ctrl, 
  487.         SOMObject* fromObj);
  488. typedef somTP_SOMClass_somDefaultConstVAssign *somTD_SOMClass_somDefaultConstVAssign;
  489. typedef void   SOMLINK somTP_SOMClass_somInit(SOMClass *somSelf);
  490. typedef somTP_SOMClass_somInit *somTD_SOMClass_somInit;
  491. typedef void   SOMLINK somTP_SOMClass_somFree(SOMClass *somSelf);
  492. typedef somTP_SOMClass_somFree *somTD_SOMClass_somFree;
  493. typedef void   SOMLINK somTP_SOMClass_somUninit(SOMClass *somSelf);
  494. typedef somTP_SOMClass_somUninit *somTD_SOMClass_somUninit;
  495. typedef SOMClass*   SOMLINK somTP_SOMClass_somGetClass(SOMClass *somSelf);
  496. typedef somTP_SOMClass_somGetClass *somTD_SOMClass_somGetClass;
  497. typedef string   SOMLINK somTP_SOMClass_somGetClassName(SOMClass *somSelf);
  498. typedef somTP_SOMClass_somGetClassName *somTD_SOMClass_somGetClassName;
  499. typedef long   SOMLINK somTP_SOMClass_somGetSize(SOMClass *somSelf);
  500. typedef somTP_SOMClass_somGetSize *somTD_SOMClass_somGetSize;
  501. typedef boolean   SOMLINK somTP_SOMClass_somIsA(SOMClass *somSelf, 
  502.         SOMClass* aClassObj);
  503. typedef somTP_SOMClass_somIsA *somTD_SOMClass_somIsA;
  504. typedef boolean   SOMLINK somTP_SOMClass_somIsInstanceOf(SOMClass *somSelf, 
  505.         SOMClass* aClassObj);
  506. typedef somTP_SOMClass_somIsInstanceOf *somTD_SOMClass_somIsInstanceOf;
  507. typedef boolean   SOMLINK somTP_SOMClass_somRespondsTo(SOMClass *somSelf, 
  508.         somId mId);
  509. typedef somTP_SOMClass_somRespondsTo *somTD_SOMClass_somRespondsTo;
  510. typedef boolean   SOMLINK somTP_SOMClass_somDispatch(SOMClass *somSelf, 
  511.         somToken* retValue, 
  512.         somId methodId, 
  513.         va_list ap);
  514. typedef somTP_SOMClass_somDispatch *somTD_SOMClass_somDispatch;
  515. typedef boolean   SOMLINK somTP_SOMClass_somClassDispatch(SOMClass *somSelf, 
  516.         SOMClass* clsObj, 
  517.         somToken* retValue, 
  518.         somId methodId, 
  519.         va_list ap);
  520. typedef somTP_SOMClass_somClassDispatch *somTD_SOMClass_somClassDispatch;
  521. typedef boolean   SOMLINK somTP_SOMClass_somCastObj(SOMClass *somSelf, 
  522.         SOMClass* cls);
  523. typedef somTP_SOMClass_somCastObj *somTD_SOMClass_somCastObj;
  524. typedef boolean   SOMLINK somTP_SOMClass_somResetObj(SOMClass *somSelf);
  525. typedef somTP_SOMClass_somResetObj *somTD_SOMClass_somResetObj;
  526. typedef void   SOMLINK somTP_SOMClass_somDispatchV(SOMClass *somSelf, 
  527.         somId methodId, 
  528.         somId descriptor, 
  529.         va_list ap);
  530. typedef somTP_SOMClass_somDispatchV *somTD_SOMClass_somDispatchV;
  531. typedef long   SOMLINK somTP_SOMClass_somDispatchL(SOMClass *somSelf, 
  532.         somId methodId, 
  533.         somId descriptor, 
  534.         va_list ap);
  535. typedef somTP_SOMClass_somDispatchL *somTD_SOMClass_somDispatchL;
  536. typedef void*   SOMLINK somTP_SOMClass_somDispatchA(SOMClass *somSelf, 
  537.         somId methodId, 
  538.         somId descriptor, 
  539.         va_list ap);
  540. typedef somTP_SOMClass_somDispatchA *somTD_SOMClass_somDispatchA;
  541. typedef double   SOMLINK somTP_SOMClass_somDispatchD(SOMClass *somSelf, 
  542.         somId methodId, 
  543.         somId descriptor, 
  544.         va_list ap);
  545. typedef somTP_SOMClass_somDispatchD *somTD_SOMClass_somDispatchD;
  546. typedef SOMObject*   SOMLINK somTP_SOMClass_somPrintSelf(SOMClass *somSelf);
  547. typedef somTP_SOMClass_somPrintSelf *somTD_SOMClass_somPrintSelf;
  548. typedef void   SOMLINK somTP_SOMClass_somDumpSelf(SOMClass *somSelf, 
  549.         long level);
  550. typedef somTP_SOMClass_somDumpSelf *somTD_SOMClass_somDumpSelf;
  551. typedef void   SOMLINK somTP_SOMClass_somDumpSelfInt(SOMClass *somSelf, 
  552.         long level);
  553. typedef somTP_SOMClass_somDumpSelfInt *somTD_SOMClass_somDumpSelfInt;
  554. }
  555.  
  556. #endif /* SOMClass_API */
  557.  
  558.  
  559. /*
  560.  * -- This emitter treats Method Tokens as Thunks by default.
  561.  * -- Use the sc modifier "nothunks" to change this default
  562.  */
  563. #undef somresolve_
  564. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  565.  
  566. /*
  567.  * -- The C++ Wrapper Class for SOMClass
  568.  */
  569. class SOMClass : public SOMObject
  570. {
  571. /*
  572.  *   This is the SOM metaclass.  That is, the instances of this class
  573.  *   are class objects.  When the SOM environment is created an instance
  574.  *   of SOMClass is created and a pointer to it is placed in the external
  575.  *   data location (SOMClassClassData.classObject). Bindings provide the
  576.  *   macro _SOMClass for this expression. _SOMClass is unique in that it
  577.  *   is its own class object. I.e., _SOMClass == _somGetClass(_SOMClass).
  578.  *   SOMClass can be subclassed just like any SOM class. The subclasses
  579.  *   of SOMClass are new metaclasses and can generate class objects with
  580.  *   different implementations than those produced by _SOMClass.
  581.  * 
  582.  *   An important rule for metaclass programming is that no methods
  583.  *   introduced by SOMClass should ever be overridden. While this
  584.  *   limits the utility of metaclass programming in SOM, it guarantees
  585.  *   that SOM will operate correctly. Special class frameworks may be
  586.  *   available from IBM to alleviate this restriction. Also, the
  587.  *   restriction may be lifted in the future.
  588.  * 
  589.  */
  590. public:
  591.  
  592. // SOMClass::new creates the class object if necessary, and then uses somNewNoInit
  593. // to allocate memory and create the object. Initialization is in ctors.
  594. void *operator new(size_t)
  595. {
  596.    if (!_SOMClass) SOMClassNewClass(SOMClass_MajorVersion,SOMClass_MinorVersion);
  597.    return (void*)
  598.       SOM_Resolve(_SOMClass,SOMClass,somNewNoInit)
  599.          ((SOMClass *)((void*)_SOMClass));
  600. }
  601.  
  602. // SOMClass::delete uses somDestruct.
  603. void operator delete(void * obj)
  604. {
  605.    if (obj && *(void**)obj) {
  606.       SOM_Resolve(obj,SOMObject,somFree)
  607.          ((SOMObject*)obj);
  608.    }
  609. }
  610.  
  611. SOMClass& operator=(SOMClass& fromObj)
  612. {
  613.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  614.    return *this;
  615. }
  616.  
  617. SOMClass()
  618. {
  619.    if (*(void**)this != 
  620.        ((somParentMtabStructPtr)
  621.         (SOMClassCClassData.parentMtab))->mtab)
  622.       return;
  623.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  624. }
  625.  
  626. SOMClass(SOMClass* fromObj)
  627. {
  628.    if (*(void**)this != 
  629.        ((somParentMtabStructPtr)
  630.         (SOMClassCClassData.parentMtab))->mtab)
  631.       return;
  632.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  633. }
  634.  
  635. #ifdef __IBMCPP__
  636. #pragma info(nocnv,nopar)
  637. #endif
  638. SOMClass(const SOMClass* fromObj)
  639. {
  640.    if (*(void**)this != 
  641.        ((somParentMtabStructPtr)
  642.         (SOMClassCClassData.parentMtab))->mtab)
  643.       return;
  644.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  645. }
  646. #ifdef __IBMCPP__
  647. #pragma info(restore)
  648. #endif
  649.  
  650.  
  651. /* method: _get_somDataAlignment */
  652. long   _get_somDataAlignment()
  653. {
  654. /*
  655.  *  The alignment required for the instance data structure
  656.  *  introduced by the receiving class.
  657.  */
  658.    return SOM_ResolveD(this,SOMClass,SOMClass,_get_somDataAlignment)
  659.     (this);
  660. }
  661.  
  662.  
  663. /* nonstatic method: _get_somInstanceDataOffsets */
  664. SOMClass_somOffsets   _get_somInstanceDataOffsets()
  665. {
  666. /*
  667.  *  A sequence of the instance data offsets for all classes used in
  668.  *  the derivation of the receiving class (including the receiver).
  669.  */
  670.    return SOM_ResolveD(this,SOMClass,SOMClass,_get_somInstanceDataOffsets)
  671.     (this);
  672. }
  673.  
  674.  
  675. /* nonstatic method: _get_somDirectInitClasses */
  676. SOMClass_SOMClassSequence   _get_somDirectInitClasses()
  677. {
  678. /*
  679.  *  The ancestors whose initializers the receiving
  680.  *  class wants to directly invoke.
  681.  */
  682.    return SOM_ResolveD(this,SOMClass,SOMClass,_get_somDirectInitClasses)
  683.     (this);
  684. }
  685.  
  686.  
  687. /* method: somNew */
  688. SOMObject*   somNew()
  689. {
  690. /*
  691.  *  Uses SOMMalloc to allocate storage for a new instance of the
  692.  *  receiving class, and then calls somRenewNoInitNoZero to load the
  693.  *  new object's method table pointer. Then somDefaultInit is called to
  694.  *  initialize the new object.  Note: If the instance is a class object,
  695.  *  somInitMIClass must then be invoked to declare parents and
  696.  *  initialize the class's instance method table. Upon failure, NULL
  697.  *  is returned.
  698.  */
  699.    return SOM_ResolveD(this,SOMClass,SOMClass,somNew)
  700.     (this);
  701. }
  702.  
  703.  
  704. /* method: somNewNoInit */
  705. SOMObject*   somNewNoInit()
  706. {
  707. /*
  708.  *  Equivalent to somNew except that somDefaultInit is not called.
  709.  */
  710.    return SOM_ResolveD(this,SOMClass,SOMClass,somNewNoInit)
  711.     (this);
  712. }
  713.  
  714.  
  715. /* method: somRenew */
  716. SOMObject*   somRenew(void* obj)
  717. {
  718. /*
  719.  *  Equivalent to somNew except that storage is not allocated.
  720.  *  <obj> is taken as the address of the new object.
  721.  */
  722.    return SOM_ResolveD(this,SOMClass,SOMClass,somRenew)
  723.     (this,obj);
  724. }
  725.  
  726.  
  727. /* method: somRenewNoInit */
  728. SOMObject*   somRenewNoInit(void* obj)
  729. {
  730. /*
  731.  *  Equivalent to somRenew except that somDefaultInit is not called.
  732.  */
  733.    return SOM_ResolveD(this,SOMClass,SOMClass,somRenewNoInit)
  734.     (this,obj);
  735. }
  736.  
  737.  
  738. /* method: somRenewNoZero */
  739. SOMObject*   somRenewNoZero(void* obj)
  740. {
  741. /*
  742.  *  Equivalent to somRenew except that memory is not zeroed out.
  743.  */
  744.    return SOM_ResolveD(this,SOMClass,SOMClass,somRenewNoZero)
  745.     (this,obj);
  746. }
  747.  
  748.  
  749. /* method: somRenewNoInitNoZero */
  750. SOMObject*   somRenewNoInitNoZero(void* obj)
  751. {
  752. /*
  753.  *  The purpose of this method is to load an object's method table.
  754.  *  The SOM API requires that somRenewNoInitNoZero always be
  755.  *  called when creating a new object whose metaclass is not SOMClass.
  756.  *  This is because metaclasses must be guaranteed that they can use
  757.  *  somRenewNoInitNoZero to track object creation if this is desired.
  758.  */
  759.    return SOM_ResolveD(this,SOMClass,SOMClass,somRenewNoInitNoZero)
  760.     (this,obj);
  761. }
  762.  
  763.  
  764. /* nonstatic method: somAllocate */
  765. somToken   somAllocate(long size)
  766. {
  767. /*
  768.  *  Allocates memory to hold an object and returns a pointer to this memory.
  769.  *  This is a nonstatic method, and cannot be overridden. The default
  770.  *  implementation calls SOMMalloc, but a class designer can specify a
  771.  *  different implementation using the somallocate modifier in IDL. The
  772.  *  allocator takes the same parameters as this method.
  773.  */
  774.    return SOM_ResolveD(this,SOMClass,SOMClass,somAllocate)
  775.     (this,size);
  776. }
  777.  
  778.  
  779. /* nonstatic method: somDeallocate */
  780. void   somDeallocate(somToken memptr)
  781. {
  782. /*
  783.  *  Zeros out the method table pointer stored in the word pointed to by
  784.  *  memptr, and then deallocates the block of memory pointed to by memptr.
  785.  *  This is a nonstatic method and cannot be overridden. The default
  786.  *  deallocator called is SOMFree, but a class designer can specify a
  787.  *  different deallocator using the somdeallocate modifier in IDL. The
  788.  *  deallocator takes a char* (memptr) and a long (size) as arguments.
  789.  */
  790.    SOM_ResolveD(this,SOMClass,SOMClass,somDeallocate)
  791.     (this,memptr);
  792. }
  793.  
  794.  
  795. /* method: somInitClass */
  796. void   somInitClass(string className, 
  797.         SOMClass* parentClass, 
  798.         long dataSize, 
  799.         long maxStaticMethods, 
  800.         long majorVersion, 
  801.         long minorVersion)
  802. {
  803. /*
  804.  *  somInitClass is obsolete, and should no longer be used. The SOM 2.0
  805.  *  kernel provides special handling for redispatch stubs in the case
  806.  *  of SOM 1.0 classes, and use of this method is what tells the kernel
  807.  *  that old-style redispatch stubs will be registered.
  808.  */
  809.    SOM_ResolveD(this,SOMClass,SOMClass,somInitClass)
  810.     (this,className,parentClass,dataSize,maxStaticMethods,majorVersion,minorVersion);
  811. }
  812.  
  813.  
  814. /* method: somInitMIClass */
  815. void   somInitMIClass(long inherit_vars, 
  816.         string className, 
  817.         SOMClass_SOMClassSequence* parentClasses, 
  818.         long dataSize, 
  819.         long dataAlignment, 
  820.         long maxStaticMethods, 
  821.         long majorVersion, 
  822.         long minorVersion)
  823. {
  824. /*
  825.  *  somInitMIClass implements the second phase of dynamic class creation:
  826.  *  inheritance of interface and possibly implementation (instance
  827.  *  variables) by suitable initialization of <self> (a class object).
  828.  * 
  829.  *  For somInitMIClass, the inherit_vars argument controls whether abstract
  830.  *  or implementation inheritance is used. Inherit_vars is a 32 bit
  831.  *  bit-vector. Implementation is inherited from parent i iff the bit
  832.  *  1<<i is on, or i>=32.
  833.  *  On a class-by-class basis, for each class ancestor, implementation
  834.  *  inheritance always takes precidence over abstract inheritance. This is
  835.  *  necessary to guarantee that procedures supporting parent method calls
  836.  *  (available on non-abstract parents) are always supported by parent
  837.  *  instance variables.
  838.  * 
  839.  *  <className> is a string containing the class name. A copy is made, so
  840.  *  the string may be freed upon return to the caller if this is desired.
  841.  * 
  842.  *  <parentClasses> is a SOMClassSequence containing pointers to the
  843.  *  parent classes. somInitMIClass makes a copy of this, so it may
  844.  *  be freed upon return to the caller if this is desired.
  845.  * 
  846.  *  <dataSize> is the space needed for the instance variables
  847.  *  introduced by this class.
  848.  * 
  849.  *  <dataAlignment> specifies the desired byte alignment for instance
  850.  *  data introduced by this class. A value of 0 selects a system-wide default;
  851.  *  any other argument is taken as the desired byte alignment multiple. Thus,
  852.  *  for example, even if a byte multiple of 8 is needed for double precision
  853.  *  values on a given system (so 8 is the default), a class whose instance data
  854.  *  doesn't require this can indicate otherwise. If A is the next memory
  855.  *  address available for holding instance data, the address that will be
  856.  *  used is A + (A mod byte-alignment).
  857.  * 
  858.  *  <maxStaticMethods> is the maximum number of static methods that will be
  859.  *  added to the initialized class using addStaticMethod.
  860.  * 
  861.  *  <majorVersion> indicates the major version number for this
  862.  *  implementation of the class definition, and <minorVersion>
  863.  *  indicates the minor version number.
  864.  */
  865.    SOM_ResolveD(this,SOMClass,SOMClass,somInitMIClass)
  866.     (this,inherit_vars,className,parentClasses,dataSize,dataAlignment,maxStaticMethods,majorVersion,minorVersion);
  867. }
  868.  
  869.  
  870. /* method: somAddStaticMethod */
  871. somMToken   somAddStaticMethod(somId methodId, 
  872.         somId methodDescriptor, 
  873.         somMethodPtr method, 
  874.         somMethodPtr redispatchStub, 
  875.         somMethodPtr applyStub)
  876. {
  877. /*
  878.  *  Adds the indicated method, creating and returning a new method token.
  879.  * 
  880.  *  <methodDescriptor> is the somId for an identifier that can be used
  881.  *  to access signature information about the method from an interface
  882.  *  repository.
  883.  * 
  884.  *  <method> is the actual method procedure for this method
  885.  * 
  886.  *  <redispatchStub> is a procedure with the same calling sequence as
  887.  *  <method> that invokes somDispatch for the method.
  888.  * 
  889.  *  <applyStub> is a procedure used to support somApply.
  890.  */
  891.    return SOM_ResolveD(this,SOMClass,SOMClass,somAddStaticMethod)
  892.     (this,methodId,methodDescriptor,method,redispatchStub,applyStub);
  893. }
  894.  
  895.  
  896. /* method: somAddDynamicMethod */
  897. void   somAddDynamicMethod(somId methodId, 
  898.         somId methodDescriptor, 
  899.         somMethodPtr method, 
  900.         somMethodPtr applyStub)
  901. {
  902. /*
  903.  *  Adds the indicated method to the class's name lookup list.
  904.  *  If this happens to override a static method then this operation is
  905.  *  equivalent to <somOverrideSMethod> and the <methodDescriptor> and
  906.  *  <applyStub> arguments are ignored (the overridden method's values
  907.  *  will be used).
  908.  * 
  909.  *  <methodDescriptor> is the somId for an identifier that can be used
  910.  *  to access signature information about the method from an interface
  911.  *  repository.
  912.  * 
  913.  *  <method> is the actual method procedure for this method
  914.  * 
  915.  *  <applyStub> is a procedure that takes a standard variable argument
  916.  *  list data structure applies it to its target object by calling
  917.  *  <method> with arguments derived from the data structure.  Its
  918.  *  calling sequence is the same as the calling sequence of the
  919.  *  dispatch methods defined in SOMObject.  This stub is used in the
  920.  *  support of the dispatch methods used in some classes.  In classes
  921.  *  where the dispatch functions do not need such a function this
  922.  *  parameter may be null.
  923.  */
  924.    SOM_ResolveD(this,SOMClass,SOMClass,somAddDynamicMethod)
  925.     (this,methodId,methodDescriptor,method,applyStub);
  926. }
  927.  
  928.  
  929. /* method: somOverrideSMethod */
  930. void   somOverrideSMethod(somId methodId, 
  931.         somMethodPtr method)
  932. {
  933. /*
  934.  *  This method can be used instead of <somAddStaticMethod> or
  935.  *  <somAddDynamicMethod> when it is known that the class' parent
  936.  *  class already supports this method.  This call does not require the
  937.  *  method descriptor and stub methods that the others do.
  938.  */
  939.    SOM_ResolveD(this,SOMClass,SOMClass,somOverrideSMethod)
  940.     (this,methodId,method);
  941. }
  942.  
  943.  
  944. /* method: somClassReady */
  945. void   somClassReady()
  946. {
  947. /*
  948.  *  This method is invoked when all of the static initialization for
  949.  *  the class has been finished.  The default implementation simply
  950.  *  registers the newly constructed class with the SOMClassMgr.
  951.  */
  952.    SOM_ResolveD(this,SOMClass,SOMClass,somClassReady)
  953.     (this);
  954. }
  955.  
  956.  
  957. /* method: somGetApplyStub */
  958. somMethodPtr   somGetApplyStub(somId methodId)
  959. {
  960. /*
  961.  *  Returns the apply stub associated with the specified method,
  962.  *  if one exists; otherwise NULL is returned. This method is obsolete,
  963.  *  and retained for binary compatability. In SOMr2, users never access
  964.  *  apply stubs directly; The function somApply is used to invoke apply
  965.  *  stubs. See somApply documentation for further information on apply
  966.  *  stubs, and see somAddStaticMethod documentation for information
  967.  *  on how apply stubs are registered by class implementations.
  968.  */
  969.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetApplyStub)
  970.     (this,methodId);
  971. }
  972.  
  973.  
  974. /* method: somGetClassData */
  975. somClassDataStructure*   somGetClassData()
  976. {
  977.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetClassData)
  978.     (this);
  979. }
  980.  
  981.  
  982. /* method: somSetClassData */
  983. void   somSetClassData(somClassDataStructure* cds)
  984. {
  985. /*
  986.  *  The class' pointer to the static <className>ClassData structure.
  987.  */
  988.    SOM_ResolveD(this,SOMClass,SOMClass,somSetClassData)
  989.     (this,cds);
  990. }
  991.  
  992.  
  993. /* method: somGetClassMtab */
  994. somMethodTab*   somGetClassMtab()
  995. {
  996. /*
  997.  *  A pointer to the method table used by instances of this class. This
  998.  *  method was misnamed; it should have been called somGetInstanceMtab.
  999.  */
  1000.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetClassMtab)
  1001.     (this);
  1002. }
  1003.  
  1004.  
  1005. /* method: somGetInstanceOffset */
  1006. long   somGetInstanceOffset()
  1007. {
  1008. /*
  1009.  *  Returns the offset of instance data introduced by the receiver in
  1010.  *  an instance of the receiver. This method is obsolete and not useful in
  1011.  *  multiple-inheritance situations. The attribute somInstanceDataOffsets
  1012.  *  replaces this method.
  1013.  */
  1014.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstanceOffset)
  1015.     (this);
  1016. }
  1017.  
  1018.  
  1019. /* method: somGetInstancePartSize */
  1020. long   somGetInstancePartSize()
  1021. {
  1022. /*
  1023.  *  The size in bytes of the instance data introduced by the receiving
  1024.  *  class.
  1025.  */
  1026.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstancePartSize)
  1027.     (this);
  1028. }
  1029.  
  1030.  
  1031. /* method: somGetInstanceSize */
  1032. long   somGetInstanceSize()
  1033. {
  1034. /*
  1035.  *  The total size of an instance of the receiving class.
  1036.  */
  1037.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstanceSize)
  1038.     (this);
  1039. }
  1040.  
  1041.  
  1042. /* method: somGetInstanceToken */
  1043. somDToken   somGetInstanceToken()
  1044. {
  1045. /*
  1046.  *  A data token that identifies the introduced portion of this class
  1047.  *  within itself or any derived class.  This token can be subsequently
  1048.  *  passed to the run-time somDataResolve function to locate the instance
  1049.  *  data introduced by this class in any object derived from this class.
  1050.  */
  1051.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetInstanceToken)
  1052.     (this);
  1053. }
  1054.  
  1055.  
  1056. /* method: somGetMemberToken */
  1057. somDToken   somGetMemberToken(long memberOffset, 
  1058.         somDToken instanceToken)
  1059. {
  1060. /*
  1061.  *  Returns a data token that for the data member at offset
  1062.  *  "memberOffset" within the introduced portion of the class identified
  1063.  *  by instanceToken.  The instance token must have been obtained from a
  1064.  *  previous invocation of somGetInstanceToken.  The returned member
  1065.  *  token can be subsequently passed to the run-time somDataResolve
  1066.  *  function to locate the data member.
  1067.  */
  1068.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetMemberToken)
  1069.     (this,memberOffset,instanceToken);
  1070. }
  1071.  
  1072.  
  1073. /* method: somGetMethodData */
  1074. boolean   somGetMethodData(somId methodId, 
  1075.         somMethodData* md)
  1076. {
  1077. /*
  1078.  *  If a method with id <methodId> is supported by the target class,
  1079.  *  the structure pointed to by <md> is loaded with method information
  1080.  *  and the value 1 is returned. In this case, if the method is not
  1081.  *  dynamic, md->method is loaded with the result of somClassResolve on
  1082.  *  the target class for the method. If the method is not supported,
  1083.  *  md->id is loaded with 0, and the value 0 is returned.
  1084.  */
  1085.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodData)
  1086.     (this,methodId,md);
  1087. }
  1088.  
  1089.  
  1090. /* method: somGetRdStub */
  1091. somMethodProc*   somGetRdStub(somId methodId)
  1092. {
  1093. /*
  1094.  *  Returns a redispatch stub for the indicated method, if possible.
  1095.  *  If not possible (because a valid redispatch stub has not been
  1096.  *  registered, and there is insufficient information to dynamically
  1097.  *  construct one), then a NULL is returned.
  1098.  */
  1099.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetRdStub)
  1100.     (this,methodId);
  1101. }
  1102.  
  1103.  
  1104. /* method: somGetMethodDescriptor */
  1105. somId   somGetMethodDescriptor(somId methodId)
  1106. {
  1107. /*
  1108.  *  Returns the method descriptor for the indicated method.    If
  1109.  *  this object does not support the indicated method then NULL is
  1110.  *  returned.
  1111.  */
  1112.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodDescriptor)
  1113.     (this,methodId);
  1114. }
  1115.  
  1116.  
  1117. /* method: somGetMethodIndex */
  1118. long   somGetMethodIndex(somId id)
  1119. {
  1120. /*
  1121.  *  Returns the index for the specified method. (A number that may
  1122.  *  change if any methods are added or deleted to this class object or
  1123.  *  any of its ancestors).  This number is the basis for other calls to
  1124.  *  get info about the method. Indexes start at 0. A -1 is returned if
  1125.  *  the method cannot be found.
  1126.  */
  1127.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodIndex)
  1128.     (this,id);
  1129. }
  1130.  
  1131.  
  1132. /* method: somGetMethodToken */
  1133. somMToken   somGetMethodToken(somId methodId)
  1134. {
  1135. /*
  1136.  *  Returns the specified method's access token. This token can then
  1137.  *  be passed to method resolution routines, which use the token
  1138.  *  to select a method pointer from a method table.
  1139.  */
  1140.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetMethodToken)
  1141.     (this,methodId);
  1142. }
  1143.  
  1144.  
  1145. /* method: somGetName */
  1146. string   somGetName()
  1147. {
  1148. /*
  1149.  *  This object's class name as a NULL terminated string.
  1150.  */
  1151.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetName)
  1152.     (this);
  1153. }
  1154.  
  1155.  
  1156. /* method: somGetNthMethodData */
  1157. boolean   somGetNthMethodData(long n, 
  1158.         somMethodData* md)
  1159. {
  1160. /*
  1161.  *  loads *md with the method data associated with the the nth method,
  1162.  *  or NULL if there is no such method. Returns true is successful;
  1163.  *  false otherwise.
  1164.  */
  1165.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetNthMethodData)
  1166.     (this,n,md);
  1167. }
  1168.  
  1169.  
  1170. /* method: somGetNthMethodInfo */
  1171. somId   somGetNthMethodInfo(long n, 
  1172.         somId* descriptor)
  1173. {
  1174. /*
  1175.  *  Returns the id of the <n>th method if one exists and NULL
  1176.  *  otherwise.
  1177.  * 
  1178.  *  The ordering of the methods is unpredictable, but will not change
  1179.  *  unless some change is made to the class or one of its ancestor classes.
  1180.  * 
  1181.  *  See CORBA documentation for info on method descriptors.
  1182.  */
  1183.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetNthMethodInfo)
  1184.     (this,n,descriptor);
  1185. }
  1186.  
  1187.  
  1188. /* method: somGetNumMethods */
  1189. long   somGetNumMethods()
  1190. {
  1191. /*
  1192.  *  The number of methods currently supported by this class,
  1193.  *  including inherited methods (both static and dynamic).
  1194.  */
  1195.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetNumMethods)
  1196.     (this);
  1197. }
  1198.  
  1199.  
  1200. /* method: somGetNumStaticMethods */
  1201. long   somGetNumStaticMethods()
  1202. {
  1203. /*
  1204.  *  The number of static methods that this class has.  Can
  1205.  *  be used by a child class when initializing its method table.
  1206.  */
  1207.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetNumStaticMethods)
  1208.     (this);
  1209. }
  1210.  
  1211.  
  1212. /* method: somGetParent */
  1213. SOMClass*   somGetParent()
  1214. {
  1215. /*
  1216.  *  Returns the parent class of self (along its "left-hand" derivation
  1217.  *  path), if one exists and NULL otherwise.
  1218.  */
  1219.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetParent)
  1220.     (this);
  1221. }
  1222.  
  1223.  
  1224. /* method: somGetParents */
  1225. SOMClass_SOMClassSequence   somGetParents()
  1226. {
  1227. /*
  1228.  *  The parent classes of self.
  1229.  */
  1230.    return SOM_ResolveD(this,SOMClass,SOMClass,somGetParents)
  1231.     (this);
  1232. }
  1233.  
  1234.  
  1235. /* method: somGetVersionNumbers */
  1236. void   somGetVersionNumbers(long* majorVersion, 
  1237.         long* minorVersion)
  1238. {
  1239. /*
  1240.  *  Returns the class' major and minor version numbers in the corresponding
  1241.  *  output parameters.
  1242.  */
  1243.    SOM_ResolveD(this,SOMClass,SOMClass,somGetVersionNumbers)
  1244.     (this,majorVersion,minorVersion);
  1245. }
  1246.  
  1247.  
  1248. /* method: somFindMethod */
  1249. boolean   somFindMethod(somId methodId, 
  1250.         somMethodPtr* m)
  1251. {
  1252. /*
  1253.  *  Finds the method procedure associated with <methodId> for this
  1254.  *  class and sets <m> to it.  1 (true) is returned when the
  1255.  *  method procedure is a static method and 0 (false) is returned
  1256.  *  when the method procedure is dynamic method.
  1257.  * 
  1258.  *  If the class does not support the specified method then
  1259.  *  <m> is set to NULL and the return value is meaningless.
  1260.  * 
  1261.  */
  1262.    return SOM_ResolveD(this,SOMClass,SOMClass,somFindMethod)
  1263.     (this,methodId,m);
  1264. }
  1265.  
  1266.  
  1267. /* method: somFindMethodOk */
  1268. boolean   somFindMethodOk(somId methodId, 
  1269.         somMethodPtr* m)
  1270. {
  1271. /*
  1272.  *  Just like <somFindMethod> except that if the method is not
  1273.  *  supported then an error is raised and execution is halted.
  1274.  */
  1275.    return SOM_ResolveD(this,SOMClass,SOMClass,somFindMethodOk)
  1276.     (this,methodId,m);
  1277. }
  1278.  
  1279.  
  1280. /* method: somFindSMethod */
  1281. somMethodPtr   somFindSMethod(somId methodId)
  1282. {
  1283. /*
  1284.  *  Finds the indicated method, which must be a static method supported
  1285.  *  by this class, and returns a pointer to its method procedure.
  1286.  *  If the method is not supported by the receiver (as a static method
  1287.  *  or at all) then a NULL pointer is returned.
  1288.  */
  1289.    return SOM_ResolveD(this,SOMClass,SOMClass,somFindSMethod)
  1290.     (this,methodId);
  1291. }
  1292.  
  1293.  
  1294. /* method: somFindSMethodOk */
  1295. somMethodPtr   somFindSMethodOk(somId methodId)
  1296. {
  1297. /*
  1298.  *  Uses <somFindSMethod>, and raises an error if the result is NULL.
  1299.  */
  1300.    return SOM_ResolveD(this,SOMClass,SOMClass,somFindSMethodOk)
  1301.     (this,methodId);
  1302. }
  1303.  
  1304.  
  1305. /* method: somLookupMethod */
  1306. somMethodPtr   somLookupMethod(somId methodId)
  1307. {
  1308. /*
  1309.  *  Like <somFindSMethodOK>, but without restriction to static methods.
  1310.  */
  1311.    return SOM_ResolveD(this,SOMClass,SOMClass,somLookupMethod)
  1312.     (this,methodId);
  1313. }
  1314.  
  1315.  
  1316. /* method: somCheckVersion */
  1317. boolean   somCheckVersion(long majorVersion, 
  1318.         long minorVersion)
  1319. {
  1320. /*
  1321.  *  Returns 1 (true) if the implementation of this class is
  1322.  *  compatible with the specified major and minor version number and
  1323.  *  false (0) otherwise.  An implementation is compatible with the
  1324.  *  specified version numbers if it has the same major version number
  1325.  *  and a minor version number that is equal to or greater than
  1326.  *  <minorVersion>.    The major, minor version number pair (0,0) is
  1327.  *  considered to match any version.  This method is usually called
  1328.  *  immediately after creating the class object to verify that a
  1329.  *  dynamically loaded class definition is compatible with a using
  1330.  *  application.
  1331.  */
  1332.    return SOM_ResolveD(this,SOMClass,SOMClass,somCheckVersion)
  1333.     (this,majorVersion,minorVersion);
  1334. }
  1335.  
  1336.  
  1337. /* method: somDescendedFrom */
  1338. boolean   somDescendedFrom(SOMClass* aClassObj)
  1339. {
  1340. /*
  1341.  *  Returns 1 (true) if <self> is a descendent class of <aClassObj> and
  1342.  *  0 (false) otherwise.  Note: a class object is considered to be
  1343.  *  descended itself for the purposes of this method.
  1344.  */
  1345.    return SOM_ResolveD(this,SOMClass,SOMClass,somDescendedFrom)
  1346.     (this,aClassObj);
  1347. }
  1348.  
  1349.  
  1350. /* method: somSupportsMethod */
  1351. boolean   somSupportsMethod(somId mId)
  1352. {
  1353. /*
  1354.  *  Returns 1 (true) if the indicated method is supported by this
  1355.  *  class and 0 (false) otherwise.
  1356.  */
  1357.    return SOM_ResolveD(this,SOMClass,SOMClass,somSupportsMethod)
  1358.     (this,mId);
  1359. }
  1360.  
  1361.  
  1362. /* method: somDefinedMethod */
  1363. somMethodPtr   somDefinedMethod(somMToken method)
  1364. {
  1365. /*
  1366.  *  if the receiving class either introduces or overrides the
  1367.  *  indicated method, then its somMethodPtr is returned, otherwise
  1368.  *  NULL is returned.
  1369.  */
  1370.    return SOM_ResolveD(this,SOMClass,SOMClass,somDefinedMethod)
  1371.     (this,method);
  1372. }
  1373.  
  1374.  
  1375. /* method: somOverrideMtab */
  1376. void   somOverrideMtab()
  1377. {
  1378. /*
  1379.  *  Overrides the method table pointers to point to the redispatch stubs.
  1380.  *  All the methods except somDispatch methods are overriden.
  1381.  */
  1382.    SOM_ResolveD(this,SOMClass,SOMClass,somOverrideMtab)
  1383.     (this);
  1384. }
  1385.  
  1386.  
  1387. /*
  1388.  * Reintroduce inherited methods
  1389.  */
  1390.  
  1391. /* initializer method: somDefaultInit */
  1392. void   somDefaultInit(som3InitCtrl* ctrl)
  1393. {
  1394. /*
  1395.  *  A default initializer for a SOM object. Passing a null ctrl
  1396.  *  indicates to the receiver that its class is the class of the
  1397.  *  object being initialized, whereby the initializer will determine
  1398.  *  an appropriate control structure.
  1399.  */
  1400.    SOM_ResolveD(this,SOMClass,SOMObject,somDefaultInit)
  1401.     (this,ctrl);
  1402. }
  1403.  
  1404.  
  1405. /* method: somDestruct */
  1406. void   somDestruct(octet doFree, 
  1407.         som3DestructCtrl* ctrl)
  1408. {
  1409. /*
  1410.  *  The default destructor for a SOM object. A nonzero <doFree>
  1411.  *  indicates that the object storage should be freed by the
  1412.  *  object's class (via somDeallocate) after uninitialization.
  1413.  *  As with somDefaultInit, a null ctrl can be passed.
  1414.  */
  1415.    SOM_ResolveD(this,SOMClass,SOMObject,somDestruct)
  1416.     (this,doFree,ctrl);
  1417. }
  1418.  
  1419.  
  1420. /* initializer method: somDefaultCopyInit */
  1421. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  1422.         SOMObject* fromObj)
  1423. {
  1424. /*
  1425.  *  A default copy constructor. Use this to make copies of objects for
  1426.  *  calling methods with "by-value" argument semantics.
  1427.  */
  1428.    SOM_ResolveD(this,SOMClass,SOMObject,somDefaultCopyInit)
  1429.     (this,ctrl,fromObj);
  1430. }
  1431.  
  1432.  
  1433. /* method: somDefaultAssign */
  1434. SOMClass*  somDefaultAssign(som3AssignCtrl* ctrl, 
  1435.         SOMObject* fromObj)
  1436. {
  1437. /*
  1438.  *  A default assignment operator. Use this to "assign" the state of one
  1439.  *  object to another.
  1440.  */
  1441.    return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultAssign)
  1442.     (this,ctrl,fromObj);
  1443. }
  1444.  
  1445.  
  1446. /* initializer method: somDefaultConstCopyInit */
  1447. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  1448.         SOMObject* fromObj)
  1449. {
  1450. /*
  1451.  *  A default copy constructor that uses a const fromObj.
  1452.  */
  1453.    SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstCopyInit)
  1454.     (this,ctrl,fromObj);
  1455. }
  1456.  
  1457.  
  1458. /* initializer method: somDefaultVCopyInit */
  1459. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  1460.         SOMObject* fromObj)
  1461. {
  1462. /*
  1463.  *  A default copy constructor that uses a volatile fromObj.
  1464.  */
  1465.    SOM_ResolveD(this,SOMClass,SOMObject,somDefaultVCopyInit)
  1466.     (this,ctrl,fromObj);
  1467. }
  1468.  
  1469.  
  1470. /* initializer method: somDefaultConstVCopyInit */
  1471. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  1472.         SOMObject* fromObj)
  1473. {
  1474. /*
  1475.  *  A default copy constructor that uses a const volatile fromObj.
  1476.  */
  1477.    SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstVCopyInit)
  1478.     (this,ctrl,fromObj);
  1479. }
  1480.  
  1481.  
  1482. /* method: somDefaultConstAssign */
  1483. SOMClass*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  1484.         SOMObject* fromObj)
  1485. {
  1486. /*
  1487.  *  A default assignment operator that uses a const fromObj.
  1488.  */
  1489.    return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstAssign)
  1490.     (this,ctrl,fromObj);
  1491. }
  1492.  
  1493.  
  1494. /* method: somDefaultVAssign */
  1495. SOMClass*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  1496.         SOMObject* fromObj)
  1497. {
  1498. /*
  1499.  *  A default assignment operator that uses a volatile fromObj.
  1500.  */
  1501.    return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultVAssign)
  1502.     (this,ctrl,fromObj);
  1503. }
  1504.  
  1505.  
  1506. /* method: somDefaultConstVAssign */
  1507. SOMClass*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  1508.         SOMObject* fromObj)
  1509. {
  1510. /*
  1511.  *  A default assignment operator that uses a const volatile fromObj.
  1512.  */
  1513.    return SOM_ResolveD(this,SOMClass,SOMObject,somDefaultConstVAssign)
  1514.     (this,ctrl,fromObj);
  1515. }
  1516.  
  1517.  
  1518. /* method: somInit */
  1519. void   somInit()
  1520. {
  1521. /*
  1522.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  1523.  */
  1524.    SOM_ResolveD(this,SOMClass,SOMObject,somInit)
  1525.     (this);
  1526. }
  1527.  
  1528.  
  1529. /* method: somFree */
  1530. void   somFree()
  1531. {
  1532. /*
  1533.  *  Use as directed by framework implementations.
  1534.  */
  1535.    SOM_ResolveD(this,SOMClass,SOMObject,somFree)
  1536.     (this);
  1537. }
  1538.  
  1539.  
  1540. /* method: somUninit */
  1541. void   somUninit()
  1542. {
  1543. /*
  1544.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  1545.  */
  1546.    SOM_ResolveD(this,SOMClass,SOMObject,somUninit)
  1547.     (this);
  1548. }
  1549.  
  1550.  
  1551. /* method: somGetClass */
  1552. SOMClass*   somGetClass()
  1553. {
  1554. /*
  1555.  *  Return the receiver's class.
  1556.  */
  1557.    return SOM_ResolveD(this,SOMClass,SOMObject,somGetClass)
  1558.     (this);
  1559. }
  1560.  
  1561.  
  1562. /* method: somGetClassName */
  1563. string   somGetClassName()
  1564. {
  1565. /*
  1566.  *  Return the name of the receiver's class.
  1567.  */
  1568.    return SOM_ResolveD(this,SOMClass,SOMObject,somGetClassName)
  1569.     (this);
  1570. }
  1571.  
  1572.  
  1573. /* method: somGetSize */
  1574. long   somGetSize()
  1575. {
  1576. /*
  1577.  *  Return the size of the receiver.
  1578.  */
  1579.    return SOM_ResolveD(this,SOMClass,SOMObject,somGetSize)
  1580.     (this);
  1581. }
  1582.  
  1583.  
  1584. /* method: somIsA */
  1585. boolean   somIsA(SOMClass* aClassObj)
  1586. {
  1587. /*
  1588.  *  Returns 1 (true) if the receiver responds to methods
  1589.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  1590.  */
  1591.    return SOM_ResolveD(this,SOMClass,SOMObject,somIsA)
  1592.     (this,aClassObj);
  1593. }
  1594.  
  1595.  
  1596. /* method: somIsInstanceOf */
  1597. boolean   somIsInstanceOf(SOMClass* aClassObj)
  1598. {
  1599. /*
  1600.  *  Returns 1 (true) if the receiver is an instance of
  1601.  *  <aClassObj> and 0 (false) otherwise.
  1602.  */
  1603.    return SOM_ResolveD(this,SOMClass,SOMObject,somIsInstanceOf)
  1604.     (this,aClassObj);
  1605. }
  1606.  
  1607.  
  1608. /* method: somRespondsTo */
  1609. boolean   somRespondsTo(somId mId)
  1610. {
  1611. /*
  1612.  *  Returns 1 (true) if the indicated method can be invoked
  1613.  *  on the receiver and 0 (false) otherwise.
  1614.  */
  1615.    return SOM_ResolveD(this,SOMClass,SOMObject,somRespondsTo)
  1616.     (this,mId);
  1617. }
  1618.  
  1619.  
  1620. /* va_list method: somDispatch */
  1621.  
  1622. /*
  1623.  *  This method provides a generic, class-specific dispatch mechanism.
  1624.  *  It accepts as input <retValue> a pointer to the memory area to be
  1625.  *  loaded with the result of dispatching the method indicated by
  1626.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  1627.  *  on which the method is to be invoked as the first argument.
  1628.  */
  1629. /* the va_list invocation form */
  1630. boolean   SOMClass_somDispatch(somToken* retValue, 
  1631.         somId methodId, 
  1632.         va_list ap)
  1633. {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatch)
  1634.     (this,retValue,methodId,ap);
  1635. }
  1636.  
  1637. /* the varargs invocation form */
  1638. boolean   somDispatch(somToken* retValue, 
  1639.         somId methodId, 
  1640.         ...)
  1641. {
  1642. /*
  1643.  *  This method provides a generic, class-specific dispatch mechanism.
  1644.  *  It accepts as input <retValue> a pointer to the memory area to be
  1645.  *  loaded with the result of dispatching the method indicated by
  1646.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  1647.  *  on which the method is to be invoked as the first argument.
  1648.  */
  1649.    va_list ap;
  1650.    va_start(ap, methodId);
  1651.    boolean __somResult = 
  1652.       SOM_ResolveD(this,SOMClass,SOMObject,somDispatch)
  1653.     (this,retValue,methodId,ap);
  1654.    va_end(ap);
  1655.    return __somResult;
  1656. }
  1657.  
  1658.  
  1659. /* va_list method: somClassDispatch */
  1660.  
  1661. /*
  1662.  *  Like somDispatch, but method resolution for static methods is done
  1663.  *  according to the clsObj instance method table.
  1664.  */
  1665. /* the va_list invocation form */
  1666. boolean   SOMClass_somClassDispatch(SOMClass* clsObj, 
  1667.         somToken* retValue, 
  1668.         somId methodId, 
  1669.         va_list ap)
  1670. {return SOM_ResolveD(this,SOMClass,SOMObject,somClassDispatch)
  1671.     (this,clsObj,retValue,methodId,ap);
  1672. }
  1673.  
  1674. /* the varargs invocation form */
  1675. boolean   somClassDispatch(SOMClass* clsObj, 
  1676.         somToken* retValue, 
  1677.         somId methodId, 
  1678.         ...)
  1679. {
  1680. /*
  1681.  *  Like somDispatch, but method resolution for static methods is done
  1682.  *  according to the clsObj instance method table.
  1683.  */
  1684.    va_list ap;
  1685.    va_start(ap, methodId);
  1686.    boolean __somResult = 
  1687.       SOM_ResolveD(this,SOMClass,SOMObject,somClassDispatch)
  1688.     (this,clsObj,retValue,methodId,ap);
  1689.    va_end(ap);
  1690.    return __somResult;
  1691. }
  1692.  
  1693.  
  1694. /* method: somCastObj */
  1695. boolean   somCastObj(SOMClass* cls)
  1696. {
  1697. /*
  1698.  *  cast the receiving object to cls (which must be an ancestor of the
  1699.  *  objects true class. Returns true on success.
  1700.  */
  1701.    return SOM_ResolveD(this,SOMClass,SOMObject,somCastObj)
  1702.     (this,cls);
  1703. }
  1704.  
  1705.  
  1706. /* method: somResetObj */
  1707. boolean   somResetObj()
  1708. {
  1709. /*
  1710.  *  reset an object to its true class. Returns true always.
  1711.  */
  1712.    return SOM_ResolveD(this,SOMClass,SOMObject,somResetObj)
  1713.     (this);
  1714. }
  1715.  
  1716.  
  1717. /* va_list method: somDispatchV */
  1718.  
  1719. /*
  1720.  *  Obsolete. Use somDispatch instead.
  1721.  */
  1722. /* the va_list invocation form */
  1723. void   SOMClass_somDispatchV(somId methodId, 
  1724.         somId descriptor, 
  1725.         va_list ap)
  1726. {   SOM_ResolveD(this,SOMClass,SOMObject,somDispatchV)
  1727.     (this,methodId,descriptor,ap);
  1728. }
  1729.  
  1730. /* the varargs invocation form */
  1731. void   somDispatchV(somId methodId, 
  1732.         somId descriptor, 
  1733.         ...)
  1734. {
  1735. /*
  1736.  *  Obsolete. Use somDispatch instead.
  1737.  */
  1738.    va_list ap;
  1739.    va_start(ap, descriptor);
  1740.    SOM_ResolveD(this,SOMClass,SOMObject,somDispatchV)
  1741.     (this,methodId,descriptor,ap);
  1742.    va_end(ap);
  1743. }
  1744.  
  1745.  
  1746. /* va_list method: somDispatchL */
  1747.  
  1748. /*
  1749.  *  Obsolete. Use somDispatch instead.
  1750.  */
  1751. /* the va_list invocation form */
  1752. long   SOMClass_somDispatchL(somId methodId, 
  1753.         somId descriptor, 
  1754.         va_list ap)
  1755. {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatchL)
  1756.     (this,methodId,descriptor,ap);
  1757. }
  1758.  
  1759. /* the varargs invocation form */
  1760. long   somDispatchL(somId methodId, 
  1761.         somId descriptor, 
  1762.         ...)
  1763. {
  1764. /*
  1765.  *  Obsolete. Use somDispatch instead.
  1766.  */
  1767.    va_list ap;
  1768.    va_start(ap, descriptor);
  1769.    long __somResult = 
  1770.       SOM_ResolveD(this,SOMClass,SOMObject,somDispatchL)
  1771.     (this,methodId,descriptor,ap);
  1772.    va_end(ap);
  1773.    return __somResult;
  1774. }
  1775.  
  1776.  
  1777. /* va_list method: somDispatchA */
  1778.  
  1779. /*
  1780.  *  Obsolete. Use somDispatch instead.
  1781.  */
  1782. /* the va_list invocation form */
  1783. void*   SOMClass_somDispatchA(somId methodId, 
  1784.         somId descriptor, 
  1785.         va_list ap)
  1786. {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatchA)
  1787.     (this,methodId,descriptor,ap);
  1788. }
  1789.  
  1790. /* the varargs invocation form */
  1791. void*   somDispatchA(somId methodId, 
  1792.         somId descriptor, 
  1793.         ...)
  1794. {
  1795. /*
  1796.  *  Obsolete. Use somDispatch instead.
  1797.  */
  1798.    va_list ap;
  1799.    va_start(ap, descriptor);
  1800.    void* __somResult = 
  1801.       SOM_ResolveD(this,SOMClass,SOMObject,somDispatchA)
  1802.     (this,methodId,descriptor,ap);
  1803.    va_end(ap);
  1804.    return __somResult;
  1805. }
  1806.  
  1807.  
  1808. /* va_list method: somDispatchD */
  1809.  
  1810. /*
  1811.  *  Obsolete. Use somDispatch instead.
  1812.  */
  1813. /* the va_list invocation form */
  1814. double   SOMClass_somDispatchD(somId methodId, 
  1815.         somId descriptor, 
  1816.         va_list ap)
  1817. {return SOM_ResolveD(this,SOMClass,SOMObject,somDispatchD)
  1818.     (this,methodId,descriptor,ap);
  1819. }
  1820.  
  1821. /* the varargs invocation form */
  1822. double   somDispatchD(somId methodId, 
  1823.         somId descriptor, 
  1824.         ...)
  1825. {
  1826. /*
  1827.  *  Obsolete. Use somDispatch instead.
  1828.  */
  1829.    va_list ap;
  1830.    va_start(ap, descriptor);
  1831.    double __somResult = 
  1832.       SOM_ResolveD(this,SOMClass,SOMObject,somDispatchD)
  1833.     (this,methodId,descriptor,ap);
  1834.    va_end(ap);
  1835.    return __somResult;
  1836. }
  1837.  
  1838.  
  1839. /* method: somPrintSelf */
  1840. SOMObject*   somPrintSelf()
  1841. {
  1842. /*
  1843.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  1844.  *  information about this object.  The default implementation just gives
  1845.  *  the object's class name and its address in memory.
  1846.  *  <self> is returned.
  1847.  */
  1848.    return SOM_ResolveD(this,SOMClass,SOMObject,somPrintSelf)
  1849.     (this);
  1850. }
  1851.  
  1852.  
  1853. /* method: somDumpSelf */
  1854. void   somDumpSelf(long level)
  1855. {
  1856. /*
  1857.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  1858.  *  and its current state.
  1859.  * 
  1860.  *  <level> indicates the nesting level for describing compound objects
  1861.  *  it must be greater than or equal to zero.  All lines in the
  1862.  *  description will be preceeded by <2*level> spaces.
  1863.  * 
  1864.  *  This routine only actually writes the data that concerns the object
  1865.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  1866.  *  the object's current state.  This approach allows readable
  1867.  *  descriptions of compound objects to be constructed.
  1868.  * 
  1869.  *  Generally it is not necessary to override this method, if it is
  1870.  *  overriden it generally must be completely replaced.
  1871.  */
  1872.    SOM_ResolveD(this,SOMClass,SOMObject,somDumpSelf)
  1873.     (this,level);
  1874. }
  1875.  
  1876.  
  1877. /* method: somDumpSelfInt */
  1878. void   somDumpSelfInt(long level)
  1879. {
  1880. /*
  1881.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  1882.  *  Generally this method will need to be overridden.  When overriding
  1883.  *  it, begin by calling the parent class form of this method and then
  1884.  *  write in a description of your class's instance data. This will
  1885.  *  result in a description of all the object's instance data going
  1886.  *  from its root ancestor class to its specific class.
  1887.  */
  1888.    SOM_ResolveD(this,SOMClass,SOMObject,somDumpSelfInt)
  1889.     (this,level);
  1890. }
  1891.  
  1892.  
  1893.  
  1894. };   /* SOMClass */
  1895.  
  1896.  
  1897.  
  1898. #endif       /* SOM_SOMClass_xh */
  1899.