home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / toolkt21 / cplus / os2h / somcls.xh < prev    next >
Encoding:
Text File  |  1993-05-02  |  20.6 KB  |  659 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: somcls.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitxh: 1.11
  8.  */
  9.  
  10. /*
  11.  *  SOMClass: System Object Model base metaclass
  12.  *  Copyright (c) International Business Machines Corporation
  13.  *                1991, 1992
  14.  */
  15.  
  16. #ifndef somcls_xh
  17. #define somcls_xh
  18. class SOMClass;
  19.  
  20. /*
  21.  *  This is the SOM metaclass.  That is, the instances of this class
  22.  *  are class objects.  When the SOM environment is created one
  23.  *  instance of this class with the external name
  24.  *  <SOMClassClassData.classObject> is created. This class object is
  25.  *  unique in that it is its own class object.  That is,
  26.  *  _SOMClass == _somGetClass(SOMClassClassData.classObject).
  27.  *  SOMClass can be subclassed just like any SOM class. The subclasses
  28.  *  of SOMClass are new metaclasses and can generate class objects with
  29.  *  different implementations than those produced by _SOMClass.
  30.  */
  31.  
  32. #define SOMClass_MajorVersion 1
  33. #define SOMClass_MinorVersion 1
  34.  
  35. /* C++ som defs */
  36. #include <som.xh>
  37.  
  38. /* C++ parent def */
  39. #ifndef somobj_xh
  40. #include <somobj.xh>
  41. #endif
  42.  
  43. #ifndef SOMClass_API
  44. #define SOMClass_API
  45. /*
  46.  * The Class API
  47.  */
  48.  
  49. /* A procedure to create the SOMClass Class */
  50. SOMEXTERN SOMClass * SOMLINK SOMClassNewClass(
  51.         integer4 majorVersion,
  52.         integer4 minorVersion);
  53.  
  54. /* A macro to return the SOMClass class object */
  55. #define _SOMClass ((SOMClass*)SOMClassClassData.classObject)
  56.  
  57. /* The static interface to SOMClass and its instances */
  58. SOMEXTERN struct SOMClassClassDataStructure {
  59.     SOMClass *classObject;
  60.     somMToken somNew;
  61.     somMToken somRenew;
  62.     somMToken somInitClass;
  63.     somMToken somClassReady;
  64.     somMToken somGetName;
  65.     somMToken somGetParent;
  66.     somMToken somDescendedFrom;
  67.     somMToken somCheckVersion;
  68.     somMToken somFindMethod;
  69.     somMToken somFindMethodOk;
  70.     somMToken somSupportsMethod;
  71.     somMToken somGetNumMethods;
  72.     somMToken somGetInstanceSize;
  73.     somMToken somGetInstanceOffset;
  74.     somMToken somGetInstancePartSize;
  75.     somMToken somGetMethodIndex;
  76.     somMToken somGetNumStaticMethods;
  77.     somMToken somGetPClsMtab;
  78.     somMToken somGetClassMtab;
  79.     somMToken somAddStaticMethod;
  80.     somMToken somOverrideSMethod;
  81.     somMToken somAddDynamicMethod;
  82.     somMToken somGetMethodOffset;
  83.     somMToken somGetApplyStub;
  84.     somMToken somFindSMethod;
  85.     somMToken somFindSMethodOk;
  86.     somMToken somGetMethodDescriptor;
  87.     somMToken somGetNthMethodInfo;
  88.     somMToken somSetClassData;
  89.     somMToken somGetClassData;
  90.     somMToken somNewNoInit;
  91.     somMToken somRenewNoInit;
  92.     somMToken somGetInstanceToken;
  93.     somMToken somGetMemberToken;
  94.     somMToken somSetMethodDescriptor;
  95.     somMToken somGetMethodData;
  96. } SOMClassClassData;
  97.  
  98. /*
  99.  * -- Typedefs for Procedures that support SOMClass Methods
  100.  */
  101. extern "C" {
  102. typedef somMToken    (SOMLINK *somTD_SOMClass_somAddStaticMethod)(SOMClass *somSelf,INOUT somId methodId,INOUT somId methodDescriptor,IN somMethodProc *method,IN somMethodProc *redispatchStub,IN somMethodProc *applyStub);
  103. typedef void    (SOMLINK *somTD_SOMClass_somClassReady)(SOMClass *somSelf);
  104. typedef void    (SOMLINK *somTD_SOMClass_somInitClass)(SOMClass *somSelf,IN zString className,IN SOMObject *parentClass,IN integer4 instanceSize,IN int maxStaticMethods,IN integer4 majorVersion,IN integer4 minorVersion);
  105. typedef void    (SOMLINK *somTD_SOMClass_somOverrideSMethod)(SOMClass *somSelf,INOUT somId methodId,IN somMethodProc *method);
  106. typedef SOMObject *   (SOMLINK *somTD_SOMClass_somNew)(SOMClass *somSelf);
  107. typedef SOMObject *   (SOMLINK *somTD_SOMClass_somNewNoInit)(SOMClass *somSelf);
  108. typedef SOMObject *   (SOMLINK *somTD_SOMClass_somRenew)(SOMClass *somSelf,IN void *obj);
  109. typedef SOMObject *   (SOMLINK *somTD_SOMClass_somRenewNoInit)(SOMClass *somSelf,IN void *obj);
  110. typedef somMethodProc *   (SOMLINK *somTD_SOMClass_somGetApplyStub)(SOMClass *somSelf,INOUT somId methodId);
  111. typedef somClassDataStructure *   (SOMLINK *somTD_SOMClass_somGetClassData)(SOMClass *somSelf);
  112. typedef somMethodTab *   (SOMLINK *somTD_SOMClass_somGetClassMtab)(SOMClass *somSelf);
  113. typedef somDToken    (SOMLINK *somTD_SOMClass_somGetInstanceToken)(SOMClass *somSelf);
  114. typedef somDToken    (SOMLINK *somTD_SOMClass_somGetMemberToken)(SOMClass *somSelf,integer4 memberOffset,somDToken instanceToken);
  115. typedef integer4    (SOMLINK *somTD_SOMClass_somGetInstanceOffset)(SOMClass *somSelf);
  116. typedef integer4    (SOMLINK *somTD_SOMClass_somGetInstancePartSize)(SOMClass *somSelf);
  117. typedef integer4    (SOMLINK *somTD_SOMClass_somGetInstanceSize)(SOMClass *somSelf);
  118. typedef somId    (SOMLINK *somTD_SOMClass_somGetMethodDescriptor)(SOMClass *somSelf,IN somId methodId);
  119. typedef zString    (SOMLINK *somTD_SOMClass_somGetName)(SOMClass *somSelf);
  120. typedef int    (SOMLINK *somTD_SOMClass_somGetNumMethods)(SOMClass *somSelf);
  121. typedef int    (SOMLINK *somTD_SOMClass_somGetNumStaticMethods)(SOMClass *somSelf);
  122. typedef SOMClass *   (SOMLINK *somTD_SOMClass_somGetParent)(SOMClass *somSelf);
  123. typedef somMethodTab *   (SOMLINK *somTD_SOMClass_somGetPClsMtab)(SOMClass *somSelf);
  124. typedef void    (SOMLINK *somTD_SOMClass_somSetClassData)(SOMClass *somSelf,IN somClassDataStructure *cds);
  125. typedef int    (SOMLINK *somTD_SOMClass_somCheckVersion)(SOMClass *somSelf,IN integer4 majorVersion,IN integer4 minorVersion);
  126. typedef int    (SOMLINK *somTD_SOMClass_somDescendedFrom)(SOMClass *somSelf,IN SOMClass *aClassObj);
  127. typedef int    (SOMLINK *somTD_SOMClass_somSupportsMethod)(SOMClass *somSelf,INOUT somId mId);
  128. typedef int    (SOMLINK *somTD_SOMClass_somFindMethod)(SOMClass *somSelf,INOUT somId methodId,OUT somMethodProc **m);
  129. typedef int    (SOMLINK *somTD_SOMClass_somFindMethodOk)(SOMClass *somSelf,INOUT somId methodId,OUT somMethodProc **m);
  130. typedef somMethodProc *   (SOMLINK *somTD_SOMClass_somFindSMethod)(SOMClass *somSelf,INOUT somId methodId);
  131. typedef somMethodProc *   (SOMLINK *somTD_SOMClass_somFindSMethodOk)(SOMClass *somSelf,INOUT somId methodId);
  132. }
  133.  
  134.  
  135. #endif /* SOMClass_API */
  136.  
  137.  
  138. /*
  139.  * -- The C++ Wrapper Class for SOMClass
  140.  */
  141. class SOMClass : public SOMObject
  142. {
  143. public:
  144.  
  145. void *operator new(size_t size)
  146. {
  147.    (void) size;
  148.    if (!SOMClassClassData.classObject) 
  149.       SOMClassNewClass(SOMClass_MajorVersion,SOMClass_MinorVersion);
  150.    return (void *)
  151.       ((somTD_SOMClass_somNew)
  152.       somResolve(SOM_TestCls((SOMAny *)(SOMClassClassData.classObject),
  153.                              SOMClassClassData.classObject),
  154.                  SOMClassClassData.somNew))
  155.          ((SOMClass*)(SOMClassClassData.classObject));
  156. }
  157.  
  158. void operator delete(void * obj)
  159. {
  160.    ((SOMObject *)obj)->somFree();
  161. }
  162.  
  163. /*
  164.  *  Initialization / Termination / Class construction group
  165.  */
  166.  
  167. /* public method: somAddStaticMethod */
  168.  
  169. /*
  170.  *  Adds/overrides the indicated method, returns the value that
  171.  *  should be used to set the method slot in the class data structure
  172.  *  for this method name.
  173.  * 
  174.  *  <methodDescriptor> is a somId for a string describing the calling
  175.  *  sequence to this method as described in <somcGetNthMethodInfo>
  176.  *  defined in the SOMObject class definition.
  177.  * 
  178.  *  <method> is the actual method procedure for this method
  179.  * 
  180.  *  <redispatchStub> is a procedure with the same calling sequence as
  181.  *  <method> that re-dispatches the method to one of this class's
  182.  *  dispatch functions.
  183.  * 
  184.  *  <applyStub> is a procedure that takes a standard variable argument
  185.  *  list data structure applies it to its target object by calling
  186.  *  <method> with arguments derived from the data structure.  Its
  187.  *  calling sequence is the same as the calling sequence of the
  188.  *  dispatch methods defined in SOMObject.  This stub is used in the
  189.  *  support of the dispatch methods used in some classes.  In classes
  190.  *  where the dispatch functions do not need such a function this
  191.  *  parameter may be null.
  192.  */
  193. somMToken    somAddStaticMethod(INOUT somId methodId,
  194.         INOUT somId methodDescriptor,
  195.         IN somMethodProc *method,
  196.         IN somMethodProc *redispatchStub,
  197.         IN somMethodProc *applyStub)
  198. {
  199.    return (somMToken) SOM_Resolve((SOMAny *)this,SOMClass,somAddStaticMethod)
  200.     (this,methodId,methodDescriptor,method,redispatchStub,applyStub);
  201. }
  202.  
  203.  
  204. /* public method: somClassReady */
  205.  
  206. /*
  207.  *  This method is invoked when all of the static initialization for
  208.  *  the class has been finished.  The default implementation simply
  209.  *  registers the newly constructed class with the SOMClassMgr.
  210.  *  Metaclasses may override this method to augment the class construction
  211.  *  sequence in any way that they wish.
  212.  */
  213. void    somClassReady()
  214. {
  215.    SOM_Resolve((SOMAny *)this,SOMClass,somClassReady)
  216.     (this);
  217. }
  218.  
  219.  
  220. /* public method: somInitClass */
  221.  
  222. /*
  223.  *  Initializes <self>.
  224.  *  <parentClass> is the parent (or parent class) of this class, it may
  225.  *  be NULL in which case it defaults to SOMObject (actually
  226.  *  SOMObjectClassData.classObject the class object for SOMObject).
  227.  *  If a parent class is specifed then it must have already been created
  228.  *  as a pointer to its class object is required.
  229.  * 
  230.  *  <instanceSize> should be just the space needed for this class, it
  231.  *  is not necessary to consider the parent class's (if any) space
  232.  *  requirements.
  233.  * 
  234.  *  <maxStaticMethods> should be just the static methods defined by
  235.  *  this class, it is not necessary to consider the parent class's
  236.  *  methods (if any), even if they are overriden in this class.
  237.  * 
  238.  *  <majorVersion> indicates the major version number for this
  239.  *  implementation of the class definition, and <minorVersion>
  240.  *  indicates the minor version number.
  241.  */
  242. void    somInitClass(IN zString className,
  243.         IN SOMObject *parentClass,
  244.         IN integer4 instanceSize,
  245.         IN int maxStaticMethods,
  246.         IN integer4 majorVersion,
  247.         IN integer4 minorVersion)
  248. {
  249.    SOM_Resolve((SOMAny *)this,SOMClass,somInitClass)
  250.     (this,className,parentClass,instanceSize,maxStaticMethods,majorVersion,minorVersion);
  251. }
  252.  
  253.  
  254. /* public method: somOverrideSMethod */
  255.  
  256. /*
  257.  *  This method can be used instead of <somAddStaticMethod> or
  258.  *  <somAddDynamicMethod> when it is known that the class' parent
  259.  *  class already supports this method.  This call does not require the
  260.  *  method descriptor and stub methods that the others do.
  261.  */
  262. void    somOverrideSMethod(INOUT somId methodId,
  263.         IN somMethodProc *method)
  264. {
  265.    SOM_Resolve((SOMAny *)this,SOMClass,somOverrideSMethod)
  266.     (this,methodId,method);
  267. }
  268.  
  269.  
  270. /*
  271.  *  Instance creation / Constructor group
  272.  */
  273.  
  274. /* public method: somNew */
  275.  
  276. /*
  277.  *  Make an instance of this class.  When applied to _SOMClass, or any
  278.  *  other metaclass object, this will produce a new class object;
  279.  *  when applied to a regular class object, this will produce an
  280.  *  instance of that class.  The somInit method of the newly created
  281.  *  object is then invoked automatically.
  282.  */
  283. SOMObject *   somNew()
  284. {
  285.    return (SOMObject*) SOM_Resolve((SOMAny *)this,SOMClass,somNew)
  286.     (this);
  287. }
  288.  
  289.  
  290. /* public method: somNewNoInit */
  291.  
  292. /*
  293.  *  Equivalent to somNew except that somInit is not automatically invoked.
  294.  */
  295. SOMObject *   somNewNoInit()
  296. {
  297.    return (SOMObject*) SOM_Resolve((SOMAny *)this,SOMClass,somNewNoInit)
  298.     (this);
  299. }
  300.  
  301.  
  302. /* public method: somRenew */
  303.  
  304. /*
  305.  *  Make an instance of this class, but use the space pointed to by
  306.  *  <obj> rather than allocating new space for the object.  Note: no
  307.  *  test is made to insure that <obj> points to enough space.  <obj>
  308.  *  is returned, but it is now a pointer to a valid, initialized,
  309.  *  object (the somInit method of the "renewed" object is invoked
  310.  *  automatically).
  311.  */
  312. SOMObject *   somRenew(IN void *obj)
  313. {
  314.    return (SOMObject*) SOM_Resolve((SOMAny *)this,SOMClass,somRenew)
  315.     (this,obj);
  316. }
  317.  
  318.  
  319. /* public method: somRenewNoInit */
  320.  
  321. /*
  322.  *  Equivalent to somRenew except that somInit is not automatically invoked.
  323.  */
  324. SOMObject *   somRenewNoInit(IN void *obj)
  325. {
  326.    return (SOMObject*) SOM_Resolve((SOMAny *)this,SOMClass,somRenewNoInit)
  327.     (this,obj);
  328. }
  329.  
  330.  
  331. /* public method: somGetApplyStub */
  332.  
  333. /*
  334.  *  Returns the apply stub associated with the specified method. NULL
  335.  *  is returned if the method is not supported by this class.  An apply
  336.  *  stub is a procedure that is called with a fixed calling sequence,
  337.  *  namely (SOMObject *self, somId methodId, somId descriptor, ap_list
  338.  *  ap) where <ap> is a varargs data structure that contains the actual
  339.  *  argument list to be passed to the method.  The apply stub fowards
  340.  *  the call to its associated method and then returns any result
  341.  *  produced by the method.
  342.  */
  343. somMethodProc *   somGetApplyStub(INOUT somId methodId)
  344. {
  345.    return (somMethodProc*) SOM_Resolve((SOMAny *)this,SOMClass,somGetApplyStub)
  346.     (this,methodId);
  347. }
  348.  
  349.  
  350. /* public method: somGetClassData */
  351.  
  352. /*
  353.  *  Returns a pointer to the static <className>ClassData structure.
  354.  */
  355. somClassDataStructure *   somGetClassData()
  356. {
  357.    return (somClassDataStructure*) SOM_Resolve((SOMAny *)this,SOMClass,somGetClassData)
  358.     (this);
  359. }
  360.  
  361.  
  362. /* public method: somGetClassMtab */
  363.  
  364. /*
  365.  *  Returns a pointer to the method table of this class.
  366.  */
  367. somMethodTab *   somGetClassMtab()
  368. {
  369.    return (somMethodTab*) SOM_Resolve((SOMAny *)this,SOMClass,somGetClassMtab)
  370.     (this);
  371. }
  372.  
  373.  
  374. /* public method: somGetInstanceToken */
  375.  
  376. /*
  377.  *  Returns a token that identifies the introduced portion of this class
  378.  *  within itself or any derived class.  This token can be subsequently
  379.  *  passed to the run-time somDataResolve function to locate the instance
  380.  *  data introduced by this class.
  381.  */
  382. somDToken    somGetInstanceToken()
  383. {
  384.    return (somDToken) SOM_Resolve((SOMAny *)this,SOMClass,somGetInstanceToken)
  385.     (this);
  386. }
  387.  
  388.  
  389. /* public method: somGetMemberToken */
  390.  
  391. /*
  392.  *  Returns a token that represents the data member at offset
  393.  *  "memberOffset" within the introduced portion of the class identified
  394.  *  by instanceToken.  The instance token must have been obtained from a
  395.  *  previous invocation of somGetInstanceToken.  The returned member
  396.  *  token can be subsequently passed to the run-time somDataResolve
  397.  *  function to locate the data member.
  398.  */
  399. somDToken    somGetMemberToken(integer4 memberOffset,
  400.         somDToken instanceToken)
  401. {
  402.    return (somDToken) SOM_Resolve((SOMAny *)this,SOMClass,somGetMemberToken)
  403.     (this,memberOffset,instanceToken);
  404. }
  405.  
  406.  
  407. /* public method: somGetInstanceOffset */
  408.  
  409. /*
  410.  *  Returns the offset in the body part of this [class] object for the
  411.  *  instance data introduced by this class, as the distance in bytes along
  412.  *  the class' "left-hand" derivation path.
  413.  */
  414. integer4    somGetInstanceOffset()
  415. {
  416.    return (integer4) SOM_Resolve((SOMAny *)this,SOMClass,somGetInstanceOffset)
  417.     (this);
  418. }
  419.  
  420.  
  421. /* public method: somGetInstancePartSize */
  422.  
  423. /*
  424.  *  Returns the size in bytes of the instance data introduced by this
  425.  *  class.  This does not include the instance data space required for
  426.  *  this class' ancestor or descendent classes.
  427.  */
  428. integer4    somGetInstancePartSize()
  429. {
  430.    return (integer4) SOM_Resolve((SOMAny *)this,SOMClass,somGetInstancePartSize)
  431.     (this);
  432. }
  433.  
  434.  
  435. /* public method: somGetInstanceSize */
  436.  
  437. /*
  438.  *  Returns the total size of an instance of <self>.
  439.  *  All instances of <self> have the same size.
  440.  */
  441. integer4    somGetInstanceSize()
  442. {
  443.    return (integer4) SOM_Resolve((SOMAny *)this,SOMClass,somGetInstanceSize)
  444.     (this);
  445. }
  446.  
  447.  
  448. /* public method: somGetMethodDescriptor */
  449.  
  450. /*
  451.  *  Returns the method descriptor for the indicated method.  If
  452.  *  this object does not support the indicated method then NULL is
  453.  *  returned.
  454.  */
  455. somId    somGetMethodDescriptor(IN somId methodId)
  456. {
  457.    return (somId) SOM_Resolve((SOMAny *)this,SOMClass,somGetMethodDescriptor)
  458.     (this,methodId);
  459. }
  460.  
  461.  
  462. /* public method: somGetName */
  463.  
  464. /*
  465.  *  Returns this object's class name as a NULL terminated string.
  466.  */
  467. zString    somGetName()
  468. {
  469.    return (zString) SOM_Resolve((SOMAny *)this,SOMClass,somGetName)
  470.     (this);
  471. }
  472.  
  473.  
  474. /* public method: somGetNumMethods */
  475.  
  476. /*
  477.  *  Returns the number of methods currently supported by this class,
  478.  *  including inherited methods (both static and dynamic).
  479.  */
  480. int    somGetNumMethods()
  481. {
  482.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somGetNumMethods)
  483.     (this);
  484. }
  485.  
  486.  
  487. /* public method: somGetNumStaticMethods */
  488.  
  489. /*
  490.  *  Returns the number of static methods that this class has.  This is
  491.  *  used by a child class in initializing its method table.
  492.  */
  493. int    somGetNumStaticMethods()
  494. {
  495.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somGetNumStaticMethods)
  496.     (this);
  497. }
  498.  
  499.  
  500. /* public method: somGetParent */
  501.  
  502. /*
  503.  *  Returns the parent class of self (along its "left-hand" derivation
  504.  *  path), if one exists and NULL otherwise.
  505.  */
  506. SOMClass *   somGetParent()
  507. {
  508.    return (SOMClass*) SOM_Resolve((SOMAny *)this,SOMClass,somGetParent)
  509.     (this);
  510. }
  511.  
  512.  
  513. /* public method: somGetPClsMtab */
  514.  
  515. /*
  516.  *  Returns a pointer to the method table of this class's parent class
  517.  *  (along its "left-hand" derivation path).  If this class is a root
  518.  *  class (SOMObject), NULL is returned.
  519.  */
  520. somMethodTab *   somGetPClsMtab()
  521. {
  522.    return (somMethodTab*) SOM_Resolve((SOMAny *)this,SOMClass,somGetPClsMtab)
  523.     (this);
  524. }
  525.  
  526.  
  527. /* public method: somSetClassData */
  528.  
  529. /*
  530.  *  Sets the class' pointer to the static <className>ClassData structure.
  531.  */
  532. void    somSetClassData(IN somClassDataStructure *cds)
  533. {
  534.    SOM_Resolve((SOMAny *)this,SOMClass,somSetClassData)
  535.     (this,cds);
  536. }
  537.  
  538.  
  539. /* public method: somCheckVersion */
  540.  
  541. /*
  542.  *  Returns 1 (true) if the implementation of this class is
  543.  *  compatible with the specified major and minor version number and
  544.  *  false (0) otherwise.  An implementation is compatible with the
  545.  *  specified version numbers if it has the same major version number
  546.  *  and a minor version number that is equal to or greater than
  547.  *  <minorVersion>.  The major, minor version number pair (0,0) is
  548.  *  considered to match any version.  This method is usually called
  549.  *  immediately after creating the class object to verify that a
  550.  *  dynamically loaded class definition is compatible with a using
  551.  *  application.
  552.  */
  553. int    somCheckVersion(IN integer4 majorVersion,
  554.         IN integer4 minorVersion)
  555. {
  556.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somCheckVersion)
  557.     (this,majorVersion,minorVersion);
  558. }
  559.  
  560.  
  561. /* public method: somDescendedFrom */
  562.  
  563. /*
  564.  *  Returns 1 (true) if <self> is a descendent class of <aClassObj> and
  565.  *  0 (false) otherwise.  Note: a class object is considered to be
  566.  *  descended itself for the purposes of this method.
  567.  */
  568. int    somDescendedFrom(IN SOMClass *aClassObj)
  569. {
  570.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somDescendedFrom)
  571.     (this,aClassObj);
  572. }
  573.  
  574.  
  575. /* public method: somSupportsMethod */
  576.  
  577. /*
  578.  *  Returns 1 (true) if the indicated method is supported by this
  579.  *  class and 0 (false) otherwise.
  580.  */
  581. int    somSupportsMethod(INOUT somId mId)
  582. {
  583.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somSupportsMethod)
  584.     (this,mId);
  585. }
  586.  
  587.  
  588. /* public method: somFindMethod */
  589.  
  590. /*
  591.  *  Finds the method procedure associated with <methodId> for this
  592.  *  class and sets <m> to it.  1 (true) is returned when the
  593.  *  method procedure is directly callable and 0 (false) is returned
  594.  *  when the method procedure is a dispatch function.
  595.  * 
  596.  *  If the class does not support the specified method then
  597.  *  <m> is set to NULL and the return value is meaningless.
  598.  * 
  599.  *  Returning a dispatch function does not guarantee that a
  600.  *  class supports the specified method; the dispatch may fail.
  601.  */
  602. int    somFindMethod(INOUT somId methodId,
  603.         OUT somMethodProc **m)
  604. {
  605.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somFindMethod)
  606.     (this,methodId,m);
  607. }
  608.  
  609.  
  610. /* public method: somFindMethodOk */
  611.  
  612. /*
  613.  *  Just like <somFindMethod> except that if the method is not
  614.  *  supported then an error is raised and execution is halted.
  615.  */
  616. int    somFindMethodOk(INOUT somId methodId,
  617.         OUT somMethodProc **m)
  618. {
  619.    return (int) SOM_Resolve((SOMAny *)this,SOMClass,somFindMethodOk)
  620.     (this,methodId,m);
  621. }
  622.  
  623.  
  624. /* public method: somFindSMethod */
  625.  
  626. /*
  627.  *  Finds the indicated method, which must be a static method defined
  628.  *  for this class, and returns a pointer to its method procedure.
  629.  * 
  630.  *  If the method is not defined (as a static method or at all) for
  631.  *  this class then a NULL pointer is returned.
  632.  */
  633. somMethodProc *   somFindSMethod(INOUT somId methodId)
  634. {
  635.    return (somMethodProc*) SOM_Resolve((SOMAny *)this,SOMClass,somFindSMethod)
  636.     (this,methodId);
  637. }
  638.  
  639.  
  640. /* public method: somFindSMethodOk */
  641.  
  642. /*
  643.  *  Just like <somFindSMethod> except that an error is raised if the
  644.  *  method is not defined for this class.
  645.  */
  646. somMethodProc *   somFindSMethodOk(INOUT somId methodId)
  647. {
  648.    return (somMethodProc*) SOM_Resolve((SOMAny *)this,SOMClass,somFindSMethodOk)
  649.     (this,methodId);
  650. }
  651.  
  652.  
  653.  
  654. };   /* SOMClass */
  655.  
  656.  
  657.  
  658. #endif       /* somcls_xh */
  659.