pragma Style_Checks ("NM32766");

---------------------------------------------------
--  This file has been generated automatically from
--  /wrkdirs/usr/ports/net/polyorb/work/polyorb-2.9.0/idls/cos/event/CosEventComm.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.Any;
with PolyORB.Std;
with PolyORB.Exceptions;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CosEventComm.Helper is

   
   package body Internals is

      procedure Raise_Disconnected_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String);

      pragma No_Return (Raise_Disconnected_From_Any);

      ---------------------------------
      -- Raise_Disconnected_From_Any --
      ---------------------------------

      procedure Raise_Disconnected_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String)
      is
         Members : constant CosEventComm.Disconnected_Members :=
           CosEventComm.Helper.From_Any
              (CORBA.Any
                 (Item));
      begin
         PolyORB.Exceptions.User_Raise_Exception
           (Disconnected'Identity,
            Members,
            Message);
      end Raise_Disconnected_From_Any;

      Disconnected_Initialized : PolyORB.Std.Boolean :=
        False;

      -----------------------------
      -- Initialize_Disconnected --
      -----------------------------

      procedure Initialize_Disconnected is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("Disconnected_Members");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosEventComm/Disconnected:1.0");
      begin
         if not Disconnected_Initialized
         then
            Disconnected_Initialized :=
              True;
            CosEventComm.Helper.TC_Disconnected :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Except);
            CORBA.Internals.Add_Parameter
              (TC_Disconnected,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_Disconnected,
               CORBA.To_Any
                 (Id_Ü));
            PolyORB.Exceptions.Register_Exception
              (CORBA.TypeCode.Internals.To_PolyORB_Object
                 (TC_Disconnected),
               Raise_Disconnected_From_Any'Access);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CosEventComm.Helper.TC_Disconnected);
         end if;
      end Initialize_Disconnected;

   end Internals;

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

   function From_Any
     (Item : CORBA.Any)
     return CosEventComm.Disconnected_Members
   is
      Result_Ü : CosEventComm.Disconnected_Members;
      pragma Warnings (Off);
      pragma Unreferenced (Item);
      pragma Warnings (On);
   begin
      return Result_Ü;
   end From_Any;

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

   function To_Any
     (Item : CosEventComm.Disconnected_Members)
     return CORBA.Any
   is
      Result_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Empty_Any_Aggregate
           (CosEventComm.Helper.TC_Disconnected);
      pragma Warnings (Off);
      pragma Unreferenced (Item);
      pragma Warnings (On);
   begin
      return Result_Ü;
   end To_Any;

   ------------------------
   -- Raise_Disconnected --
   ------------------------

   procedure Raise_Disconnected
     (Members : CosEventComm.Disconnected_Members)
   is
   begin
      PolyORB.Exceptions.User_Raise_Exception
        (Disconnected'Identity,
         Members);
   end Raise_Disconnected;

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

   procedure Deferred_Initialization is
   begin
      CosEventComm.Helper.Internals.Initialize_Disconnected;
   end Deferred_Initialization;

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