//
//   COMPONENT_NAME: somi
//
//   ORIGINS: 27
//
//
//   10H9767, 10H9769  (C) COPYRIGHT International Business Machines Corp. 1992,1994
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//
//  Contained: CORBA Interface for objects contained
//  in the Interface Repository.  See CORBA 7.5.1 pp. 129-130
#ifndef containd_idl
#define containd_idl
#include <somobj.idl>
#include <somcls.idl>
struct somModifier {
    string name;
    string value;
}; // SOM-unique extension
interface Container;
typedef string Identifier;
typedef string RepositoryId;
// CORBA 7.5.1, p.130
//
// The Contained interface is the most generic form of interface
// for the objects in the SOM CORBA-compliant Interface Repository (IR).
// All objects contained in the IR inherit this interface.
//
interface Contained : SOMObject
{
    struct Description {
	Identifier name;
	any	   value;
    };
    attribute Identifier name;
    // The value of the "name" field of the receiving object
    //
    // This is a simple name that indentifies the receiving object
    // within its containment hierarchy.  Outside of the containment
    // hierarchy this name is not necessarily unique, and may require
    // qualification by ModuleDef name, InterfaceDef name, etc.
    attribute RepositoryId id;
    // The value of the "id" field of the receiving object
    //
    // The "id" is a string that uniquely identifies any object in
    // the interface repository.  No qualification is needed for
    // an "id".  Notice that "RepositoryId"s have no relationship
    // to the SOM type "somId".
    attribute RepositoryId defined_in;
    // The value of the "defined_in" field of the receiving object
    //
    // This "id" uniquely identifies the container where the
    // receiving object is defined.  Objects that have global scope
    // and do not appear within any other objects are by default
    // placed in the "Repository" object.
    attribute sequence<somModifier> somModifiers;
    // [SOM-unique extension]
    //
    // The somModifiers attribute is a sequence containing all of
    // the "modifiers" attached to the corresponding IDL object in
    // the SOM-unique implementation section of the IDL file where
    // the receiving object was originally defined.
    sequence<Container> within();
    // Returns a list of objects that contain the receiving object.
    // If the object is an interface or module, it can only be contained
    // by the object that defines it.  Other objects can be contained by
    // objects that define or inherit them.
    //
    // When you have finished using the sequence returned by this method
    // it is your responsibility to release the storage allocated for it.
    // To free the sequence, use a call similar to the following:
    //
    //	  if (seqname._length)
    //	      SOMFree (seqname._buffer);
    Description describe();
    // Returns a structure containing all of the attributes defined in
    // the interface of the receiving object.
    //
    // Warning: this method returns pointers to things withing objects
    // (for example, name).  Don't use the somFree method to release
    // any of these objects while this information is still needed..
    //
    // When you have finished using the information in the returned
    // Description structure, it is your responsibility to release
    // the associated storage using a call similar to the following:
    //
    //	  if (desc.value._value)
    //	      SOMFree (desc.value._value);
#ifdef __SOMIDL__
  implementation {
      releaseorder: within, describe,
		  _get_name, _set_name,
		  _get_id, _set_id,
		  _get_defined_in, _set_defined_in,
		  _get_somModifiers, _set_somModifiers
		  ;
      callstyle = idl;
      majorversion = 2;
      minorversion = 1;
      filestem = containd;
      dllname = "somir.dll";
      passthru C_h =
	""
	"    #include <somtcnst.h>"
	"    #include <stdio.h>"
	"    #include <somir.h>"
	""
	"    #define RepositoryId string"
	"    #define _IDL_SEQUENCE_RepositoryId _IDL_SEQUENCE_string"
	"    #define TC_Contained ((TypeCode) &TC__Contained)"
	"    typedef struct {TCKind t; long f; string s;} TC_Contained_td;"
	"    SOMEXTERN TC_Contained_td SOMDLINK TC__Contained;"
	"";
      passthru C_xh =
	""
	"    #include <somtcnst.xh>"
	"    #include <stdio.h>"
	"    #include <somir.xh>"
	""
	"    #define RepositoryId string"
	"    #define _IDL_SEQUENCE_RepositoryId _IDL_SEQUENCE_string"
	"    #define TC_Contained ((TypeCode) &TC__Contained)"
	"    typedef struct {TCKind t; long f; string s;} TC_Contained_td;"
	"    SOMEXTERN TC_Contained_td SOMDLINK TC__Contained;"
	"";
      name: noget, noset;
      id: noget, noset;
      defined_in: nodata;
      somModifiers: noset;
      somFree: override;
      somInit: override;
      somUninit: override;
      somDumpSelf: override;
      somDumpSelfInt: override;
  };
#endif /* __SOMIDL__ */
};
#endif	/* containd_idl */
