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

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: tcollect.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emitxh: 2.47
  8.  */
  9.  
  10. /*
  11.  *    COMPONENT_NAME: somuc
  12.  * 
  13.  *    ORIGINS: 82, 81, 27
  14.  * 
  15.  * 
  16.  *     25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,1996
  17.  *    All Rights Reserved
  18.  *    Licensed Materials - Property of IBM
  19.  *    US Government Users Restricted Rights - Use, duplication or
  20.  *    disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  21.  * 
  22.  *    Copyright ⌐ 1988, 1989 Apple Computer, Inc. All rights reserved.
  23.  * 
  24.  * CLASS_NAME: somf_TCollection
  25.  * 
  26.  * DESCRIPTION: This class represents a group of objects.  It is implemented
  27.  *              as an abstract class from which all collection classes inherit
  28.  *              methods.
  29.  * 
  30.  *  This file was generated by the SOM Compiler.
  31.  *  FileName: TCollect.id2.
  32.  *  Generated using:
  33.  *      SOM Precompiler spc: 6.13
  34.  *      SOM Emitter emitidl.dll: 6.18
  35.  */
  36.  
  37.  
  38. #ifndef SOM_somf_TCollection_xh
  39. #define SOM_somf_TCollection_xh
  40.  
  41. class somf_TCollection;
  42.  
  43. #define somf_TCollection_MajorVersion 2
  44. #define somf_TCollection_MinorVersion 1
  45.  
  46. /* C++ SOM defs */
  47. #include <somcls.xh>
  48. #include <somcm.xh>
  49.  
  50. /* C++ parent defs */
  51. #ifndef SOM_somf_MCollectible_xh
  52. #include <mcollect.xh>
  53. #endif
  54.  
  55. #ifndef somf_TCollection_API
  56. #define somf_TCollection_API
  57. /*
  58.  * -- The Class API
  59.  */
  60.  
  61. /*
  62.  * Start of bindings for IDL types
  63.  */
  64.  
  65. class SOMClass;
  66. class SOMObject;
  67. class somf_TIterator;
  68. #define somf_TCollection_kCollectionSizeHint 8 /* 8 */
  69.  
  70. #ifndef SOM_DONT_USE_SHORT_NAMES
  71. #ifndef SOMTGD_kCollectionSizeHint
  72.     #ifdef kCollectionSizeHint
  73.         #undef kCollectionSizeHint
  74.         #define SOMTGD_kCollectionSizeHint 1
  75.     #else
  76.         #define kCollectionSizeHint somf_TCollection_kCollectionSizeHint
  77.     #endif /* kCollectionSizeHint */
  78. #endif /* SOMTGD_kCollectionSizeHint */
  79. #endif /* SOM_DONT_USE_SHORT_NAMES */
  80.  
  81. /*
  82.  * End of bindings for IDL types.
  83.  */
  84.  
  85. /*
  86.  * Passthru lines: File: "C.xh", "after"
  87.  */
  88.  
  89. class somf_TCollection;
  90. #include <titeratr.xh>
  91.  
  92. /* A procedure to create the somf_TCollection Class */
  93. SOMEXTERN SOMClass * SOMLINK somf_TCollectionNewClass(
  94.         integer4 majorVersion,
  95.         integer4 minorVersion);
  96.  
  97. /* The API to the somf_TCollection class object, and the methods it introduces. */
  98. SOMEXTERN struct somf_TCollectionClassDataStructure {
  99.     SOMClass *classObject;
  100.     somMToken somfAdd;
  101.     somMToken somfAddAll;
  102.     somMToken somfRemove;
  103.     somMToken somfRemoveAll;
  104.     somMToken somfDeleteAll;
  105.     somMToken somfCount;
  106.     somMToken somfMember;
  107.     somMToken somfCreateIterator;
  108.     somMToken somfTestFunction;
  109.     somMToken somfSetTestFunction;
  110.     somMToken somfTCollectionInit;
  111. } SOMDLINK somf_TCollectionClassData;
  112. #define _somf_TCollection somf_TCollectionClassData.classObject
  113.  
  114. /* The API to parentMtabs for somf_TCollection, and the instance data it introduces. */
  115. SOMEXTERN struct somf_TCollectionCClassDataStructure {
  116.     somMethodTabs parentMtab;
  117.     somDToken              instanceDataToken;
  118. } SOMDLINK somf_TCollectionCClassData;
  119.  
  120. /*
  121.  * -- Typedefs for somf_TCollection Method Procedures
  122.  */
  123. SOMEXTERN {
  124. typedef somf_MCollectible*   SOMLINK somTP_somf_TCollection_somfAdd(somf_TCollection *somSelf, Environment *ev, 
  125.         somf_MCollectible* obj);
  126. typedef somTP_somf_TCollection_somfAdd *somTD_somf_TCollection_somfAdd;
  127. typedef void   SOMLINK somTP_somf_TCollection_somfAddAll(somf_TCollection *somSelf, Environment *ev, 
  128.         somf_TCollection* col);
  129. typedef somTP_somf_TCollection_somfAddAll *somTD_somf_TCollection_somfAddAll;
  130. typedef somf_MCollectible*   SOMLINK somTP_somf_TCollection_somfRemove(somf_TCollection *somSelf, Environment *ev, 
  131.         somf_MCollectible* obj);
  132. typedef somTP_somf_TCollection_somfRemove *somTD_somf_TCollection_somfRemove;
  133. typedef void   SOMLINK somTP_somf_TCollection_somfRemoveAll(somf_TCollection *somSelf, Environment *ev);
  134. typedef somTP_somf_TCollection_somfRemoveAll *somTD_somf_TCollection_somfRemoveAll;
  135. typedef void   SOMLINK somTP_somf_TCollection_somfDeleteAll(somf_TCollection *somSelf, Environment *ev);
  136. typedef somTP_somf_TCollection_somfDeleteAll *somTD_somf_TCollection_somfDeleteAll;
  137. typedef long   SOMLINK somTP_somf_TCollection_somfCount(somf_TCollection *somSelf, Environment *ev);
  138. typedef somTP_somf_TCollection_somfCount *somTD_somf_TCollection_somfCount;
  139. typedef somf_MCollectible*   SOMLINK somTP_somf_TCollection_somfMember(somf_TCollection *somSelf, Environment *ev, 
  140.         somf_MCollectible* obj);
  141. typedef somTP_somf_TCollection_somfMember *somTD_somf_TCollection_somfMember;
  142. typedef somf_TIterator*   SOMLINK somTP_somf_TCollection_somfCreateIterator(somf_TCollection *somSelf, Environment *ev);
  143. typedef somTP_somf_TCollection_somfCreateIterator *somTD_somf_TCollection_somfCreateIterator;
  144. typedef somf_MCollectible_somf_MCollectibleCompareFn   SOMLINK somTP_somf_TCollection_somfTestFunction(somf_TCollection *somSelf, Environment *ev);
  145. typedef somTP_somf_TCollection_somfTestFunction *somTD_somf_TCollection_somfTestFunction;
  146. typedef void   SOMLINK somTP_somf_TCollection_somfSetTestFunction(somf_TCollection *somSelf, Environment *ev, 
  147.         somf_MCollectible_somf_MCollectibleCompareFn testfn);
  148. typedef somTP_somf_TCollection_somfSetTestFunction *somTD_somf_TCollection_somfSetTestFunction;
  149. typedef somf_TCollection*   SOMLINK somTP_somf_TCollection_somfTCollectionInit(somf_TCollection *somSelf, Environment *ev, 
  150.         somf_MCollectible_somf_MCollectibleCompareFn testfn);
  151. typedef somTP_somf_TCollection_somfTCollectionInit *somTD_somf_TCollection_somfTCollectionInit;
  152.  
  153. /*
  154.  * -- Typedefs for Reintroduced Wrapper Methods
  155.  */
  156. typedef somf_MCollectible*   SOMLINK somTP_somf_TCollection_somfClone(somf_TCollection *somSelf, Environment *ev);
  157. typedef somTP_somf_TCollection_somfClone *somTD_somf_TCollection_somfClone;
  158. typedef somf_MCollectible*   SOMLINK somTP_somf_TCollection_somfClonePointer(somf_TCollection *somSelf, Environment *ev, 
  159.         somf_MCollectible* clonee);
  160. typedef somTP_somf_TCollection_somfClonePointer *somTD_somf_TCollection_somfClonePointer;
  161. typedef long   SOMLINK somTP_somf_TCollection_somfHash(somf_TCollection *somSelf, Environment *ev);
  162. typedef somTP_somf_TCollection_somfHash *somTD_somf_TCollection_somfHash;
  163. typedef boolean   SOMLINK somTP_somf_TCollection_somfIsEqual(somf_TCollection *somSelf, Environment *ev, 
  164.         somf_MCollectible* obj);
  165. typedef somTP_somf_TCollection_somfIsEqual *somTD_somf_TCollection_somfIsEqual;
  166. typedef boolean   SOMLINK somTP_somf_TCollection_somfIsSame(somf_TCollection *somSelf, Environment *ev, 
  167.         somf_MCollectible* obj);
  168. typedef somTP_somf_TCollection_somfIsSame *somTD_somf_TCollection_somfIsSame;
  169. typedef boolean   SOMLINK somTP_somf_TCollection_somfIsNotEqual(somf_TCollection *somSelf, Environment *ev, 
  170.         somf_MCollectible* obj);
  171. typedef somTP_somf_TCollection_somfIsNotEqual *somTD_somf_TCollection_somfIsNotEqual;
  172. typedef void   SOMLINK somTP_somf_TCollection_somDefaultInit(somf_TCollection *somSelf, 
  173.         som3InitCtrl* ctrl);
  174. typedef somTP_somf_TCollection_somDefaultInit *somTD_somf_TCollection_somDefaultInit;
  175. typedef void   SOMLINK somTP_somf_TCollection_somDestruct(somf_TCollection *somSelf, 
  176.         octet doFree, 
  177.         som3DestructCtrl* ctrl);
  178. typedef somTP_somf_TCollection_somDestruct *somTD_somf_TCollection_somDestruct;
  179. typedef void   SOMLINK somTP_somf_TCollection_somDefaultCopyInit(somf_TCollection *somSelf, 
  180.         som3InitCtrl* ctrl, 
  181.         SOMObject* fromObj);
  182. typedef somTP_somf_TCollection_somDefaultCopyInit *somTD_somf_TCollection_somDefaultCopyInit;
  183. typedef somf_TCollection*   SOMLINK somTP_somf_TCollection_somDefaultAssign(somf_TCollection *somSelf, 
  184.         som3AssignCtrl* ctrl, 
  185.         SOMObject* fromObj);
  186. typedef somTP_somf_TCollection_somDefaultAssign *somTD_somf_TCollection_somDefaultAssign;
  187. typedef void   SOMLINK somTP_somf_TCollection_somDefaultConstCopyInit(somf_TCollection *somSelf, 
  188.         som3InitCtrl* ctrl, 
  189.         SOMObject* fromObj);
  190. typedef somTP_somf_TCollection_somDefaultConstCopyInit *somTD_somf_TCollection_somDefaultConstCopyInit;
  191. typedef void   SOMLINK somTP_somf_TCollection_somDefaultVCopyInit(somf_TCollection *somSelf, 
  192.         som3InitCtrl* ctrl, 
  193.         SOMObject* fromObj);
  194. typedef somTP_somf_TCollection_somDefaultVCopyInit *somTD_somf_TCollection_somDefaultVCopyInit;
  195. typedef void   SOMLINK somTP_somf_TCollection_somDefaultConstVCopyInit(somf_TCollection *somSelf, 
  196.         som3InitCtrl* ctrl, 
  197.         SOMObject* fromObj);
  198. typedef somTP_somf_TCollection_somDefaultConstVCopyInit *somTD_somf_TCollection_somDefaultConstVCopyInit;
  199. typedef somf_TCollection*   SOMLINK somTP_somf_TCollection_somDefaultConstAssign(somf_TCollection *somSelf, 
  200.         som3AssignCtrl* ctrl, 
  201.         SOMObject* fromObj);
  202. typedef somTP_somf_TCollection_somDefaultConstAssign *somTD_somf_TCollection_somDefaultConstAssign;
  203. typedef somf_TCollection*   SOMLINK somTP_somf_TCollection_somDefaultVAssign(somf_TCollection *somSelf, 
  204.         som3AssignCtrl* ctrl, 
  205.         SOMObject* fromObj);
  206. typedef somTP_somf_TCollection_somDefaultVAssign *somTD_somf_TCollection_somDefaultVAssign;
  207. typedef somf_TCollection*   SOMLINK somTP_somf_TCollection_somDefaultConstVAssign(somf_TCollection *somSelf, 
  208.         som3AssignCtrl* ctrl, 
  209.         SOMObject* fromObj);
  210. typedef somTP_somf_TCollection_somDefaultConstVAssign *somTD_somf_TCollection_somDefaultConstVAssign;
  211. typedef void   SOMLINK somTP_somf_TCollection_somInit(somf_TCollection *somSelf);
  212. typedef somTP_somf_TCollection_somInit *somTD_somf_TCollection_somInit;
  213. typedef void   SOMLINK somTP_somf_TCollection_somFree(somf_TCollection *somSelf);
  214. typedef somTP_somf_TCollection_somFree *somTD_somf_TCollection_somFree;
  215. typedef void   SOMLINK somTP_somf_TCollection_somUninit(somf_TCollection *somSelf);
  216. typedef somTP_somf_TCollection_somUninit *somTD_somf_TCollection_somUninit;
  217. typedef SOMClass*   SOMLINK somTP_somf_TCollection_somGetClass(somf_TCollection *somSelf);
  218. typedef somTP_somf_TCollection_somGetClass *somTD_somf_TCollection_somGetClass;
  219. typedef string   SOMLINK somTP_somf_TCollection_somGetClassName(somf_TCollection *somSelf);
  220. typedef somTP_somf_TCollection_somGetClassName *somTD_somf_TCollection_somGetClassName;
  221. typedef long   SOMLINK somTP_somf_TCollection_somGetSize(somf_TCollection *somSelf);
  222. typedef somTP_somf_TCollection_somGetSize *somTD_somf_TCollection_somGetSize;
  223. typedef boolean   SOMLINK somTP_somf_TCollection_somIsA(somf_TCollection *somSelf, 
  224.         SOMClass* aClassObj);
  225. typedef somTP_somf_TCollection_somIsA *somTD_somf_TCollection_somIsA;
  226. typedef boolean   SOMLINK somTP_somf_TCollection_somIsInstanceOf(somf_TCollection *somSelf, 
  227.         SOMClass* aClassObj);
  228. typedef somTP_somf_TCollection_somIsInstanceOf *somTD_somf_TCollection_somIsInstanceOf;
  229. typedef boolean   SOMLINK somTP_somf_TCollection_somRespondsTo(somf_TCollection *somSelf, 
  230.         somId mId);
  231. typedef somTP_somf_TCollection_somRespondsTo *somTD_somf_TCollection_somRespondsTo;
  232. typedef boolean   SOMLINK somTP_somf_TCollection_somDispatch(somf_TCollection *somSelf, 
  233.         somToken* retValue, 
  234.         somId methodId, 
  235.         va_list ap);
  236. typedef somTP_somf_TCollection_somDispatch *somTD_somf_TCollection_somDispatch;
  237. typedef boolean   SOMLINK somTP_somf_TCollection_somClassDispatch(somf_TCollection *somSelf, 
  238.         SOMClass* clsObj, 
  239.         somToken* retValue, 
  240.         somId methodId, 
  241.         va_list ap);
  242. typedef somTP_somf_TCollection_somClassDispatch *somTD_somf_TCollection_somClassDispatch;
  243. typedef boolean   SOMLINK somTP_somf_TCollection_somCastObj(somf_TCollection *somSelf, 
  244.         SOMClass* cls);
  245. typedef somTP_somf_TCollection_somCastObj *somTD_somf_TCollection_somCastObj;
  246. typedef boolean   SOMLINK somTP_somf_TCollection_somResetObj(somf_TCollection *somSelf);
  247. typedef somTP_somf_TCollection_somResetObj *somTD_somf_TCollection_somResetObj;
  248. typedef void   SOMLINK somTP_somf_TCollection_somDispatchV(somf_TCollection *somSelf, 
  249.         somId methodId, 
  250.         somId descriptor, 
  251.         va_list ap);
  252. typedef somTP_somf_TCollection_somDispatchV *somTD_somf_TCollection_somDispatchV;
  253. typedef long   SOMLINK somTP_somf_TCollection_somDispatchL(somf_TCollection *somSelf, 
  254.         somId methodId, 
  255.         somId descriptor, 
  256.         va_list ap);
  257. typedef somTP_somf_TCollection_somDispatchL *somTD_somf_TCollection_somDispatchL;
  258. typedef void*   SOMLINK somTP_somf_TCollection_somDispatchA(somf_TCollection *somSelf, 
  259.         somId methodId, 
  260.         somId descriptor, 
  261.         va_list ap);
  262. typedef somTP_somf_TCollection_somDispatchA *somTD_somf_TCollection_somDispatchA;
  263. typedef double   SOMLINK somTP_somf_TCollection_somDispatchD(somf_TCollection *somSelf, 
  264.         somId methodId, 
  265.         somId descriptor, 
  266.         va_list ap);
  267. typedef somTP_somf_TCollection_somDispatchD *somTD_somf_TCollection_somDispatchD;
  268. typedef SOMObject*   SOMLINK somTP_somf_TCollection_somPrintSelf(somf_TCollection *somSelf);
  269. typedef somTP_somf_TCollection_somPrintSelf *somTD_somf_TCollection_somPrintSelf;
  270. typedef void   SOMLINK somTP_somf_TCollection_somDumpSelf(somf_TCollection *somSelf, 
  271.         long level);
  272. typedef somTP_somf_TCollection_somDumpSelf *somTD_somf_TCollection_somDumpSelf;
  273. typedef void   SOMLINK somTP_somf_TCollection_somDumpSelfInt(somf_TCollection *somSelf, 
  274.         long level);
  275. typedef somTP_somf_TCollection_somDumpSelfInt *somTD_somf_TCollection_somDumpSelfInt;
  276. }
  277.  
  278. #endif /* somf_TCollection_API */
  279.  
  280.  
  281. /*
  282.  * -- This emitter treats Method Tokens as Thunks by default.
  283.  * -- Use the sc modifier "nothunks" to change this default
  284.  */
  285. #undef somresolve_
  286. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  287.  
  288. /*
  289.  * -- The C++ Wrapper Class for somf_TCollection
  290.  */
  291. class somf_TCollection : public somf_MCollectible
  292. {
  293. public:
  294.  
  295. // somf_TCollection::new creates the class object if necessary, and then uses somNewNoInit
  296. // to allocate memory and create the object. Initialization is in ctors.
  297. void *operator new(size_t)
  298. {
  299.    if (!_somf_TCollection) somf_TCollectionNewClass(somf_TCollection_MajorVersion,somf_TCollection_MinorVersion);
  300.    return (void*)
  301.       SOM_Resolve(_somf_TCollection,SOMClass,somNewNoInit)
  302.          ((SOMClass *)((void*)_somf_TCollection));
  303. }
  304.  
  305. // somf_TCollection::delete uses somDestruct.
  306. void operator delete(void * obj)
  307. {
  308.    if (obj && *(void**)obj) {
  309.       SOM_Resolve(obj,SOMObject,somFree)
  310.          ((SOMObject*)obj);
  311.    }
  312. }
  313.  
  314. somf_TCollection& operator=(somf_TCollection& fromObj)
  315. {
  316.    this->somDefaultAssign(0,(SOMObject*)((void*)&fromObj));
  317.    return *this;
  318. }
  319.  
  320. somf_TCollection()
  321. {
  322.    if (*(void**)this != 
  323.        ((somParentMtabStructPtr)
  324.         (somf_TCollectionCClassData.parentMtab))->mtab)
  325.       return;
  326.    ((SOMObject*)((void*)this))->somDefaultInit(0);
  327. }
  328.  
  329. somf_TCollection(somf_TCollection* fromObj)
  330. {
  331.    if (*(void**)this != 
  332.        ((somParentMtabStructPtr)
  333.         (somf_TCollectionCClassData.parentMtab))->mtab)
  334.       return;
  335.    ((SOMObject*)((void*)this))->somDefaultCopyInit(0,((SOMObject*)((void*)fromObj)));
  336. }
  337.  
  338. #ifdef __IBMCPP__
  339. #pragma info(nocnv,nopar)
  340. #endif
  341. somf_TCollection(const somf_TCollection* fromObj)
  342. {
  343.    if (*(void**)this != 
  344.        ((somParentMtabStructPtr)
  345.         (somf_TCollectionCClassData.parentMtab))->mtab)
  346.       return;
  347.    ((SOMObject*)((void*)this))->somDefaultConstCopyInit(0,((SOMObject*)((void*)fromObj)));
  348. }
  349. #ifdef __IBMCPP__
  350. #pragma info(restore)
  351. #endif
  352.  
  353.  
  354. /* method: somfAdd */
  355. somf_MCollectible*   somfAdd(Environment *ev, 
  356.         somf_MCollectible* obj)
  357. {
  358. /*
  359.  *  Add obj to this.
  360.  */
  361.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfAdd)
  362.     (this, ev,obj);
  363. }
  364.  
  365.  
  366. /* method: somfAddAll */
  367. void   somfAddAll(Environment *ev, 
  368.         somf_TCollection* col)
  369. {
  370. /*
  371.  *  Add all of the objects in collection to this.  Essentially this is
  372.  *  equivalent to getting an iterator for the collection passed in and adding
  373.  *  each element in the collection to this.
  374.  */
  375.    SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfAddAll)
  376.     (this, ev,col);
  377. }
  378.  
  379.  
  380. /* method: somfRemove */
  381. somf_MCollectible*   somfRemove(Environment *ev, 
  382.         somf_MCollectible* obj)
  383. {
  384. /*
  385.  *  Remove obj from this.  Return the object which was actually removed
  386.  *  (which if you are using an IsEqual test function may not be the same as the
  387.  *  object passed in only "equal")
  388.  */
  389.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfRemove)
  390.     (this, ev,obj);
  391. }
  392.  
  393.  
  394. /* method: somfRemoveAll */
  395. void   somfRemoveAll(Environment *ev)
  396. {
  397. /*
  398.  *  Remove all of the objects from this.
  399.  */
  400.    SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfRemoveAll)
  401.     (this, ev);
  402. }
  403.  
  404.  
  405. /* method: somfDeleteAll */
  406. void   somfDeleteAll(Environment *ev)
  407. {
  408. /*
  409.  *  Remove all of the objects from this and deallocate the storage that these
  410.  *  objects might have owned (that is, the destructor function is called
  411.  *  for each object in the collection).
  412.  */
  413.    SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfDeleteAll)
  414.     (this, ev);
  415. }
  416.  
  417.  
  418. /* method: somfCount */
  419. long   somfCount(Environment *ev)
  420. {
  421. /*
  422.  *  Return the number of objects in this.
  423.  */
  424.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfCount)
  425.     (this, ev);
  426. }
  427.  
  428.  
  429. /* method: somfMember */
  430. somf_MCollectible*   somfMember(Environment *ev, 
  431.         somf_MCollectible* obj)
  432. {
  433. /*
  434.  *  Each object in this is compared to obj using the function testFn.  Return the
  435.  *  object for which testFn returned TRUE.  Return SOMF_NIL if not object was found.
  436.  */
  437.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfMember)
  438.     (this, ev,obj);
  439. }
  440.  
  441.  
  442. /* method: somfCreateIterator */
  443. somf_TIterator*   somfCreateIterator(Environment *ev)
  444. {
  445. /*
  446.  *  This method returns a new iterator which is suitable for use in iterating
  447.  *  over the objects in this collection.
  448.  */
  449.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfCreateIterator)
  450.     (this, ev);
  451. }
  452.  
  453.  
  454. /* method: somfTestFunction */
  455. somf_MCollectible_somf_MCollectibleCompareFn   somfTestFunction(Environment *ev)
  456. {
  457. /*
  458.  *  Return the test function.  This is usually either IsSame or IsEqual.
  459.  */
  460.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfTestFunction)
  461.     (this, ev);
  462. }
  463.  
  464.  
  465. /* method: somfSetTestFunction */
  466. void   somfSetTestFunction(Environment *ev, 
  467.         somf_MCollectible_somf_MCollectibleCompareFn testfn)
  468. {
  469. /*
  470.  *  Set the test function.
  471.  */
  472.    SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfSetTestFunction)
  473.     (this, ev,testfn);
  474. }
  475.  
  476.  
  477. /* method: somfTCollectionInit */
  478. somf_TCollection*   somfTCollectionInit(Environment *ev, 
  479.         somf_MCollectible_somf_MCollectibleCompareFn testfn)
  480. {
  481. /*
  482.  *  Initialize the somf_TCollection test function to testfn.
  483.  */
  484.    return SOM_ResolveD(this,somf_TCollection,somf_TCollection,somfTCollectionInit)
  485.     (this, ev,testfn);
  486. }
  487.  
  488.  
  489. /*
  490.  * Reintroduce inherited methods
  491.  */
  492.  
  493. /* method: somfClone */
  494. somf_MCollectible*   somfClone(Environment *ev)
  495. {
  496. /*
  497.  *  somfClone provides a general function for creating a new instance of this.
  498.  */
  499.    return SOM_ResolveD(this,somf_TCollection,somf_MCollectible,somfClone)
  500.     (this, ev);
  501. }
  502.  
  503.  
  504. /* method: somfClonePointer */
  505. somf_MCollectible*   somfClonePointer(Environment *ev, 
  506.         somf_MCollectible* clonee)
  507. {
  508. /*
  509.  *  somfClonePointer returns a pointer to a Clone
  510.  */
  511.    return SOM_ResolveD(this,somf_TCollection,somf_MCollectible,somfClonePointer)
  512.     (this, ev,clonee);
  513. }
  514.  
  515.  
  516. /* method: somfHash */
  517. long   somfHash(Environment *ev)
  518. {
  519. /*
  520.  *  somfHash returns a value suitable for use as a hashing probe for this.
  521.  *  The default function will simply return the address of the object.
  522.  *  The default function is almost certainly not adequate if you are overriding
  523.  *  somfIsEqual because you need to make sure that all objects that "are equal"
  524.  *  to each other return the same hash value.  For example, a TText object would
  525.  *  return a hash value computed using the characters in the string instead of
  526.  *  the address of the string.
  527.  */
  528.    return SOM_ResolveD(this,somf_TCollection,somf_MCollectible,somfHash)
  529.     (this, ev);
  530. }
  531.  
  532.  
  533. /* method: somfIsEqual */
  534. boolean   somfIsEqual(Environment *ev, 
  535.         somf_MCollectible* obj)
  536. {
  537. /*
  538.  *  somfIsEqual returns TRUE if obj is isomorphic to this.  The default function
  539.  *  will give you a nasty message.  For example, the somfIsEqual method
  540.  *  for TText objects will do a string comparison.  All of the utility classes
  541.  *  allow you to specify what methods to use when comparing objects for
  542.  *  insertion, deletion, etc.
  543.  */
  544.    return SOM_ResolveD(this,somf_TCollection,somf_MCollectible,somfIsEqual)
  545.     (this, ev,obj);
  546. }
  547.  
  548.  
  549. /* method: somfIsSame */
  550. boolean   somfIsSame(Environment *ev, 
  551.         somf_MCollectible* obj)
  552. {
  553. /*
  554.  *  The default function for somfIsSame is a pointer comparison
  555.  */
  556.    return SOM_ResolveD(this,somf_TCollection,somf_MCollectible,somfIsSame)
  557.     (this, ev,obj);
  558. }
  559.  
  560.  
  561. /* method: somfIsNotEqual */
  562. boolean   somfIsNotEqual(Environment *ev, 
  563.         somf_MCollectible* obj)
  564. {
  565. /*
  566.  *  somfIsNotEqual returns TRUE if obj is NOT isomorphic to this.  It uses
  567.  *  somfIsEqual, so overriding somfIsEqual will handle the logic of somfIsNotEqual too.
  568.  */
  569.    return SOM_ResolveD(this,somf_TCollection,somf_MCollectible,somfIsNotEqual)
  570.     (this, ev,obj);
  571. }
  572.  
  573.  
  574. /* initializer method: somDefaultInit */
  575. void   somDefaultInit(som3InitCtrl* ctrl)
  576. {
  577. /*
  578.  *  A default initializer for a SOM object. Passing a null ctrl
  579.  *  indicates to the receiver that its class is the class of the
  580.  *  object being initialized, whereby the initializer will determine
  581.  *  an appropriate control structure.
  582.  */
  583.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultInit)
  584.     (this,ctrl);
  585. }
  586.  
  587.  
  588. /* method: somDestruct */
  589. void   somDestruct(octet doFree, 
  590.         som3DestructCtrl* ctrl)
  591. {
  592. /*
  593.  *  The default destructor for a SOM object. A nonzero <doFree>
  594.  *  indicates that the object storage should be freed by the
  595.  *  object's class (via somDeallocate) after uninitialization.
  596.  *  As with somDefaultInit, a null ctrl can be passed.
  597.  */
  598.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDestruct)
  599.     (this,doFree,ctrl);
  600. }
  601.  
  602.  
  603. /* initializer method: somDefaultCopyInit */
  604. void   somDefaultCopyInit(som3InitCtrl* ctrl, 
  605.         SOMObject* fromObj)
  606. {
  607. /*
  608.  *  A default copy constructor. Use this to make copies of objects for
  609.  *  calling methods with "by-value" argument semantics.
  610.  */
  611.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultCopyInit)
  612.     (this,ctrl,fromObj);
  613. }
  614.  
  615.  
  616. /* method: somDefaultAssign */
  617. somf_TCollection*  somDefaultAssign(som3AssignCtrl* ctrl, 
  618.         SOMObject* fromObj)
  619. {
  620. /*
  621.  *  A default assignment operator. Use this to "assign" the state of one
  622.  *  object to another.
  623.  */
  624.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultAssign)
  625.     (this,ctrl,fromObj);
  626. }
  627.  
  628.  
  629. /* initializer method: somDefaultConstCopyInit */
  630. void   somDefaultConstCopyInit(som3InitCtrl* ctrl, 
  631.         SOMObject* fromObj)
  632. {
  633. /*
  634.  *  A default copy constructor that uses a const fromObj.
  635.  */
  636.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultConstCopyInit)
  637.     (this,ctrl,fromObj);
  638. }
  639.  
  640.  
  641. /* initializer method: somDefaultVCopyInit */
  642. void   somDefaultVCopyInit(som3InitCtrl* ctrl, 
  643.         SOMObject* fromObj)
  644. {
  645. /*
  646.  *  A default copy constructor that uses a volatile fromObj.
  647.  */
  648.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultVCopyInit)
  649.     (this,ctrl,fromObj);
  650. }
  651.  
  652.  
  653. /* initializer method: somDefaultConstVCopyInit */
  654. void   somDefaultConstVCopyInit(som3InitCtrl* ctrl, 
  655.         SOMObject* fromObj)
  656. {
  657. /*
  658.  *  A default copy constructor that uses a const volatile fromObj.
  659.  */
  660.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultConstVCopyInit)
  661.     (this,ctrl,fromObj);
  662. }
  663.  
  664.  
  665. /* method: somDefaultConstAssign */
  666. somf_TCollection*  somDefaultConstAssign(som3AssignCtrl* ctrl, 
  667.         SOMObject* fromObj)
  668. {
  669. /*
  670.  *  A default assignment operator that uses a const fromObj.
  671.  */
  672.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultConstAssign)
  673.     (this,ctrl,fromObj);
  674. }
  675.  
  676.  
  677. /* method: somDefaultVAssign */
  678. somf_TCollection*  somDefaultVAssign(som3AssignCtrl* ctrl, 
  679.         SOMObject* fromObj)
  680. {
  681. /*
  682.  *  A default assignment operator that uses a volatile fromObj.
  683.  */
  684.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultVAssign)
  685.     (this,ctrl,fromObj);
  686. }
  687.  
  688.  
  689. /* method: somDefaultConstVAssign */
  690. somf_TCollection*  somDefaultConstVAssign(som3AssignCtrl* ctrl, 
  691.         SOMObject* fromObj)
  692. {
  693. /*
  694.  *  A default assignment operator that uses a const volatile fromObj.
  695.  */
  696.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somDefaultConstVAssign)
  697.     (this,ctrl,fromObj);
  698. }
  699.  
  700.  
  701. /* method: somInit */
  702. void   somInit()
  703. {
  704. /*
  705.  *  Obsolete but still supported. Override somDefaultInit instead of somInit.
  706.  */
  707.    SOM_ResolveD(this,somf_TCollection,SOMObject,somInit)
  708.     (this);
  709. }
  710.  
  711.  
  712. /* method: somFree */
  713. void   somFree()
  714. {
  715. /*
  716.  *  Use as directed by framework implementations.
  717.  */
  718.    SOM_ResolveD(this,somf_TCollection,SOMObject,somFree)
  719.     (this);
  720. }
  721.  
  722.  
  723. /* method: somUninit */
  724. void   somUninit()
  725. {
  726. /*
  727.  *  Obsolete but still supported. Override somDestruct instead of somUninit.
  728.  */
  729.    SOM_ResolveD(this,somf_TCollection,SOMObject,somUninit)
  730.     (this);
  731. }
  732.  
  733.  
  734. /* method: somGetClass */
  735. SOMClass*   somGetClass()
  736. {
  737. /*
  738.  *  Return the receiver's class.
  739.  */
  740.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somGetClass)
  741.     (this);
  742. }
  743.  
  744.  
  745. /* method: somGetClassName */
  746. string   somGetClassName()
  747. {
  748. /*
  749.  *  Return the name of the receiver's class.
  750.  */
  751.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somGetClassName)
  752.     (this);
  753. }
  754.  
  755.  
  756. /* method: somGetSize */
  757. long   somGetSize()
  758. {
  759. /*
  760.  *  Return the size of the receiver.
  761.  */
  762.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somGetSize)
  763.     (this);
  764. }
  765.  
  766.  
  767. /* method: somIsA */
  768. boolean   somIsA(SOMClass* aClassObj)
  769. {
  770. /*
  771.  *  Returns 1 (true) if the receiver responds to methods
  772.  *  introduced by <aClassObj>, and 0 (false) otherwise.
  773.  */
  774.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somIsA)
  775.     (this,aClassObj);
  776. }
  777.  
  778.  
  779. /* method: somIsInstanceOf */
  780. boolean   somIsInstanceOf(SOMClass* aClassObj)
  781. {
  782. /*
  783.  *  Returns 1 (true) if the receiver is an instance of
  784.  *  <aClassObj> and 0 (false) otherwise.
  785.  */
  786.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somIsInstanceOf)
  787.     (this,aClassObj);
  788. }
  789.  
  790.  
  791. /* method: somRespondsTo */
  792. boolean   somRespondsTo(somId mId)
  793. {
  794. /*
  795.  *  Returns 1 (true) if the indicated method can be invoked
  796.  *  on the receiver and 0 (false) otherwise.
  797.  */
  798.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somRespondsTo)
  799.     (this,mId);
  800. }
  801.  
  802.  
  803. /* va_list method: somDispatch */
  804.  
  805. /*
  806.  *  This method provides a generic, class-specific dispatch mechanism.
  807.  *  It accepts as input <retValue> a pointer to the memory area to be
  808.  *  loaded with the result of dispatching the method indicated by
  809.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  810.  *  on which the method is to be invoked as the first argument.
  811.  */
  812. /* the va_list invocation form */
  813. boolean   somf_TCollection_somDispatch(somToken* retValue, 
  814.         somId methodId, 
  815.         va_list ap)
  816. {return SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatch)
  817.     (this,retValue,methodId,ap);
  818. }
  819.  
  820. /* the varargs invocation form */
  821. boolean   somDispatch(somToken* retValue, 
  822.         somId methodId, 
  823.         ...)
  824. {
  825. /*
  826.  *  This method provides a generic, class-specific dispatch mechanism.
  827.  *  It accepts as input <retValue> a pointer to the memory area to be
  828.  *  loaded with the result of dispatching the method indicated by
  829.  *  <methodId> using the arguments in <ap>. <ap> contains the object
  830.  *  on which the method is to be invoked as the first argument.
  831.  */
  832.    va_list ap;
  833.    va_start(ap, methodId);
  834.    boolean __somResult = 
  835.       SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatch)
  836.     (this,retValue,methodId,ap);
  837.    va_end(ap);
  838.    return __somResult;
  839. }
  840.  
  841.  
  842. /* va_list method: somClassDispatch */
  843.  
  844. /*
  845.  *  Like somDispatch, but method resolution for static methods is done
  846.  *  according to the clsObj instance method table.
  847.  */
  848. /* the va_list invocation form */
  849. boolean   somf_TCollection_somClassDispatch(SOMClass* clsObj, 
  850.         somToken* retValue, 
  851.         somId methodId, 
  852.         va_list ap)
  853. {return SOM_ResolveD(this,somf_TCollection,SOMObject,somClassDispatch)
  854.     (this,clsObj,retValue,methodId,ap);
  855. }
  856.  
  857. /* the varargs invocation form */
  858. boolean   somClassDispatch(SOMClass* clsObj, 
  859.         somToken* retValue, 
  860.         somId methodId, 
  861.         ...)
  862. {
  863. /*
  864.  *  Like somDispatch, but method resolution for static methods is done
  865.  *  according to the clsObj instance method table.
  866.  */
  867.    va_list ap;
  868.    va_start(ap, methodId);
  869.    boolean __somResult = 
  870.       SOM_ResolveD(this,somf_TCollection,SOMObject,somClassDispatch)
  871.     (this,clsObj,retValue,methodId,ap);
  872.    va_end(ap);
  873.    return __somResult;
  874. }
  875.  
  876.  
  877. /* method: somCastObj */
  878. boolean   somCastObj(SOMClass* cls)
  879. {
  880. /*
  881.  *  cast the receiving object to cls (which must be an ancestor of the
  882.  *  objects true class. Returns true on success.
  883.  */
  884.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somCastObj)
  885.     (this,cls);
  886. }
  887.  
  888.  
  889. /* method: somResetObj */
  890. boolean   somResetObj()
  891. {
  892. /*
  893.  *  reset an object to its true class. Returns true always.
  894.  */
  895.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somResetObj)
  896.     (this);
  897. }
  898.  
  899.  
  900. /* va_list method: somDispatchV */
  901.  
  902. /*
  903.  *  Obsolete. Use somDispatch instead.
  904.  */
  905. /* the va_list invocation form */
  906. void   somf_TCollection_somDispatchV(somId methodId, 
  907.         somId descriptor, 
  908.         va_list ap)
  909. {   SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchV)
  910.     (this,methodId,descriptor,ap);
  911. }
  912.  
  913. /* the varargs invocation form */
  914. void   somDispatchV(somId methodId, 
  915.         somId descriptor, 
  916.         ...)
  917. {
  918. /*
  919.  *  Obsolete. Use somDispatch instead.
  920.  */
  921.    va_list ap;
  922.    va_start(ap, descriptor);
  923.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchV)
  924.     (this,methodId,descriptor,ap);
  925.    va_end(ap);
  926. }
  927.  
  928.  
  929. /* va_list method: somDispatchL */
  930.  
  931. /*
  932.  *  Obsolete. Use somDispatch instead.
  933.  */
  934. /* the va_list invocation form */
  935. long   somf_TCollection_somDispatchL(somId methodId, 
  936.         somId descriptor, 
  937.         va_list ap)
  938. {return SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchL)
  939.     (this,methodId,descriptor,ap);
  940. }
  941.  
  942. /* the varargs invocation form */
  943. long   somDispatchL(somId methodId, 
  944.         somId descriptor, 
  945.         ...)
  946. {
  947. /*
  948.  *  Obsolete. Use somDispatch instead.
  949.  */
  950.    va_list ap;
  951.    va_start(ap, descriptor);
  952.    long __somResult = 
  953.       SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchL)
  954.     (this,methodId,descriptor,ap);
  955.    va_end(ap);
  956.    return __somResult;
  957. }
  958.  
  959.  
  960. /* va_list method: somDispatchA */
  961.  
  962. /*
  963.  *  Obsolete. Use somDispatch instead.
  964.  */
  965. /* the va_list invocation form */
  966. void*   somf_TCollection_somDispatchA(somId methodId, 
  967.         somId descriptor, 
  968.         va_list ap)
  969. {return SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchA)
  970.     (this,methodId,descriptor,ap);
  971. }
  972.  
  973. /* the varargs invocation form */
  974. void*   somDispatchA(somId methodId, 
  975.         somId descriptor, 
  976.         ...)
  977. {
  978. /*
  979.  *  Obsolete. Use somDispatch instead.
  980.  */
  981.    va_list ap;
  982.    va_start(ap, descriptor);
  983.    void* __somResult = 
  984.       SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchA)
  985.     (this,methodId,descriptor,ap);
  986.    va_end(ap);
  987.    return __somResult;
  988. }
  989.  
  990.  
  991. /* va_list method: somDispatchD */
  992.  
  993. /*
  994.  *  Obsolete. Use somDispatch instead.
  995.  */
  996. /* the va_list invocation form */
  997. double   somf_TCollection_somDispatchD(somId methodId, 
  998.         somId descriptor, 
  999.         va_list ap)
  1000. {return SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchD)
  1001.     (this,methodId,descriptor,ap);
  1002. }
  1003.  
  1004. /* the varargs invocation form */
  1005. double   somDispatchD(somId methodId, 
  1006.         somId descriptor, 
  1007.         ...)
  1008. {
  1009. /*
  1010.  *  Obsolete. Use somDispatch instead.
  1011.  */
  1012.    va_list ap;
  1013.    va_start(ap, descriptor);
  1014.    double __somResult = 
  1015.       SOM_ResolveD(this,somf_TCollection,SOMObject,somDispatchD)
  1016.     (this,methodId,descriptor,ap);
  1017.    va_end(ap);
  1018.    return __somResult;
  1019. }
  1020.  
  1021.  
  1022. /* method: somPrintSelf */
  1023. SOMObject*   somPrintSelf()
  1024. {
  1025. /*
  1026.  *  Uses <SOMOutCharRoutine> to write a brief string with identifying
  1027.  *  information about this object.  The default implementation just gives
  1028.  *  the object's class name and its address in memory.
  1029.  *  <self> is returned.
  1030.  */
  1031.    return SOM_ResolveD(this,somf_TCollection,SOMObject,somPrintSelf)
  1032.     (this);
  1033. }
  1034.  
  1035.  
  1036. /* method: somDumpSelf */
  1037. void   somDumpSelf(long level)
  1038. {
  1039. /*
  1040.  *  Uses <SOMOutCharRoutine> to write a detailed description of this object
  1041.  *  and its current state.
  1042.  * 
  1043.  *  <level> indicates the nesting level for describing compound objects
  1044.  *  it must be greater than or equal to zero.  All lines in the
  1045.  *  description will be preceeded by <2*level> spaces.
  1046.  * 
  1047.  *  This routine only actually writes the data that concerns the object
  1048.  *  as a whole, such as class, and uses <somDumpSelfInt> to describe
  1049.  *  the object's current state.  This approach allows readable
  1050.  *  descriptions of compound objects to be constructed.
  1051.  * 
  1052.  *  Generally it is not necessary to override this method, if it is
  1053.  *  overriden it generally must be completely replaced.
  1054.  */
  1055.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDumpSelf)
  1056.     (this,level);
  1057. }
  1058.  
  1059.  
  1060. /* method: somDumpSelfInt */
  1061. void   somDumpSelfInt(long level)
  1062. {
  1063. /*
  1064.  *  Uses <SOMOutCharRoutine> to write in the current state of this object.
  1065.  *  Generally this method will need to be overridden.  When overriding
  1066.  *  it, begin by calling the parent class form of this method and then
  1067.  *  write in a description of your class's instance data. This will
  1068.  *  result in a description of all the object's instance data going
  1069.  *  from its root ancestor class to its specific class.
  1070.  */
  1071.    SOM_ResolveD(this,somf_TCollection,SOMObject,somDumpSelfInt)
  1072.     (this,level);
  1073. }
  1074.  
  1075.  
  1076.  
  1077. };   /* somf_TCollection */
  1078.  
  1079.  
  1080.  
  1081. #endif       /* SOM_somf_TCollection_xh */
  1082.