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

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