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.Any.NVList;
with CORBA.Object.Helper;
with PolyORB.Any;
with PolyORB.Types;
with CosNotification.Helper;
with CosNotifyChannelAdmin.Helper;
with PolyORB.Requests;
with CORBA.ExceptionList;
with CosNotifyChannelAdmin.EventChannel.Helper;
with PolyORB.CORBA_P.Interceptors_Hooks;
with PolyORB.CORBA_P.Exceptions;

package body CosNotifyChannelAdmin.EventChannelFactory is

   create_channel_Arg_Name_initial_qos_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("initial_qos");

   create_channel_Arg_Name_initial_admin_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("initial_admin");

   create_channel_Arg_Name_id_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("id");

   create_channel_Result_Name_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("Result");

   -----------------------------
   -- create_channel_Result_Ü --
   -----------------------------

   function create_channel_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (create_channel_Result_Ü);
   begin
      return (Name => create_channel_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNotifyChannelAdmin.EventChannel.Helper.TC_EventChannel),
      Arg_Modes => 0);
   end create_channel_Result_Ü;

   --------------------
   -- create_channel --
   --------------------

   procedure create_channel
     (Self : Ref;
      initial_qos : CosNotification.QoSProperties;
      initial_admin : CosNotification.AdminProperties;
      id : out CosNotifyChannelAdmin.ChannelID;
      Returns : out CosNotifyChannelAdmin.EventChannel.Ref)
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNotifyChannelAdmin.EventChannel.Ref
        renames Returns;
      pragma Warnings (Off, Returns);
      pragma Suppress (Validity_Check, Returns);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Object.Helper.Wrap
           (CORBA.Object.Ref
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_initial_qos_Ü : aliased PolyORB.Any.Content'Class :=
        CosNotification.Helper.Internals.Wrap
           (CosNotification.IDL_SEQUENCE_CosNotification_Property.Sequence
              (initial_qos)'Unrestricted_Access);
      Arg_Any_initial_qos_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNotification.Helper.TC_QoSProperties,
            Arg_CC_initial_qos_Ü'Unchecked_Access);
      Arg_CC_initial_admin_Ü : aliased PolyORB.Any.Content'Class :=
        CosNotification.Helper.Internals.Wrap
           (CosNotification.IDL_SEQUENCE_CosNotification_Property.Sequence
              (initial_admin)'Unrestricted_Access);
      Arg_Any_initial_admin_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNotification.Helper.TC_AdminProperties,
            Arg_CC_initial_admin_Ü'Unchecked_Access);
      Arg_CC_id_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.Long
              (id)'Unrestricted_Access);
      Arg_Any_id_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNotifyChannelAdmin.Helper.TC_ChannelID,
            Arg_CC_id_Ü'Unchecked_Access);
      pragma Warnings (Off, id);
      pragma Suppress (Validity_Check, id);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        create_channel_Result_Ü;
   begin
      if CORBA.Object.Is_Nil
        (CORBA.Object.Ref
           (Self))
      then
         CORBA.Raise_Inv_Objref
           (CORBA.Default_Sys_Member);
      end if;
      --  Create the Argument list
      PolyORB.Any.NVList.Create
        (Argument_List_Ü);
      --  Fill the Argument list
      PolyORB.Any.NVList.Add_Item
        (Argument_List_Ü,
         create_channel_Arg_Name_initial_qos_Ü,
         PolyORB.Any.Any
           (Arg_Any_initial_qos_Ü),
         PolyORB.Any.ARG_IN);
      PolyORB.Any.NVList.Add_Item
        (Argument_List_Ü,
         create_channel_Arg_Name_initial_admin_Ü,
         PolyORB.Any.Any
           (Arg_Any_initial_admin_Ü),
         PolyORB.Any.ARG_IN);
      PolyORB.Any.NVList.Add_Item
        (Argument_List_Ü,
         create_channel_Arg_Name_id_Ü,
         PolyORB.Any.Any
           (Arg_Any_id_Ü),
         PolyORB.Any.ARG_OUT);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNotification.Helper.TC_UnsupportedQoS);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNotification.Helper.TC_UnsupportedAdmin);
      --  Setting the result value
      PolyORB.Any.Set_Value
        (PolyORB.Any.Get_Container
           (Result_Nv_Ü.Argument).all,
         Arg_CC_Result_Ü_Ü'Unrestricted_Access);
      --  Creating the request
      PolyORB.Requests.Setup_Request
        (Req => Request_Ü,
         Target => CORBA.Object.Internals.To_PolyORB_Ref
           (CORBA.Object.Ref
              (Self)),
         Operation => "create_channel",
         Arg_List => Argument_List_Ü,
         Result => Result_Nv_Ü,
         Exc_List => CORBA.ExceptionList.Internals.To_PolyORB_Ref
           (Exception_List_Ü));
      --  Invoking the request (synchronously or asynchronously)
      PolyORB.CORBA_P.Interceptors_Hooks.Client_Invoke
        (Request_Ü'Access,
         PolyORB.Requests.Flags
           (0));
      --  Raise exception, if needed
      PolyORB.CORBA_P.Exceptions.Request_Raise_Occurrence
        (Request_Ü);
   end create_channel;

   get_all_channels_Result_Name_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("Result");

   -------------------------------
   -- get_all_channels_Result_Ü --
   -------------------------------

   function get_all_channels_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (get_all_channels_Result_Ü);
   begin
      return (Name => get_all_channels_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNotifyChannelAdmin.Helper.TC_ChannelIDSeq),
      Arg_Modes => 0);
   end get_all_channels_Result_Ü;

   ----------------------
   -- get_all_channels --
   ----------------------

   function get_all_channels
     (Self : Ref)
     return CosNotifyChannelAdmin.ChannelIDSeq
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNotifyChannelAdmin.ChannelIDSeq;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CosNotifyChannelAdmin.Helper.Internals.Wrap
           (CosNotifyChannelAdmin.IDL_SEQUENCE_CosNotifyChannelAdmin_ChannelID.Sequence
              (Result_Ü)'Unrestricted_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        get_all_channels_Result_Ü;
   begin
      if CORBA.Object.Is_Nil
        (CORBA.Object.Ref
           (Self))
      then
         CORBA.Raise_Inv_Objref
           (CORBA.Default_Sys_Member);
      end if;
      --  Create the Argument list
      PolyORB.Any.NVList.Create
        (Argument_List_Ü);
      --  Setting the result value
      PolyORB.Any.Set_Value
        (PolyORB.Any.Get_Container
           (Result_Nv_Ü.Argument).all,
         Arg_CC_Result_Ü_Ü'Unrestricted_Access);
      --  Creating the request
      PolyORB.Requests.Setup_Request
        (Req => Request_Ü,
         Target => CORBA.Object.Internals.To_PolyORB_Ref
           (CORBA.Object.Ref
              (Self)),
         Operation => "get_all_channels",
         Arg_List => Argument_List_Ü,
         Result => Result_Nv_Ü);
      --  Invoking the request (synchronously or asynchronously)
      PolyORB.CORBA_P.Interceptors_Hooks.Client_Invoke
        (Request_Ü'Access,
         PolyORB.Requests.Flags
           (0));
      --  Raise exception, if needed
      PolyORB.CORBA_P.Exceptions.Request_Raise_Occurrence
        (Request_Ü);
      --  Return value
      return Result_Ü;
   end get_all_channels;

   get_event_channel_Arg_Name_id_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("id");

   get_event_channel_Result_Name_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("Result");

   --------------------------------
   -- get_event_channel_Result_Ü --
   --------------------------------

   function get_event_channel_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (get_event_channel_Result_Ü);
   begin
      return (Name => get_event_channel_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNotifyChannelAdmin.EventChannel.Helper.TC_EventChannel),
      Arg_Modes => 0);
   end get_event_channel_Result_Ü;

   -----------------------
   -- get_event_channel --
   -----------------------

   function get_event_channel
     (Self : Ref;
      id : CosNotifyChannelAdmin.ChannelID)
     return CosNotifyChannelAdmin.EventChannel.Ref
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNotifyChannelAdmin.EventChannel.Ref;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Object.Helper.Wrap
           (CORBA.Object.Ref
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_id_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.Long
              (id)'Unrestricted_Access);
      Arg_Any_id_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNotifyChannelAdmin.Helper.TC_ChannelID,
            Arg_CC_id_Ü'Unchecked_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        get_event_channel_Result_Ü;
   begin
      if CORBA.Object.Is_Nil
        (CORBA.Object.Ref
           (Self))
      then
         CORBA.Raise_Inv_Objref
           (CORBA.Default_Sys_Member);
      end if;
      --  Create the Argument list
      PolyORB.Any.NVList.Create
        (Argument_List_Ü);
      --  Fill the Argument list
      PolyORB.Any.NVList.Add_Item
        (Argument_List_Ü,
         get_event_channel_Arg_Name_id_Ü,
         PolyORB.Any.Any
           (Arg_Any_id_Ü),
         PolyORB.Any.ARG_IN);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNotifyChannelAdmin.Helper.TC_ChannelNotFound);
      --  Setting the result value
      PolyORB.Any.Set_Value
        (PolyORB.Any.Get_Container
           (Result_Nv_Ü.Argument).all,
         Arg_CC_Result_Ü_Ü'Unrestricted_Access);
      --  Creating the request
      PolyORB.Requests.Setup_Request
        (Req => Request_Ü,
         Target => CORBA.Object.Internals.To_PolyORB_Ref
           (CORBA.Object.Ref
              (Self)),
         Operation => "get_event_channel",
         Arg_List => Argument_List_Ü,
         Result => Result_Nv_Ü,
         Exc_List => CORBA.ExceptionList.Internals.To_PolyORB_Ref
           (Exception_List_Ü));
      --  Invoking the request (synchronously or asynchronously)
      PolyORB.CORBA_P.Interceptors_Hooks.Client_Invoke
        (Request_Ü'Access,
         PolyORB.Requests.Flags
           (0));
      --  Raise exception, if needed
      PolyORB.CORBA_P.Exceptions.Request_Raise_Occurrence
        (Request_Ü);
      --  Return value
      return Result_Ü;
   end get_event_channel;

   ----------
   -- Is_A --
   ----------

   function Is_A
     (Self : Ref;
      Logical_Type_Id : PolyORB.Std.String)
     return CORBA.Boolean
   is
   begin
      return (False
         or else (Is_A
           (Logical_Type_Id)
            or else CORBA.Object.Is_A
              (CORBA.Object.Ref
                 (Self),
               Logical_Type_Id)));
   end Is_A;

   ----------
   -- Is_A --
   ----------

   function Is_A
     (Logical_Type_Id : PolyORB.Std.String)
     return CORBA.Boolean
   is
   begin
      return ((CORBA.Is_Equivalent
        (Logical_Type_Id,
         CosNotifyChannelAdmin.EventChannelFactory.Repository_Id)
         or else CORBA.Is_Equivalent
           (Logical_Type_Id,
            "IDL:omg.org/CORBA/Object:1.0"))
         or else False);
   end Is_A;

end CosNotifyChannelAdmin.EventChannelFactory;
