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/notification/CosNotifyComm.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 CosNotification.Helper;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CosNotifyComm.Helper is

   
   package body Internals is

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

      pragma No_Return (Raise_InvalidEventType_From_Any);

      -------------------------------------
      -- Raise_InvalidEventType_From_Any --
      -------------------------------------

      procedure Raise_InvalidEventType_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String)
      is
         Members : constant CosNotifyComm.InvalidEventType_Members :=
           CosNotifyComm.Helper.From_Any
              (CORBA.Any
                 (Item));
      begin
         PolyORB.Exceptions.User_Raise_Exception
           (InvalidEventType'Identity,
            Members,
            Message);
      end Raise_InvalidEventType_From_Any;

      InvalidEventType_Initialized : PolyORB.Std.Boolean :=
        False;

      ---------------------------------
      -- Initialize_InvalidEventType --
      ---------------------------------

      procedure Initialize_InvalidEventType is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("InvalidEventType_Members");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosNotifyComm/InvalidEventType:1.0");
         Arg_Name_IDL_type : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL_type");
      begin
         if not InvalidEventType_Initialized
         then
            InvalidEventType_Initialized :=
              True;
            CosNotifyComm.Helper.TC_InvalidEventType :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Except);
            CORBA.Internals.Add_Parameter
              (TC_InvalidEventType,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_InvalidEventType,
               CORBA.To_Any
                 (Id_Ü));
            CosNotification.Helper.Internals.Initialize_EventType;
            CORBA.Internals.Add_Parameter
              (TC_InvalidEventType,
               CORBA.To_Any
                 (CosNotification.Helper.TC_EventType));
            CORBA.Internals.Add_Parameter
              (TC_InvalidEventType,
               CORBA.To_Any
                 (Arg_Name_IDL_type));
            PolyORB.Exceptions.Register_Exception
              (CORBA.TypeCode.Internals.To_PolyORB_Object
                 (TC_InvalidEventType),
               Raise_InvalidEventType_From_Any'Access);
            CORBA.TypeCode.Internals.Disable_Ref_Counting
              (TC_InvalidEventType);
            CORBA.TypeCode.Internals.Freeze
              (TC_InvalidEventType);
         end if;
      end Initialize_InvalidEventType;

   end Internals;

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

   function From_Any
     (Item : CORBA.Any)
     return CosNotifyComm.InvalidEventType_Members
   is
   begin
      return (IDL_type => CosNotification.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CosNotification.Helper.TC_EventType,
            0)));
   end From_Any;

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

   function To_Any
     (Item : CosNotifyComm.InvalidEventType_Members)
     return CORBA.Any
   is
      Result_Ü : CORBA.Any :=
        CORBA.Internals.Get_Empty_Any_Aggregate
           (CosNotifyComm.Helper.TC_InvalidEventType);
   begin
      CORBA.Internals.Add_Aggregate_Element
        (Result_Ü,
         CosNotification.Helper.To_Any
           (Item.IDL_type));
      return Result_Ü;
   end To_Any;

   ----------------------------
   -- Raise_InvalidEventType --
   ----------------------------

   procedure Raise_InvalidEventType
     (Members : CosNotifyComm.InvalidEventType_Members)
   is
   begin
      PolyORB.Exceptions.User_Raise_Exception
        (InvalidEventType'Identity,
         Members);
   end Raise_InvalidEventType;

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

   procedure Deferred_Initialization is
   begin
      CosNotifyComm.Helper.Internals.Initialize_InvalidEventType;
   end Deferred_Initialization;

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