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