home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / som / include / containr.h < prev    next >
C/C++ Source or Header  |  1999-02-22  |  13KB  |  367 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: containr.h.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.29.1.17
  7.  *     SOM Emitter emith: 2.47
  8.  */
  9.  
  10. #ifndef SOM_Container_h
  11. #define SOM_Container_h
  12.  
  13.  
  14. /*
  15.  * Passthru lines: File: "C.h", "before"
  16.  */
  17.  
  18.     #include <somtcnst.h>
  19.     #include <stdio.h>
  20.     #include <somir.h>
  21.     #include <containd.h>
  22.  
  23.  
  24. #include <som.h>
  25.  
  26. /*
  27.  * -- This emitter treats Method Tokens as Thunks by default.
  28.  * -- Use the sc modifier "nothunks" to change this default
  29.  */
  30. #undef somresolve_
  31. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  32.  
  33. /*
  34.  * Define the class name as an object type
  35.  */
  36. #ifndef Container
  37. #define Container SOMObject
  38. #endif
  39. /*
  40.  *  CORBA 1.1, 7.5.1, p.131
  41.  * 
  42.  *  Container is a generic interface that is common to all of the
  43.  *  SOM CORBA-compliant Interface Repository (IR) objects that can
  44.  *  be used to hold or contain other objects.  The different types
  45.  *  of Container objects are: ModuleDefs, InterfaceDefs, and OperationDefs,
  46.  */
  47. #include <somobj.h>
  48.  
  49. /*
  50.  * Start of bindings for IDL types
  51.  */
  52.  
  53. #ifndef SOMClass
  54.     #define SOMClass SOMObject
  55. #endif /* SOMClass */
  56. #ifndef Contained
  57.     #define Contained SOMObject
  58. #endif /* Contained */
  59. typedef
  60. string  Container_InterfaceName;
  61. /*
  62.  *  Valid values for InterfaceName are limited to the following set:
  63.  *      {"AttributeDef", "ConstantDef", "ExceptionDef", "InterfaceDef",
  64.  *       "ModuleDef", "ParameterDef", "OperationDef", "TypeDef", "all"}
  65.  */
  66.  
  67. typedef
  68. struct Container_ContainerDescription {
  69. Contained* contained_object;
  70. Identifier name;
  71. any  value;
  72. } Container_ContainerDescription;
  73. #ifndef _IDL_SEQUENCE_Contained_defined
  74. #define _IDL_SEQUENCE_Contained_defined
  75. typedef struct {
  76.     unsigned long _maximum;
  77.     unsigned long _length;
  78.     Contained **_buffer;
  79. } _IDL_SEQUENCE_Contained;
  80. #endif /* _IDL_SEQUENCE_Contained_defined */ 
  81. struct Container_ContainerDescription;
  82. #ifndef _IDL_SEQUENCE_Container_ContainerDescription_defined
  83. #define _IDL_SEQUENCE_Container_ContainerDescription_defined
  84. typedef struct {
  85.     unsigned long _maximum;
  86.     unsigned long _length;
  87.     struct Container_ContainerDescription *_buffer;
  88. } _IDL_SEQUENCE_Container_ContainerDescription;
  89. #endif /* _IDL_SEQUENCE_Container_ContainerDescription_defined */ 
  90.  
  91. #ifndef SOM_DONT_USE_SHORT_NAMES
  92. #ifndef SOMTGD_InterfaceName
  93.     #ifdef InterfaceName
  94.         #undef InterfaceName
  95.         #define SOMTGD_InterfaceName 1
  96.     #else
  97.         #define InterfaceName Container_InterfaceName
  98.     #endif /* InterfaceName */
  99. #endif /* SOMTGD_InterfaceName */
  100. #endif /* SOM_DONT_USE_SHORT_NAMES */
  101.  
  102. #ifndef SOM_DONT_USE_SHORT_NAMES
  103. #ifndef SOMTGD_ContainerDescription
  104.     #ifdef ContainerDescription
  105.         #undef ContainerDescription
  106.         #define SOMTGD_ContainerDescription 1
  107.     #else
  108.         #define ContainerDescription Container_ContainerDescription
  109.     #endif /* ContainerDescription */
  110. #endif /* SOMTGD_ContainerDescription */
  111. #ifndef SOMTGD__IDL_SEQUENCE_ContainerDescription
  112.     #ifdef _IDL_SEQUENCE_ContainerDescription
  113.         #undef _IDL_SEQUENCE_ContainerDescription
  114.         #define SOMTGD__IDL_SEQUENCE_ContainerDescription 1
  115.     #else
  116.         #define _IDL_SEQUENCE_ContainerDescription _IDL_SEQUENCE_Container_ContainerDescription
  117.     #endif /* _IDL_SEQUENCE_ContainerDescription */
  118. #endif /* SOMTGD__IDL_SEQUENCE_ContainerDescription */
  119. #endif /* SOM_DONT_USE_SHORT_NAMES */
  120.  
  121. /*
  122.  * End of bindings for IDL types.
  123.  */
  124.  
  125. #define Container_MajorVersion 2
  126. #define Container_MinorVersion 3
  127.  
  128. /*
  129.  * External name shortening if required
  130.  */
  131. #ifdef SOM_USE_SHORT_EXTERNAL_NAMES
  132. #define ContainerNewClass c
  133. #pragma linkage(c, system)
  134. #define ContainerClassData d
  135. #define ContainerCClassData x
  136. #endif /* SOM_USE_SHORT_EXTERNAL_NAMES */
  137. /*--------------Migration------------*/
  138. #define Container_classObj ContainerClassData.classObject
  139. #define _Container Container_classObj
  140.  
  141. /*
  142.  * Declare the class creation procedure
  143.  */
  144. SOMEXTERN SOMClass * SOMLINK ContainerNewClass(integer4 somtmajorVersion,
  145.         integer4 somtminorVersion);
  146. #pragma linkage(ContainerNewClass, system)
  147.  
  148. /*
  149.  * Declare the class data structure
  150.  */
  151. SOMEXTERN struct ContainerClassDataStructure {
  152.     SOMClass *classObject;
  153.     somMToken contents;
  154.     somMToken lookup_name;
  155.     somMToken describe_contents;
  156. } SOMDLINK ContainerClassData;
  157.  
  158. /*
  159.  * Declare the C specific class data structure
  160.  */
  161. SOMEXTERN struct ContainerCClassDataStructure {
  162.     somMethodTabs parentMtab;
  163.     somDToken instanceDataToken;
  164. } SOMDLINK ContainerCClassData;
  165.  
  166. /*
  167.  * New and Renew macros for Container
  168.  */
  169. #define ContainerNew() \
  170.    ( _Container ? \
  171.     _somNew(_Container) \
  172.     : ( ContainerNewClass(\
  173.         Container_MajorVersion, \
  174.         Container_MinorVersion),\
  175.        _somNew(_Container)))
  176. #define ContainerRenew(buf) \
  177.    ( _Container ? \
  178.     _somRenew(_Container, buf) \
  179.     : ( ContainerNewClass(\
  180.         Container_MajorVersion, \
  181.         Container_MinorVersion),\
  182.        _somRenew(_Container, buf)))
  183.  
  184. /*
  185.  * Override method: somDefaultInit
  186.  */
  187. #define Container_somDefaultInit(somSelf,ctrl) \
  188.     SOMObject_somDefaultInit(somSelf,ctrl)
  189.  
  190. /*
  191.  * Override method: somDestruct
  192.  */
  193. #define Container_somDestruct(somSelf,doFree,ctrl) \
  194.     SOMObject_somDestruct(somSelf,doFree,ctrl)
  195.  
  196. /*
  197.  * Override method: somDumpSelf
  198.  */
  199. #define Container_somDumpSelf(somSelf,level) \
  200.     SOMObject_somDumpSelf(somSelf,level)
  201.  
  202. /*
  203.  * Override method: somDumpSelfInt
  204.  */
  205. #define Container_somDumpSelfInt(somSelf,level) \
  206.     SOMObject_somDumpSelfInt(somSelf,level)
  207.  
  208. /*
  209.  * New Method: contents
  210.  */
  211. typedef _IDL_SEQUENCE_Contained   SOMLINK somTP_Container_contents(Container *somSelf, Environment *ev, 
  212.         Container_InterfaceName limit_type, 
  213.         boolean exclude_inherited);
  214. #pragma linkage(somTP_Container_contents, system)
  215. typedef somTP_Container_contents *somTD_Container_contents;
  216. /*
  217.  *  Returns a list of objects contained by the receiving object.
  218.  *  This operation is used to navigate thru the hierarchy of objects.
  219.  *  Starting with the Repository object, use this operation to list
  220.  *  all of the objects in the Repository, then all of the objects
  221.  *  within the ModuleDef objects, then all of the objects in the
  222.  *  InterfaceDefs, etc.
  223.  * 
  224.  *  If restrict_type is set to "all", objects of all interface types
  225.  *  are returned, otherwise only objects of the requested interface type
  226.  *  will be returned.  If exclude_inherited is set to TRUE, inherited
  227.  *  objects, if any, will not be returned.
  228.  * 
  229.  *  You are responsible for freeing the contents of the returned
  230.  *  sequence when you are finished with it.    Use a code fragment
  231.  *  similar to the following to free it:
  232.  * 
  233.  *       if (containedSeq._length)
  234.  *           long i;
  235.  *           for(i=0; i<containedSeq._length; i++)
  236.  *         SOMObject_somFree(containedSeq._buffer[i]);
  237.  *           SOMFree (containedSeq._buffer);
  238.  */
  239. #define somMD_Container_contents "::Container::contents"
  240. #define Container_contents(somSelf,ev,limit_type,exclude_inherited) \
  241.     (SOM_Resolve(somSelf, Container, contents) \
  242.     (somSelf,ev,limit_type,exclude_inherited))
  243. #ifndef SOMGD_contents
  244.     #if (defined(_contents) || defined(__contents))
  245.         #undef _contents
  246.         #undef __contents
  247.         #define SOMGD_contents 1
  248.     #else
  249.         #define _contents Container_contents
  250.     #endif /* _contents */
  251. #endif /* SOMGD_contents */
  252.  
  253. /*
  254.  * New Method: lookup_name
  255.  */
  256. typedef _IDL_SEQUENCE_Contained   SOMLINK somTP_Container_lookup_name(Container *somSelf, Environment *ev, 
  257.         Identifier search_name, 
  258.         long levels_to_search, 
  259.         Container_InterfaceName limit_type, 
  260.         boolean exclude_inherited);
  261. #pragma linkage(somTP_Container_lookup_name, system)
  262. typedef somTP_Container_lookup_name *somTD_Container_lookup_name;
  263. /*
  264.  *  Locates an object by name within the receiving object, or within
  265.  *  objects contained in the receiving object.  Search_name specifies
  266.  *  the name of the object to be found.  Levels_to_search controls
  267.  *  whether the lookup is constrained to the receiving object or
  268.  *  whether it includes objects contained withing the receiving object.
  269.  *  (Set levels_to_search to -1 to search the receiver and all contained
  270.  *  objects, -- set it to 1 to search the receiver only.)  If
  271.  *  limit_type is set to "all", objects of all interface types
  272.  *  are returned, otherwise only objects of the requested interface type
  273.  *  will be returned.  Only the values "AttributeDef", "ConstantDef",
  274.  *  "ExceptionDef", "InterfaceDef", "ModuleDef", "ParameterDef",
  275.  *  "OperationDef", "TypeDef", or "all" may be specified for limit_type.
  276.  *  If exclude_inherited is set to TRUE, inherited objects will not be
  277.  *  included in the returned sequence.
  278.  * 
  279.  *  You are responsible for freeing the contents of the returned
  280.  *  sequence when you are finished with it.    Use a code fragment
  281.  *  similar to the following to free it:
  282.  * 
  283.  *       if (containedSeq._length)
  284.  *           long i;
  285.  *           for(i=0; i<containedSeq._length; i++)
  286.  *         SOMObject_somFree(containedSeq._buffer[i]);
  287.  *           SOMFree (containedSeq._buffer);
  288.  */
  289. #define somMD_Container_lookup_name "::Container::lookup_name"
  290. #define Container_lookup_name(somSelf,ev,search_name,levels_to_search,limit_type,exclude_inherited) \
  291.     (SOM_Resolve(somSelf, Container, lookup_name) \
  292.     (somSelf,ev,search_name,levels_to_search,limit_type,exclude_inherited))
  293. #ifndef SOMGD_lookup_name
  294.     #if (defined(_lookup_name) || defined(__lookup_name))
  295.         #undef _lookup_name
  296.         #undef __lookup_name
  297.         #define SOMGD_lookup_name 1
  298.     #else
  299.         #define _lookup_name Container_lookup_name
  300.     #endif /* _lookup_name */
  301. #endif /* SOMGD_lookup_name */
  302.  
  303. /*
  304.  * New Method: describe_contents
  305.  */
  306. typedef _IDL_SEQUENCE_Container_ContainerDescription   SOMLINK somTP_Container_describe_contents(Container *somSelf, Environment *ev, 
  307.         Container_InterfaceName limit_type, 
  308.         boolean exclude_inherited, 
  309.         long max_returned_objs);
  310. #pragma linkage(somTP_Container_describe_contents, system)
  311. typedef somTP_Container_describe_contents *somTD_Container_describe_contents;
  312. /*
  313.  *  Combines the "contents" operation and the "describe" operation.  For
  314.  *  each object returned by the contents operation, the description of
  315.  *  the object is returned by invoking its "describe" operation.
  316.  * 
  317.  *  Max_returned_objs can be used to limit the number of objects that can
  318.  *  be returned.  If max_returned_objs is set to -1, results for all
  319.  *  contained objects will be returned.
  320.  * 
  321.  *  Note: You should SOMFree result._buffer when you are done with it
  322.  *  as well as result._buffer[x].value._value !
  323.  */
  324. #define somMD_Container_describe_contents "::Container::describe_contents"
  325. #define Container_describe_contents(somSelf,ev,limit_type,exclude_inherited,max_returned_objs) \
  326.     (SOM_Resolve(somSelf, Container, describe_contents) \
  327.     (somSelf,ev,limit_type,exclude_inherited,max_returned_objs))
  328. #ifndef SOMGD_describe_contents
  329.     #if (defined(_describe_contents) || defined(__describe_contents))
  330.         #undef _describe_contents
  331.         #undef __describe_contents
  332.         #define SOMGD_describe_contents 1
  333.     #else
  334.         #define _describe_contents Container_describe_contents
  335.     #endif /* _describe_contents */
  336. #endif /* SOMGD_describe_contents */
  337. #ifndef SOM_DONT_USE_INHERITED_MACROS
  338. #define Container_somDefaultCopyInit SOMObject_somDefaultCopyInit
  339. #define Container_somDefaultAssign SOMObject_somDefaultAssign
  340. #define Container_somDefaultConstCopyInit SOMObject_somDefaultConstCopyInit
  341. #define Container_somDefaultVCopyInit SOMObject_somDefaultVCopyInit
  342. #define Container_somDefaultConstVCopyInit SOMObject_somDefaultConstVCopyInit
  343. #define Container_somDefaultConstAssign SOMObject_somDefaultConstAssign
  344. #define Container_somDefaultVAssign SOMObject_somDefaultVAssign
  345. #define Container_somDefaultConstVAssign SOMObject_somDefaultConstVAssign
  346. #define Container_somInit SOMObject_somInit
  347. #define Container_somFree SOMObject_somFree
  348. #define Container_somUninit SOMObject_somUninit
  349. #define Container_somGetClass SOMObject_somGetClass
  350. #define Container_somGetClassName SOMObject_somGetClassName
  351. #define Container_somGetSize SOMObject_somGetSize
  352. #define Container_somIsA SOMObject_somIsA
  353. #define Container_somIsInstanceOf SOMObject_somIsInstanceOf
  354. #define Container_somRespondsTo SOMObject_somRespondsTo
  355. #define Container_somDispatch SOMObject_somDispatch
  356. #define Container_somClassDispatch SOMObject_somClassDispatch
  357. #define Container_somCastObj SOMObject_somCastObj
  358. #define Container_somResetObj SOMObject_somResetObj
  359. #define Container_somDispatchV SOMObject_somDispatchV
  360. #define Container_somDispatchL SOMObject_somDispatchL
  361. #define Container_somDispatchA SOMObject_somDispatchA
  362. #define Container_somDispatchD SOMObject_somDispatchD
  363. #define Container_somPrintSelf SOMObject_somPrintSelf
  364. #endif /* SOM_DONT_USE_INHERITED_MACROS */
  365.  
  366. #endif       /* SOM_Container_h */
  367.