// **********************************************************************
//
// Copyright (c) 2002
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef IFR4_IDL
#define IFR4_IDL

#include <OB/IFR2.idl>
#include <OB/IFR3.idl>

#pragma prefix "omg.org"

module CORBA
{

interface AbstractInterfaceDef : InterfaceDef
{
};

interface LocalInterfaceDef : InterfaceDef
{
};

interface ValueMemberDef : Contained
{
    readonly attribute TypeCode type;
    attribute IDLType type_def;
    attribute Visibility access;
};

interface ValueDef : Container, Contained, IDLType
{
    attribute InterfaceDefSeq supported_interfaces;
    attribute InitializerSeq initializers;
    attribute ValueDef base_value;
    attribute ValueDefSeq abstract_base_values;
    attribute boolean is_abstract;
    attribute boolean is_custom;
    attribute boolean is_truncatable;

    boolean is_a(in RepositoryId value_id);

    struct FullValueDescription
    {
	Identifier name;
	RepositoryId id;
	boolean is_abstract;
	boolean is_custom;
	RepositoryId defined_in;
	VersionSpec version;
	OpDescriptionSeq operations;
	AttrDescriptionSeq attributes;
	ValueMemberSeq members;
	InitializerSeq initializers;
	RepositoryIdSeq supported_interfaces;
	RepositoryIdSeq abstract_base_values;
	boolean is_truncatable;
	RepositoryId base_value;
	TypeCode type;
    };

    FullValueDescription describe_value();

    ValueMemberDef create_value_member(in RepositoryId id,
				       in Identifier name,
				       in VersionSpec version,
				       in IDLType type,
				       in Visibility access);

    AttributeDef create_attribute(in RepositoryId id,
				  in Identifier name,
				  in VersionSpec version,
				  in IDLType type,
				  in AttributeMode mode);

    OperationDef create_operation(in RepositoryId id,
				  in Identifier name,
				  in VersionSpec version,
				  in IDLType result,
				  in OperationMode mode,
				  in ParDescriptionSeq params,
				  in ExceptionDefSeq exceptions,
				  in ContextIdSeq contexts);
};

struct ValueDescription
{
    Identifier name;
    RepositoryId id;
    boolean is_abstract;
    boolean is_custom;
    RepositoryId defined_in;
    VersionSpec version;
    RepositoryIdSeq supported_interfaces;
    RepositoryIdSeq abstract_base_values;
    boolean is_truncatable;
    RepositoryId base_value;
};

interface ValueBoxDef : TypedefDef
{
    attribute IDLType original_type_def;
};

}; // End module CORBA

#endif
