pragma Style_Checks ("NM32766");
pragma Warnings (Off, "use of an anonymous access type allocator");
pragma Warnings (Off, "unnecessary with of ancestor");

---------------------------------------------------
--  This file has been generated automatically from
--  /pbulk/work/net/ada-polyorb/work/PolyORB-25.0/idls/cos/event/CosEventChannelAdmin.idl
--  by IAC (IDL to Ada Compiler) 25.0w (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 CosEventChannelAdmin.Helper is

   
   package body Internals is

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

      pragma No_Return (Raise_AlreadyConnected_From_Any);

      -------------------------------------
      -- Raise_AlreadyConnected_From_Any --
      -------------------------------------

      procedure Raise_AlreadyConnected_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String)
      is
         Members : constant CosEventChannelAdmin.AlreadyConnected_Members :=
           CosEventChannelAdmin.Helper.From_Any
              (CORBA.Any
                 (Item));
      begin
         PolyORB.Exceptions.User_Raise_Exception
           (AlreadyConnected'Identity,
            Members,
            Message);
      end Raise_AlreadyConnected_From_Any;

      AlreadyConnected_Initialized : PolyORB.Std.Boolean :=
        False;

      ---------------------------------
      -- Initialize_AlreadyConnected --
      ---------------------------------

      procedure Initialize_AlreadyConnected is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("AlreadyConnected_Members");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosEventChannelAdmin/AlreadyConnected:1.0");
      begin
         if not AlreadyConnected_Initialized
         then
            AlreadyConnected_Initialized :=
              True;
            CosEventChannelAdmin.Helper.TC_AlreadyConnected :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Except);
            CORBA.Internals.Add_Parameter
              (TC_AlreadyConnected,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_AlreadyConnected,
               CORBA.To_Any
                 (Id_Ü));
            PolyORB.Exceptions.Register_Exception
              (CORBA.TypeCode.Internals.To_PolyORB_Object
                 (TC_AlreadyConnected),
               Raise_AlreadyConnected_From_Any'Access);
            CORBA.TypeCode.Internals.Disable_Ref_Counting
              (TC_AlreadyConnected);
            CORBA.TypeCode.Internals.Freeze
              (TC_AlreadyConnected);
         end if;
      end Initialize_AlreadyConnected;

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

      pragma No_Return (Raise_TypeError_From_Any);

      ------------------------------
      -- Raise_TypeError_From_Any --
      ------------------------------

      procedure Raise_TypeError_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String)
      is
         Members : constant CosEventChannelAdmin.TypeError_Members :=
           CosEventChannelAdmin.Helper.From_Any
              (CORBA.Any
                 (Item));
      begin
         PolyORB.Exceptions.User_Raise_Exception
           (TypeError'Identity,
            Members,
            Message);
      end Raise_TypeError_From_Any;

      TypeError_Initialized : PolyORB.Std.Boolean :=
        False;

      --------------------------
      -- Initialize_TypeError --
      --------------------------

      procedure Initialize_TypeError is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("TypeError_Members");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosEventChannelAdmin/TypeError:1.0");
      begin
         if not TypeError_Initialized
         then
            TypeError_Initialized :=
              True;
            CosEventChannelAdmin.Helper.TC_TypeError :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Except);
            CORBA.Internals.Add_Parameter
              (TC_TypeError,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_TypeError,
               CORBA.To_Any
                 (Id_Ü));
            PolyORB.Exceptions.Register_Exception
              (CORBA.TypeCode.Internals.To_PolyORB_Object
                 (TC_TypeError),
               Raise_TypeError_From_Any'Access);
            CORBA.TypeCode.Internals.Disable_Ref_Counting
              (TC_TypeError);
            CORBA.TypeCode.Internals.Freeze
              (TC_TypeError);
         end if;
      end Initialize_TypeError;

   end Internals;

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

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

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

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

   ----------------------------
   -- Raise_AlreadyConnected --
   ----------------------------

   procedure Raise_AlreadyConnected
     (Members : CosEventChannelAdmin.AlreadyConnected_Members)
   is
   begin
      PolyORB.Exceptions.User_Raise_Exception
        (AlreadyConnected'Identity,
         Members);
   end Raise_AlreadyConnected;

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

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

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

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

   ---------------------
   -- Raise_TypeError --
   ---------------------

   procedure Raise_TypeError
     (Members : CosEventChannelAdmin.TypeError_Members)
   is
   begin
      PolyORB.Exceptions.User_Raise_Exception
        (TypeError'Identity,
         Members);
   end Raise_TypeError;

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

   procedure Deferred_Initialization is
   begin
      CosEventChannelAdmin.Helper.Internals.Initialize_AlreadyConnected;
      CosEventChannelAdmin.Helper.Internals.Initialize_TypeError;
   end Deferred_Initialization;

begin
   declare
      use PolyORB.Utils.Strings;
      use PolyORB.Utils.Strings.Lists;
   begin
      PolyORB.Initialization.Register_Module
        (PolyORB.Initialization.Module_Info'
           (Name => +"CosEventChannelAdmin.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 CosEventChannelAdmin.Helper;
