home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / containd.idl < prev    next >
Encoding:
Text File  |  1996-02-21  |  6.2 KB  |  192 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. //  Contained: CORBA Interface for objects contained
  15. //  in the Interface Repository.  See CORBA 7.5.1 pp. 129-130
  16.  
  17. #ifndef containd_idl
  18. #define containd_idl
  19.  
  20. #include <somobj.idl>
  21. #include <somcls.idl>
  22.  
  23. struct somModifier {
  24.     string name;
  25.     string value;
  26. }; // SOM-unique extension
  27.  
  28. interface Container;
  29.  
  30. typedef string Identifier;
  31. typedef string RepositoryId;
  32.  
  33. // CORBA 7.5.1, p.130
  34. //
  35. // The Contained interface is the most generic form of interface
  36. // for the objects in the SOM CORBA-compliant Interface Repository (IR).
  37. // All objects contained in the IR inherit this interface.
  38. //
  39. interface Contained : SOMObject
  40. {
  41.     struct Description {
  42.     Identifier name;
  43.     any       value;
  44.     };
  45.  
  46.     attribute Identifier name;
  47.     // The value of the "name" field of the receiving object
  48.     //
  49.     // This is a simple name that indentifies the receiving object
  50.     // within its containment hierarchy.  Outside of the containment
  51.     // hierarchy this name is not necessarily unique, and may require
  52.     // qualification by ModuleDef name, InterfaceDef name, etc.
  53.  
  54.     attribute RepositoryId id;
  55.     // The value of the "id" field of the receiving object
  56.     //
  57.     // The "id" is a string that uniquely identifies any object in
  58.     // the interface repository.  No qualification is needed for
  59.     // an "id".  Notice that "RepositoryId"s have no relationship
  60.     // to the SOM type "somId".
  61.  
  62.     attribute RepositoryId defined_in;
  63.     // The value of the "defined_in" field of the receiving object
  64.     //
  65.     // This "id" uniquely identifies the container where the
  66.     // receiving object is defined.  Objects that have global scope
  67.     // and do not appear within any other objects are by default
  68.     // placed in the "Repository" object.
  69.  
  70.     attribute sequence<somModifier> somModifiers;
  71.     // [SOM-unique extension]
  72.     //
  73.     // The somModifiers attribute is a sequence containing all of
  74.     // the "modifiers" attached to the corresponding IDL object in
  75.     // the SOM-unique implementation section of the IDL file where
  76.     // the receiving object was originally defined.
  77.  
  78.     sequence<Container> within();
  79.     // Returns a list of objects that contain the receiving object.
  80.     // If the object is an interface or module, it can only be contained
  81.     // by the object that defines it.  Other objects can be contained by
  82.     // objects that define or inherit them.
  83.     //
  84.     // When you have finished using the sequence returned by this method
  85.     // it is your responsibility to release the storage allocated for it.
  86.     // To free the sequence, use a call similar to the following:
  87.     //
  88.     //      if (seqname._length)
  89.     //          SOMFree (seqname._buffer);
  90.  
  91.     Description describe();
  92.     // Returns a structure containing all of the attributes defined in
  93.     // the interface of the receiving object.
  94.     //
  95.     // Warning: this method returns pointers to things withing objects
  96.     // (for example, name).  Don't use the somFree method to release
  97.     // any of these objects while this information is still needed..
  98.     //
  99.     // When you have finished using the information in the returned
  100.     // Description structure, it is your responsibility to release
  101.     // the associated storage using a call similar to the following:
  102.     //
  103.     //      if (desc.value._value)
  104.     //          SOMFree (desc.value._value);
  105.  
  106. #ifdef __SOMIDL__
  107.   implementation {
  108.       releaseorder: within, describe,
  109.           _get_name, _set_name,
  110.           _get_id, _set_id,
  111.           _get_defined_in, _set_defined_in,
  112.           _get_somModifiers, _set_somModifiers
  113.           ;
  114.  
  115.       callstyle = idl;
  116.       majorversion = 2;
  117.       minorversion = 1;
  118.       filestem = containd;
  119.       dllname = "somir.dll";
  120.  
  121.       passthru C_h =
  122.     ""
  123.     "    #include <somtcnst.h>"
  124.     "    #include <stdio.h>"
  125.     "    #include <somir.h>"
  126.     ""
  127.     "    #define RepositoryId string"
  128.     "    #define _IDL_SEQUENCE_RepositoryId _IDL_SEQUENCE_string"
  129.     "    #define TC_Contained ((TypeCode) &TC__Contained)"
  130.     "    typedef struct {TCKind t; long f; string s;} TC_Contained_td;"
  131.     "    SOMEXTERN TC_Contained_td SOMDLINK TC__Contained;"
  132.     "";
  133.       passthru C_xh =
  134.     ""
  135.     "    #include <somtcnst.xh>"
  136.     "    #include <stdio.h>"
  137.     "    #include <somir.xh>"
  138.     ""
  139.     "    #define RepositoryId string"
  140.     "    #define _IDL_SEQUENCE_RepositoryId _IDL_SEQUENCE_string"
  141.     "    #define TC_Contained ((TypeCode) &TC__Contained)"
  142.     "    typedef struct {TCKind t; long f; string s;} TC_Contained_td;"
  143.     "    SOMEXTERN TC_Contained_td SOMDLINK TC__Contained;"
  144.     "";
  145.       passthru C_hh =
  146.     ""
  147.     "    #include <somtcnst.hh>"
  148.     "    #include <stdio.hh>"
  149.     "    #include <somir.hh>"
  150.     ""
  151.     "    #define RepositoryId string"
  152.     "    #define _IDL_SEQUENCE_RepositoryId _IDL_SEQUENCE_string"
  153.     "    #define TC_Contained ((TypeCode) &TC__Contained)"
  154.     "    typedef struct {TCKind t; long f; string s;} TC_Contained_td;"
  155.     "    SOMEXTERN TC_Contained_td SOMDLINK TC__Contained;"
  156.     "";
  157.  
  158.       name: noget, noset;
  159.       id: noget, noset;
  160.       defined_in: nodata;
  161.       somModifiers: noset;
  162.  
  163. #if defined __SOM_KERNEL_LEVEL && __SOM_KERNEL_LEVEL >= 250
  164.       _get_defined_in : dual_owned_result;
  165.       _get_id   : dual_owned_result;
  166.       _get_name : dual_owned_result;
  167.       _get_somModifiers : dual_owned_result;
  168. #else
  169.       _set_name : caller_owns_parameters = "name";
  170.       _set_id   : caller_owns_parameters = "id";
  171.       _set_defined_in : caller_owns_parameters = "defined_in";
  172.       _set_somModifiers : caller_owns_parameters = "somModifiers";
  173. #endif
  174.  
  175.       somFree: override;
  176.       somInit: override;
  177.       somUninit: override;
  178.       somDumpSelf: override;
  179.       somDumpSelfInt: override;
  180.  
  181. #if defined __SOM_KERNEL_LEVEL && __SOM_KERNEL_LEVEL >= 250
  182.       describe: dual_owned_result;
  183.       within : dual_owned_result;
  184. #endif
  185.  
  186.   };
  187. #endif /* __SOMIDL__ */
  188. };
  189.  
  190.  
  191. #endif    /* containd_idl */
  192.