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

#ifndef IFR3_IDL
#define IFR3_IDL

#include <OB/IFR2.idl>

#pragma prefix "omg.org"

module CORBA
{

interface PrimitiveDef;
interface StringDef;
interface SequenceDef;
interface ArrayDef;
interface WstringDef;
interface FixedDef;

enum PrimitiveKind
{
    pk_null,
    pk_void,
    pk_short,
    pk_long,
    pk_ushort,
    pk_ulong,
    pk_float,
    pk_double,
    pk_boolean,
    pk_char,
    pk_octet,
    pk_any,
    pk_TypeCode,
    pk_Principal,
    pk_string,
    pk_objref,
    pk_longlong,
    pk_ulonglong,
    pk_longdouble,
    pk_wchar,
    pk_wstring,
    pk_value_base
};

interface Repository : Container
{
    Contained lookup_id(in RepositoryId search_id);

    TypeCode get_canonical_typecode(in TypeCode tc);
   
    PrimitiveDef get_primitive(in PrimitiveKind kind);
    
    StringDef create_string(in unsigned long bound);
    
    WstringDef create_wstring(in unsigned long bound);

    SequenceDef create_sequence(in unsigned long bound,
				in IDLType element_type);
    
    ArrayDef create_array(in unsigned long length,
			  in IDLType element_type);

    FixedDef create_fixed(in unsigned short digits,
			  in short scale);
};

interface ModuleDef : Container, Contained
{
};

struct ModuleDescription
{
    Identifier name;
    RepositoryId id;
    RepositoryId defined_in;
    VersionSpec version;
};

interface ConstantDef : Contained
{
    readonly attribute TypeCode type;
    attribute IDLType type_def;
    attribute any value;
};

struct ConstantDescription
{
    Identifier name;
    RepositoryId id;
    RepositoryId defined_in;
    VersionSpec version;
    TypeCode type;
    any value;
};

interface TypedefDef : Contained, IDLType
{
};

struct TypeDescription
{
    Identifier name;
    RepositoryId id;
    RepositoryId defined_in;
    VersionSpec version;
    TypeCode type;
};

interface StructDef : TypedefDef, Container
{
    attribute StructMemberSeq members;
};

interface UnionDef : TypedefDef, Container
{
    readonly attribute TypeCode discriminator_type;
    attribute IDLType discriminator_type_def;
    attribute UnionMemberSeq members;
};

interface EnumDef : TypedefDef
{
    attribute EnumMemberSeq members;
};

interface AliasDef : TypedefDef
{
    attribute IDLType original_type_def;
};

interface NativeDef : TypedefDef
{
};

interface PrimitiveDef : IDLType
{
    readonly attribute PrimitiveKind kind;
};

interface StringDef : IDLType
{
    attribute unsigned long bound;
};

interface WstringDef : IDLType
{
    attribute unsigned long bound;
};

interface FixedDef : IDLType
{
    attribute unsigned short digits;
    attribute short scale;
};

interface SequenceDef : IDLType
{
    attribute unsigned long bound;
    readonly attribute TypeCode element_type;
    attribute IDLType element_type_def;
};

interface ArrayDef : IDLType
{
    attribute unsigned long length;
    readonly attribute TypeCode element_type;
    attribute IDLType element_type_def;
};

}; // End module CORBA

#endif
