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/CosNotifyChannelAdmin.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.Std;
with PolyORB.Any;
with CORBA.Object.Helper;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CosNotifyChannelAdmin.ConsumerAdmin.Helper is

   
   package body Internals is

      ConsumerAdmin_Initialized : PolyORB.Std.Boolean :=
        False;

      ------------------------------
      -- Initialize_ConsumerAdmin --
      ------------------------------

      procedure Initialize_ConsumerAdmin is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("ConsumerAdmin");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosNotifyChannelAdmin/ConsumerAdmin:1.0");
      begin
         if not ConsumerAdmin_Initialized
         then
            ConsumerAdmin_Initialized :=
              True;
            CosNotifyChannelAdmin.ConsumerAdmin.Helper.TC_ConsumerAdmin :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Object);
            CORBA.Internals.Add_Parameter
              (TC_ConsumerAdmin,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_ConsumerAdmin,
               CORBA.To_Any
                 (Id_Ü));
            CORBA.TypeCode.Internals.Disable_Ref_Counting
              (TC_ConsumerAdmin);
            CORBA.TypeCode.Internals.Freeze
              (TC_ConsumerAdmin);
         end if;
      end Initialize_ConsumerAdmin;

   end Internals;

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

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

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

   function To_Any
     (Item : CosNotifyChannelAdmin.ConsumerAdmin.Ref)
     return CORBA.Any
   is
      A : CORBA.Any :=
        CORBA.Object.Helper.To_Any
           (CORBA.Object.Ref
              (Item));
   begin
      CORBA.Internals.Set_Type
        (A,
         TC_ConsumerAdmin);
      return A;
   end To_Any;

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

   function Unchecked_To_Ref
     (The_Ref : CORBA.Object.Ref'Class)
     return CosNotifyChannelAdmin.ConsumerAdmin.Ref
   is
      Result : CosNotifyChannelAdmin.ConsumerAdmin.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 CosNotifyChannelAdmin.ConsumerAdmin.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;

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

   procedure Deferred_Initialization is
   begin
      CosNotifyChannelAdmin.ConsumerAdmin.Helper.Internals.Initialize_ConsumerAdmin;
   end Deferred_Initialization;

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