home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / containr.idl < prev    next >
Encoding:
Text File  |  1996-02-21  |  5.6 KB  |  158 lines

  1. //
  2. //   COMPONENT_NAME: somi
  3. //
  4. //   ORIGINS: 27
  5. //
  6. //
  7. //   10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
  8. //   All Rights Reserved
  9. //   Licensed Materials - Property of IBM
  10. //   US Government Users Restricted Rights - Use, duplication or
  11. //   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  12. //
  13.  
  14. //  Container: CORBA Interface for container objects
  15.  
  16. #ifndef containr_idl
  17. #define containr_idl
  18.  
  19. #include <somobj.idl>
  20.  
  21.  
  22. #ifndef containd_idl
  23.   interface Contained;
  24.   typedef string Identifier;
  25. #endif /* containd_idl */
  26.  
  27. // CORBA 7.5.1, p.131
  28. //
  29. // Container is a generic interface that is common to all of the
  30. // SOM CORBA-compliant Interface Repository (IR) objects that can
  31. // be used to hold or contain other objects.  The different types
  32. // of Container objects are: ModuleDefs, InterfaceDefs, and OperationDefs,
  33. interface Container : SOMObject
  34. {
  35.     typedef string InterfaceName;
  36.     //
  37.     // Valid values for InterfaceName are limited to the following set:
  38.     //     {"AttributeDef", "ConstantDef", "ExceptionDef", "InterfaceDef",
  39.     //      "ModuleDef", "ParameterDef", "OperationDef", "TypeDef", "all"}
  40.  
  41.     struct ContainerDescription {
  42.     Contained  contained_object;
  43.     Identifier name;
  44.     any       value;
  45.     };
  46.  
  47.     sequence<Contained> contents(in InterfaceName limit_type,
  48.                  in boolean exclude_inherited);
  49.     // Returns a list of objects contained by the receiving object.
  50.     // This operation is used to navigate thru the hierarchy of objects.
  51.     // Starting with the Repository object, use this operation to list
  52.     // all of the objects in the Repository, then all of the objects
  53.     // within the ModuleDef objects, then all of the objects in the
  54.     // InterfaceDefs, etc.
  55.     //
  56.     // If restrict_type is set to "all", objects of all interface types
  57.     // are returned, otherwise only objects of the requested interface type
  58.     // will be returned.  If exclude_inherited is set to TRUE, inherited
  59.     // objects, if any, will not be returned.
  60.     //
  61.     // You are responsible for freeing the contents of the returned
  62.     // sequence when you are finished with it.    Use a code fragment
  63.     // similar to the following to free it:
  64.     //
  65.     //      if (containedSeq._length)
  66.     //          SOMFree (containedSeq._buffer);
  67.  
  68.     sequence<Contained> lookup_name(in Identifier search_name,
  69.                     in long levels_to_search,
  70.                     in InterfaceName limit_type,
  71.                     in boolean exclude_inherited);
  72.     // Locates an object by name within the receiving object, or within
  73.     // objects contained in the receiving object.  Search_name specifies
  74.     // the name of the object to be found.  Levels_to_search controls
  75.     // whether the lookup is constrained to the receiving object or
  76.     // whether it includes objects contained withing the receiving object.
  77.     // (Set levels_to_search to -1 to search the receiver and all contained
  78.     // objects, -- set it to 1 to search the receiver only.)  If
  79.     // limit_type is set to "all", objects of all interface types
  80.     // are returned, otherwise only objects of the requested interface type
  81.     // will be returned.  Only the values "AttributeDef", "ConstantDef",
  82.     // "ExceptionDef", "InterfaceDef", "ModuleDef", "ParameterDef",
  83.     // "OperationDef", "TypeDef", or "all" may be specified for limit_type.
  84.     // If exclude_inherited is set to TRUE, inherited objects will not be
  85.     // included in the returned sequence.
  86.     //
  87.     // You are responsible for freeing the contents of the returned
  88.     // sequence when you are finished with it.    Use a code fragment
  89.     // similar to the following to free it:
  90.     //
  91.     //      if (containedSeq._length)
  92.     //          SOMFree (containedSeq._buffer);
  93.  
  94.     sequence<ContainerDescription> describe_contents(in InterfaceName limit_type,
  95.                                              in boolean exclude_inherited,
  96.                                              in long max_returned_objs);
  97.     // Combines the "contents" operation and the "describe" operation.  For
  98.     // each object returned by the contents operation, the description of
  99.     // the object is returned by invoking its "describe" operation.
  100.     //
  101.     // Max_returned_objs can be used to limit the number of objects that can
  102.     // be returned.  If max_returned_objs is set to -1, results for all
  103.     // contained objects will be returned.
  104.     //
  105.     // Note: You should SOMFree result._buffer when you are done with it
  106.     // as well as result._buffer[x].value._value !
  107.  
  108. #ifdef __SOMIDL__
  109.   implementation {
  110.       releaseorder: contents, lookup_name, describe_contents
  111.           ;
  112.  
  113.       callstyle = idl;
  114.       majorversion = 2;
  115.       minorversion = 1;
  116.       filestem = containr;
  117.       dllname = "somir.dll";
  118.  
  119.       passthru C_h =
  120.     ""
  121.     "    #include <somtcnst.h>"
  122.     "    #include <stdio.h>"
  123.     "    #include <somir.h>"
  124.     "    #include <containd.h>"
  125.     "";
  126.       passthru C_xh =
  127.     ""
  128.     "    #include <somtcnst.xh>"
  129.     "    #include <stdio.h>"
  130.     "    #include <somir.xh>"
  131.     "    #include <containd.xh>"
  132.     "";
  133.       passthru C_hh =
  134.     ""
  135.     "    #include <somtcnst.hh>"
  136.     "    #include <stdio.h>"
  137.     "    #include <somir.hh>"
  138.     "    #include <containd.hh>"
  139.     "";
  140.  
  141.       somInit: override;
  142.       somUninit: override;
  143.       somDumpSelf: override;
  144.       somDumpSelfInt: override;
  145.  
  146. #if defined __SOM_KERNEL_LEVEL && __SOM_KERNEL_LEVEL >= 250
  147.       describe_contents: dual_owned_result;
  148. #else
  149.       contents: caller_owns_result;
  150.       lookup_name: caller_owns_result, caller_owns_parameters="search_name";
  151. #endif
  152.  
  153.   };
  154. #endif /* __SOMIDL__ */
  155. };
  156.  
  157. #endif    /* containr_idl */
  158.