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

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: containd.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. #ifndef SOM_Contained_xh
  11. #define SOM_Contained_xh
  12.  
  13. class Contained;
  14.  
  15. /*
  16.  *  CORBA 1.1, 7.5.1, p.130
  17.  * 
  18.  *  The Contained interface is the most generic form of interface
  19.  *  for the objects in the SOM CORBA-compliant Interface Repository (IR).
  20.  *  All objects contained in the IR inherit this interface.
  21.  */
  22.  
  23. #define Contained_MajorVersion 2
  24. #define Contained_MinorVersion 3
  25.  
  26. /*
  27.  * Passthru lines: File: "C.xh", "before"
  28.  */
  29.  
  30.     #include <somtcnst.xh>
  31.     #include <stdio.h>
  32.     #include <somir.xh>
  33.  
  34.     #define RepositoryId string
  35.     #define _IDL_SEQUENCE_RepositoryId _IDL_SEQUENCE_string
  36.     #define TC_Contained ((TypeCode) &TC__Contained)
  37.     typedef struct {TCKind t; long f; string s;} TC_Contained_td;
  38.     SOMEXTERN TC_Contained_td SOMDLINK TC__Contained;
  39.  
  40.  
  41. /* C++ SOM defs */
  42. #include <somcls.xh>
  43. #include <somcm.xh>
  44.  
  45. /* C++ parent defs */
  46. #ifndef SOM_SOMObject_xh
  47. #include <somobj.xh>
  48. #endif
  49.  
  50. #ifndef Contained_API
  51. #define Contained_API
  52. /*
  53.  * -- The Class API
  54.  */
  55.  
  56. /*
  57.  * Start of bindings for IDL types
  58.  */
  59.  
  60. class SOMClass;
  61. class SOMObject;
  62. class Container;
  63. typedef
  64. struct Contained_Description {
  65. Identifier name;
  66. any  value;
  67. } Contained_Description;
  68. struct somModifier;
  69. #ifndef _IDL_SEQUENCE_somModifier_defined
  70. #define _IDL_SEQUENCE_somModifier_defined
  71. typedef struct {
  72.     unsigned long _maximum;
  73.     unsigned long _length;
  74.     struct somModifier *_buffer;
  75. } _IDL_SEQUENCE_somModifier;
  76. #endif /* _IDL_SEQUENCE_somModifier_defined */ 
  77. #ifndef _IDL_SEQUENCE_Container_defined
  78. #define _IDL_SEQUENCE_Container_defined
  79. typedef struct {
  80.     unsigned long _maximum;
  81.     unsigned long _length;
  82.     Container **_buffer;
  83. } _IDL_SEQUENCE_Container;
  84. #endif /* _IDL_SEQUENCE_Container_defined */ 
  85.  
  86. #ifndef SOM_DONT_USE_SHORT_NAMES
  87. #ifndef SOMTGD_Description
  88.     #ifdef Description
  89.         #undef Description
  90.         #define SOMTGD_Description 1
  91.     #else
  92.         #define Description Contained_Description
  93.     #endif /* Description */
  94. #endif /* SOMTGD_Description */
  95. #endif /* SOM_DONT_USE_SHORT_NAMES */
  96.  
  97. /*
  98.  * End of bindings for IDL types.
  99.  */
  100.  
  101. /* A procedure to create the Contained Class */
  102. SOMEXTERN SOMClass * SOMLINK ContainedNewClass(
  103.         integer4 majorVersion,
  104.         integer4 minorVersion);
  105.  
  106. /* The API to the Contained class object, and the methods it introduces. */
  107. SOMEXTERN struct ContainedClassDataStructure {
  108.     SOMClass *classObject;
  109.     somMToken within;
  110.     somMToken describe;
  111.     somMToken _get_name;
  112.     somMToken _set_name;
  113.     somMToken _get_id;
  114.     somMToken _set_id;
  115.     somMToken _get_defined_in;
  116.     somMToken _set_defined_in;
  117.     somMToken _get_somModifiers;
  118.     somMToken _set_somModifiers;
  119. } SOMDLINK ContainedClassData;
  120. #define _Contained ContainedClassData.classObject
  121.  
  122. /* The API to parentMtabs for Contained, and the instance data it introduces. */
  123. SOMEXTERN struct ContainedCClassDataStructure {
  124.     somMethodTabs parentMtab;
  125.     somDToken              instanceDataToken;
  126. } SOMDLINK ContainedCClassData;
  127.  
  128. /*
  129.  * -- Typedefs for Contained Method Procedures
  130.  */
  131. SOMEXTERN {
  132. typedef Identifier   SOMLINK somTP_Contained__get_name(Contained *somSelf, Environment *ev);
  133. typedef somTP_Contained__get_name *somTD_Contained__get_name;
  134. typedef void   SOMLINK somTP_Contained__set_name(Contained *somSelf, Environment *ev, 
  135.         Identifier name);
  136. typedef somTP_Contained__set_name *somTD_Contained__set_name;
  137. typedef RepositoryId   SOMLINK somTP_Contained__get_id(Contained *somSelf, Environment *ev);
  138. typedef somTP_Contained__get_id *somTD_Contained__get_id;
  139. typedef void   SOMLINK somTP_Contained__set_id(Contained *somSelf, Environment *ev, 
  140.         RepositoryId id);
  141. typedef somTP_Contained__set_id *somTD_Contained__set_id;
  142. typedef RepositoryId   SOMLINK somTP_Contained__get_defined_in(Contained *somSelf, Environment *ev);
  143. typedef somTP_Contained__get_defined_in *somTD_Contained__get_defined_in;
  144. typedef void   SOMLINK somTP_Contained__set_defined_in(Contained *somSelf, Environment *ev, 
  145.         RepositoryId defined_in);
  146. typedef somTP_Contained__set_defined_in *somTD_Contained__set_defined_in;
  147. typedef _IDL_SEQUENCE_somModifier   SOMLINK somTP_Contained__get_somModifiers(Contained *somSelf, Environment *ev);
  148. typedef somTP_Contained__get_somModifiers *somTD_Contained__get_somModifiers;
  149. typedef void   SOMLINK somTP_Contained__set_somModifiers(Contained *somSelf, Environment *ev, 
  150.         _IDL_SEQUENCE_somModifier* somModifiers);
  151. typedef somTP_Contained__set_somModifiers *somTD_Contained__set_somModifiers;
  152. typedef _IDL_SEQUENCE_Container   SOMLINK somTP_Contained_within(Contained *somSelf, Environment *ev);
  153. typedef somTP_Contained_within *somTD_Contained_within;
  154. typedef Contained_Description   SOMLINK somTP_Contained_describe(Contained *somSelf, Environment *ev);
  155. typedef somTP_Contained_describe *somTD_Contained_describe;
  156.  
  157. /*
  158.  * -- Typedefs for Reintroduced Wrapper Methods
  159.  */
  160. typedef void   SOMLINK somTP_Contained_somDefaultInit(Contained *somSelf, 
  161.         som3InitCtrl* ctrl);
  162. typedef somTP_Contained_somDefaultInit *somTD_Contained_somDefaultInit;
  163. typedef void   SOMLINK somTP_Contained_somDestruct(Contained *somSelf, 
  164.         octet doFree, 
  165.         som3DestructCtrl* ctrl);
  166. typedef somTP_Contained_somDestruct *somTD_Contained_somDestruct;
  167. typedef void   SOMLINK somTP_Contained_somDefaultCopyInit(Contained *somSelf, 
  168.         som3InitCtrl* ctrl, 
  169.         SOMObject* fromObj);
  170. typedef somTP_Contained_somDefaultCopyInit *somTD_Contained_somDefaultCopyInit;
  171. typedef Contained*   SOMLINK somTP_Contained_somDefaultAssign(Contained *somSelf, 
  172.         som3AssignCtrl* ctrl, 
  173.         SOMObject* fromObj);
  174. typedef somTP_Contained_somDefaultAssign *somTD_Contained_somDefaultAssign;
  175. typedef void   SOMLINK somTP_Contained_somDefaultConstCopyInit(Contained *somSelf, 
  176.         som3InitCtrl* ctrl, 
  177.         SOMObject* fromObj);
  178. typedef somTP_Contained_somDefaultConstCopyInit *somTD_Contained_somDefaultConstCopyInit;
  179. typedef void   SOMLINK somTP_Contained_somDefaultVCopyInit(Contained *somSelf, 
  180.         som3InitCtrl* ctrl, 
  181.         SOMObject* fromObj);
  182. typedef somTP_Contained_somDefaultVCopyInit *somTD_Contained_somDefaultVCopyInit;
  183. typedef void   SOMLINK somTP_Contained_somDefaultConstVCopyInit(Contained *somSelf, 
  184.         som3InitCtrl* ctrl, 
  185.         SOMObject* fromObj);
  186. typedef somTP_Contained_somDefaultConstVCopyInit *somTD_Contained_somDefaultConstVCopyInit;
  187. typedef Contained*   SOMLINK somTP_Contained_somDefaultConstAssign(Contained *somSelf, 
  188.         som3AssignCtrl* ctrl, 
  189.         SOMObject* fromObj);
  190. typedef somTP_Contained_somDefaultConstAssign *somTD_Contained_somDefaultConstAssign;
  191. typedef Contained*   SOMLINK somTP_Contained_somDefaultVAssign(Contained *somSelf, 
  192.         som3AssignCtrl* ctrl, 
  193.         SOMObject* fromObj);
  194. typedef somTP_Contained_somDefaultVAssign *somTD_Contained_somDefaultVAssign;
  195. typedef Contained*   SOMLINK somTP_Contained_somDefaultConstVAssign(Contained *somSelf, 
  196.         som3AssignCtrl* ctrl, 
  197.         SOMObject* fromObj);
  198. typedef somTP_Contained_somDefaultConstVAssign *somTD_Contained_somDefaultConstVAssign;
  199. typedef void   SOMLINK somTP_Contained_somInit(Contained *somSelf);
  200. typedef somTP_Contained_somInit *somTD_Contained_somInit;
  201. typedef void   SOMLINK somTP_Contained_somFree(Contained *somSelf);
  202. typedef somTP_Contained_somFree *somTD_Contained_somFree;
  203. typedef void   SOMLINK somTP_Contained_somUninit(Contained *somSelf);
  204. typedef somTP_Contained_somUninit *somTD_Contained_somUninit;
  205. typedef SOMClass*   SOMLINK somTP_Contained_somGetClass(Contained *somSelf);
  206. typedef somTP_Contained_somGetClass *somTD_Contained_somGetClass;
  207. typedef string   SOMLINK somTP_Contained_somGetClassName(Contained *somSelf);
  208. typedef somTP_Contained_somGetClassName *somTD_Contained_somGetClassName;
  209. typedef long   SOMLINK somTP_Contained_somGetSize(Contained *somSelf);
  210. typedef somTP_Contained_somGetSize *somTD_Contained_somGetSize;
  211. typedef boolean   SOMLINK somTP_Contained_somIsA(Contained *somSelf, 
  212.         SOMClass* aClassObj);
  213. typedef somTP_Contained_somIsA *somTD_Contained_somIsA;
  214. typedef boolean   SOMLINK somTP_Contained_somIsInstanceOf(Contained *somSelf, 
  215.         SOMClass* aClassObj);
  216. typedef somTP_Contained_somIsInstanceOf *somTD_Contained_somIsInstanceOf;
  217. typedef boolean   SOMLINK somTP_Contained_somRespondsTo(Contained *somSelf, 
  218.         somId mId);
  219. typedef somTP_Contained_somRespondsTo *somTD_Contained_somRespondsTo;
  220. typedef boolean   SOMLINK somTP_Contained_somDispatch(Contained *somSelf, 
  221.         somToken* retValue, 
  222.         somId methodId, 
  223.         va_list ap);
  224. typedef somTP_Contained_somDispatch *somTD_Contained_somDispatch;
  225. typedef boolean   SOMLINK somTP_Contained_somClassDispatch(Contained *somSelf, 
  226.         SOMClass* clsObj, 
  227.         somToken* retValue, 
  228.         somId methodId, 
  229.         va_list ap);
  230. typedef somTP_Contained_somClassDispatch *somTD_Contained_somClassDispatch;
  231. typedef boolean   SOMLINK somTP_Contained_somCastObj(Contained *somSelf, 
  232.         SOMClass* cls);
  233. typedef somTP_Contained_somCastObj *somTD_Contained_somCastObj;
  234. typedef boolean   SOMLINK somTP_Contained_somResetObj(Contained *somSelf);
  235. typedef somTP_Contained_somResetObj *somTD_Contained_somResetObj;
  236. typedef void   SOMLINK somTP_Contained_somDispatchV(Contained *somSelf, 
  237.         somId methodId, 
  238.         somId descriptor, 
  239.         va_list ap);
  240. typedef somTP_Contained_somDispatchV *somTD_Contained_somDispatchV;
  241. typedef long   SOMLINK somTP_Contained_somDispatchL(Contained *somSelf, 
  242.         somId methodId, 
  243.         somId descriptor, 
  244.         va_list ap);
  245. typedef somTP_Contained_somDispatchL *somTD_Contained_somDispatchL;
  246. typedef void*   SOMLINK somTP_Contained_somDispatchA(Contained *somSelf, 
  247.         somId methodId, 
  248.         somId descriptor, 
  249.         va_list ap);
  250. typedef somTP_Contained_somDispatchA *somTD_Contained_somDispatchA;
  251. typedef double   SOMLINK somTP_Contained_somDispatchD(Contained *somSelf, 
  252.         somId methodId, 
  253.         somId descriptor, 
  254.         va_list ap);
  255. typedef somTP_Contained_somDispatchD *somTD_Contained_somDispatchD;
  256. typedef SOMObject*   SOMLINK somTP_Contained_somPrintSelf(Contained *somSelf);
  257. typedef somTP_Contained_somPrintSelf *somTD_Contained_somPrintSelf;
  258. typedef void   SOMLINK somTP_Contained_somDumpSelf(Contained *somSelf, 
  259.         long level);
  260. typedef somTP_Contained_somDumpSelf *somTD_Contained_somDumpSelf;
  261. typedef void   SOMLINK somTP_Contained_somDumpSelfInt(Contained *somSelf, 
  262.         long level);
  263. typedef somTP_Contained_somDumpSelfInt *somTD_Contained_somDumpSelfInt;
  264. }
  265.  
  266. #endif /* Contained_API */
  267.  
  268.  
  269. /*
  270.  * -- This emitter treats Method Tokens as Thunks by default.
  271.  * -- Use the sc modifier "nothunks" to change this default
  272.  */
  273. #undef somresolve_
  274. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  275.  
  276. /*
  277.  * -- The C++ Wrapper Class for Contained
  278.  */
  279. class Contained : public SOMObject
  280. {
  281. /*
  282.  *  CORBA 1.1, 7.5.1, p.130
  283.  * 
  284.  *  The Contained interface is the most generic form of interface
  285.  *  for the objects in the SOM CORBA-compliant Interface Repository (IR).
  286.  *  All objects contained in the IR inherit this interface.
  287.  */
  288. public:
  289.  
  290. // Contained::new creates the class object if necessary, and then uses somNewNoInit
  291. // to allocate memory and create the object. Initialization is in ctors.
  292. void *operator new(size_t)
  293. {
  294.    if (!_Contained) ContainedNewClass(Contained_MajorVersion,Contained_MinorVersion);
  295.    return (void*)
  296.       SOM_Resolve(_Contained,SOMClass,somNewNoInit)
  297.          ((SOMClass *)((void*)_Contained));
  298. }
  299.  
  300. // Contained::delete uses somDestruct.
  301. void operator delete(void * obj)
  302. {
  303.    if (obj && *(void**)obj) {
  304.       SOM_Resolve(obj,SOMObject,somFree)
  305.          ((SOMObject*)obj);
  306.    }
  307. }
  308.  
  309. Contained& operator=(Contained& fromObj)
  310. {
  311.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  312.    return *this;
  313. }
  314.  
  315. Contained()
  316. {
  317.    if (*(void**)this != 
  318.        ((somParentMtabStructPtr)
  319.         (ContainedCClassData.parentMtab))->mtab)
  320.       return;
  321.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  322. }
  323.  
  324. Contained(Contained* fromObj)
  325. {
  326.    if (*(void**)this != 
  327.        ((somParentMtabStructPtr)
  328.         (ContainedCClassData.parentMtab))->mtab)
  329.       return;
  330.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  331. }
  332.  
  333. #ifdef __IBMCPP__
  334. #pragma info(nocnv,nopar)
  335. #endif
  336. Contained(const Contained* fromObj)
  337. {
  338.    if (*(void**)this != 
  339.        ((somParentMtabStructPtr)
  340.         (ContainedCClassData.parentMtab))->mtab)
  341.       return;
  342.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  343. }
  344. #ifdef __IBMCPP__
  345. #pragma info(restore)
  346. #endif
  347.  
  348.  
  349. /* method: _get_name */
  350. Identifier   _get_name(Environment *ev)
  351. {
  352. /*
  353.  *  The value of the "name" field of the receiving object
  354.  * 
  355.  *  This is a simple name that indentifies the receiving object
  356.  *  within its containment hierarchy.  Outside of the containment
  357.  *  hierarchy this name is not necessarily unique, and may require
  358.  *  qualification by ModuleDef name, InterfaceDef name, etc.
  359.  */
  360.    return SOM_ResolveD(this,Contained,Contained,_get_name)
  361.     (this, ev);
  362. }
  363.  
  364.  
  365. /* method: _set_name */
  366. void   _set_name(Environment *ev, 
  367.         Identifier name)
  368. {
  369. /*
  370.  *  The value of the "name" field of the receiving object
  371.  * 
  372.  *  This is a simple name that indentifies the receiving object
  373.  *  within its containment hierarchy.  Outside of the containment
  374.  *  hierarchy this name is not necessarily unique, and may require
  375.  *  qualification by ModuleDef name, InterfaceDef name, etc.
  376.  */
  377.    SOM_ResolveD(this,Contained,Contained,_set_name)
  378.     (this, ev,name);
  379. }
  380.  
  381.  
  382. /* method: _get_id */
  383. RepositoryId   _get_id(Environment *ev)
  384. {
  385. /*
  386.  *  The value of the "id" field of the receiving object
  387.  * 
  388.  *  The "id" is a string that uniquely identifies any object in
  389.  *  the interface repository.  No qualification is needed for
  390.  *  an "id".  Notice that "RepositoryId"s have no relationship
  391.  *  to the SOM type "somId".
  392.  */
  393.    return SOM_ResolveD(this,Contained,Contained,_get_id)
  394.     (this, ev);
  395. }
  396.  
  397.  
  398. /* method: _set_id */
  399. void   _set_id(Environment *ev, 
  400.         RepositoryId id)
  401. {
  402. /*
  403.  *  The value of the "id" field of the receiving object
  404.  * 
  405.  *  The "id" is a string that uniquely identifies any object in
  406.  *  the interface repository.  No qualification is needed for
  407.  *  an "id".  Notice that "RepositoryId"s have no relationship
  408.  *  to the SOM type "somId".
  409.  */
  410.    SOM_ResolveD(this,Contained,Contained,_set_id)
  411.     (this, ev,id);
  412. }
  413.  
  414.  
  415. /* method: _get_defined_in */
  416. RepositoryId   _get_defined_in(Environment *ev)
  417. {
  418. /*
  419.  *  The value of the "defined_in" field of the receiving object
  420.  * 
  421.  *  This "id" uniquely identifies the container where the
  422.  *  receiving object is defined.  Objects that have global scope
  423.  *  and do not appear within any other objects are by default
  424.  *  placed in the "Repository" object.
  425.  */
  426.    return SOM_ResolveD(this,Contained,Contained,_get_defined_in)
  427.     (this, ev);
  428. }
  429.  
  430.  
  431. /* method: _set_defined_in */
  432. void   _set_defined_in(Environment *ev, 
  433.         RepositoryId defined_in)
  434. {
  435. /*
  436.  *  The value of the "defined_in" field of the receiving object
  437.  * 
  438.  *  This "id" uniquely identifies the container where the
  439.  *  receiving object is defined.  Objects that have global scope
  440.  *  and do not appear within any other objects are by default
  441.  *  placed in the "Repository" object.
  442.  */
  443.    SOM_ResolveD(this,Contained,Contained,_set_defined_in)
  444.     (this, ev,defined_in);
  445. }
  446.  
  447.  
  448. /* method: _get_somModifiers */
  449. _IDL_SEQUENCE_somModifier   _get_somModifiers(Environment *ev)
  450. {
  451. /*
  452.  *  [SOM-unique extension]
  453.  * 
  454.  *  The somModifiers attribute is a sequence containing all of
  455.  *  the "modifiers" attached to the corresponding IDL object in
  456.  *  the SOM-unique implementation section of the IDL file where
  457.  *  the receiving object was originally defined.
  458.  */
  459.    return SOM_ResolveD(this,Contained,Contained,_get_somModifiers)
  460.     (this, ev);
  461. }
  462.  
  463.  
  464. /* method: _set_somModifiers */
  465. void   _set_somModifiers(Environment *ev, 
  466.         _IDL_SEQUENCE_somModifier* somModifiers)
  467. {
  468. /*
  469.  *  [SOM-unique extension]
  470.  * 
  471.  *  The somModifiers attribute is a sequence containing all of
  472.  *  the "modifiers" attached to the corresponding IDL object in
  473.  *  the SOM-unique implementation section of the IDL file where
  474.  *  the receiving object was originally defined.
  475.  */
  476.    SOM_ResolveD(this,Contained,Contained,_set_somModifiers)
  477.     (this, ev,somModifiers);
  478. }
  479.  
  480.  
  481. /* method: within */
  482. _IDL_SEQUENCE_Container   within(Environment *ev)
  483. {
  484. /*
  485.  *  Returns a list of objects that contain the receiving object.
  486.  *  If the object is an interface or module, it can only be contained
  487.  *  by the object that defines it.  Other objects can be contained by
  488.  *  objects that define or inherit them.
  489.  * 
  490.  *  When you have finished using the sequence returned by this method
  491.  *  it is your responsibility to release the storage allocated for it.
  492.  *  To free the sequence, use a call similar to the following:
  493.  * 
  494.  *       if (seqname._length)
  495.  *           long i;
  496.  *           for(i=0; i<seqname._length; i++)
  497.  *         _somFree(seqname._buffer[i]);
  498.  *           SOMFree (seqname._buffer);
  499.  */
  500.    return SOM_ResolveD(this,Contained,Contained,within)
  501.     (this, ev);
  502. }
  503.  
  504.  
  505. /* method: describe */
  506. Contained_Description   describe(Environment *ev)
  507. {
  508. /*
  509.  *  Returns a structure containing all of the attributes defined in
  510.  *  the interface of the receiving object.
  511.  * 
  512.  *  Warning: this method returns pointers to things withing objects
  513.  *  (for example, name).  Don't use the somFree method to release
  514.  *  any of these objects while this information is still needed..
  515.  * 
  516.  *  When you have finished using the information in the returned
  517.  *  Description structure, it is your responsibility to release
  518.  *  the associated storage using a call similar to the following:
  519.  * 
  520.  *       if (desc.value._value)
  521.  *           SOMFree (desc.value._value);
  522.  */
  523.    return SOM_ResolveD(this,Contained,Contained,describe)
  524.     (this, ev);
  525. }
  526.  
  527.  
  528. /*
  529.  * Reintroduce inherited methods
  530.  */
  531.  
  532. /* initializer method: somDefaultInit */
  533. void   somDefaultInit(som3InitCtrl* ctrl)
  534. {
  535. /*
  536.  *  A default initializer for a SOM object. Passing a null ctrl
  537.  *  indicates to the receiver that its class is the class of the
  538.  *  object being initialized, whereby the initializer will determine
  539.  *  an appropriate control structure.
  540.  */
  541.    SOM_ResolveD(this,Contained,SOMObject,somDefaultInit)
  542.     (this,ctrl);
  543. }
  544.  
  545.  
  546. /* method: somDestruct */
  547. void   somDestruct(octet doFree, 
  548.         som3DestructCtrl* ctrl)
  549. {
  550. /*
  551.  *  The default destructor for a SOM object. A nonzero <doFree>
  552.  *  indicates that the object storage should be freed by the
  553.  *  object's class (via somDeallocate) after uninitialization.
  554.  *  As with somDefaultInit, a null ctrl can be passed.
  555.  */
  556.    SOM_ResolveD(this,Contained,SOMObject,somDestruct)
  557.     (this,doFree,ctrl);
  558. }
  559.  
  560.  
  561. /* initializer method: somDefaultCopyInit */
  562. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  563.         SOMObject* fromObj)
  564. {
  565. /*
  566.  *  A default copy constructor. Use this to make copies of objects for
  567.  *  calling methods with "by-value" argument semantics.
  568.  */
  569.    SOM_ResolveD(this,Contained,SOMObject,somDefaultCopyInit)
  570.     (this,ctrl,fromObj);
  571. }
  572.  
  573.  
  574. /* method: somDefaultAssign */
  575. Contained*  somDefaultAssign(som3AssignCtrl* ctrl, 
  576.         SOMObject* fromObj)
  577. {
  578. /*
  579.  *  A default assignment operator. Use this to "assign" the state of one
  580.  *  object to another.
  581.  */
  582.    return SOM_ResolveD(this,Contained,SOMObject,somDefaultAssign)
  583.     (this,ctrl,fromObj);
  584. }
  585.  
  586.  
  587. /* initializer method: somDefaultConstCopyInit */
  588. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  589.         SOMObject* fromObj)
  590. {
  591. /*
  592.  *  A default copy constructor that uses a const fromObj.
  593.  */
  594.    SOM_ResolveD(this,Contained,SOMObject,somDefaultConstCopyInit)
  595.     (this,ctrl,fromObj);
  596. }
  597.  
  598.  
  599. /* initializer method: somDefaultVCopyInit */
  600. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  601.         SOMObject* fromObj)
  602. {
  603. /*
  604.  *  A default copy constructor that uses a volatile fromObj.
  605.  */
  606.    SOM_ResolveD(this,Contained,SOMObject,somDefaultVCopyInit)
  607.     (this,ctrl,fromObj);
  608. }
  609.  
  610.  
  611. /* initializer method: somDefaultConstVCopyInit */
  612. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  613.         SOMObject* fromObj)
  614. {
  615. /*
  616.  *  A default copy constructor that uses a const volatile fromObj.
  617.  */
  618.    SOM_ResolveD(this,Contained,SOMObject,somDefaultConstVCopyInit)
  619.     (this,ctrl,fromObj);
  620. }
  621.  
  622.  
  623. /* method: somDefaultConstAssign */
  624. Contained*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  625.         SOMObject* fromObj)
  626. {
  627. /*
  628.  *  A default assignment operator that uses a const fromObj.
  629.  */
  630.    return SOM_ResolveD(this,Contained,SOMObject,somDefaultConstAssign)
  631.     (this,ctrl,fromObj);
  632. }
  633.  
  634.  
  635. /* method: somDefaultVAssign */
  636. Contained*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  637.         SOMObject* fromObj)
  638. {
  639. /*
  640.  *  A default assignment operator that uses a volatile fromObj.
  641.  */
  642.    return SOM_ResolveD(this,Contained,SOMObject,somDefaultVAssign)
  643.     (this,ctrl,fromObj);
  644. }
  645.  
  646.  
  647. /* method: somDefaultConstVAssign */
  648. Contained*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  649.         SOMObject* fromObj)
  650. {
  651. /*
  652.  *  A default assignment operator that uses a const volatile fromObj.
  653.  */
  654.    return SOM_ResolveD(this,Contained,SOMObject,somDefaultConstVAssign)
  655.     (this,ctrl,fromObj);
  656. }
  657.  
  658.  
  659. /* method: somInit */
  660. void   somInit()
  661. {
  662. /*
  663.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  664.  */
  665.    SOM_ResolveD(this,Contained,SOMObject,somInit)
  666.     (this);
  667. }
  668.  
  669.  
  670. /* method: somFree */
  671. void   somFree()
  672. {
  673. /*
  674.  *  Use as directed by framework implementations.
  675.  */
  676.    SOM_ResolveD(this,Contained,SOMObject,somFree)
  677.     (this);
  678. }
  679.  
  680.  
  681. /* method: somUninit */
  682. void   somUninit()
  683. {
  684. /*
  685.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  686.  */
  687.    SOM_ResolveD(this,Contained,SOMObject,somUninit)
  688.     (this);
  689. }
  690.  
  691.  
  692. /* method: somGetClass */
  693. SOMClass*   somGetClass()
  694. {
  695. /*
  696.  *  Return the receiver's class.
  697.  */
  698.    return SOM_ResolveD(this,Contained,SOMObject,somGetClass)
  699.     (this);
  700. }
  701.  
  702.  
  703. /* method: somGetClassName */
  704. string   somGetClassName()
  705. {
  706. /*
  707.  *  Return the name of the receiver's class.
  708.  */
  709.    return SOM_ResolveD(this,Contained,SOMObject,somGetClassName)
  710.     (this);
  711. }
  712.  
  713.  
  714. /* method: somGetSize */
  715. long   somGetSize()
  716. {
  717. /*
  718.  *  Return the size of the receiver.
  719.  */
  720.    return SOM_ResolveD(this,Contained,SOMObject,somGetSize)
  721.     (this);
  722. }
  723.  
  724.  
  725. /* method: somIsA */
  726. boolean   somIsA(SOMClass* aClassObj)
  727. {
  728. /*
  729.  *  Returns 1 (true) if the receiver responds to methods
  730.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  731.  */
  732.    return SOM_ResolveD(this,Contained,SOMObject,somIsA)
  733.     (this,aClassObj);
  734. }
  735.  
  736.  
  737. /* method: somIsInstanceOf */
  738. boolean   somIsInstanceOf(SOMClass* aClassObj)
  739. {
  740. /*
  741.  *  Returns 1 (true) if the receiver is an instance of
  742.  *  <aClassObj> and 0 (false) otherwise.
  743.  */
  744.    return SOM_ResolveD(this,Contained,SOMObject,somIsInstanceOf)
  745.     (this,aClassObj);
  746. }
  747.  
  748.  
  749. /* method: somRespondsTo */
  750. boolean   somRespondsTo(somId mId)
  751. {
  752. /*
  753.  *  Returns 1 (true) if the indicated method can be invoked
  754.  *  on the receiver and 0 (false) otherwise.
  755.  */
  756.    return SOM_ResolveD(this,Contained,SOMObject,somRespondsTo)
  757.     (this,mId);
  758. }
  759.  
  760.  
  761. /* va_list method: somDispatch */
  762.  
  763. /*
  764.  *  This method provides a generic, class-specific dispatch mechanism.
  765.  *  It accepts as input <retValue> a pointer to the memory area to be
  766.  *  loaded with the result of dispatching the method indicated by
  767.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  768.  *  on which the method is to be invoked as the first argument.
  769.  */
  770. /* the va_list invocation form */
  771. boolean   Contained_somDispatch(somToken* retValue, 
  772.         somId methodId, 
  773.         va_list ap)
  774. {return SOM_ResolveD(this,Contained,SOMObject,somDispatch)
  775.     (this,retValue,methodId,ap);
  776. }
  777.  
  778. /* the varargs invocation form */
  779. boolean   somDispatch(somToken* retValue, 
  780.         somId methodId, 
  781.         ...)
  782. {
  783. /*
  784.  *  This method provides a generic, class-specific dispatch mechanism.
  785.  *  It accepts as input <retValue> a pointer to the memory area to be
  786.  *  loaded with the result of dispatching the method indicated by
  787.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  788.  *  on which the method is to be invoked as the first argument.
  789.  */
  790.    va_list ap;
  791.    va_start(ap, methodId);
  792.    boolean __somResult = 
  793.       SOM_ResolveD(this,Contained,SOMObject,somDispatch)
  794.     (this,retValue,methodId,ap);
  795.    va_end(ap);
  796.    return __somResult;
  797. }
  798.  
  799.  
  800. /* va_list method: somClassDispatch */
  801.  
  802. /*
  803.  *  Like somDispatch, but method resolution for static methods is done
  804.  *  according to the clsObj instance method table.
  805.  */
  806. /* the va_list invocation form */
  807. boolean   Contained_somClassDispatch(SOMClass* clsObj, 
  808.         somToken* retValue, 
  809.         somId methodId, 
  810.         va_list ap)
  811. {return SOM_ResolveD(this,Contained,SOMObject,somClassDispatch)
  812.     (this,clsObj,retValue,methodId,ap);
  813. }
  814.  
  815. /* the varargs invocation form */
  816. boolean   somClassDispatch(SOMClass* clsObj, 
  817.         somToken* retValue, 
  818.         somId methodId, 
  819.         ...)
  820. {
  821. /*
  822.  *  Like somDispatch, but method resolution for static methods is done
  823.  *  according to the clsObj instance method table.
  824.  */
  825.    va_list ap;
  826.    va_start(ap, methodId);
  827.    boolean __somResult = 
  828.       SOM_ResolveD(this,Contained,SOMObject,somClassDispatch)
  829.     (this,clsObj,retValue,methodId,ap);
  830.    va_end(ap);
  831.    return __somResult;
  832. }
  833.  
  834.  
  835. /* method: somCastObj */
  836. boolean   somCastObj(SOMClass* cls)
  837. {
  838. /*
  839.  *  cast the receiving object to cls (which must be an ancestor of the
  840.  *  objects true class. Returns true on success.
  841.  */
  842.    return SOM_ResolveD(this,Contained,SOMObject,somCastObj)
  843.     (this,cls);
  844. }
  845.  
  846.  
  847. /* method: somResetObj */
  848. boolean   somResetObj()
  849. {
  850. /*
  851.  *  reset an object to its true class. Returns true always.
  852.  */
  853.    return SOM_ResolveD(this,Contained,SOMObject,somResetObj)
  854.     (this);
  855. }
  856.  
  857.  
  858. /* va_list method: somDispatchV */
  859.  
  860. /*
  861.  *  Obsolete. Use somDispatch instead.
  862.  */
  863. /* the va_list invocation form */
  864. void   Contained_somDispatchV(somId methodId, 
  865.         somId descriptor, 
  866.         va_list ap)
  867. {   SOM_ResolveD(this,Contained,SOMObject,somDispatchV)
  868.     (this,methodId,descriptor,ap);
  869. }
  870.  
  871. /* the varargs invocation form */
  872. void   somDispatchV(somId methodId, 
  873.         somId descriptor, 
  874.         ...)
  875. {
  876. /*
  877.  *  Obsolete. Use somDispatch instead.
  878.  */
  879.    va_list ap;
  880.    va_start(ap, descriptor);
  881.    SOM_ResolveD(this,Contained,SOMObject,somDispatchV)
  882.     (this,methodId,descriptor,ap);
  883.    va_end(ap);
  884. }
  885.  
  886.  
  887. /* va_list method: somDispatchL */
  888.  
  889. /*
  890.  *  Obsolete. Use somDispatch instead.
  891.  */
  892. /* the va_list invocation form */
  893. long   Contained_somDispatchL(somId methodId, 
  894.         somId descriptor, 
  895.         va_list ap)
  896. {return SOM_ResolveD(this,Contained,SOMObject,somDispatchL)
  897.     (this,methodId,descriptor,ap);
  898. }
  899.  
  900. /* the varargs invocation form */
  901. long   somDispatchL(somId methodId, 
  902.         somId descriptor, 
  903.         ...)
  904. {
  905. /*
  906.  *  Obsolete. Use somDispatch instead.
  907.  */
  908.    va_list ap;
  909.    va_start(ap, descriptor);
  910.    long __somResult = 
  911.       SOM_ResolveD(this,Contained,SOMObject,somDispatchL)
  912.     (this,methodId,descriptor,ap);
  913.    va_end(ap);
  914.    return __somResult;
  915. }
  916.  
  917.  
  918. /* va_list method: somDispatchA */
  919.  
  920. /*
  921.  *  Obsolete. Use somDispatch instead.
  922.  */
  923. /* the va_list invocation form */
  924. void*   Contained_somDispatchA(somId methodId, 
  925.         somId descriptor, 
  926.         va_list ap)
  927. {return SOM_ResolveD(this,Contained,SOMObject,somDispatchA)
  928.     (this,methodId,descriptor,ap);
  929. }
  930.  
  931. /* the varargs invocation form */
  932. void*   somDispatchA(somId methodId, 
  933.         somId descriptor, 
  934.         ...)
  935. {
  936. /*
  937.  *  Obsolete. Use somDispatch instead.
  938.  */
  939.    va_list ap;
  940.    va_start(ap, descriptor);
  941.    void* __somResult = 
  942.       SOM_ResolveD(this,Contained,SOMObject,somDispatchA)
  943.     (this,methodId,descriptor,ap);
  944.    va_end(ap);
  945.    return __somResult;
  946. }
  947.  
  948.  
  949. /* va_list method: somDispatchD */
  950.  
  951. /*
  952.  *  Obsolete. Use somDispatch instead.
  953.  */
  954. /* the va_list invocation form */
  955. double   Contained_somDispatchD(somId methodId, 
  956.         somId descriptor, 
  957.         va_list ap)
  958. {return SOM_ResolveD(this,Contained,SOMObject,somDispatchD)
  959.     (this,methodId,descriptor,ap);
  960. }
  961.  
  962. /* the varargs invocation form */
  963. double   somDispatchD(somId methodId, 
  964.         somId descriptor, 
  965.         ...)
  966. {
  967. /*
  968.  *  Obsolete. Use somDispatch instead.
  969.  */
  970.    va_list ap;
  971.    va_start(ap, descriptor);
  972.    double __somResult = 
  973.       SOM_ResolveD(this,Contained,SOMObject,somDispatchD)
  974.     (this,methodId,descriptor,ap);
  975.    va_end(ap);
  976.    return __somResult;
  977. }
  978.  
  979.  
  980. /* method: somPrintSelf */
  981. SOMObject*   somPrintSelf()
  982. {
  983. /*
  984.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  985.  *  information about this object.  The default implementation just gives
  986.  *  the object's class name and its address in memory.
  987.  *  <self> is returned.
  988.  */
  989.    return SOM_ResolveD(this,Contained,SOMObject,somPrintSelf)
  990.     (this);
  991. }
  992.  
  993.  
  994. /* method: somDumpSelf */
  995. void   somDumpSelf(long level)
  996. {
  997. /*
  998.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  999.  *  and its current state.
  1000.  * 
  1001.  *  <level> indicates the nesting level for describing compound objects
  1002.  *  it must be greater than or equal to zero.  All lines in the
  1003.  *  description will be preceeded by <2*level> spaces.
  1004.  * 
  1005.  *  This routine only actually writes the data that concerns the object
  1006.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  1007.  *  the object's current state.  This approach allows readable
  1008.  *  descriptions of compound objects to be constructed.
  1009.  * 
  1010.  *  Generally it is not necessary to override this method, if it is
  1011.  *  overriden it generally must be completely replaced.
  1012.  */
  1013.    SOM_ResolveD(this,Contained,SOMObject,somDumpSelf)
  1014.     (this,level);
  1015. }
  1016.  
  1017.  
  1018. /* method: somDumpSelfInt */
  1019. void   somDumpSelfInt(long level)
  1020. {
  1021. /*
  1022.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  1023.  *  Generally this method will need to be overridden.  When overriding
  1024.  *  it, begin by calling the parent class form of this method and then
  1025.  *  write in a description of your class's instance data. This will
  1026.  *  result in a description of all the object's instance data going
  1027.  *  from its root ancestor class to its specific class.
  1028.  */
  1029.    SOM_ResolveD(this,Contained,SOMObject,somDumpSelfInt)
  1030.     (this,level);
  1031. }
  1032.  
  1033.  
  1034.  
  1035. };   /* Contained */
  1036.  
  1037.  
  1038.  
  1039. #endif       /* SOM_Contained_xh */
  1040.