pragma Style_Checks ("NM32766");

---------------------------------------------------
--  This file has been generated automatically from
--  /wrkdirs/usr/ports/net/polyorb/work/polyorb-2.9.0/idls/CORBA_IDL/orb.idl
--  by IAC (IDL to Ada Compiler) 2.9.0 (rev. unknown).
---------------------------------------------------
--  NOTE: If you modify this file by hand, your
--  changes will be lost when you re-run the
--  IDL to Ada compiler.
---------------------------------------------------

with PolyORB.Std;
with PolyORB.Any;
with CORBA.Object.Helper;
with CORBA.Repository_Root.InterfaceDef.Helper;
with CORBA.Repository_Root.InterfaceAttrExtension.Helper;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CORBA.Repository_Root.ExtInterfaceDef.Helper is

   
   package body Internals is

      ExtInterfaceDef_Initialized : PolyORB.Std.Boolean :=
        False;

      --------------------------------
      -- Initialize_ExtInterfaceDef --
      --------------------------------

      procedure Initialize_ExtInterfaceDef is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("ExtInterfaceDef");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CORBA/ExtInterfaceDef:1.0");
      begin
         if not ExtInterfaceDef_Initialized
         then
            ExtInterfaceDef_Initialized :=
              True;
            CORBA.Repository_Root.ExtInterfaceDef.Helper.TC_ExtInterfaceDef :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Object);
            CORBA.Internals.Add_Parameter
              (TC_ExtInterfaceDef,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_ExtInterfaceDef,
               CORBA.To_Any
                 (Id_Ü));
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CORBA.Repository_Root.ExtInterfaceDef.Helper.TC_ExtInterfaceDef);
         end if;
      end Initialize_ExtInterfaceDef;

   end Internals;

   --------------
   -- From_Any --
   --------------

   function From_Any
     (Item : CORBA.Any)
     return CORBA.Repository_Root.ExtInterfaceDef.Ref
   is
   begin
      return To_Ref
        (CORBA.Object.Helper.From_Any
           (Item));
   end From_Any;

   ------------
   -- To_Any --
   ------------

   function To_Any
     (Item : CORBA.Repository_Root.ExtInterfaceDef.Ref)
     return CORBA.Any
   is
      A : CORBA.Any :=
        CORBA.Object.Helper.To_Any
           (CORBA.Object.Ref
              (Item));
   begin
      CORBA.Internals.Set_Type
        (A,
         TC_ExtInterfaceDef);
      return A;
   end To_Any;

   ----------------------
   -- Unchecked_To_Ref --
   ----------------------

   function Unchecked_To_Ref
     (The_Ref : CORBA.Object.Ref'Class)
     return CORBA.Repository_Root.ExtInterfaceDef.Ref
   is
      Result : CORBA.Repository_Root.ExtInterfaceDef.Ref;
   begin
      Set
        (Result,
         CORBA.Object.Object_Of
           (The_Ref));
      return Result;
   end Unchecked_To_Ref;

   ------------
   -- To_Ref --
   ------------

   function To_Ref
     (The_Ref : CORBA.Object.Ref'Class)
     return CORBA.Repository_Root.ExtInterfaceDef.Ref
   is
   begin
      if (CORBA.Object.Is_Nil
        (The_Ref)
         or else CORBA.Object.Is_A
           (The_Ref,
            Repository_Id))
      then
         return Unchecked_To_Ref
           (The_Ref);
      end if;
      CORBA.Raise_Bad_Param
        (CORBA.Default_Sys_Member);
   end To_Ref;

   function From_Any
     (Item : CORBA.Any)
     return CORBA.Repository_Root.ExtInterfaceDef.FullInterfaceDescription
     renames CORBA.Repository_Root.InterfaceDef.Helper.From_Any;

   function To_Any
     (Item : CORBA.Repository_Root.ExtInterfaceDef.FullInterfaceDescription)
     return CORBA.Any
     renames CORBA.Repository_Root.InterfaceDef.Helper.To_Any;

   function From_Any
     (Item : CORBA.Any)
     return CORBA.Repository_Root.ExtInterfaceDef.ExtFullInterfaceDescription
     renames CORBA.Repository_Root.InterfaceAttrExtension.Helper.From_Any;

   function To_Any
     (Item : CORBA.Repository_Root.ExtInterfaceDef.ExtFullInterfaceDescription)
     return CORBA.Any
     renames CORBA.Repository_Root.InterfaceAttrExtension.Helper.To_Any;

   -----------------------------
   -- Deferred_Initialization --
   -----------------------------

   procedure Deferred_Initialization is
   begin
      CORBA.Repository_Root.ExtInterfaceDef.Helper.Internals.Initialize_ExtInterfaceDef;
   end Deferred_Initialization;

begin
   declare
      use PolyORB.Utils.Strings;
      use PolyORB.Utils.Strings.Lists;
   begin
      PolyORB.Initialization.Register_Module
        (PolyORB.Initialization.Module_Info'
           (Name => +"CORBA.Repository_Root.ExtInterfaceDef.Helper",
            Conflicts => PolyORB.Utils.Strings.Lists.Empty,
            Depends => +"any",
            Provides => PolyORB.Utils.Strings.Lists.Empty,
            Implicit => False,
            Init => Deferred_Initialization'Access,
            Shutdown => null));
   end;
end CORBA.Repository_Root.ExtInterfaceDef.Helper;
