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

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: cntxt.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *   IDL specification for CORBA Context Object.
  12.  */
  13.  
  14.  
  15. #ifndef SOM_Context_xh
  16. #define SOM_Context_xh
  17.  
  18. class Context;
  19.  
  20. #define Context_MajorVersion 2
  21. #define Context_MinorVersion 1
  22.  
  23. /* C++ SOM defs */
  24. #include <somcls.xh>
  25. #include <somcm.xh>
  26.  
  27. /* C++ parent defs */
  28. #ifndef SOM_SOMObject_xh
  29. #include <somobj.xh>
  30. #endif
  31.  
  32. #ifndef Context_API
  33. #define Context_API
  34. /*
  35.  * -- The Class API
  36.  */
  37.  
  38. /*
  39.  * Start of bindings for IDL types
  40.  */
  41.  
  42. class SOMClass;
  43. class SOMObject;
  44. class Container;
  45. class NVList;
  46.  
  47. /*
  48.  * End of bindings for IDL types.
  49.  */
  50.  
  51. /*
  52.  * Passthru lines: File: "C.xh", "after"
  53.  */
  54.  
  55. /*
  56.  * Context flags
  57.  */
  58. #define CTX_DELETE_DESCENDENTS      0x00000200
  59. #define CTX_RESTRICT_SCOPE          0x00000400
  60.  
  61.  
  62. /* A procedure to create the Context Class */
  63. SOMEXTERN SOMClass * SOMLINK ContextNewClass(
  64.         integer4 majorVersion,
  65.         integer4 minorVersion);
  66.  
  67. /* The API to the Context class object, and the methods it introduces. */
  68. SOMEXTERN struct ContextClassDataStructure {
  69.     SOMClass *classObject;
  70.     somMToken set_one_value;
  71.     somMToken set_values;
  72.     somMToken get_values;
  73.     somMToken delete_values;
  74.     somMToken create_child;
  75.     somMToken destroy;
  76.     somMToken _get_context_name;
  77.     somMToken _set_context_name;
  78.     somMToken _get_context_parent;
  79.     somMToken _set_context_parent;
  80.     somMToken _get_properties;
  81.     somMToken _set_properties;
  82. } SOMDLINK ContextClassData;
  83. #define _Context ContextClassData.classObject
  84.  
  85. /* The API to parentMtabs for Context, and the instance data it introduces. */
  86. SOMEXTERN struct ContextCClassDataStructure {
  87.     somMethodTabs parentMtab;
  88.     somDToken              instanceDataToken;
  89. } SOMDLINK ContextCClassData;
  90.  
  91. /*
  92.  * -- Typedefs for Context Method Procedures
  93.  */
  94. SOMEXTERN {
  95. typedef ORBStatus   SOMLINK somTP_Context_set_one_value(Context *somSelf, Environment *ev, 
  96.         Identifier prop_name, 
  97.         string value);
  98. typedef somTP_Context_set_one_value *somTD_Context_set_one_value;
  99. typedef ORBStatus   SOMLINK somTP_Context_set_values(Context *somSelf, Environment *ev, 
  100.         NVList* values);
  101. typedef somTP_Context_set_values *somTD_Context_set_values;
  102. typedef ORBStatus   SOMLINK somTP_Context_get_values(Context *somSelf, Environment *ev, 
  103.         Identifier start_scope, 
  104.         Flags op_flags, 
  105.         Identifier prop_name, 
  106.         NVList** values);
  107. typedef somTP_Context_get_values *somTD_Context_get_values;
  108. typedef ORBStatus   SOMLINK somTP_Context_delete_values(Context *somSelf, Environment *ev, 
  109.         Identifier prop_name);
  110. typedef somTP_Context_delete_values *somTD_Context_delete_values;
  111. typedef ORBStatus   SOMLINK somTP_Context_create_child(Context *somSelf, Environment *ev, 
  112.         Identifier ctx_name, 
  113.         Context** child_ctx);
  114. typedef somTP_Context_create_child *somTD_Context_create_child;
  115. typedef ORBStatus   SOMLINK somTP_Context_destroy(Context *somSelf, Environment *ev, 
  116.         Flags flags);
  117. typedef somTP_Context_destroy *somTD_Context_destroy;
  118.  
  119. /*
  120.  * -- Typedefs for Reintroduced Wrapper Methods
  121.  */
  122. typedef void   SOMLINK somTP_Context_somDefaultInit(Context *somSelf, 
  123.         som3InitCtrl* ctrl);
  124. typedef somTP_Context_somDefaultInit *somTD_Context_somDefaultInit;
  125. typedef void   SOMLINK somTP_Context_somDestruct(Context *somSelf, 
  126.         octet doFree, 
  127.         som3DestructCtrl* ctrl);
  128. typedef somTP_Context_somDestruct *somTD_Context_somDestruct;
  129. typedef void   SOMLINK somTP_Context_somDefaultCopyInit(Context *somSelf, 
  130.         som3InitCtrl* ctrl, 
  131.         SOMObject* fromObj);
  132. typedef somTP_Context_somDefaultCopyInit *somTD_Context_somDefaultCopyInit;
  133. typedef Context*   SOMLINK somTP_Context_somDefaultAssign(Context *somSelf, 
  134.         som3AssignCtrl* ctrl, 
  135.         SOMObject* fromObj);
  136. typedef somTP_Context_somDefaultAssign *somTD_Context_somDefaultAssign;
  137. typedef void   SOMLINK somTP_Context_somDefaultConstCopyInit(Context *somSelf, 
  138.         som3InitCtrl* ctrl, 
  139.         SOMObject* fromObj);
  140. typedef somTP_Context_somDefaultConstCopyInit *somTD_Context_somDefaultConstCopyInit;
  141. typedef void   SOMLINK somTP_Context_somDefaultVCopyInit(Context *somSelf, 
  142.         som3InitCtrl* ctrl, 
  143.         SOMObject* fromObj);
  144. typedef somTP_Context_somDefaultVCopyInit *somTD_Context_somDefaultVCopyInit;
  145. typedef void   SOMLINK somTP_Context_somDefaultConstVCopyInit(Context *somSelf, 
  146.         som3InitCtrl* ctrl, 
  147.         SOMObject* fromObj);
  148. typedef somTP_Context_somDefaultConstVCopyInit *somTD_Context_somDefaultConstVCopyInit;
  149. typedef Context*   SOMLINK somTP_Context_somDefaultConstAssign(Context *somSelf, 
  150.         som3AssignCtrl* ctrl, 
  151.         SOMObject* fromObj);
  152. typedef somTP_Context_somDefaultConstAssign *somTD_Context_somDefaultConstAssign;
  153. typedef Context*   SOMLINK somTP_Context_somDefaultVAssign(Context *somSelf, 
  154.         som3AssignCtrl* ctrl, 
  155.         SOMObject* fromObj);
  156. typedef somTP_Context_somDefaultVAssign *somTD_Context_somDefaultVAssign;
  157. typedef Context*   SOMLINK somTP_Context_somDefaultConstVAssign(Context *somSelf, 
  158.         som3AssignCtrl* ctrl, 
  159.         SOMObject* fromObj);
  160. typedef somTP_Context_somDefaultConstVAssign *somTD_Context_somDefaultConstVAssign;
  161. typedef void   SOMLINK somTP_Context_somInit(Context *somSelf);
  162. typedef somTP_Context_somInit *somTD_Context_somInit;
  163. typedef void   SOMLINK somTP_Context_somFree(Context *somSelf);
  164. typedef somTP_Context_somFree *somTD_Context_somFree;
  165. typedef void   SOMLINK somTP_Context_somUninit(Context *somSelf);
  166. typedef somTP_Context_somUninit *somTD_Context_somUninit;
  167. typedef SOMClass*   SOMLINK somTP_Context_somGetClass(Context *somSelf);
  168. typedef somTP_Context_somGetClass *somTD_Context_somGetClass;
  169. typedef string   SOMLINK somTP_Context_somGetClassName(Context *somSelf);
  170. typedef somTP_Context_somGetClassName *somTD_Context_somGetClassName;
  171. typedef long   SOMLINK somTP_Context_somGetSize(Context *somSelf);
  172. typedef somTP_Context_somGetSize *somTD_Context_somGetSize;
  173. typedef boolean   SOMLINK somTP_Context_somIsA(Context *somSelf, 
  174.         SOMClass* aClassObj);
  175. typedef somTP_Context_somIsA *somTD_Context_somIsA;
  176. typedef boolean   SOMLINK somTP_Context_somIsInstanceOf(Context *somSelf, 
  177.         SOMClass* aClassObj);
  178. typedef somTP_Context_somIsInstanceOf *somTD_Context_somIsInstanceOf;
  179. typedef boolean   SOMLINK somTP_Context_somRespondsTo(Context *somSelf, 
  180.         somId mId);
  181. typedef somTP_Context_somRespondsTo *somTD_Context_somRespondsTo;
  182. typedef boolean   SOMLINK somTP_Context_somDispatch(Context *somSelf, 
  183.         somToken* retValue, 
  184.         somId methodId, 
  185.         va_list ap);
  186. typedef somTP_Context_somDispatch *somTD_Context_somDispatch;
  187. typedef boolean   SOMLINK somTP_Context_somClassDispatch(Context *somSelf, 
  188.         SOMClass* clsObj, 
  189.         somToken* retValue, 
  190.         somId methodId, 
  191.         va_list ap);
  192. typedef somTP_Context_somClassDispatch *somTD_Context_somClassDispatch;
  193. typedef boolean   SOMLINK somTP_Context_somCastObj(Context *somSelf, 
  194.         SOMClass* cls);
  195. typedef somTP_Context_somCastObj *somTD_Context_somCastObj;
  196. typedef boolean   SOMLINK somTP_Context_somResetObj(Context *somSelf);
  197. typedef somTP_Context_somResetObj *somTD_Context_somResetObj;
  198. typedef void   SOMLINK somTP_Context_somDispatchV(Context *somSelf, 
  199.         somId methodId, 
  200.         somId descriptor, 
  201.         va_list ap);
  202. typedef somTP_Context_somDispatchV *somTD_Context_somDispatchV;
  203. typedef long   SOMLINK somTP_Context_somDispatchL(Context *somSelf, 
  204.         somId methodId, 
  205.         somId descriptor, 
  206.         va_list ap);
  207. typedef somTP_Context_somDispatchL *somTD_Context_somDispatchL;
  208. typedef void*   SOMLINK somTP_Context_somDispatchA(Context *somSelf, 
  209.         somId methodId, 
  210.         somId descriptor, 
  211.         va_list ap);
  212. typedef somTP_Context_somDispatchA *somTD_Context_somDispatchA;
  213. typedef double   SOMLINK somTP_Context_somDispatchD(Context *somSelf, 
  214.         somId methodId, 
  215.         somId descriptor, 
  216.         va_list ap);
  217. typedef somTP_Context_somDispatchD *somTD_Context_somDispatchD;
  218. typedef SOMObject*   SOMLINK somTP_Context_somPrintSelf(Context *somSelf);
  219. typedef somTP_Context_somPrintSelf *somTD_Context_somPrintSelf;
  220. typedef void   SOMLINK somTP_Context_somDumpSelf(Context *somSelf, 
  221.         long level);
  222. typedef somTP_Context_somDumpSelf *somTD_Context_somDumpSelf;
  223. typedef void   SOMLINK somTP_Context_somDumpSelfInt(Context *somSelf, 
  224.         long level);
  225. typedef somTP_Context_somDumpSelfInt *somTD_Context_somDumpSelfInt;
  226. }
  227.  
  228. #endif /* Context_API */
  229.  
  230.  
  231. /*
  232.  * -- This emitter treats Method Tokens as Thunks by default.
  233.  * -- Use the sc modifier "nothunks" to change this default
  234.  */
  235. #undef somresolve_
  236. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  237.  
  238. /*
  239.  * -- The C++ Wrapper Class for Context
  240.  */
  241. class Context : public SOMObject
  242. {
  243. public:
  244.  
  245. // Context::new creates the class object if necessary, and then uses somNewNoInit
  246. // to allocate memory and create the object. Initialization is in ctors.
  247. void *operator new(size_t)
  248. {
  249.    if (!_Context) ContextNewClass(Context_MajorVersion,Context_MinorVersion);
  250.    return (void*)
  251.       SOM_Resolve(_Context,SOMClass,somNewNoInit)
  252.          ((SOMClass *)((void*)_Context));
  253. }
  254.  
  255. // Context::delete uses somDestruct.
  256. void operator delete(void * obj)
  257. {
  258.    if (obj && *(void**)obj) {
  259.       SOM_Resolve(obj,SOMObject,somFree)
  260.          ((SOMObject*)obj);
  261.    }
  262. }
  263.  
  264. Context& operator=(Context& fromObj)
  265. {
  266.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  267.    return *this;
  268. }
  269.  
  270. Context()
  271. {
  272.    if (*(void**)this != 
  273.        ((somParentMtabStructPtr)
  274.         (ContextCClassData.parentMtab))->mtab)
  275.       return;
  276.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  277. }
  278.  
  279. Context(Context* fromObj)
  280. {
  281.    if (*(void**)this != 
  282.        ((somParentMtabStructPtr)
  283.         (ContextCClassData.parentMtab))->mtab)
  284.       return;
  285.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  286. }
  287.  
  288. #ifdef __IBMCPP__
  289. #pragma info(nocnv,nopar)
  290. #endif
  291. Context(const Context* fromObj)
  292. {
  293.    if (*(void**)this != 
  294.        ((somParentMtabStructPtr)
  295.         (ContextCClassData.parentMtab))->mtab)
  296.       return;
  297.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  298. }
  299. #ifdef __IBMCPP__
  300. #pragma info(restore)
  301. #endif
  302.  
  303.  
  304. /* method: set_one_value */
  305. ORBStatus   set_one_value(Environment *ev, 
  306.         Identifier prop_name, 
  307.         string value)
  308. {
  309. /*
  310.  *   This method sets or adds a single context object property. If prop_name
  311.  *   does not exist in the property list, it is added. If prop_name
  312.  *   does exist, its value is changed.
  313.  * 
  314.  */
  315.    return SOM_ResolveD(this,Context,Context,set_one_value)
  316.     (this, ev,prop_name,value);
  317. }
  318.  
  319.  
  320. /* method: set_values */
  321. ORBStatus   set_values(Environment *ev, 
  322.         NVList* values)
  323. {
  324. /*
  325.  *   This method sets or changes one or more property values in the context
  326.  *   object. If a prop_name specified in the NVList does not exist in the
  327.  *   Context object property list, it is added. If a prop_name specified in
  328.  *   the NVList does exist in the Context object property list, its value
  329.  *   is changed.
  330.  * 
  331.  */
  332.    return SOM_ResolveD(this,Context,Context,set_values)
  333.     (this, ev,values);
  334. }
  335.  
  336.  
  337. /* method: get_values */
  338. ORBStatus   get_values(Environment *ev, 
  339.         Identifier start_scope, 
  340.         Flags op_flags, 
  341.         Identifier prop_name, 
  342.         NVList** values)
  343. {
  344. /*
  345.  *   This method retrieves the specified context property value(s) If
  346.  *   prop_name has a trailing wildcard ("*"), then all matching properties
  347.  *   and their values are returned. The returned NVList is the responsibility
  348.  *   of the caller,
  349.  * 
  350.  *   If no matching properties are found, and error is returned the property
  351.  *   list contains no values.
  352.  * 
  353.  *   Scope indicates the context object level at which to initiate the search
  354.  *   for the specified properties (e.g. "_USER", "_SYSTEM"). If the property
  355.  *   is not found at the indicated level, the search continues up the context
  356.  *   object tree until a match is found or all context objects in the chain
  357.  *   have been searched.
  358.  * 
  359.  *   If scope name is ommitted, the search begins with the specified context
  360.  *   object. If the specified scope name is not found, an exception is
  361.  *   returned.
  362.  * 
  363.  *   The following operation flags may be specified:
  364.  * 
  365.  *   CTX_RESTRICT_SCOPE  Searching is limited to the specified search scope or
  366.  *                       context object.
  367.  * 
  368.  */
  369.    return SOM_ResolveD(this,Context,Context,get_values)
  370.     (this, ev,start_scope,op_flags,prop_name,values);
  371. }
  372.  
  373.  
  374. /* method: delete_values */
  375. ORBStatus   delete_values(Environment *ev, 
  376.         Identifier prop_name)
  377. {
  378. /*
  379.  *   This method deletes the specified property value(s) from the context
  380.  *   object.  If prop_name has a trailing wildcard character ("*"), then
  381.  *   all property names which match will be deleted.
  382.  * 
  383.  *   Search scope is always limited to the specified context object.
  384.  * 
  385.  *   If no matching property is found, an exception is returned.
  386.  * 
  387.  */
  388.    return SOM_ResolveD(this,Context,Context,delete_values)
  389.     (this, ev,prop_name);
  390. }
  391.  
  392.  
  393. /* method: create_child */
  394. ORBStatus   create_child(Environment *ev, 
  395.         Identifier ctx_name, 
  396.         Context** child_ctx)
  397. {
  398. /*
  399.  *   This method creates a child context object.
  400.  * 
  401.  *   The returned context object is chained to its parent context. That is,
  402.  *   searches on the child context object will look in the parent context
  403.  *   (and so on, up the context tree), if necessary, for matching property
  404.  *   names.
  405.  * 
  406.  */
  407.    return SOM_ResolveD(this,Context,Context,create_child)
  408.     (this, ev,ctx_name,child_ctx);
  409. }
  410.  
  411.  
  412. /* method: destroy */
  413. ORBStatus   destroy(Environment *ev, 
  414.         Flags flags)
  415. {
  416. /*
  417.  *   This operation deletes the indicated context object.
  418.  *   The following flags may be specified:
  419.  * 
  420.  *   CTX_DELETE_DESCENDENTS    Deletes the indicated context object and all
  421.  *                             of its descendent context objects as well.
  422.  * 
  423.  *   An exception is returned if there are one or more child context objects
  424.  *   and the CTX_DELETE_DESCENDENTS flag was not set.
  425.  * 
  426.  */
  427.    return SOM_ResolveD(this,Context,Context,destroy)
  428.     (this, ev,flags);
  429. }
  430.  
  431.  
  432. /*
  433.  * Reintroduce inherited methods
  434.  */
  435.  
  436. /* initializer method: somDefaultInit */
  437. void   somDefaultInit(som3InitCtrl* ctrl)
  438. {
  439. /*
  440.  *  A default initializer for a SOM object. Passing a null ctrl
  441.  *  indicates to the receiver that its class is the class of the
  442.  *  object being initialized, whereby the initializer will determine
  443.  *  an appropriate control structure.
  444.  */
  445.    SOM_ResolveD(this,Context,SOMObject,somDefaultInit)
  446.     (this,ctrl);
  447. }
  448.  
  449.  
  450. /* method: somDestruct */
  451. void   somDestruct(octet doFree, 
  452.         som3DestructCtrl* ctrl)
  453. {
  454. /*
  455.  *  The default destructor for a SOM object. A nonzero <doFree>
  456.  *  indicates that the object storage should be freed by the
  457.  *  object's class (via somDeallocate) after uninitialization.
  458.  *  As with somDefaultInit, a null ctrl can be passed.
  459.  */
  460.    SOM_ResolveD(this,Context,SOMObject,somDestruct)
  461.     (this,doFree,ctrl);
  462. }
  463.  
  464.  
  465. /* initializer method: somDefaultCopyInit */
  466. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  467.         SOMObject* fromObj)
  468. {
  469. /*
  470.  *  A default copy constructor. Use this to make copies of objects for
  471.  *  calling methods with "by-value" argument semantics.
  472.  */
  473.    SOM_ResolveD(this,Context,SOMObject,somDefaultCopyInit)
  474.     (this,ctrl,fromObj);
  475. }
  476.  
  477.  
  478. /* method: somDefaultAssign */
  479. Context*  somDefaultAssign(som3AssignCtrl* ctrl, 
  480.         SOMObject* fromObj)
  481. {
  482. /*
  483.  *  A default assignment operator. Use this to "assign" the state of one
  484.  *  object to another.
  485.  */
  486.    return SOM_ResolveD(this,Context,SOMObject,somDefaultAssign)
  487.     (this,ctrl,fromObj);
  488. }
  489.  
  490.  
  491. /* initializer method: somDefaultConstCopyInit */
  492. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  493.         SOMObject* fromObj)
  494. {
  495. /*
  496.  *  A default copy constructor that uses a const fromObj.
  497.  */
  498.    SOM_ResolveD(this,Context,SOMObject,somDefaultConstCopyInit)
  499.     (this,ctrl,fromObj);
  500. }
  501.  
  502.  
  503. /* initializer method: somDefaultVCopyInit */
  504. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  505.         SOMObject* fromObj)
  506. {
  507. /*
  508.  *  A default copy constructor that uses a volatile fromObj.
  509.  */
  510.    SOM_ResolveD(this,Context,SOMObject,somDefaultVCopyInit)
  511.     (this,ctrl,fromObj);
  512. }
  513.  
  514.  
  515. /* initializer method: somDefaultConstVCopyInit */
  516. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  517.         SOMObject* fromObj)
  518. {
  519. /*
  520.  *  A default copy constructor that uses a const volatile fromObj.
  521.  */
  522.    SOM_ResolveD(this,Context,SOMObject,somDefaultConstVCopyInit)
  523.     (this,ctrl,fromObj);
  524. }
  525.  
  526.  
  527. /* method: somDefaultConstAssign */
  528. Context*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  529.         SOMObject* fromObj)
  530. {
  531. /*
  532.  *  A default assignment operator that uses a const fromObj.
  533.  */
  534.    return SOM_ResolveD(this,Context,SOMObject,somDefaultConstAssign)
  535.     (this,ctrl,fromObj);
  536. }
  537.  
  538.  
  539. /* method: somDefaultVAssign */
  540. Context*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  541.         SOMObject* fromObj)
  542. {
  543. /*
  544.  *  A default assignment operator that uses a volatile fromObj.
  545.  */
  546.    return SOM_ResolveD(this,Context,SOMObject,somDefaultVAssign)
  547.     (this,ctrl,fromObj);
  548. }
  549.  
  550.  
  551. /* method: somDefaultConstVAssign */
  552. Context*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  553.         SOMObject* fromObj)
  554. {
  555. /*
  556.  *  A default assignment operator that uses a const volatile fromObj.
  557.  */
  558.    return SOM_ResolveD(this,Context,SOMObject,somDefaultConstVAssign)
  559.     (this,ctrl,fromObj);
  560. }
  561.  
  562.  
  563. /* method: somInit */
  564. void   somInit()
  565. {
  566. /*
  567.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  568.  */
  569.    SOM_ResolveD(this,Context,SOMObject,somInit)
  570.     (this);
  571. }
  572.  
  573.  
  574. /* method: somFree */
  575. void   somFree()
  576. {
  577. /*
  578.  *  Use as directed by framework implementations.
  579.  */
  580.    SOM_ResolveD(this,Context,SOMObject,somFree)
  581.     (this);
  582. }
  583.  
  584.  
  585. /* method: somUninit */
  586. void   somUninit()
  587. {
  588. /*
  589.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  590.  */
  591.    SOM_ResolveD(this,Context,SOMObject,somUninit)
  592.     (this);
  593. }
  594.  
  595.  
  596. /* method: somGetClass */
  597. SOMClass*   somGetClass()
  598. {
  599. /*
  600.  *  Return the receiver's class.
  601.  */
  602.    return SOM_ResolveD(this,Context,SOMObject,somGetClass)
  603.     (this);
  604. }
  605.  
  606.  
  607. /* method: somGetClassName */
  608. string   somGetClassName()
  609. {
  610. /*
  611.  *  Return the name of the receiver's class.
  612.  */
  613.    return SOM_ResolveD(this,Context,SOMObject,somGetClassName)
  614.     (this);
  615. }
  616.  
  617.  
  618. /* method: somGetSize */
  619. long   somGetSize()
  620. {
  621. /*
  622.  *  Return the size of the receiver.
  623.  */
  624.    return SOM_ResolveD(this,Context,SOMObject,somGetSize)
  625.     (this);
  626. }
  627.  
  628.  
  629. /* method: somIsA */
  630. boolean   somIsA(SOMClass* aClassObj)
  631. {
  632. /*
  633.  *  Returns 1 (true) if the receiver responds to methods
  634.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  635.  */
  636.    return SOM_ResolveD(this,Context,SOMObject,somIsA)
  637.     (this,aClassObj);
  638. }
  639.  
  640.  
  641. /* method: somIsInstanceOf */
  642. boolean   somIsInstanceOf(SOMClass* aClassObj)
  643. {
  644. /*
  645.  *  Returns 1 (true) if the receiver is an instance of
  646.  *  <aClassObj> and 0 (false) otherwise.
  647.  */
  648.    return SOM_ResolveD(this,Context,SOMObject,somIsInstanceOf)
  649.     (this,aClassObj);
  650. }
  651.  
  652.  
  653. /* method: somRespondsTo */
  654. boolean   somRespondsTo(somId mId)
  655. {
  656. /*
  657.  *  Returns 1 (true) if the indicated method can be invoked
  658.  *  on the receiver and 0 (false) otherwise.
  659.  */
  660.    return SOM_ResolveD(this,Context,SOMObject,somRespondsTo)
  661.     (this,mId);
  662. }
  663.  
  664.  
  665. /* va_list method: somDispatch */
  666.  
  667. /*
  668.  *  This method provides a generic, class-specific dispatch mechanism.
  669.  *  It accepts as input <retValue> a pointer to the memory area to be
  670.  *  loaded with the result of dispatching the method indicated by
  671.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  672.  *  on which the method is to be invoked as the first argument.
  673.  */
  674. /* the va_list invocation form */
  675. boolean   Context_somDispatch(somToken* retValue, 
  676.         somId methodId, 
  677.         va_list ap)
  678. {return SOM_ResolveD(this,Context,SOMObject,somDispatch)
  679.     (this,retValue,methodId,ap);
  680. }
  681.  
  682. /* the varargs invocation form */
  683. boolean   somDispatch(somToken* retValue, 
  684.         somId methodId, 
  685.         ...)
  686. {
  687. /*
  688.  *  This method provides a generic, class-specific dispatch mechanism.
  689.  *  It accepts as input <retValue> a pointer to the memory area to be
  690.  *  loaded with the result of dispatching the method indicated by
  691.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  692.  *  on which the method is to be invoked as the first argument.
  693.  */
  694.    va_list ap;
  695.    va_start(ap, methodId);
  696.    boolean __somResult = 
  697.       SOM_ResolveD(this,Context,SOMObject,somDispatch)
  698.     (this,retValue,methodId,ap);
  699.    va_end(ap);
  700.    return __somResult;
  701. }
  702.  
  703.  
  704. /* va_list method: somClassDispatch */
  705.  
  706. /*
  707.  *  Like somDispatch, but method resolution for static methods is done
  708.  *  according to the clsObj instance method table.
  709.  */
  710. /* the va_list invocation form */
  711. boolean   Context_somClassDispatch(SOMClass* clsObj, 
  712.         somToken* retValue, 
  713.         somId methodId, 
  714.         va_list ap)
  715. {return SOM_ResolveD(this,Context,SOMObject,somClassDispatch)
  716.     (this,clsObj,retValue,methodId,ap);
  717. }
  718.  
  719. /* the varargs invocation form */
  720. boolean   somClassDispatch(SOMClass* clsObj, 
  721.         somToken* retValue, 
  722.         somId methodId, 
  723.         ...)
  724. {
  725. /*
  726.  *  Like somDispatch, but method resolution for static methods is done
  727.  *  according to the clsObj instance method table.
  728.  */
  729.    va_list ap;
  730.    va_start(ap, methodId);
  731.    boolean __somResult = 
  732.       SOM_ResolveD(this,Context,SOMObject,somClassDispatch)
  733.     (this,clsObj,retValue,methodId,ap);
  734.    va_end(ap);
  735.    return __somResult;
  736. }
  737.  
  738.  
  739. /* method: somCastObj */
  740. boolean   somCastObj(SOMClass* cls)
  741. {
  742. /*
  743.  *  cast the receiving object to cls (which must be an ancestor of the
  744.  *  objects true class. Returns true on success.
  745.  */
  746.    return SOM_ResolveD(this,Context,SOMObject,somCastObj)
  747.     (this,cls);
  748. }
  749.  
  750.  
  751. /* method: somResetObj */
  752. boolean   somResetObj()
  753. {
  754. /*
  755.  *  reset an object to its true class. Returns true always.
  756.  */
  757.    return SOM_ResolveD(this,Context,SOMObject,somResetObj)
  758.     (this);
  759. }
  760.  
  761.  
  762. /* va_list method: somDispatchV */
  763.  
  764. /*
  765.  *  Obsolete. Use somDispatch instead.
  766.  */
  767. /* the va_list invocation form */
  768. void   Context_somDispatchV(somId methodId, 
  769.         somId descriptor, 
  770.         va_list ap)
  771. {   SOM_ResolveD(this,Context,SOMObject,somDispatchV)
  772.     (this,methodId,descriptor,ap);
  773. }
  774.  
  775. /* the varargs invocation form */
  776. void   somDispatchV(somId methodId, 
  777.         somId descriptor, 
  778.         ...)
  779. {
  780. /*
  781.  *  Obsolete. Use somDispatch instead.
  782.  */
  783.    va_list ap;
  784.    va_start(ap, descriptor);
  785.    SOM_ResolveD(this,Context,SOMObject,somDispatchV)
  786.     (this,methodId,descriptor,ap);
  787.    va_end(ap);
  788. }
  789.  
  790.  
  791. /* va_list method: somDispatchL */
  792.  
  793. /*
  794.  *  Obsolete. Use somDispatch instead.
  795.  */
  796. /* the va_list invocation form */
  797. long   Context_somDispatchL(somId methodId, 
  798.         somId descriptor, 
  799.         va_list ap)
  800. {return SOM_ResolveD(this,Context,SOMObject,somDispatchL)
  801.     (this,methodId,descriptor,ap);
  802. }
  803.  
  804. /* the varargs invocation form */
  805. long   somDispatchL(somId methodId, 
  806.         somId descriptor, 
  807.         ...)
  808. {
  809. /*
  810.  *  Obsolete. Use somDispatch instead.
  811.  */
  812.    va_list ap;
  813.    va_start(ap, descriptor);
  814.    long __somResult = 
  815.       SOM_ResolveD(this,Context,SOMObject,somDispatchL)
  816.     (this,methodId,descriptor,ap);
  817.    va_end(ap);
  818.    return __somResult;
  819. }
  820.  
  821.  
  822. /* va_list method: somDispatchA */
  823.  
  824. /*
  825.  *  Obsolete. Use somDispatch instead.
  826.  */
  827. /* the va_list invocation form */
  828. void*   Context_somDispatchA(somId methodId, 
  829.         somId descriptor, 
  830.         va_list ap)
  831. {return SOM_ResolveD(this,Context,SOMObject,somDispatchA)
  832.     (this,methodId,descriptor,ap);
  833. }
  834.  
  835. /* the varargs invocation form */
  836. void*   somDispatchA(somId methodId, 
  837.         somId descriptor, 
  838.         ...)
  839. {
  840. /*
  841.  *  Obsolete. Use somDispatch instead.
  842.  */
  843.    va_list ap;
  844.    va_start(ap, descriptor);
  845.    void* __somResult = 
  846.       SOM_ResolveD(this,Context,SOMObject,somDispatchA)
  847.     (this,methodId,descriptor,ap);
  848.    va_end(ap);
  849.    return __somResult;
  850. }
  851.  
  852.  
  853. /* va_list method: somDispatchD */
  854.  
  855. /*
  856.  *  Obsolete. Use somDispatch instead.
  857.  */
  858. /* the va_list invocation form */
  859. double   Context_somDispatchD(somId methodId, 
  860.         somId descriptor, 
  861.         va_list ap)
  862. {return SOM_ResolveD(this,Context,SOMObject,somDispatchD)
  863.     (this,methodId,descriptor,ap);
  864. }
  865.  
  866. /* the varargs invocation form */
  867. double   somDispatchD(somId methodId, 
  868.         somId descriptor, 
  869.         ...)
  870. {
  871. /*
  872.  *  Obsolete. Use somDispatch instead.
  873.  */
  874.    va_list ap;
  875.    va_start(ap, descriptor);
  876.    double __somResult = 
  877.       SOM_ResolveD(this,Context,SOMObject,somDispatchD)
  878.     (this,methodId,descriptor,ap);
  879.    va_end(ap);
  880.    return __somResult;
  881. }
  882.  
  883.  
  884. /* method: somPrintSelf */
  885. SOMObject*   somPrintSelf()
  886. {
  887. /*
  888.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  889.  *  information about this object.  The default implementation just gives
  890.  *  the object's class name and its address in memory.
  891.  *  <self> is returned.
  892.  */
  893.    return SOM_ResolveD(this,Context,SOMObject,somPrintSelf)
  894.     (this);
  895. }
  896.  
  897.  
  898. /* method: somDumpSelf */
  899. void   somDumpSelf(long level)
  900. {
  901. /*
  902.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  903.  *  and its current state.
  904.  * 
  905.  *  <level> indicates the nesting level for describing compound objects
  906.  *  it must be greater than or equal to zero.  All lines in the
  907.  *  description will be preceeded by <2*level> spaces.
  908.  * 
  909.  *  This routine only actually writes the data that concerns the object
  910.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  911.  *  the object's current state.  This approach allows readable
  912.  *  descriptions of compound objects to be constructed.
  913.  * 
  914.  *  Generally it is not necessary to override this method, if it is
  915.  *  overriden it generally must be completely replaced.
  916.  */
  917.    SOM_ResolveD(this,Context,SOMObject,somDumpSelf)
  918.     (this,level);
  919. }
  920.  
  921.  
  922. /* method: somDumpSelfInt */
  923. void   somDumpSelfInt(long level)
  924. {
  925. /*
  926.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  927.  *  Generally this method will need to be overridden.  When overriding
  928.  *  it, begin by calling the parent class form of this method and then
  929.  *  write in a description of your class's instance data. This will
  930.  *  result in a description of all the object's instance data going
  931.  *  from its root ancestor class to its specific class.
  932.  */
  933.    SOM_ResolveD(this,Context,SOMObject,somDumpSelfInt)
  934.     (this,level);
  935. }
  936.  
  937.  
  938.  
  939. };   /* Context */
  940.  
  941.  
  942.  
  943. #endif       /* SOM_Context_xh */
  944.