pragma Style_Checks ("NM32766");

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

package body CosTypedEventChannelAdmin.Helper is

   
   package body Internals is

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

      pragma No_Return (Raise_InterfaceNotSupported_From_Any);

      ------------------------------------------
      -- Raise_InterfaceNotSupported_From_Any --
      ------------------------------------------

      procedure Raise_InterfaceNotSupported_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String)
      is
         Members : constant CosTypedEventChannelAdmin.InterfaceNotSupported_Members :=
           CosTypedEventChannelAdmin.Helper.From_Any
              (CORBA.Any
                 (Item));
      begin
         PolyORB.Exceptions.User_Raise_Exception
           (InterfaceNotSupported'Identity,
            Members,
            Message);
      end Raise_InterfaceNotSupported_From_Any;

      InterfaceNotSupported_Initialized : PolyORB.Std.Boolean :=
        False;

      --------------------------------------
      -- Initialize_InterfaceNotSupported --
      --------------------------------------

      procedure Initialize_InterfaceNotSupported is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("InterfaceNotSupported_Members");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosTypedEventChannelAdmin/InterfaceNotSupported:1.0");
      begin
         if not InterfaceNotSupported_Initialized
         then
            InterfaceNotSupported_Initialized :=
              True;
            CosTypedEventChannelAdmin.Helper.TC_InterfaceNotSupported :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Except);
            CORBA.Internals.Add_Parameter
              (TC_InterfaceNotSupported,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_InterfaceNotSupported,
               CORBA.To_Any
                 (Id_Ü));
            PolyORB.Exceptions.Register_Exception
              (CORBA.TypeCode.Internals.To_PolyORB_Object
                 (TC_InterfaceNotSupported),
               Raise_InterfaceNotSupported_From_Any'Access);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CosTypedEventChannelAdmin.Helper.TC_InterfaceNotSupported);
         end if;
      end Initialize_InterfaceNotSupported;

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

      pragma No_Return (Raise_NoSuchImplementation_From_Any);

      -----------------------------------------
      -- Raise_NoSuchImplementation_From_Any --
      -----------------------------------------

      procedure Raise_NoSuchImplementation_From_Any
        (Item : PolyORB.Any.Any;
         Message : PolyORB.Std.String)
      is
         Members : constant CosTypedEventChannelAdmin.NoSuchImplementation_Members :=
           CosTypedEventChannelAdmin.Helper.From_Any
              (CORBA.Any
                 (Item));
      begin
         PolyORB.Exceptions.User_Raise_Exception
           (NoSuchImplementation'Identity,
            Members,
            Message);
      end Raise_NoSuchImplementation_From_Any;

      NoSuchImplementation_Initialized : PolyORB.Std.Boolean :=
        False;

      -------------------------------------
      -- Initialize_NoSuchImplementation --
      -------------------------------------

      procedure Initialize_NoSuchImplementation is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("NoSuchImplementation_Members");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosTypedEventChannelAdmin/NoSuchImplementation:1.0");
      begin
         if not NoSuchImplementation_Initialized
         then
            NoSuchImplementation_Initialized :=
              True;
            CosTypedEventChannelAdmin.Helper.TC_NoSuchImplementation :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Except);
            CORBA.Internals.Add_Parameter
              (TC_NoSuchImplementation,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_NoSuchImplementation,
               CORBA.To_Any
                 (Id_Ü));
            PolyORB.Exceptions.Register_Exception
              (CORBA.TypeCode.Internals.To_PolyORB_Object
                 (TC_NoSuchImplementation),
               Raise_NoSuchImplementation_From_Any'Access);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CosTypedEventChannelAdmin.Helper.TC_NoSuchImplementation);
         end if;
      end Initialize_NoSuchImplementation;

      ----------
      -- Wrap --
      ----------

      function Wrap
        (X : access CosTypedEventChannelAdmin.Key)
        return PolyORB.Any.Content'Class
      is
      begin
         return CORBA.Wrap
           (CORBA.String
              (X.all)'Unrestricted_Access);
      end Wrap;

      Key_Initialized : PolyORB.Std.Boolean :=
        False;

      --------------------
      -- Initialize_Key --
      --------------------

      procedure Initialize_Key is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("Key");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CosTypedEventChannelAdmin/Key:1.0");
      begin
         if not Key_Initialized
         then
            Key_Initialized :=
              True;
            CosTypedEventChannelAdmin.Helper.TC_Key :=
              CORBA.TypeCode.Internals.Build_Alias_TC
                 (Name => Name_Ü,
                  Id => Id_Ü,
                  Parent => CORBA.TC_String);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CosTypedEventChannelAdmin.Helper.TC_Key);
         end if;
      end Initialize_Key;

   end Internals;

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

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

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

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

   ---------------------------------
   -- Raise_InterfaceNotSupported --
   ---------------------------------

   procedure Raise_InterfaceNotSupported
     (Members : CosTypedEventChannelAdmin.InterfaceNotSupported_Members)
   is
   begin
      PolyORB.Exceptions.User_Raise_Exception
        (InterfaceNotSupported'Identity,
         Members);
   end Raise_InterfaceNotSupported;

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

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

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

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

   --------------------------------
   -- Raise_NoSuchImplementation --
   --------------------------------

   procedure Raise_NoSuchImplementation
     (Members : CosTypedEventChannelAdmin.NoSuchImplementation_Members)
   is
   begin
      PolyORB.Exceptions.User_Raise_Exception
        (NoSuchImplementation'Identity,
         Members);
   end Raise_NoSuchImplementation;

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

   function From_Any
     (Item : CORBA.Any)
     return CosTypedEventChannelAdmin.Key
   is
      Result : constant CORBA.String :=
        CORBA.From_Any
           (Item);
   begin
      return CosTypedEventChannelAdmin.Key
        (Result);
   end From_Any;

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

   function To_Any
     (Item : CosTypedEventChannelAdmin.Key)
     return CORBA.Any
   is
      Result : CORBA.Any :=
        CORBA.To_Any
           (CORBA.String
              (Item));
   begin
      CORBA.Internals.Set_Type
        (Result,
         TC_Key);
      return Result;
   end To_Any;

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

   procedure Deferred_Initialization is
   begin
      CosTypedEventChannelAdmin.Helper.Internals.Initialize_InterfaceNotSupported;
      CosTypedEventChannelAdmin.Helper.Internals.Initialize_NoSuchImplementation;
      CosTypedEventChannelAdmin.Helper.Internals.Initialize_Key;
   end Deferred_Initialization;

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