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

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: linear.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *    COMPONENT_NAME: somr
  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_SOMRLinearizable_xh
  26. #define SOM_SOMRLinearizable_xh
  27.  
  28. class SOMRLinearizable;
  29.  
  30. /*
  31.  * This is a mixin class which defines the property "linearizable".
  32.  * Any object that supports the two methods "somrGetState" and
  33.  * "somrSetState" is linearizable.  This is an abstract base class
  34.  * and hence any derived class MUST OVERRIDE these two methods.
  35.  */
  36.  
  37. #define SOMRLinearizable_MajorVersion 2
  38. #define SOMRLinearizable_MinorVersion 1
  39.  
  40. /* C++ SOM defs */
  41. #include <somcls.xh>
  42. #include <somcm.xh>
  43.  
  44. /* C++ parent defs */
  45. #ifndef SOM_SOMObject_xh
  46. #include <somobj.xh>
  47. #endif
  48.  
  49. #ifndef SOMRLinearizable_API
  50. #define SOMRLinearizable_API
  51. /*
  52.  * -- The Class API
  53.  */
  54.  
  55. /*
  56.  * Start of bindings for IDL types
  57.  */
  58.  
  59. class SOMClass;
  60. class SOMObject;
  61.  
  62. /*
  63.  * End of bindings for IDL types.
  64.  */
  65.  
  66. /* A procedure to create the SOMRLinearizable Class */
  67. SOMEXTERN SOMClass * SOMLINK SOMRLinearizableNewClass(
  68.         integer4 majorVersion,
  69.         integer4 minorVersion);
  70.  
  71. /* The API to the SOMRLinearizable class object, and the methods it introduces. */
  72. SOMEXTERN struct SOMRLinearizableClassDataStructure {
  73.     SOMClass *classObject;
  74.     somMToken somrGetState;
  75.     somMToken somrSetState;
  76. } SOMDLINK SOMRLinearizableClassData;
  77. #define _SOMRLinearizable SOMRLinearizableClassData.classObject
  78.  
  79. /* The API to parentMtabs for SOMRLinearizable, and the instance data it introduces. */
  80. SOMEXTERN struct SOMRLinearizableCClassDataStructure {
  81.     somMethodTabs parentMtab;
  82.     somDToken              instanceDataToken;
  83. } SOMDLINK SOMRLinearizableCClassData;
  84.  
  85. /*
  86.  * -- Typedefs for SOMRLinearizable Method Procedures
  87.  */
  88. SOMEXTERN {
  89. typedef void   SOMLINK somTP_SOMRLinearizable_somrGetState(SOMRLinearizable *somSelf, Environment *ev, 
  90.         string* buf);
  91. typedef somTP_SOMRLinearizable_somrGetState *somTD_SOMRLinearizable_somrGetState;
  92. typedef void   SOMLINK somTP_SOMRLinearizable_somrSetState(SOMRLinearizable *somSelf, Environment *ev, 
  93.         string buf);
  94. typedef somTP_SOMRLinearizable_somrSetState *somTD_SOMRLinearizable_somrSetState;
  95.  
  96. /*
  97.  * -- Typedefs for Reintroduced Wrapper Methods
  98.  */
  99. typedef void   SOMLINK somTP_SOMRLinearizable_somDefaultInit(SOMRLinearizable *somSelf, 
  100.         som3InitCtrl* ctrl);
  101. typedef somTP_SOMRLinearizable_somDefaultInit *somTD_SOMRLinearizable_somDefaultInit;
  102. typedef void   SOMLINK somTP_SOMRLinearizable_somDestruct(SOMRLinearizable *somSelf, 
  103.         octet doFree, 
  104.         som3DestructCtrl* ctrl);
  105. typedef somTP_SOMRLinearizable_somDestruct *somTD_SOMRLinearizable_somDestruct;
  106. typedef void   SOMLINK somTP_SOMRLinearizable_somDefaultCopyInit(SOMRLinearizable *somSelf, 
  107.         som3InitCtrl* ctrl, 
  108.         SOMObject* fromObj);
  109. typedef somTP_SOMRLinearizable_somDefaultCopyInit *somTD_SOMRLinearizable_somDefaultCopyInit;
  110. typedef SOMRLinearizable*   SOMLINK somTP_SOMRLinearizable_somDefaultAssign(SOMRLinearizable *somSelf, 
  111.         som3AssignCtrl* ctrl, 
  112.         SOMObject* fromObj);
  113. typedef somTP_SOMRLinearizable_somDefaultAssign *somTD_SOMRLinearizable_somDefaultAssign;
  114. typedef void   SOMLINK somTP_SOMRLinearizable_somDefaultConstCopyInit(SOMRLinearizable *somSelf, 
  115.         som3InitCtrl* ctrl, 
  116.         SOMObject* fromObj);
  117. typedef somTP_SOMRLinearizable_somDefaultConstCopyInit *somTD_SOMRLinearizable_somDefaultConstCopyInit;
  118. typedef void   SOMLINK somTP_SOMRLinearizable_somDefaultVCopyInit(SOMRLinearizable *somSelf, 
  119.         som3InitCtrl* ctrl, 
  120.         SOMObject* fromObj);
  121. typedef somTP_SOMRLinearizable_somDefaultVCopyInit *somTD_SOMRLinearizable_somDefaultVCopyInit;
  122. typedef void   SOMLINK somTP_SOMRLinearizable_somDefaultConstVCopyInit(SOMRLinearizable *somSelf, 
  123.         som3InitCtrl* ctrl, 
  124.         SOMObject* fromObj);
  125. typedef somTP_SOMRLinearizable_somDefaultConstVCopyInit *somTD_SOMRLinearizable_somDefaultConstVCopyInit;
  126. typedef SOMRLinearizable*   SOMLINK somTP_SOMRLinearizable_somDefaultConstAssign(SOMRLinearizable *somSelf, 
  127.         som3AssignCtrl* ctrl, 
  128.         SOMObject* fromObj);
  129. typedef somTP_SOMRLinearizable_somDefaultConstAssign *somTD_SOMRLinearizable_somDefaultConstAssign;
  130. typedef SOMRLinearizable*   SOMLINK somTP_SOMRLinearizable_somDefaultVAssign(SOMRLinearizable *somSelf, 
  131.         som3AssignCtrl* ctrl, 
  132.         SOMObject* fromObj);
  133. typedef somTP_SOMRLinearizable_somDefaultVAssign *somTD_SOMRLinearizable_somDefaultVAssign;
  134. typedef SOMRLinearizable*   SOMLINK somTP_SOMRLinearizable_somDefaultConstVAssign(SOMRLinearizable *somSelf, 
  135.         som3AssignCtrl* ctrl, 
  136.         SOMObject* fromObj);
  137. typedef somTP_SOMRLinearizable_somDefaultConstVAssign *somTD_SOMRLinearizable_somDefaultConstVAssign;
  138. typedef void   SOMLINK somTP_SOMRLinearizable_somInit(SOMRLinearizable *somSelf);
  139. typedef somTP_SOMRLinearizable_somInit *somTD_SOMRLinearizable_somInit;
  140. typedef void   SOMLINK somTP_SOMRLinearizable_somFree(SOMRLinearizable *somSelf);
  141. typedef somTP_SOMRLinearizable_somFree *somTD_SOMRLinearizable_somFree;
  142. typedef void   SOMLINK somTP_SOMRLinearizable_somUninit(SOMRLinearizable *somSelf);
  143. typedef somTP_SOMRLinearizable_somUninit *somTD_SOMRLinearizable_somUninit;
  144. typedef SOMClass*   SOMLINK somTP_SOMRLinearizable_somGetClass(SOMRLinearizable *somSelf);
  145. typedef somTP_SOMRLinearizable_somGetClass *somTD_SOMRLinearizable_somGetClass;
  146. typedef string   SOMLINK somTP_SOMRLinearizable_somGetClassName(SOMRLinearizable *somSelf);
  147. typedef somTP_SOMRLinearizable_somGetClassName *somTD_SOMRLinearizable_somGetClassName;
  148. typedef long   SOMLINK somTP_SOMRLinearizable_somGetSize(SOMRLinearizable *somSelf);
  149. typedef somTP_SOMRLinearizable_somGetSize *somTD_SOMRLinearizable_somGetSize;
  150. typedef boolean   SOMLINK somTP_SOMRLinearizable_somIsA(SOMRLinearizable *somSelf, 
  151.         SOMClass* aClassObj);
  152. typedef somTP_SOMRLinearizable_somIsA *somTD_SOMRLinearizable_somIsA;
  153. typedef boolean   SOMLINK somTP_SOMRLinearizable_somIsInstanceOf(SOMRLinearizable *somSelf, 
  154.         SOMClass* aClassObj);
  155. typedef somTP_SOMRLinearizable_somIsInstanceOf *somTD_SOMRLinearizable_somIsInstanceOf;
  156. typedef boolean   SOMLINK somTP_SOMRLinearizable_somRespondsTo(SOMRLinearizable *somSelf, 
  157.         somId mId);
  158. typedef somTP_SOMRLinearizable_somRespondsTo *somTD_SOMRLinearizable_somRespondsTo;
  159. typedef boolean   SOMLINK somTP_SOMRLinearizable_somDispatch(SOMRLinearizable *somSelf, 
  160.         somToken* retValue, 
  161.         somId methodId, 
  162.         va_list ap);
  163. typedef somTP_SOMRLinearizable_somDispatch *somTD_SOMRLinearizable_somDispatch;
  164. typedef boolean   SOMLINK somTP_SOMRLinearizable_somClassDispatch(SOMRLinearizable *somSelf, 
  165.         SOMClass* clsObj, 
  166.         somToken* retValue, 
  167.         somId methodId, 
  168.         va_list ap);
  169. typedef somTP_SOMRLinearizable_somClassDispatch *somTD_SOMRLinearizable_somClassDispatch;
  170. typedef boolean   SOMLINK somTP_SOMRLinearizable_somCastObj(SOMRLinearizable *somSelf, 
  171.         SOMClass* cls);
  172. typedef somTP_SOMRLinearizable_somCastObj *somTD_SOMRLinearizable_somCastObj;
  173. typedef boolean   SOMLINK somTP_SOMRLinearizable_somResetObj(SOMRLinearizable *somSelf);
  174. typedef somTP_SOMRLinearizable_somResetObj *somTD_SOMRLinearizable_somResetObj;
  175. typedef void   SOMLINK somTP_SOMRLinearizable_somDispatchV(SOMRLinearizable *somSelf, 
  176.         somId methodId, 
  177.         somId descriptor, 
  178.         va_list ap);
  179. typedef somTP_SOMRLinearizable_somDispatchV *somTD_SOMRLinearizable_somDispatchV;
  180. typedef long   SOMLINK somTP_SOMRLinearizable_somDispatchL(SOMRLinearizable *somSelf, 
  181.         somId methodId, 
  182.         somId descriptor, 
  183.         va_list ap);
  184. typedef somTP_SOMRLinearizable_somDispatchL *somTD_SOMRLinearizable_somDispatchL;
  185. typedef void*   SOMLINK somTP_SOMRLinearizable_somDispatchA(SOMRLinearizable *somSelf, 
  186.         somId methodId, 
  187.         somId descriptor, 
  188.         va_list ap);
  189. typedef somTP_SOMRLinearizable_somDispatchA *somTD_SOMRLinearizable_somDispatchA;
  190. typedef double   SOMLINK somTP_SOMRLinearizable_somDispatchD(SOMRLinearizable *somSelf, 
  191.         somId methodId, 
  192.         somId descriptor, 
  193.         va_list ap);
  194. typedef somTP_SOMRLinearizable_somDispatchD *somTD_SOMRLinearizable_somDispatchD;
  195. typedef SOMObject*   SOMLINK somTP_SOMRLinearizable_somPrintSelf(SOMRLinearizable *somSelf);
  196. typedef somTP_SOMRLinearizable_somPrintSelf *somTD_SOMRLinearizable_somPrintSelf;
  197. typedef void   SOMLINK somTP_SOMRLinearizable_somDumpSelf(SOMRLinearizable *somSelf, 
  198.         long level);
  199. typedef somTP_SOMRLinearizable_somDumpSelf *somTD_SOMRLinearizable_somDumpSelf;
  200. typedef void   SOMLINK somTP_SOMRLinearizable_somDumpSelfInt(SOMRLinearizable *somSelf, 
  201.         long level);
  202. typedef somTP_SOMRLinearizable_somDumpSelfInt *somTD_SOMRLinearizable_somDumpSelfInt;
  203. }
  204.  
  205. #endif /* SOMRLinearizable_API */
  206.  
  207.  
  208. /*
  209.  * -- This emitter treats Method Tokens as Thunks by default.
  210.  * -- Use the sc modifier "nothunks" to change this default
  211.  */
  212. #undef somresolve_
  213. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  214.  
  215. /*
  216.  * -- The C++ Wrapper Class for SOMRLinearizable
  217.  */
  218. class SOMRLinearizable : public SOMObject
  219. {
  220. /*
  221.  * This is a mixin class which defines the property "linearizable".
  222.  * Any object that supports the two methods "somrGetState" and
  223.  * "somrSetState" is linearizable.  This is an abstract base class
  224.  * and hence any derived class MUST OVERRIDE these two methods.
  225.  */
  226. public:
  227.  
  228. // SOMRLinearizable::new creates the class object if necessary, and then uses somNewNoInit
  229. // to allocate memory and create the object. Initialization is in ctors.
  230. void *operator new(size_t)
  231. {
  232.    if (!_SOMRLinearizable) SOMRLinearizableNewClass(SOMRLinearizable_MajorVersion,SOMRLinearizable_MinorVersion);
  233.    return (void*)
  234.       SOM_Resolve(_SOMRLinearizable,SOMClass,somNewNoInit)
  235.          ((SOMClass *)((void*)_SOMRLinearizable));
  236. }
  237.  
  238. // SOMRLinearizable::delete uses somDestruct.
  239. void operator delete(void * obj)
  240. {
  241.    if (obj && *(void**)obj) {
  242.       SOM_Resolve(obj,SOMObject,somFree)
  243.          ((SOMObject*)obj);
  244.    }
  245. }
  246.  
  247. SOMRLinearizable& operator=(SOMRLinearizable& fromObj)
  248. {
  249.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  250.    return *this;
  251. }
  252.  
  253. SOMRLinearizable()
  254. {
  255.    if (*(void**)this != 
  256.        ((somParentMtabStructPtr)
  257.         (SOMRLinearizableCClassData.parentMtab))->mtab)
  258.       return;
  259.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  260. }
  261.  
  262. SOMRLinearizable(SOMRLinearizable* fromObj)
  263. {
  264.    if (*(void**)this != 
  265.        ((somParentMtabStructPtr)
  266.         (SOMRLinearizableCClassData.parentMtab))->mtab)
  267.       return;
  268.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  269. }
  270.  
  271. #ifdef __IBMCPP__
  272. #pragma info(nocnv,nopar)
  273. #endif
  274. SOMRLinearizable(const SOMRLinearizable* fromObj)
  275. {
  276.    if (*(void**)this != 
  277.        ((somParentMtabStructPtr)
  278.         (SOMRLinearizableCClassData.parentMtab))->mtab)
  279.       return;
  280.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  281. }
  282. #ifdef __IBMCPP__
  283. #pragma info(restore)
  284. #endif
  285.  
  286.  
  287. /* method: somrGetState */
  288. void   somrGetState(Environment *ev, 
  289.         string* buf)
  290. {
  291. /*
  292.  *  Converts its internal state into a linear string and returns a
  293.  *  pointer to the string (the length of the string is in the
  294.  *  first sizeof(int) bytes of this string).   The implementer of this
  295.  *  method should allocate the necessary memory for the string.
  296.  *  The OWNERSHIP of this string is transferred to the caller of this method.
  297.  */
  298.    SOM_ResolveD(this,SOMRLinearizable,SOMRLinearizable,somrGetState)
  299.     (this, ev,buf);
  300. }
  301.  
  302.  
  303. /* method: somrSetState */
  304. void   somrSetState(Environment *ev, 
  305.         string buf)
  306. {
  307. /*
  308.  *  The reverse of Get State. It converts the given linear string into
  309.  *  its internal state.  The ownership of buf stays with the caller.
  310.  */
  311.    SOM_ResolveD(this,SOMRLinearizable,SOMRLinearizable,somrSetState)
  312.     (this, ev,buf);
  313. }
  314.  
  315.  
  316. /*
  317.  * Reintroduce inherited methods
  318.  */
  319.  
  320. /* initializer method: somDefaultInit */
  321. void   somDefaultInit(som3InitCtrl* ctrl)
  322. {
  323. /*
  324.  *  A default initializer for a SOM object. Passing a null ctrl
  325.  *  indicates to the receiver that its class is the class of the
  326.  *  object being initialized, whereby the initializer will determine
  327.  *  an appropriate control structure.
  328.  */
  329.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultInit)
  330.     (this,ctrl);
  331. }
  332.  
  333.  
  334. /* method: somDestruct */
  335. void   somDestruct(octet doFree, 
  336.         som3DestructCtrl* ctrl)
  337. {
  338. /*
  339.  *  The default destructor for a SOM object. A nonzero <doFree>
  340.  *  indicates that the object storage should be freed by the
  341.  *  object's class (via somDeallocate) after uninitialization.
  342.  *  As with somDefaultInit, a null ctrl can be passed.
  343.  */
  344.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDestruct)
  345.     (this,doFree,ctrl);
  346. }
  347.  
  348.  
  349. /* initializer method: somDefaultCopyInit */
  350. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  351.         SOMObject* fromObj)
  352. {
  353. /*
  354.  *  A default copy constructor. Use this to make copies of objects for
  355.  *  calling methods with "by-value" argument semantics.
  356.  */
  357.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultCopyInit)
  358.     (this,ctrl,fromObj);
  359. }
  360.  
  361.  
  362. /* method: somDefaultAssign */
  363. SOMRLinearizable*  somDefaultAssign(som3AssignCtrl* ctrl, 
  364.         SOMObject* fromObj)
  365. {
  366. /*
  367.  *  A default assignment operator. Use this to "assign" the state of one
  368.  *  object to another.
  369.  */
  370.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultAssign)
  371.     (this,ctrl,fromObj);
  372. }
  373.  
  374.  
  375. /* initializer method: somDefaultConstCopyInit */
  376. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  377.         SOMObject* fromObj)
  378. {
  379. /*
  380.  *  A default copy constructor that uses a const fromObj.
  381.  */
  382.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultConstCopyInit)
  383.     (this,ctrl,fromObj);
  384. }
  385.  
  386.  
  387. /* initializer method: somDefaultVCopyInit */
  388. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  389.         SOMObject* fromObj)
  390. {
  391. /*
  392.  *  A default copy constructor that uses a volatile fromObj.
  393.  */
  394.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultVCopyInit)
  395.     (this,ctrl,fromObj);
  396. }
  397.  
  398.  
  399. /* initializer method: somDefaultConstVCopyInit */
  400. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  401.         SOMObject* fromObj)
  402. {
  403. /*
  404.  *  A default copy constructor that uses a const volatile fromObj.
  405.  */
  406.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultConstVCopyInit)
  407.     (this,ctrl,fromObj);
  408. }
  409.  
  410.  
  411. /* method: somDefaultConstAssign */
  412. SOMRLinearizable*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  413.         SOMObject* fromObj)
  414. {
  415. /*
  416.  *  A default assignment operator that uses a const fromObj.
  417.  */
  418.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultConstAssign)
  419.     (this,ctrl,fromObj);
  420. }
  421.  
  422.  
  423. /* method: somDefaultVAssign */
  424. SOMRLinearizable*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  425.         SOMObject* fromObj)
  426. {
  427. /*
  428.  *  A default assignment operator that uses a volatile fromObj.
  429.  */
  430.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultVAssign)
  431.     (this,ctrl,fromObj);
  432. }
  433.  
  434.  
  435. /* method: somDefaultConstVAssign */
  436. SOMRLinearizable*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  437.         SOMObject* fromObj)
  438. {
  439. /*
  440.  *  A default assignment operator that uses a const volatile fromObj.
  441.  */
  442.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDefaultConstVAssign)
  443.     (this,ctrl,fromObj);
  444. }
  445.  
  446.  
  447. /* method: somInit */
  448. void   somInit()
  449. {
  450. /*
  451.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  452.  */
  453.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somInit)
  454.     (this);
  455. }
  456.  
  457.  
  458. /* method: somFree */
  459. void   somFree()
  460. {
  461. /*
  462.  *  Use as directed by framework implementations.
  463.  */
  464.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somFree)
  465.     (this);
  466. }
  467.  
  468.  
  469. /* method: somUninit */
  470. void   somUninit()
  471. {
  472. /*
  473.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  474.  */
  475.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somUninit)
  476.     (this);
  477. }
  478.  
  479.  
  480. /* method: somGetClass */
  481. SOMClass*   somGetClass()
  482. {
  483. /*
  484.  *  Return the receiver's class.
  485.  */
  486.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somGetClass)
  487.     (this);
  488. }
  489.  
  490.  
  491. /* method: somGetClassName */
  492. string   somGetClassName()
  493. {
  494. /*
  495.  *  Return the name of the receiver's class.
  496.  */
  497.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somGetClassName)
  498.     (this);
  499. }
  500.  
  501.  
  502. /* method: somGetSize */
  503. long   somGetSize()
  504. {
  505. /*
  506.  *  Return the size of the receiver.
  507.  */
  508.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somGetSize)
  509.     (this);
  510. }
  511.  
  512.  
  513. /* method: somIsA */
  514. boolean   somIsA(SOMClass* aClassObj)
  515. {
  516. /*
  517.  *  Returns 1 (true) if the receiver responds to methods
  518.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  519.  */
  520.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somIsA)
  521.     (this,aClassObj);
  522. }
  523.  
  524.  
  525. /* method: somIsInstanceOf */
  526. boolean   somIsInstanceOf(SOMClass* aClassObj)
  527. {
  528. /*
  529.  *  Returns 1 (true) if the receiver is an instance of
  530.  *  <aClassObj> and 0 (false) otherwise.
  531.  */
  532.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somIsInstanceOf)
  533.     (this,aClassObj);
  534. }
  535.  
  536.  
  537. /* method: somRespondsTo */
  538. boolean   somRespondsTo(somId mId)
  539. {
  540. /*
  541.  *  Returns 1 (true) if the indicated method can be invoked
  542.  *  on the receiver and 0 (false) otherwise.
  543.  */
  544.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somRespondsTo)
  545.     (this,mId);
  546. }
  547.  
  548.  
  549. /* va_list method: somDispatch */
  550.  
  551. /*
  552.  *  This method provides a generic, class-specific dispatch mechanism.
  553.  *  It accepts as input <retValue> a pointer to the memory area to be
  554.  *  loaded with the result of dispatching the method indicated by
  555.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  556.  *  on which the method is to be invoked as the first argument.
  557.  */
  558. /* the va_list invocation form */
  559. boolean   SOMRLinearizable_somDispatch(somToken* retValue, 
  560.         somId methodId, 
  561.         va_list ap)
  562. {return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatch)
  563.     (this,retValue,methodId,ap);
  564. }
  565.  
  566. /* the varargs invocation form */
  567. boolean   somDispatch(somToken* retValue, 
  568.         somId methodId, 
  569.         ...)
  570. {
  571. /*
  572.  *  This method provides a generic, class-specific dispatch mechanism.
  573.  *  It accepts as input <retValue> a pointer to the memory area to be
  574.  *  loaded with the result of dispatching the method indicated by
  575.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  576.  *  on which the method is to be invoked as the first argument.
  577.  */
  578.    va_list ap;
  579.    va_start(ap, methodId);
  580.    boolean __somResult = 
  581.       SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatch)
  582.     (this,retValue,methodId,ap);
  583.    va_end(ap);
  584.    return __somResult;
  585. }
  586.  
  587.  
  588. /* va_list method: somClassDispatch */
  589.  
  590. /*
  591.  *  Like somDispatch, but method resolution for static methods is done
  592.  *  according to the clsObj instance method table.
  593.  */
  594. /* the va_list invocation form */
  595. boolean   SOMRLinearizable_somClassDispatch(SOMClass* clsObj, 
  596.         somToken* retValue, 
  597.         somId methodId, 
  598.         va_list ap)
  599. {return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somClassDispatch)
  600.     (this,clsObj,retValue,methodId,ap);
  601. }
  602.  
  603. /* the varargs invocation form */
  604. boolean   somClassDispatch(SOMClass* clsObj, 
  605.         somToken* retValue, 
  606.         somId methodId, 
  607.         ...)
  608. {
  609. /*
  610.  *  Like somDispatch, but method resolution for static methods is done
  611.  *  according to the clsObj instance method table.
  612.  */
  613.    va_list ap;
  614.    va_start(ap, methodId);
  615.    boolean __somResult = 
  616.       SOM_ResolveD(this,SOMRLinearizable,SOMObject,somClassDispatch)
  617.     (this,clsObj,retValue,methodId,ap);
  618.    va_end(ap);
  619.    return __somResult;
  620. }
  621.  
  622.  
  623. /* method: somCastObj */
  624. boolean   somCastObj(SOMClass* cls)
  625. {
  626. /*
  627.  *  cast the receiving object to cls (which must be an ancestor of the
  628.  *  objects true class. Returns true on success.
  629.  */
  630.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somCastObj)
  631.     (this,cls);
  632. }
  633.  
  634.  
  635. /* method: somResetObj */
  636. boolean   somResetObj()
  637. {
  638. /*
  639.  *  reset an object to its true class. Returns true always.
  640.  */
  641.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somResetObj)
  642.     (this);
  643. }
  644.  
  645.  
  646. /* va_list method: somDispatchV */
  647.  
  648. /*
  649.  *  Obsolete. Use somDispatch instead.
  650.  */
  651. /* the va_list invocation form */
  652. void   SOMRLinearizable_somDispatchV(somId methodId, 
  653.         somId descriptor, 
  654.         va_list ap)
  655. {   SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchV)
  656.     (this,methodId,descriptor,ap);
  657. }
  658.  
  659. /* the varargs invocation form */
  660. void   somDispatchV(somId methodId, 
  661.         somId descriptor, 
  662.         ...)
  663. {
  664. /*
  665.  *  Obsolete. Use somDispatch instead.
  666.  */
  667.    va_list ap;
  668.    va_start(ap, descriptor);
  669.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchV)
  670.     (this,methodId,descriptor,ap);
  671.    va_end(ap);
  672. }
  673.  
  674.  
  675. /* va_list method: somDispatchL */
  676.  
  677. /*
  678.  *  Obsolete. Use somDispatch instead.
  679.  */
  680. /* the va_list invocation form */
  681. long   SOMRLinearizable_somDispatchL(somId methodId, 
  682.         somId descriptor, 
  683.         va_list ap)
  684. {return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchL)
  685.     (this,methodId,descriptor,ap);
  686. }
  687.  
  688. /* the varargs invocation form */
  689. long   somDispatchL(somId methodId, 
  690.         somId descriptor, 
  691.         ...)
  692. {
  693. /*
  694.  *  Obsolete. Use somDispatch instead.
  695.  */
  696.    va_list ap;
  697.    va_start(ap, descriptor);
  698.    long __somResult = 
  699.       SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchL)
  700.     (this,methodId,descriptor,ap);
  701.    va_end(ap);
  702.    return __somResult;
  703. }
  704.  
  705.  
  706. /* va_list method: somDispatchA */
  707.  
  708. /*
  709.  *  Obsolete. Use somDispatch instead.
  710.  */
  711. /* the va_list invocation form */
  712. void*   SOMRLinearizable_somDispatchA(somId methodId, 
  713.         somId descriptor, 
  714.         va_list ap)
  715. {return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchA)
  716.     (this,methodId,descriptor,ap);
  717. }
  718.  
  719. /* the varargs invocation form */
  720. void*   somDispatchA(somId methodId, 
  721.         somId descriptor, 
  722.         ...)
  723. {
  724. /*
  725.  *  Obsolete. Use somDispatch instead.
  726.  */
  727.    va_list ap;
  728.    va_start(ap, descriptor);
  729.    void* __somResult = 
  730.       SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchA)
  731.     (this,methodId,descriptor,ap);
  732.    va_end(ap);
  733.    return __somResult;
  734. }
  735.  
  736.  
  737. /* va_list method: somDispatchD */
  738.  
  739. /*
  740.  *  Obsolete. Use somDispatch instead.
  741.  */
  742. /* the va_list invocation form */
  743. double   SOMRLinearizable_somDispatchD(somId methodId, 
  744.         somId descriptor, 
  745.         va_list ap)
  746. {return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchD)
  747.     (this,methodId,descriptor,ap);
  748. }
  749.  
  750. /* the varargs invocation form */
  751. double   somDispatchD(somId methodId, 
  752.         somId descriptor, 
  753.         ...)
  754. {
  755. /*
  756.  *  Obsolete. Use somDispatch instead.
  757.  */
  758.    va_list ap;
  759.    va_start(ap, descriptor);
  760.    double __somResult = 
  761.       SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDispatchD)
  762.     (this,methodId,descriptor,ap);
  763.    va_end(ap);
  764.    return __somResult;
  765. }
  766.  
  767.  
  768. /* method: somPrintSelf */
  769. SOMObject*   somPrintSelf()
  770. {
  771. /*
  772.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  773.  *  information about this object.  The default implementation just gives
  774.  *  the object's class name and its address in memory.
  775.  *  <self> is returned.
  776.  */
  777.    return SOM_ResolveD(this,SOMRLinearizable,SOMObject,somPrintSelf)
  778.     (this);
  779. }
  780.  
  781.  
  782. /* method: somDumpSelf */
  783. void   somDumpSelf(long level)
  784. {
  785. /*
  786.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  787.  *  and its current state.
  788.  * 
  789.  *  <level> indicates the nesting level for describing compound objects
  790.  *  it must be greater than or equal to zero.  All lines in the
  791.  *  description will be preceeded by <2*level> spaces.
  792.  * 
  793.  *  This routine only actually writes the data that concerns the object
  794.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  795.  *  the object's current state.  This approach allows readable
  796.  *  descriptions of compound objects to be constructed.
  797.  * 
  798.  *  Generally it is not necessary to override this method, if it is
  799.  *  overriden it generally must be completely replaced.
  800.  */
  801.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDumpSelf)
  802.     (this,level);
  803. }
  804.  
  805.  
  806. /* method: somDumpSelfInt */
  807. void   somDumpSelfInt(long level)
  808. {
  809. /*
  810.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  811.  *  Generally this method will need to be overridden.  When overriding
  812.  *  it, begin by calling the parent class form of this method and then
  813.  *  write in a description of your class's instance data. This will
  814.  *  result in a description of all the object's instance data going
  815.  *  from its root ancestor class to its specific class.
  816.  */
  817.    SOM_ResolveD(this,SOMRLinearizable,SOMObject,somDumpSelfInt)
  818.     (this,level);
  819. }
  820.  
  821.  
  822.  
  823. };   /* SOMRLinearizable */
  824.  
  825.  
  826.  
  827. #endif       /* SOM_SOMRLinearizable_xh */
  828.