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

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: snglicls.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *    COMPONENT_NAME: somu
  12.  * 
  13.  *    ORIGINS: 27
  14.  * 
  15.  * 
  16.  *    10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  17.  *    All Rights Reserved
  18.  *    Licensed Materials - Property of IBM
  19.  *    US Government Users Restricted Rights - Use, duplication or
  20.  *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  21.  * 
  22.  */
  23.  
  24.  
  25. #ifndef SOM_SOMMSingleInstance_xh
  26. #define SOM_SOMMSingleInstance_xh
  27.  
  28. class SOMMSingleInstance;
  29.  
  30. /*
  31.  *  This class is a metaclass for classes which wish to enforce a
  32.  *  single instance rule.  That is, classes which specify this class
  33.  *  as their metaclass will only be allowed to have a single instance.
  34.  * 
  35.  *  For example, if a class named dog specified this class as its
  36.  *  metaclass, only one dog object could be instantiated. Repeated
  37.  *  calls to _somNew on the dog class would simply return the same
  38.  *  dog repeatedly.
  39.  * 
  40.  *  There are two ways to retrieve the single intance of the using
  41.  *  class:
  42.  * 
  43.  *   1) Invoke sommGetSingleInstance on the class object of the using class.
  44.  *      This is the preferred way.
  45.  * 
  46.  *   2) Invoke somNew or somNewNoInit on the class object of the using class.
  47.  * 
  48.  */
  49.  
  50. #define SOMMSingleInstance_MajorVersion 2
  51. #define SOMMSingleInstance_MinorVersion 1
  52.  
  53. /* C++ SOM defs */
  54. #include <somcls.xh>
  55. #include <somcm.xh>
  56.  
  57. /* C++ parent defs */
  58. #ifndef SOM_SOMClass_xh
  59. #include <somcls.xh>
  60. #endif
  61.  
  62. #ifndef SOMMSingleInstance_API
  63. #define SOMMSingleInstance_API
  64. /*
  65.  * -- The Class API
  66.  */
  67.  
  68. /*
  69.  * Start of bindings for IDL types
  70.  */
  71.  
  72. class SOMClass;
  73. class SOMObject;
  74.  
  75. /*
  76.  * End of bindings for IDL types.
  77.  */
  78.  
  79. /* A procedure to create the SOMMSingleInstance Class */
  80. SOMEXTERN SOMClass * SOMLINK SOMMSingleInstanceNewClass(
  81.         integer4 majorVersion,
  82.         integer4 minorVersion);
  83.  
  84. /* The API to the SOMMSingleInstance class object, and the methods it introduces. */
  85. SOMEXTERN struct SOMMSingleInstanceClassDataStructure {
  86.     SOMClass *classObject;
  87.     somMToken sommGetSingleInstance;
  88.     somMToken sommFreeSingleInstance;
  89. } SOMDLINK SOMMSingleInstanceClassData;
  90. #define _SOMMSingleInstance SOMMSingleInstanceClassData.classObject
  91.  
  92. /* The API to parentMtabs for SOMMSingleInstance, and the instance data it introduces. */
  93. SOMEXTERN struct SOMMSingleInstanceCClassDataStructure {
  94.     somMethodTabs parentMtab;
  95.     somDToken              instanceDataToken;
  96. } SOMDLINK SOMMSingleInstanceCClassData;
  97.  
  98. /*
  99.  * -- Typedefs for SOMMSingleInstance Method Procedures
  100.  */
  101. SOMEXTERN {
  102. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_sommGetSingleInstance(SOMMSingleInstance *somSelf, Environment *ev);
  103. typedef somTP_SOMMSingleInstance_sommGetSingleInstance *somTD_SOMMSingleInstance_sommGetSingleInstance;
  104. typedef void   SOMLINK somTP_SOMMSingleInstance_sommFreeSingleInstance(SOMMSingleInstance *somSelf, Environment *ev);
  105. typedef somTP_SOMMSingleInstance_sommFreeSingleInstance *somTD_SOMMSingleInstance_sommFreeSingleInstance;
  106.  
  107. /*
  108.  * -- Typedefs for Reintroduced Wrapper Methods
  109.  */
  110. typedef long   SOMLINK somTP_SOMMSingleInstance__get_somDataAlignment(SOMMSingleInstance *somSelf);
  111. typedef somTP_SOMMSingleInstance__get_somDataAlignment *somTD_SOMMSingleInstance__get_somDataAlignment;
  112. typedef SOMClass_somOffsets   SOMLINK somTP_SOMMSingleInstance__get_somInstanceDataOffsets(SOMMSingleInstance *somSelf);
  113. typedef somTP_SOMMSingleInstance__get_somInstanceDataOffsets *somTD_SOMMSingleInstance__get_somInstanceDataOffsets;
  114. typedef SOMClass_SOMClassSequence   SOMLINK somTP_SOMMSingleInstance__get_somDirectInitClasses(SOMMSingleInstance *somSelf);
  115. typedef somTP_SOMMSingleInstance__get_somDirectInitClasses *somTD_SOMMSingleInstance__get_somDirectInitClasses;
  116. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somNew(SOMMSingleInstance *somSelf);
  117. typedef somTP_SOMMSingleInstance_somNew *somTD_SOMMSingleInstance_somNew;
  118. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somNewNoInit(SOMMSingleInstance *somSelf);
  119. typedef somTP_SOMMSingleInstance_somNewNoInit *somTD_SOMMSingleInstance_somNewNoInit;
  120. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somRenew(SOMMSingleInstance *somSelf, 
  121.         void* obj);
  122. typedef somTP_SOMMSingleInstance_somRenew *somTD_SOMMSingleInstance_somRenew;
  123. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somRenewNoInit(SOMMSingleInstance *somSelf, 
  124.         void* obj);
  125. typedef somTP_SOMMSingleInstance_somRenewNoInit *somTD_SOMMSingleInstance_somRenewNoInit;
  126. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somRenewNoZero(SOMMSingleInstance *somSelf, 
  127.         void* obj);
  128. typedef somTP_SOMMSingleInstance_somRenewNoZero *somTD_SOMMSingleInstance_somRenewNoZero;
  129. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somRenewNoInitNoZero(SOMMSingleInstance *somSelf, 
  130.         void* obj);
  131. typedef somTP_SOMMSingleInstance_somRenewNoInitNoZero *somTD_SOMMSingleInstance_somRenewNoInitNoZero;
  132. typedef somToken   SOMLINK somTP_SOMMSingleInstance_somAllocate(SOMMSingleInstance *somSelf, 
  133.         long size);
  134. typedef somTP_SOMMSingleInstance_somAllocate *somTD_SOMMSingleInstance_somAllocate;
  135. typedef void   SOMLINK somTP_SOMMSingleInstance_somDeallocate(SOMMSingleInstance *somSelf, 
  136.         somToken memptr);
  137. typedef somTP_SOMMSingleInstance_somDeallocate *somTD_SOMMSingleInstance_somDeallocate;
  138. typedef void   SOMLINK somTP_SOMMSingleInstance_somInitClass(SOMMSingleInstance *somSelf, 
  139.         string className, 
  140.         SOMClass* parentClass, 
  141.         long dataSize, 
  142.         long maxStaticMethods, 
  143.         long majorVersion, 
  144.         long minorVersion);
  145. typedef somTP_SOMMSingleInstance_somInitClass *somTD_SOMMSingleInstance_somInitClass;
  146. typedef void   SOMLINK somTP_SOMMSingleInstance_somInitMIClass(SOMMSingleInstance *somSelf, 
  147.         long inherit_vars, 
  148.         string className, 
  149.         SOMClass_SOMClassSequence* parentClasses, 
  150.         long dataSize, 
  151.         long dataAlignment, 
  152.         long maxStaticMethods, 
  153.         long majorVersion, 
  154.         long minorVersion);
  155. typedef somTP_SOMMSingleInstance_somInitMIClass *somTD_SOMMSingleInstance_somInitMIClass;
  156. typedef somMToken   SOMLINK somTP_SOMMSingleInstance_somAddStaticMethod(SOMMSingleInstance *somSelf, 
  157.         somId methodId, 
  158.         somId methodDescriptor, 
  159.         somMethodPtr method, 
  160.         somMethodPtr redispatchStub, 
  161.         somMethodPtr applyStub);
  162. typedef somTP_SOMMSingleInstance_somAddStaticMethod *somTD_SOMMSingleInstance_somAddStaticMethod;
  163. typedef void   SOMLINK somTP_SOMMSingleInstance_somAddDynamicMethod(SOMMSingleInstance *somSelf, 
  164.         somId methodId, 
  165.         somId methodDescriptor, 
  166.         somMethodPtr method, 
  167.         somMethodPtr applyStub);
  168. typedef somTP_SOMMSingleInstance_somAddDynamicMethod *somTD_SOMMSingleInstance_somAddDynamicMethod;
  169. typedef void   SOMLINK somTP_SOMMSingleInstance_somOverrideSMethod(SOMMSingleInstance *somSelf, 
  170.         somId methodId, 
  171.         somMethodPtr method);
  172. typedef somTP_SOMMSingleInstance_somOverrideSMethod *somTD_SOMMSingleInstance_somOverrideSMethod;
  173. typedef void   SOMLINK somTP_SOMMSingleInstance_somClassReady(SOMMSingleInstance *somSelf);
  174. typedef somTP_SOMMSingleInstance_somClassReady *somTD_SOMMSingleInstance_somClassReady;
  175. typedef somMethodPtr   SOMLINK somTP_SOMMSingleInstance_somGetApplyStub(SOMMSingleInstance *somSelf, 
  176.         somId methodId);
  177. typedef somTP_SOMMSingleInstance_somGetApplyStub *somTD_SOMMSingleInstance_somGetApplyStub;
  178. typedef somClassDataStructure*   SOMLINK somTP_SOMMSingleInstance_somGetClassData(SOMMSingleInstance *somSelf);
  179. typedef somTP_SOMMSingleInstance_somGetClassData *somTD_SOMMSingleInstance_somGetClassData;
  180. typedef void   SOMLINK somTP_SOMMSingleInstance_somSetClassData(SOMMSingleInstance *somSelf, 
  181.         somClassDataStructure* cds);
  182. typedef somTP_SOMMSingleInstance_somSetClassData *somTD_SOMMSingleInstance_somSetClassData;
  183. typedef somMethodTab*   SOMLINK somTP_SOMMSingleInstance_somGetClassMtab(SOMMSingleInstance *somSelf);
  184. typedef somTP_SOMMSingleInstance_somGetClassMtab *somTD_SOMMSingleInstance_somGetClassMtab;
  185. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetInstanceOffset(SOMMSingleInstance *somSelf);
  186. typedef somTP_SOMMSingleInstance_somGetInstanceOffset *somTD_SOMMSingleInstance_somGetInstanceOffset;
  187. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetInstancePartSize(SOMMSingleInstance *somSelf);
  188. typedef somTP_SOMMSingleInstance_somGetInstancePartSize *somTD_SOMMSingleInstance_somGetInstancePartSize;
  189. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetInstanceSize(SOMMSingleInstance *somSelf);
  190. typedef somTP_SOMMSingleInstance_somGetInstanceSize *somTD_SOMMSingleInstance_somGetInstanceSize;
  191. typedef somDToken   SOMLINK somTP_SOMMSingleInstance_somGetInstanceToken(SOMMSingleInstance *somSelf);
  192. typedef somTP_SOMMSingleInstance_somGetInstanceToken *somTD_SOMMSingleInstance_somGetInstanceToken;
  193. typedef somDToken   SOMLINK somTP_SOMMSingleInstance_somGetMemberToken(SOMMSingleInstance *somSelf, 
  194.         long memberOffset, 
  195.         somDToken instanceToken);
  196. typedef somTP_SOMMSingleInstance_somGetMemberToken *somTD_SOMMSingleInstance_somGetMemberToken;
  197. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somGetMethodData(SOMMSingleInstance *somSelf, 
  198.         somId methodId, 
  199.         somMethodData* md);
  200. typedef somTP_SOMMSingleInstance_somGetMethodData *somTD_SOMMSingleInstance_somGetMethodData;
  201. typedef somMethodProc*   SOMLINK somTP_SOMMSingleInstance_somGetRdStub(SOMMSingleInstance *somSelf, 
  202.         somId methodId);
  203. typedef somTP_SOMMSingleInstance_somGetRdStub *somTD_SOMMSingleInstance_somGetRdStub;
  204. typedef somId   SOMLINK somTP_SOMMSingleInstance_somGetMethodDescriptor(SOMMSingleInstance *somSelf, 
  205.         somId methodId);
  206. typedef somTP_SOMMSingleInstance_somGetMethodDescriptor *somTD_SOMMSingleInstance_somGetMethodDescriptor;
  207. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetMethodIndex(SOMMSingleInstance *somSelf, 
  208.         somId id);
  209. typedef somTP_SOMMSingleInstance_somGetMethodIndex *somTD_SOMMSingleInstance_somGetMethodIndex;
  210. typedef somMToken   SOMLINK somTP_SOMMSingleInstance_somGetMethodToken(SOMMSingleInstance *somSelf, 
  211.         somId methodId);
  212. typedef somTP_SOMMSingleInstance_somGetMethodToken *somTD_SOMMSingleInstance_somGetMethodToken;
  213. typedef string   SOMLINK somTP_SOMMSingleInstance_somGetName(SOMMSingleInstance *somSelf);
  214. typedef somTP_SOMMSingleInstance_somGetName *somTD_SOMMSingleInstance_somGetName;
  215. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somGetNthMethodData(SOMMSingleInstance *somSelf, 
  216.         long n, 
  217.         somMethodData* md);
  218. typedef somTP_SOMMSingleInstance_somGetNthMethodData *somTD_SOMMSingleInstance_somGetNthMethodData;
  219. typedef somId   SOMLINK somTP_SOMMSingleInstance_somGetNthMethodInfo(SOMMSingleInstance *somSelf, 
  220.         long n, 
  221.         somId* descriptor);
  222. typedef somTP_SOMMSingleInstance_somGetNthMethodInfo *somTD_SOMMSingleInstance_somGetNthMethodInfo;
  223. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetNumMethods(SOMMSingleInstance *somSelf);
  224. typedef somTP_SOMMSingleInstance_somGetNumMethods *somTD_SOMMSingleInstance_somGetNumMethods;
  225. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetNumStaticMethods(SOMMSingleInstance *somSelf);
  226. typedef somTP_SOMMSingleInstance_somGetNumStaticMethods *somTD_SOMMSingleInstance_somGetNumStaticMethods;
  227. typedef SOMClass*   SOMLINK somTP_SOMMSingleInstance_somGetParent(SOMMSingleInstance *somSelf);
  228. typedef somTP_SOMMSingleInstance_somGetParent *somTD_SOMMSingleInstance_somGetParent;
  229. typedef SOMClass_SOMClassSequence   SOMLINK somTP_SOMMSingleInstance_somGetParents(SOMMSingleInstance *somSelf);
  230. typedef somTP_SOMMSingleInstance_somGetParents *somTD_SOMMSingleInstance_somGetParents;
  231. typedef void   SOMLINK somTP_SOMMSingleInstance_somGetVersionNumbers(SOMMSingleInstance *somSelf, 
  232.         long* majorVersion, 
  233.         long* minorVersion);
  234. typedef somTP_SOMMSingleInstance_somGetVersionNumbers *somTD_SOMMSingleInstance_somGetVersionNumbers;
  235. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somFindMethod(SOMMSingleInstance *somSelf, 
  236.         somId methodId, 
  237.         somMethodPtr* m);
  238. typedef somTP_SOMMSingleInstance_somFindMethod *somTD_SOMMSingleInstance_somFindMethod;
  239. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somFindMethodOk(SOMMSingleInstance *somSelf, 
  240.         somId methodId, 
  241.         somMethodPtr* m);
  242. typedef somTP_SOMMSingleInstance_somFindMethodOk *somTD_SOMMSingleInstance_somFindMethodOk;
  243. typedef somMethodPtr   SOMLINK somTP_SOMMSingleInstance_somFindSMethod(SOMMSingleInstance *somSelf, 
  244.         somId methodId);
  245. typedef somTP_SOMMSingleInstance_somFindSMethod *somTD_SOMMSingleInstance_somFindSMethod;
  246. typedef somMethodPtr   SOMLINK somTP_SOMMSingleInstance_somFindSMethodOk(SOMMSingleInstance *somSelf, 
  247.         somId methodId);
  248. typedef somTP_SOMMSingleInstance_somFindSMethodOk *somTD_SOMMSingleInstance_somFindSMethodOk;
  249. typedef somMethodPtr   SOMLINK somTP_SOMMSingleInstance_somLookupMethod(SOMMSingleInstance *somSelf, 
  250.         somId methodId);
  251. typedef somTP_SOMMSingleInstance_somLookupMethod *somTD_SOMMSingleInstance_somLookupMethod;
  252. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somCheckVersion(SOMMSingleInstance *somSelf, 
  253.         long majorVersion, 
  254.         long minorVersion);
  255. typedef somTP_SOMMSingleInstance_somCheckVersion *somTD_SOMMSingleInstance_somCheckVersion;
  256. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somDescendedFrom(SOMMSingleInstance *somSelf, 
  257.         SOMClass* aClassObj);
  258. typedef somTP_SOMMSingleInstance_somDescendedFrom *somTD_SOMMSingleInstance_somDescendedFrom;
  259. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somSupportsMethod(SOMMSingleInstance *somSelf, 
  260.         somId mId);
  261. typedef somTP_SOMMSingleInstance_somSupportsMethod *somTD_SOMMSingleInstance_somSupportsMethod;
  262. typedef somMethodPtr   SOMLINK somTP_SOMMSingleInstance_somDefinedMethod(SOMMSingleInstance *somSelf, 
  263.         somMToken method);
  264. typedef somTP_SOMMSingleInstance_somDefinedMethod *somTD_SOMMSingleInstance_somDefinedMethod;
  265. typedef void   SOMLINK somTP_SOMMSingleInstance_somOverrideMtab(SOMMSingleInstance *somSelf);
  266. typedef somTP_SOMMSingleInstance_somOverrideMtab *somTD_SOMMSingleInstance_somOverrideMtab;
  267. typedef void   SOMLINK somTP_SOMMSingleInstance_somDefaultInit(SOMMSingleInstance *somSelf, 
  268.         som3InitCtrl* ctrl);
  269. typedef somTP_SOMMSingleInstance_somDefaultInit *somTD_SOMMSingleInstance_somDefaultInit;
  270. typedef void   SOMLINK somTP_SOMMSingleInstance_somDestruct(SOMMSingleInstance *somSelf, 
  271.         octet doFree, 
  272.         som3DestructCtrl* ctrl);
  273. typedef somTP_SOMMSingleInstance_somDestruct *somTD_SOMMSingleInstance_somDestruct;
  274. typedef void   SOMLINK somTP_SOMMSingleInstance_somDefaultCopyInit(SOMMSingleInstance *somSelf, 
  275.         som3InitCtrl* ctrl, 
  276.         SOMObject* fromObj);
  277. typedef somTP_SOMMSingleInstance_somDefaultCopyInit *somTD_SOMMSingleInstance_somDefaultCopyInit;
  278. typedef SOMMSingleInstance*   SOMLINK somTP_SOMMSingleInstance_somDefaultAssign(SOMMSingleInstance *somSelf, 
  279.         som3AssignCtrl* ctrl, 
  280.         SOMObject* fromObj);
  281. typedef somTP_SOMMSingleInstance_somDefaultAssign *somTD_SOMMSingleInstance_somDefaultAssign;
  282. typedef void   SOMLINK somTP_SOMMSingleInstance_somDefaultConstCopyInit(SOMMSingleInstance *somSelf, 
  283.         som3InitCtrl* ctrl, 
  284.         SOMObject* fromObj);
  285. typedef somTP_SOMMSingleInstance_somDefaultConstCopyInit *somTD_SOMMSingleInstance_somDefaultConstCopyInit;
  286. typedef void   SOMLINK somTP_SOMMSingleInstance_somDefaultVCopyInit(SOMMSingleInstance *somSelf, 
  287.         som3InitCtrl* ctrl, 
  288.         SOMObject* fromObj);
  289. typedef somTP_SOMMSingleInstance_somDefaultVCopyInit *somTD_SOMMSingleInstance_somDefaultVCopyInit;
  290. typedef void   SOMLINK somTP_SOMMSingleInstance_somDefaultConstVCopyInit(SOMMSingleInstance *somSelf, 
  291.         som3InitCtrl* ctrl, 
  292.         SOMObject* fromObj);
  293. typedef somTP_SOMMSingleInstance_somDefaultConstVCopyInit *somTD_SOMMSingleInstance_somDefaultConstVCopyInit;
  294. typedef SOMMSingleInstance*   SOMLINK somTP_SOMMSingleInstance_somDefaultConstAssign(SOMMSingleInstance *somSelf, 
  295.         som3AssignCtrl* ctrl, 
  296.         SOMObject* fromObj);
  297. typedef somTP_SOMMSingleInstance_somDefaultConstAssign *somTD_SOMMSingleInstance_somDefaultConstAssign;
  298. typedef SOMMSingleInstance*   SOMLINK somTP_SOMMSingleInstance_somDefaultVAssign(SOMMSingleInstance *somSelf, 
  299.         som3AssignCtrl* ctrl, 
  300.         SOMObject* fromObj);
  301. typedef somTP_SOMMSingleInstance_somDefaultVAssign *somTD_SOMMSingleInstance_somDefaultVAssign;
  302. typedef SOMMSingleInstance*   SOMLINK somTP_SOMMSingleInstance_somDefaultConstVAssign(SOMMSingleInstance *somSelf, 
  303.         som3AssignCtrl* ctrl, 
  304.         SOMObject* fromObj);
  305. typedef somTP_SOMMSingleInstance_somDefaultConstVAssign *somTD_SOMMSingleInstance_somDefaultConstVAssign;
  306. typedef void   SOMLINK somTP_SOMMSingleInstance_somInit(SOMMSingleInstance *somSelf);
  307. typedef somTP_SOMMSingleInstance_somInit *somTD_SOMMSingleInstance_somInit;
  308. typedef void   SOMLINK somTP_SOMMSingleInstance_somFree(SOMMSingleInstance *somSelf);
  309. typedef somTP_SOMMSingleInstance_somFree *somTD_SOMMSingleInstance_somFree;
  310. typedef void   SOMLINK somTP_SOMMSingleInstance_somUninit(SOMMSingleInstance *somSelf);
  311. typedef somTP_SOMMSingleInstance_somUninit *somTD_SOMMSingleInstance_somUninit;
  312. typedef SOMClass*   SOMLINK somTP_SOMMSingleInstance_somGetClass(SOMMSingleInstance *somSelf);
  313. typedef somTP_SOMMSingleInstance_somGetClass *somTD_SOMMSingleInstance_somGetClass;
  314. typedef string   SOMLINK somTP_SOMMSingleInstance_somGetClassName(SOMMSingleInstance *somSelf);
  315. typedef somTP_SOMMSingleInstance_somGetClassName *somTD_SOMMSingleInstance_somGetClassName;
  316. typedef long   SOMLINK somTP_SOMMSingleInstance_somGetSize(SOMMSingleInstance *somSelf);
  317. typedef somTP_SOMMSingleInstance_somGetSize *somTD_SOMMSingleInstance_somGetSize;
  318. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somIsA(SOMMSingleInstance *somSelf, 
  319.         SOMClass* aClassObj);
  320. typedef somTP_SOMMSingleInstance_somIsA *somTD_SOMMSingleInstance_somIsA;
  321. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somIsInstanceOf(SOMMSingleInstance *somSelf, 
  322.         SOMClass* aClassObj);
  323. typedef somTP_SOMMSingleInstance_somIsInstanceOf *somTD_SOMMSingleInstance_somIsInstanceOf;
  324. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somRespondsTo(SOMMSingleInstance *somSelf, 
  325.         somId mId);
  326. typedef somTP_SOMMSingleInstance_somRespondsTo *somTD_SOMMSingleInstance_somRespondsTo;
  327. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somDispatch(SOMMSingleInstance *somSelf, 
  328.         somToken* retValue, 
  329.         somId methodId, 
  330.         va_list ap);
  331. typedef somTP_SOMMSingleInstance_somDispatch *somTD_SOMMSingleInstance_somDispatch;
  332. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somClassDispatch(SOMMSingleInstance *somSelf, 
  333.         SOMClass* clsObj, 
  334.         somToken* retValue, 
  335.         somId methodId, 
  336.         va_list ap);
  337. typedef somTP_SOMMSingleInstance_somClassDispatch *somTD_SOMMSingleInstance_somClassDispatch;
  338. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somCastObj(SOMMSingleInstance *somSelf, 
  339.         SOMClass* cls);
  340. typedef somTP_SOMMSingleInstance_somCastObj *somTD_SOMMSingleInstance_somCastObj;
  341. typedef boolean   SOMLINK somTP_SOMMSingleInstance_somResetObj(SOMMSingleInstance *somSelf);
  342. typedef somTP_SOMMSingleInstance_somResetObj *somTD_SOMMSingleInstance_somResetObj;
  343. typedef void   SOMLINK somTP_SOMMSingleInstance_somDispatchV(SOMMSingleInstance *somSelf, 
  344.         somId methodId, 
  345.         somId descriptor, 
  346.         va_list ap);
  347. typedef somTP_SOMMSingleInstance_somDispatchV *somTD_SOMMSingleInstance_somDispatchV;
  348. typedef long   SOMLINK somTP_SOMMSingleInstance_somDispatchL(SOMMSingleInstance *somSelf, 
  349.         somId methodId, 
  350.         somId descriptor, 
  351.         va_list ap);
  352. typedef somTP_SOMMSingleInstance_somDispatchL *somTD_SOMMSingleInstance_somDispatchL;
  353. typedef void*   SOMLINK somTP_SOMMSingleInstance_somDispatchA(SOMMSingleInstance *somSelf, 
  354.         somId methodId, 
  355.         somId descriptor, 
  356.         va_list ap);
  357. typedef somTP_SOMMSingleInstance_somDispatchA *somTD_SOMMSingleInstance_somDispatchA;
  358. typedef double   SOMLINK somTP_SOMMSingleInstance_somDispatchD(SOMMSingleInstance *somSelf, 
  359.         somId methodId, 
  360.         somId descriptor, 
  361.         va_list ap);
  362. typedef somTP_SOMMSingleInstance_somDispatchD *somTD_SOMMSingleInstance_somDispatchD;
  363. typedef SOMObject*   SOMLINK somTP_SOMMSingleInstance_somPrintSelf(SOMMSingleInstance *somSelf);
  364. typedef somTP_SOMMSingleInstance_somPrintSelf *somTD_SOMMSingleInstance_somPrintSelf;
  365. typedef void   SOMLINK somTP_SOMMSingleInstance_somDumpSelf(SOMMSingleInstance *somSelf, 
  366.         long level);
  367. typedef somTP_SOMMSingleInstance_somDumpSelf *somTD_SOMMSingleInstance_somDumpSelf;
  368. typedef void   SOMLINK somTP_SOMMSingleInstance_somDumpSelfInt(SOMMSingleInstance *somSelf, 
  369.         long level);
  370. typedef somTP_SOMMSingleInstance_somDumpSelfInt *somTD_SOMMSingleInstance_somDumpSelfInt;
  371. }
  372.  
  373. #endif /* SOMMSingleInstance_API */
  374.  
  375.  
  376. /*
  377.  * -- This emitter treats Method Tokens as Thunks by default.
  378.  * -- Use the sc modifier "nothunks" to change this default
  379.  */
  380. #undef somresolve_
  381. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  382.  
  383. /*
  384.  * -- The C++ Wrapper Class for SOMMSingleInstance
  385.  */
  386. class SOMMSingleInstance : public SOMClass
  387. {
  388. /*
  389.  *  This class is a metaclass for classes which wish to enforce a
  390.  *  single instance rule.  That is, classes which specify this class
  391.  *  as their metaclass will only be allowed to have a single instance.
  392.  * 
  393.  *  For example, if a class named dog specified this class as its
  394.  *  metaclass, only one dog object could be instantiated. Repeated
  395.  *  calls to _somNew on the dog class would simply return the same
  396.  *  dog repeatedly.
  397.  * 
  398.  *  There are two ways to retrieve the single intance of the using
  399.  *  class:
  400.  * 
  401.  *   1) Invoke sommGetSingleInstance on the class object of the using class.
  402.  *      This is the preferred way.
  403.  * 
  404.  *   2) Invoke somNew or somNewNoInit on the class object of the using class.
  405.  * 
  406.  */
  407. public:
  408.  
  409. // SOMMSingleInstance::new creates the class object if necessary, and then uses somNewNoInit
  410. // to allocate memory and create the object. Initialization is in ctors.
  411. void *operator new(size_t)
  412. {
  413.    if (!_SOMMSingleInstance) SOMMSingleInstanceNewClass(SOMMSingleInstance_MajorVersion,SOMMSingleInstance_MinorVersion);
  414.    return (void*)
  415.       SOM_Resolve(_SOMMSingleInstance,SOMClass,somNewNoInit)
  416.          ((SOMClass *)((void*)_SOMMSingleInstance));
  417. }
  418.  
  419. // SOMMSingleInstance::delete uses somDestruct.
  420. void operator delete(void * obj)
  421. {
  422.    if (obj && *(void**)obj) {
  423.       SOM_Resolve(obj,SOMObject,somFree)
  424.          ((SOMObject*)obj);
  425.    }
  426. }
  427.  
  428. SOMMSingleInstance& operator=(SOMMSingleInstance& fromObj)
  429. {
  430.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  431.    return *this;
  432. }
  433.  
  434. SOMMSingleInstance()
  435. {
  436.    if (*(void**)this != 
  437.        ((somParentMtabStructPtr)
  438.         (SOMMSingleInstanceCClassData.parentMtab))->mtab)
  439.       return;
  440.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  441. }
  442.  
  443. SOMMSingleInstance(SOMMSingleInstance* fromObj)
  444. {
  445.    if (*(void**)this != 
  446.        ((somParentMtabStructPtr)
  447.         (SOMMSingleInstanceCClassData.parentMtab))->mtab)
  448.       return;
  449.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  450. }
  451.  
  452. #ifdef __IBMCPP__
  453. #pragma info(nocnv,nopar)
  454. #endif
  455. SOMMSingleInstance(const SOMMSingleInstance* fromObj)
  456. {
  457.    if (*(void**)this != 
  458.        ((somParentMtabStructPtr)
  459.         (SOMMSingleInstanceCClassData.parentMtab))->mtab)
  460.       return;
  461.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  462. }
  463. #ifdef __IBMCPP__
  464. #pragma info(restore)
  465. #endif
  466.  
  467.  
  468. /* method: sommGetSingleInstance */
  469. SOMObject*   sommGetSingleInstance(Environment *ev)
  470. {
  471. /*
  472.  *  Returns the single instance of the using class.
  473.  *  If there isn't one, then it creates one first with somNew.
  474.  */
  475.    return SOM_ResolveD(this,SOMMSingleInstance,SOMMSingleInstance,sommGetSingleInstance)
  476.     (this, ev);
  477. }
  478.  
  479.  
  480. /* method: sommFreeSingleInstance */
  481. void   sommFreeSingleInstance(Environment *ev)
  482. {
  483. /*
  484.  *  If there isn't one, then the method does nothing.
  485.  *  Frees single instance of the class
  486.  */
  487.    SOM_ResolveD(this,SOMMSingleInstance,SOMMSingleInstance,sommFreeSingleInstance)
  488.     (this, ev);
  489. }
  490.  
  491.  
  492. /*
  493.  * Reintroduce inherited methods
  494.  */
  495.  
  496. /* method: _get_somDataAlignment */
  497. long   _get_somDataAlignment()
  498. {
  499. /*
  500.  *  The alignment required for the instance data structure
  501.  *  introduced by the receiving class.
  502.  */
  503.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,_get_somDataAlignment)
  504.     (this);
  505. }
  506.  
  507.  
  508. /* nonstatic method: _get_somInstanceDataOffsets */
  509. SOMClass_somOffsets   _get_somInstanceDataOffsets()
  510. {
  511. /*
  512.  *  A sequence of the instance data offsets for all classes used in
  513.  *  the derivation of the receiving class (including the receiver).
  514.  */
  515.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,_get_somInstanceDataOffsets)
  516.     (this);
  517. }
  518.  
  519.  
  520. /* nonstatic method: _get_somDirectInitClasses */
  521. SOMClass_SOMClassSequence   _get_somDirectInitClasses()
  522. {
  523. /*
  524.  *  The ancestors whose initializers the receiving
  525.  *  class wants to directly invoke.
  526.  */
  527.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,_get_somDirectInitClasses)
  528.     (this);
  529. }
  530.  
  531.  
  532. /* method: somNew */
  533. SOMObject*   somNew()
  534. {
  535. /*
  536.  *  Uses SOMMalloc to allocate storage for a new instance of the
  537.  *  receiving class, and then calls somRenewNoInitNoZero to load the
  538.  *  new object's method table pointer. Then somDefaultInit is called to
  539.  *  initialize the new object.  Note: If the instance is a class object,
  540.  *  somInitMIClass must then be invoked to declare parents and
  541.  *  initialize the class's instance method table. Upon failure, NULL
  542.  *  is returned.
  543.  */
  544.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somNew)
  545.     (this);
  546. }
  547.  
  548.  
  549. /* method: somNewNoInit */
  550. SOMObject*   somNewNoInit()
  551. {
  552. /*
  553.  *  Equivalent to somNew except that somDefaultInit is not called.
  554.  */
  555.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somNewNoInit)
  556.     (this);
  557. }
  558.  
  559.  
  560. /* method: somRenew */
  561. SOMObject*   somRenew(void* obj)
  562. {
  563. /*
  564.  *  Equivalent to somNew except that storage is not allocated.
  565.  *  <obj> is taken as the address of the new object.
  566.  */
  567.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somRenew)
  568.     (this,obj);
  569. }
  570.  
  571.  
  572. /* method: somRenewNoInit */
  573. SOMObject*   somRenewNoInit(void* obj)
  574. {
  575. /*
  576.  *  Equivalent to somRenew except that somDefaultInit is not called.
  577.  */
  578.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somRenewNoInit)
  579.     (this,obj);
  580. }
  581.  
  582.  
  583. /* method: somRenewNoZero */
  584. SOMObject*   somRenewNoZero(void* obj)
  585. {
  586. /*
  587.  *  Equivalent to somRenew except that memory is not zeroed out.
  588.  */
  589.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somRenewNoZero)
  590.     (this,obj);
  591. }
  592.  
  593.  
  594. /* method: somRenewNoInitNoZero */
  595. SOMObject*   somRenewNoInitNoZero(void* obj)
  596. {
  597. /*
  598.  *  The purpose of this method is to load an object's method table.
  599.  *  The SOM API requires that somRenewNoInitNoZero always be
  600.  *  called when creating a new object whose metaclass is not SOMClass.
  601.  *  This is because metaclasses must be guaranteed that they can use
  602.  *  somRenewNoInitNoZero to track object creation if this is desired.
  603.  */
  604.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somRenewNoInitNoZero)
  605.     (this,obj);
  606. }
  607.  
  608.  
  609. /* nonstatic method: somAllocate */
  610. somToken   somAllocate(long size)
  611. {
  612. /*
  613.  *  Allocates memory to hold an object and returns a pointer to this memory.
  614.  *  This is a nonstatic method, and cannot be overridden. The default
  615.  *  implementation calls SOMMalloc, but a class designer can specify a
  616.  *  different implementation using the somallocate modifier in IDL. The
  617.  *  allocator takes the same parameters as this method.
  618.  */
  619.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somAllocate)
  620.     (this,size);
  621. }
  622.  
  623.  
  624. /* nonstatic method: somDeallocate */
  625. void   somDeallocate(somToken memptr)
  626. {
  627. /*
  628.  *  Zeros out the method table pointer stored in the word pointed to by
  629.  *  memptr, and then deallocates the block of memory pointed to by memptr.
  630.  *  This is a nonstatic method and cannot be overridden. The default
  631.  *  deallocator called is SOMFree, but a class designer can specify a
  632.  *  different deallocator using the somdeallocate modifier in IDL. The
  633.  *  deallocator takes a char* (memptr) and a long (size) as arguments.
  634.  */
  635.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somDeallocate)
  636.     (this,memptr);
  637. }
  638.  
  639.  
  640. /* method: somInitClass */
  641. void   somInitClass(string className, 
  642.         SOMClass* parentClass, 
  643.         long dataSize, 
  644.         long maxStaticMethods, 
  645.         long majorVersion, 
  646.         long minorVersion)
  647. {
  648. /*
  649.  *  somInitClass is obsolete, and should no longer be used. The SOM 2.0
  650.  *  kernel provides special handling for redispatch stubs in the case
  651.  *  of SOM 1.0 classes, and use of this method is what tells the kernel
  652.  *  that old-style redispatch stubs will be registered.
  653.  */
  654.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somInitClass)
  655.     (this,className,parentClass,dataSize,maxStaticMethods,majorVersion,minorVersion);
  656. }
  657.  
  658.  
  659. /* method: somInitMIClass */
  660. void   somInitMIClass(long inherit_vars, 
  661.         string className, 
  662.         SOMClass_SOMClassSequence* parentClasses, 
  663.         long dataSize, 
  664.         long dataAlignment, 
  665.         long maxStaticMethods, 
  666.         long majorVersion, 
  667.         long minorVersion)
  668. {
  669. /*
  670.  *  somInitMIClass implements the second phase of dynamic class creation:
  671.  *  inheritance of interface and possibly implementation (instance
  672.  *  variables) by suitable initialization of <self> (a class object).
  673.  * 
  674.  *  For somInitMIClass, the inherit_vars argument controls whether abstract
  675.  *  or implementation inheritance is used. Inherit_vars is a 32 bit
  676.  *  bit-vector. Implementation is inherited from parent i iff the bit
  677.  *  1<<i is on, or i>=32.
  678.  *  On a class-by-class basis, for each class ancestor, implementation
  679.  *  inheritance always takes precidence over abstract inheritance. This is
  680.  *  necessary to guarantee that procedures supporting parent method calls
  681.  *  (available on non-abstract parents) are always supported by parent
  682.  *  instance variables.
  683.  * 
  684.  *  <className> is a string containing the class name. A copy is made, so
  685.  *  the string may be freed upon return to the caller if this is desired.
  686.  * 
  687.  *  <parentClasses> is a SOMClassSequence containing pointers to the
  688.  *  parent classes. somInitMIClass makes a copy of this, so it may
  689.  *  be freed upon return to the caller if this is desired.
  690.  * 
  691.  *  <dataSize> is the space needed for the instance variables
  692.  *  introduced by this class.
  693.  * 
  694.  *  <dataAlignment> specifies the desired byte alignment for instance
  695.  *  data introduced by this class. A value of 0 selects a system-wide default;
  696.  *  any other argument is taken as the desired byte alignment multiple. Thus,
  697.  *  for example, even if a byte multiple of 8 is needed for double precision
  698.  *  values on a given system (so 8 is the default), a class whose instance data
  699.  *  doesn't require this can indicate otherwise. If A is the next memory
  700.  *  address available for holding instance data, the address that will be
  701.  *  used is A + (A mod byte-alignment).
  702.  * 
  703.  *  <maxStaticMethods> is the maximum number of static methods that will be
  704.  *  added to the initialized class using addStaticMethod.
  705.  * 
  706.  *  <majorVersion> indicates the major version number for this
  707.  *  implementation of the class definition, and <minorVersion>
  708.  *  indicates the minor version number.
  709.  */
  710.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somInitMIClass)
  711.     (this,inherit_vars,className,parentClasses,dataSize,dataAlignment,maxStaticMethods,majorVersion,minorVersion);
  712. }
  713.  
  714.  
  715. /* method: somAddStaticMethod */
  716. somMToken   somAddStaticMethod(somId methodId, 
  717.         somId methodDescriptor, 
  718.         somMethodPtr method, 
  719.         somMethodPtr redispatchStub, 
  720.         somMethodPtr applyStub)
  721. {
  722. /*
  723.  *  Adds the indicated method, creating and returning a new method token.
  724.  * 
  725.  *  <methodDescriptor> is the somId for an identifier that can be used
  726.  *  to access signature information about the method from an interface
  727.  *  repository.
  728.  * 
  729.  *  <method> is the actual method procedure for this method
  730.  * 
  731.  *  <redispatchStub> is a procedure with the same calling sequence as
  732.  *  <method> that invokes somDispatch for the method.
  733.  * 
  734.  *  <applyStub> is a procedure used to support somApply.
  735.  */
  736.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somAddStaticMethod)
  737.     (this,methodId,methodDescriptor,method,redispatchStub,applyStub);
  738. }
  739.  
  740.  
  741. /* method: somAddDynamicMethod */
  742. void   somAddDynamicMethod(somId methodId, 
  743.         somId methodDescriptor, 
  744.         somMethodPtr method, 
  745.         somMethodPtr applyStub)
  746. {
  747. /*
  748.  *  Adds the indicated method to the class's name lookup list.
  749.  *  If this happens to override a static method then this operation is
  750.  *  equivalent to <somOverrideSMethod> and the <methodDescriptor> and
  751.  *  <applyStub> arguments are ignored (the overridden method's values
  752.  *  will be used).
  753.  * 
  754.  *  <methodDescriptor> is the somId for an identifier that can be used
  755.  *  to access signature information about the method from an interface
  756.  *  repository.
  757.  * 
  758.  *  <method> is the actual method procedure for this method
  759.  * 
  760.  *  <applyStub> is a procedure that takes a standard variable argument
  761.  *  list data structure applies it to its target object by calling
  762.  *  <method> with arguments derived from the data structure.  Its
  763.  *  calling sequence is the same as the calling sequence of the
  764.  *  dispatch methods defined in SOMObject.  This stub is used in the
  765.  *  support of the dispatch methods used in some classes.  In classes
  766.  *  where the dispatch functions do not need such a function this
  767.  *  parameter may be null.
  768.  */
  769.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somAddDynamicMethod)
  770.     (this,methodId,methodDescriptor,method,applyStub);
  771. }
  772.  
  773.  
  774. /* method: somOverrideSMethod */
  775. void   somOverrideSMethod(somId methodId, 
  776.         somMethodPtr method)
  777. {
  778. /*
  779.  *  This method can be used instead of <somAddStaticMethod> or
  780.  *  <somAddDynamicMethod> when it is known that the class' parent
  781.  *  class already supports this method.  This call does not require the
  782.  *  method descriptor and stub methods that the others do.
  783.  */
  784.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somOverrideSMethod)
  785.     (this,methodId,method);
  786. }
  787.  
  788.  
  789. /* method: somClassReady */
  790. void   somClassReady()
  791. {
  792. /*
  793.  *  This method is invoked when all of the static initialization for
  794.  *  the class has been finished.  The default implementation simply
  795.  *  registers the newly constructed class with the SOMClassMgr.
  796.  */
  797.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somClassReady)
  798.     (this);
  799. }
  800.  
  801.  
  802. /* method: somGetApplyStub */
  803. somMethodPtr   somGetApplyStub(somId methodId)
  804. {
  805. /*
  806.  *  Returns the apply stub associated with the specified method,
  807.  *  if one exists; otherwise NULL is returned. This method is obsolete,
  808.  *  and retained for binary compatability. In SOMr2, users never access
  809.  *  apply stubs directly; The function somApply is used to invoke apply
  810.  *  stubs. See somApply documentation for further information on apply
  811.  *  stubs, and see somAddStaticMethod documentation for information
  812.  *  on how apply stubs are registered by class implementations.
  813.  */
  814.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetApplyStub)
  815.     (this,methodId);
  816. }
  817.  
  818.  
  819. /* method: somGetClassData */
  820. somClassDataStructure*   somGetClassData()
  821. {
  822.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetClassData)
  823.     (this);
  824. }
  825.  
  826.  
  827. /* method: somSetClassData */
  828. void   somSetClassData(somClassDataStructure* cds)
  829. {
  830. /*
  831.  *  The class' pointer to the static <className>ClassData structure.
  832.  */
  833.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somSetClassData)
  834.     (this,cds);
  835. }
  836.  
  837.  
  838. /* method: somGetClassMtab */
  839. somMethodTab*   somGetClassMtab()
  840. {
  841. /*
  842.  *  A pointer to the method table used by instances of this class. This
  843.  *  method was misnamed; it should have been called somGetInstanceMtab.
  844.  */
  845.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetClassMtab)
  846.     (this);
  847. }
  848.  
  849.  
  850. /* method: somGetInstanceOffset */
  851. long   somGetInstanceOffset()
  852. {
  853. /*
  854.  *  Returns the offset of instance data introduced by the receiver in
  855.  *  an instance of the receiver. This method is obsolete and not useful in
  856.  *  multiple-inheritance situations. The attribute somInstanceDataOffsets
  857.  *  replaces this method.
  858.  */
  859.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetInstanceOffset)
  860.     (this);
  861. }
  862.  
  863.  
  864. /* method: somGetInstancePartSize */
  865. long   somGetInstancePartSize()
  866. {
  867. /*
  868.  *  The size in bytes of the instance data introduced by the receiving
  869.  *  class.
  870.  */
  871.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetInstancePartSize)
  872.     (this);
  873. }
  874.  
  875.  
  876. /* method: somGetInstanceSize */
  877. long   somGetInstanceSize()
  878. {
  879. /*
  880.  *  The total size of an instance of the receiving class.
  881.  */
  882.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetInstanceSize)
  883.     (this);
  884. }
  885.  
  886.  
  887. /* method: somGetInstanceToken */
  888. somDToken   somGetInstanceToken()
  889. {
  890. /*
  891.  *  A data token that identifies the introduced portion of this class
  892.  *  within itself or any derived class.  This token can be subsequently
  893.  *  passed to the run-time somDataResolve function to locate the instance
  894.  *  data introduced by this class in any object derived from this class.
  895.  */
  896.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetInstanceToken)
  897.     (this);
  898. }
  899.  
  900.  
  901. /* method: somGetMemberToken */
  902. somDToken   somGetMemberToken(long memberOffset, 
  903.         somDToken instanceToken)
  904. {
  905. /*
  906.  *  Returns a data token that for the data member at offset
  907.  *  "memberOffset" within the introduced portion of the class identified
  908.  *  by instanceToken.  The instance token must have been obtained from a
  909.  *  previous invocation of somGetInstanceToken.  The returned member
  910.  *  token can be subsequently passed to the run-time somDataResolve
  911.  *  function to locate the data member.
  912.  */
  913.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetMemberToken)
  914.     (this,memberOffset,instanceToken);
  915. }
  916.  
  917.  
  918. /* method: somGetMethodData */
  919. boolean   somGetMethodData(somId methodId, 
  920.         somMethodData* md)
  921. {
  922. /*
  923.  *  If a method with id <methodId> is supported by the target class,
  924.  *  the structure pointed to by <md> is loaded with method information
  925.  *  and the value 1 is returned. In this case, if the method is not
  926.  *  dynamic, md->method is loaded with the result of somClassResolve on
  927.  *  the target class for the method. If the method is not supported,
  928.  *  md->id is loaded with 0, and the value 0 is returned.
  929.  */
  930.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetMethodData)
  931.     (this,methodId,md);
  932. }
  933.  
  934.  
  935. /* method: somGetRdStub */
  936. somMethodProc*   somGetRdStub(somId methodId)
  937. {
  938. /*
  939.  *  Returns a redispatch stub for the indicated method, if possible.
  940.  *  If not possible (because a valid redispatch stub has not been
  941.  *  registered, and there is insufficient information to dynamically
  942.  *  construct one), then a NULL is returned.
  943.  */
  944.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetRdStub)
  945.     (this,methodId);
  946. }
  947.  
  948.  
  949. /* method: somGetMethodDescriptor */
  950. somId   somGetMethodDescriptor(somId methodId)
  951. {
  952. /*
  953.  *  Returns the method descriptor for the indicated method.    If
  954.  *  this object does not support the indicated method then NULL is
  955.  *  returned.
  956.  */
  957.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetMethodDescriptor)
  958.     (this,methodId);
  959. }
  960.  
  961.  
  962. /* method: somGetMethodIndex */
  963. long   somGetMethodIndex(somId id)
  964. {
  965. /*
  966.  *  Returns the index for the specified method. (A number that may
  967.  *  change if any methods are added or deleted to this class object or
  968.  *  any of its ancestors).  This number is the basis for other calls to
  969.  *  get info about the method. Indexes start at 0. A -1 is returned if
  970.  *  the method cannot be found.
  971.  */
  972.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetMethodIndex)
  973.     (this,id);
  974. }
  975.  
  976.  
  977. /* method: somGetMethodToken */
  978. somMToken   somGetMethodToken(somId methodId)
  979. {
  980. /*
  981.  *  Returns the specified method's access token. This token can then
  982.  *  be passed to method resolution routines, which use the token
  983.  *  to select a method pointer from a method table.
  984.  */
  985.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetMethodToken)
  986.     (this,methodId);
  987. }
  988.  
  989.  
  990. /* method: somGetName */
  991. string   somGetName()
  992. {
  993. /*
  994.  *  This object's class name as a NULL terminated string.
  995.  */
  996.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetName)
  997.     (this);
  998. }
  999.  
  1000.  
  1001. /* method: somGetNthMethodData */
  1002. boolean   somGetNthMethodData(long n, 
  1003.         somMethodData* md)
  1004. {
  1005. /*
  1006.  *  loads *md with the method data associated with the the nth method,
  1007.  *  or NULL if there is no such method. Returns true is successful;
  1008.  *  false otherwise.
  1009.  */
  1010.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetNthMethodData)
  1011.     (this,n,md);
  1012. }
  1013.  
  1014.  
  1015. /* method: somGetNthMethodInfo */
  1016. somId   somGetNthMethodInfo(long n, 
  1017.         somId* descriptor)
  1018. {
  1019. /*
  1020.  *  Returns the id of the <n>th method if one exists and NULL
  1021.  *  otherwise.
  1022.  * 
  1023.  *  The ordering of the methods is unpredictable, but will not change
  1024.  *  unless some change is made to the class or one of its ancestor classes.
  1025.  * 
  1026.  *  See CORBA documentation for info on method descriptors.
  1027.  */
  1028.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetNthMethodInfo)
  1029.     (this,n,descriptor);
  1030. }
  1031.  
  1032.  
  1033. /* method: somGetNumMethods */
  1034. long   somGetNumMethods()
  1035. {
  1036. /*
  1037.  *  The number of methods currently supported by this class,
  1038.  *  including inherited methods (both static and dynamic).
  1039.  */
  1040.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetNumMethods)
  1041.     (this);
  1042. }
  1043.  
  1044.  
  1045. /* method: somGetNumStaticMethods */
  1046. long   somGetNumStaticMethods()
  1047. {
  1048. /*
  1049.  *  The number of static methods that this class has.  Can
  1050.  *  be used by a child class when initializing its method table.
  1051.  */
  1052.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetNumStaticMethods)
  1053.     (this);
  1054. }
  1055.  
  1056.  
  1057. /* method: somGetParent */
  1058. SOMClass*   somGetParent()
  1059. {
  1060. /*
  1061.  *  Returns the parent class of self (along its "left-hand" derivation
  1062.  *  path), if one exists and NULL otherwise.
  1063.  */
  1064.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetParent)
  1065.     (this);
  1066. }
  1067.  
  1068.  
  1069. /* method: somGetParents */
  1070. SOMClass_SOMClassSequence   somGetParents()
  1071. {
  1072. /*
  1073.  *  The parent classes of self.
  1074.  */
  1075.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetParents)
  1076.     (this);
  1077. }
  1078.  
  1079.  
  1080. /* method: somGetVersionNumbers */
  1081. void   somGetVersionNumbers(long* majorVersion, 
  1082.         long* minorVersion)
  1083. {
  1084. /*
  1085.  *  Returns the class' major and minor version numbers in the corresponding
  1086.  *  output parameters.
  1087.  */
  1088.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somGetVersionNumbers)
  1089.     (this,majorVersion,minorVersion);
  1090. }
  1091.  
  1092.  
  1093. /* method: somFindMethod */
  1094. boolean   somFindMethod(somId methodId, 
  1095.         somMethodPtr* m)
  1096. {
  1097. /*
  1098.  *  Finds the method procedure associated with <methodId> for this
  1099.  *  class and sets <m> to it.  1 (true) is returned when the
  1100.  *  method procedure is a static method and 0 (false) is returned
  1101.  *  when the method procedure is dynamic method.
  1102.  * 
  1103.  *  If the class does not support the specified method then
  1104.  *  <m> is set to NULL and the return value is meaningless.
  1105.  * 
  1106.  */
  1107.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somFindMethod)
  1108.     (this,methodId,m);
  1109. }
  1110.  
  1111.  
  1112. /* method: somFindMethodOk */
  1113. boolean   somFindMethodOk(somId methodId, 
  1114.         somMethodPtr* m)
  1115. {
  1116. /*
  1117.  *  Just like <somFindMethod> except that if the method is not
  1118.  *  supported then an error is raised and execution is halted.
  1119.  */
  1120.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somFindMethodOk)
  1121.     (this,methodId,m);
  1122. }
  1123.  
  1124.  
  1125. /* method: somFindSMethod */
  1126. somMethodPtr   somFindSMethod(somId methodId)
  1127. {
  1128. /*
  1129.  *  Finds the indicated method, which must be a static method supported
  1130.  *  by this class, and returns a pointer to its method procedure.
  1131.  *  If the method is not supported by the receiver (as a static method
  1132.  *  or at all) then a NULL pointer is returned.
  1133.  */
  1134.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somFindSMethod)
  1135.     (this,methodId);
  1136. }
  1137.  
  1138.  
  1139. /* method: somFindSMethodOk */
  1140. somMethodPtr   somFindSMethodOk(somId methodId)
  1141. {
  1142. /*
  1143.  *  Uses <somFindSMethod>, and raises an error if the result is NULL.
  1144.  */
  1145.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somFindSMethodOk)
  1146.     (this,methodId);
  1147. }
  1148.  
  1149.  
  1150. /* method: somLookupMethod */
  1151. somMethodPtr   somLookupMethod(somId methodId)
  1152. {
  1153. /*
  1154.  *  Like <somFindSMethodOK>, but without restriction to static methods.
  1155.  */
  1156.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somLookupMethod)
  1157.     (this,methodId);
  1158. }
  1159.  
  1160.  
  1161. /* method: somCheckVersion */
  1162. boolean   somCheckVersion(long majorVersion, 
  1163.         long minorVersion)
  1164. {
  1165. /*
  1166.  *  Returns 1 (true) if the implementation of this class is
  1167.  *  compatible with the specified major and minor version number and
  1168.  *  false (0) otherwise.  An implementation is compatible with the
  1169.  *  specified version numbers if it has the same major version number
  1170.  *  and a minor version number that is equal to or greater than
  1171.  *  <minorVersion>.    The major, minor version number pair (0,0) is
  1172.  *  considered to match any version.  This method is usually called
  1173.  *  immediately after creating the class object to verify that a
  1174.  *  dynamically loaded class definition is compatible with a using
  1175.  *  application.
  1176.  */
  1177.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somCheckVersion)
  1178.     (this,majorVersion,minorVersion);
  1179. }
  1180.  
  1181.  
  1182. /* method: somDescendedFrom */
  1183. boolean   somDescendedFrom(SOMClass* aClassObj)
  1184. {
  1185. /*
  1186.  *  Returns 1 (true) if <self> is a descendent class of <aClassObj> and
  1187.  *  0 (false) otherwise.  Note: a class object is considered to be
  1188.  *  descended itself for the purposes of this method.
  1189.  */
  1190.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somDescendedFrom)
  1191.     (this,aClassObj);
  1192. }
  1193.  
  1194.  
  1195. /* method: somSupportsMethod */
  1196. boolean   somSupportsMethod(somId mId)
  1197. {
  1198. /*
  1199.  *  Returns 1 (true) if the indicated method is supported by this
  1200.  *  class and 0 (false) otherwise.
  1201.  */
  1202.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somSupportsMethod)
  1203.     (this,mId);
  1204. }
  1205.  
  1206.  
  1207. /* method: somDefinedMethod */
  1208. somMethodPtr   somDefinedMethod(somMToken method)
  1209. {
  1210. /*
  1211.  *  if the receiving class either introduces or overrides the
  1212.  *  indicated method, then its somMethodPtr is returned, otherwise
  1213.  *  NULL is returned.
  1214.  */
  1215.    return SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somDefinedMethod)
  1216.     (this,method);
  1217. }
  1218.  
  1219.  
  1220. /* method: somOverrideMtab */
  1221. void   somOverrideMtab()
  1222. {
  1223. /*
  1224.  *  Overrides the method table pointers to point to the redispatch stubs.
  1225.  *  All the methods except somDispatch methods are overriden.
  1226.  */
  1227.    SOM_ResolveD(this,SOMMSingleInstance,SOMClass,somOverrideMtab)
  1228.     (this);
  1229. }
  1230.  
  1231.  
  1232. /* initializer method: somDefaultInit */
  1233. void   somDefaultInit(som3InitCtrl* ctrl)
  1234. {
  1235. /*
  1236.  *  A default initializer for a SOM object. Passing a null ctrl
  1237.  *  indicates to the receiver that its class is the class of the
  1238.  *  object being initialized, whereby the initializer will determine
  1239.  *  an appropriate control structure.
  1240.  */
  1241.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultInit)
  1242.     (this,ctrl);
  1243. }
  1244.  
  1245.  
  1246. /* method: somDestruct */
  1247. void   somDestruct(octet doFree, 
  1248.         som3DestructCtrl* ctrl)
  1249. {
  1250. /*
  1251.  *  The default destructor for a SOM object. A nonzero <doFree>
  1252.  *  indicates that the object storage should be freed by the
  1253.  *  object's class (via somDeallocate) after uninitialization.
  1254.  *  As with somDefaultInit, a null ctrl can be passed.
  1255.  */
  1256.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDestruct)
  1257.     (this,doFree,ctrl);
  1258. }
  1259.  
  1260.  
  1261. /* initializer method: somDefaultCopyInit */
  1262. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  1263.         SOMObject* fromObj)
  1264. {
  1265. /*
  1266.  *  A default copy constructor. Use this to make copies of objects for
  1267.  *  calling methods with "by-value" argument semantics.
  1268.  */
  1269.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultCopyInit)
  1270.     (this,ctrl,fromObj);
  1271. }
  1272.  
  1273.  
  1274. /* method: somDefaultAssign */
  1275. SOMMSingleInstance*  somDefaultAssign(som3AssignCtrl* ctrl, 
  1276.         SOMObject* fromObj)
  1277. {
  1278. /*
  1279.  *  A default assignment operator. Use this to "assign" the state of one
  1280.  *  object to another.
  1281.  */
  1282.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultAssign)
  1283.     (this,ctrl,fromObj);
  1284. }
  1285.  
  1286.  
  1287. /* initializer method: somDefaultConstCopyInit */
  1288. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  1289.         SOMObject* fromObj)
  1290. {
  1291. /*
  1292.  *  A default copy constructor that uses a const fromObj.
  1293.  */
  1294.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultConstCopyInit)
  1295.     (this,ctrl,fromObj);
  1296. }
  1297.  
  1298.  
  1299. /* initializer method: somDefaultVCopyInit */
  1300. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  1301.         SOMObject* fromObj)
  1302. {
  1303. /*
  1304.  *  A default copy constructor that uses a volatile fromObj.
  1305.  */
  1306.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultVCopyInit)
  1307.     (this,ctrl,fromObj);
  1308. }
  1309.  
  1310.  
  1311. /* initializer method: somDefaultConstVCopyInit */
  1312. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  1313.         SOMObject* fromObj)
  1314. {
  1315. /*
  1316.  *  A default copy constructor that uses a const volatile fromObj.
  1317.  */
  1318.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultConstVCopyInit)
  1319.     (this,ctrl,fromObj);
  1320. }
  1321.  
  1322.  
  1323. /* method: somDefaultConstAssign */
  1324. SOMMSingleInstance*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  1325.         SOMObject* fromObj)
  1326. {
  1327. /*
  1328.  *  A default assignment operator that uses a const fromObj.
  1329.  */
  1330.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultConstAssign)
  1331.     (this,ctrl,fromObj);
  1332. }
  1333.  
  1334.  
  1335. /* method: somDefaultVAssign */
  1336. SOMMSingleInstance*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  1337.         SOMObject* fromObj)
  1338. {
  1339. /*
  1340.  *  A default assignment operator that uses a volatile fromObj.
  1341.  */
  1342.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultVAssign)
  1343.     (this,ctrl,fromObj);
  1344. }
  1345.  
  1346.  
  1347. /* method: somDefaultConstVAssign */
  1348. SOMMSingleInstance*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  1349.         SOMObject* fromObj)
  1350. {
  1351. /*
  1352.  *  A default assignment operator that uses a const volatile fromObj.
  1353.  */
  1354.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDefaultConstVAssign)
  1355.     (this,ctrl,fromObj);
  1356. }
  1357.  
  1358.  
  1359. /* method: somInit */
  1360. void   somInit()
  1361. {
  1362. /*
  1363.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  1364.  */
  1365.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somInit)
  1366.     (this);
  1367. }
  1368.  
  1369.  
  1370. /* method: somFree */
  1371. void   somFree()
  1372. {
  1373. /*
  1374.  *  Use as directed by framework implementations.
  1375.  */
  1376.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somFree)
  1377.     (this);
  1378. }
  1379.  
  1380.  
  1381. /* method: somUninit */
  1382. void   somUninit()
  1383. {
  1384. /*
  1385.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  1386.  */
  1387.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somUninit)
  1388.     (this);
  1389. }
  1390.  
  1391.  
  1392. /* method: somGetClass */
  1393. SOMClass*   somGetClass()
  1394. {
  1395. /*
  1396.  *  Return the receiver's class.
  1397.  */
  1398.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somGetClass)
  1399.     (this);
  1400. }
  1401.  
  1402.  
  1403. /* method: somGetClassName */
  1404. string   somGetClassName()
  1405. {
  1406. /*
  1407.  *  Return the name of the receiver's class.
  1408.  */
  1409.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somGetClassName)
  1410.     (this);
  1411. }
  1412.  
  1413.  
  1414. /* method: somGetSize */
  1415. long   somGetSize()
  1416. {
  1417. /*
  1418.  *  Return the size of the receiver.
  1419.  */
  1420.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somGetSize)
  1421.     (this);
  1422. }
  1423.  
  1424.  
  1425. /* method: somIsA */
  1426. boolean   somIsA(SOMClass* aClassObj)
  1427. {
  1428. /*
  1429.  *  Returns 1 (true) if the receiver responds to methods
  1430.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  1431.  */
  1432.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somIsA)
  1433.     (this,aClassObj);
  1434. }
  1435.  
  1436.  
  1437. /* method: somIsInstanceOf */
  1438. boolean   somIsInstanceOf(SOMClass* aClassObj)
  1439. {
  1440. /*
  1441.  *  Returns 1 (true) if the receiver is an instance of
  1442.  *  <aClassObj> and 0 (false) otherwise.
  1443.  */
  1444.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somIsInstanceOf)
  1445.     (this,aClassObj);
  1446. }
  1447.  
  1448.  
  1449. /* method: somRespondsTo */
  1450. boolean   somRespondsTo(somId mId)
  1451. {
  1452. /*
  1453.  *  Returns 1 (true) if the indicated method can be invoked
  1454.  *  on the receiver and 0 (false) otherwise.
  1455.  */
  1456.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somRespondsTo)
  1457.     (this,mId);
  1458. }
  1459.  
  1460.  
  1461. /* va_list method: somDispatch */
  1462.  
  1463. /*
  1464.  *  This method provides a generic, class-specific dispatch mechanism.
  1465.  *  It accepts as input <retValue> a pointer to the memory area to be
  1466.  *  loaded with the result of dispatching the method indicated by
  1467.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  1468.  *  on which the method is to be invoked as the first argument.
  1469.  */
  1470. /* the va_list invocation form */
  1471. boolean   SOMMSingleInstance_somDispatch(somToken* retValue, 
  1472.         somId methodId, 
  1473.         va_list ap)
  1474. {return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatch)
  1475.     (this,retValue,methodId,ap);
  1476. }
  1477.  
  1478. /* the varargs invocation form */
  1479. boolean   somDispatch(somToken* retValue, 
  1480.         somId methodId, 
  1481.         ...)
  1482. {
  1483. /*
  1484.  *  This method provides a generic, class-specific dispatch mechanism.
  1485.  *  It accepts as input <retValue> a pointer to the memory area to be
  1486.  *  loaded with the result of dispatching the method indicated by
  1487.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  1488.  *  on which the method is to be invoked as the first argument.
  1489.  */
  1490.    va_list ap;
  1491.    va_start(ap, methodId);
  1492.    boolean __somResult = 
  1493.       SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatch)
  1494.     (this,retValue,methodId,ap);
  1495.    va_end(ap);
  1496.    return __somResult;
  1497. }
  1498.  
  1499.  
  1500. /* va_list method: somClassDispatch */
  1501.  
  1502. /*
  1503.  *  Like somDispatch, but method resolution for static methods is done
  1504.  *  according to the clsObj instance method table.
  1505.  */
  1506. /* the va_list invocation form */
  1507. boolean   SOMMSingleInstance_somClassDispatch(SOMClass* clsObj, 
  1508.         somToken* retValue, 
  1509.         somId methodId, 
  1510.         va_list ap)
  1511. {return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somClassDispatch)
  1512.     (this,clsObj,retValue,methodId,ap);
  1513. }
  1514.  
  1515. /* the varargs invocation form */
  1516. boolean   somClassDispatch(SOMClass* clsObj, 
  1517.         somToken* retValue, 
  1518.         somId methodId, 
  1519.         ...)
  1520. {
  1521. /*
  1522.  *  Like somDispatch, but method resolution for static methods is done
  1523.  *  according to the clsObj instance method table.
  1524.  */
  1525.    va_list ap;
  1526.    va_start(ap, methodId);
  1527.    boolean __somResult = 
  1528.       SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somClassDispatch)
  1529.     (this,clsObj,retValue,methodId,ap);
  1530.    va_end(ap);
  1531.    return __somResult;
  1532. }
  1533.  
  1534.  
  1535. /* method: somCastObj */
  1536. boolean   somCastObj(SOMClass* cls)
  1537. {
  1538. /*
  1539.  *  cast the receiving object to cls (which must be an ancestor of the
  1540.  *  objects true class. Returns true on success.
  1541.  */
  1542.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somCastObj)
  1543.     (this,cls);
  1544. }
  1545.  
  1546.  
  1547. /* method: somResetObj */
  1548. boolean   somResetObj()
  1549. {
  1550. /*
  1551.  *  reset an object to its true class. Returns true always.
  1552.  */
  1553.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somResetObj)
  1554.     (this);
  1555. }
  1556.  
  1557.  
  1558. /* va_list method: somDispatchV */
  1559.  
  1560. /*
  1561.  *  Obsolete. Use somDispatch instead.
  1562.  */
  1563. /* the va_list invocation form */
  1564. void   SOMMSingleInstance_somDispatchV(somId methodId, 
  1565.         somId descriptor, 
  1566.         va_list ap)
  1567. {   SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchV)
  1568.     (this,methodId,descriptor,ap);
  1569. }
  1570.  
  1571. /* the varargs invocation form */
  1572. void   somDispatchV(somId methodId, 
  1573.         somId descriptor, 
  1574.         ...)
  1575. {
  1576. /*
  1577.  *  Obsolete. Use somDispatch instead.
  1578.  */
  1579.    va_list ap;
  1580.    va_start(ap, descriptor);
  1581.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchV)
  1582.     (this,methodId,descriptor,ap);
  1583.    va_end(ap);
  1584. }
  1585.  
  1586.  
  1587. /* va_list method: somDispatchL */
  1588.  
  1589. /*
  1590.  *  Obsolete. Use somDispatch instead.
  1591.  */
  1592. /* the va_list invocation form */
  1593. long   SOMMSingleInstance_somDispatchL(somId methodId, 
  1594.         somId descriptor, 
  1595.         va_list ap)
  1596. {return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchL)
  1597.     (this,methodId,descriptor,ap);
  1598. }
  1599.  
  1600. /* the varargs invocation form */
  1601. long   somDispatchL(somId methodId, 
  1602.         somId descriptor, 
  1603.         ...)
  1604. {
  1605. /*
  1606.  *  Obsolete. Use somDispatch instead.
  1607.  */
  1608.    va_list ap;
  1609.    va_start(ap, descriptor);
  1610.    long __somResult = 
  1611.       SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchL)
  1612.     (this,methodId,descriptor,ap);
  1613.    va_end(ap);
  1614.    return __somResult;
  1615. }
  1616.  
  1617.  
  1618. /* va_list method: somDispatchA */
  1619.  
  1620. /*
  1621.  *  Obsolete. Use somDispatch instead.
  1622.  */
  1623. /* the va_list invocation form */
  1624. void*   SOMMSingleInstance_somDispatchA(somId methodId, 
  1625.         somId descriptor, 
  1626.         va_list ap)
  1627. {return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchA)
  1628.     (this,methodId,descriptor,ap);
  1629. }
  1630.  
  1631. /* the varargs invocation form */
  1632. void*   somDispatchA(somId methodId, 
  1633.         somId descriptor, 
  1634.         ...)
  1635. {
  1636. /*
  1637.  *  Obsolete. Use somDispatch instead.
  1638.  */
  1639.    va_list ap;
  1640.    va_start(ap, descriptor);
  1641.    void* __somResult = 
  1642.       SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchA)
  1643.     (this,methodId,descriptor,ap);
  1644.    va_end(ap);
  1645.    return __somResult;
  1646. }
  1647.  
  1648.  
  1649. /* va_list method: somDispatchD */
  1650.  
  1651. /*
  1652.  *  Obsolete. Use somDispatch instead.
  1653.  */
  1654. /* the va_list invocation form */
  1655. double   SOMMSingleInstance_somDispatchD(somId methodId, 
  1656.         somId descriptor, 
  1657.         va_list ap)
  1658. {return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchD)
  1659.     (this,methodId,descriptor,ap);
  1660. }
  1661.  
  1662. /* the varargs invocation form */
  1663. double   somDispatchD(somId methodId, 
  1664.         somId descriptor, 
  1665.         ...)
  1666. {
  1667. /*
  1668.  *  Obsolete. Use somDispatch instead.
  1669.  */
  1670.    va_list ap;
  1671.    va_start(ap, descriptor);
  1672.    double __somResult = 
  1673.       SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDispatchD)
  1674.     (this,methodId,descriptor,ap);
  1675.    va_end(ap);
  1676.    return __somResult;
  1677. }
  1678.  
  1679.  
  1680. /* method: somPrintSelf */
  1681. SOMObject*   somPrintSelf()
  1682. {
  1683. /*
  1684.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  1685.  *  information about this object.  The default implementation just gives
  1686.  *  the object's class name and its address in memory.
  1687.  *  <self> is returned.
  1688.  */
  1689.    return SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somPrintSelf)
  1690.     (this);
  1691. }
  1692.  
  1693.  
  1694. /* method: somDumpSelf */
  1695. void   somDumpSelf(long level)
  1696. {
  1697. /*
  1698.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  1699.  *  and its current state.
  1700.  * 
  1701.  *  <level> indicates the nesting level for describing compound objects
  1702.  *  it must be greater than or equal to zero.  All lines in the
  1703.  *  description will be preceeded by <2*level> spaces.
  1704.  * 
  1705.  *  This routine only actually writes the data that concerns the object
  1706.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  1707.  *  the object's current state.  This approach allows readable
  1708.  *  descriptions of compound objects to be constructed.
  1709.  * 
  1710.  *  Generally it is not necessary to override this method, if it is
  1711.  *  overriden it generally must be completely replaced.
  1712.  */
  1713.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDumpSelf)
  1714.     (this,level);
  1715. }
  1716.  
  1717.  
  1718. /* method: somDumpSelfInt */
  1719. void   somDumpSelfInt(long level)
  1720. {
  1721. /*
  1722.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  1723.  *  Generally this method will need to be overridden.  When overriding
  1724.  *  it, begin by calling the parent class form of this method and then
  1725.  *  write in a description of your class's instance data. This will
  1726.  *  result in a description of all the object's instance data going
  1727.  *  from its root ancestor class to its specific class.
  1728.  */
  1729.    SOM_ResolveD(this,SOMMSingleInstance,SOMObject,somDumpSelfInt)
  1730.     (this,level);
  1731. }
  1732.  
  1733.  
  1734.  
  1735. };   /* SOMMSingleInstance */
  1736.  
  1737.  
  1738.  
  1739. #endif       /* SOM_SOMMSingleInstance_xh */
  1740.