pragma Style_Checks ("NM32766");

---------------------------------------------------
--  This file has been generated automatically from
--  /wrkdirs/usr/ports/net/polyorb/work/polyorb-2.9.0/idls/cos/notification/CosNotifyComm.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.Any.NVList;
with CosNotification.Helper;
with PolyORB.Any;
with PolyORB.Types;
with PolyORB.Requests;
with CORBA.ExceptionList;
with CORBA.Object;
with CosEventComm.Helper;
with PolyORB.CORBA_P.Interceptors_Hooks;
with PolyORB.CORBA_P.Exceptions;

package body CosNotifyComm.SequencePullSupplier is

   pull_structured_events_Arg_Name_max_number_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("max_number");

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

   -------------------------------------
   -- pull_structured_events_Result_Ü --
   -------------------------------------

   function pull_structured_events_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (pull_structured_events_Result_Ü);
   begin
      return (Name => pull_structured_events_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNotification.Helper.TC_EventBatch),
      Arg_Modes => 0);
   end pull_structured_events_Result_Ü;

   ----------------------------
   -- pull_structured_events --
   ----------------------------

   function pull_structured_events
     (Self : Ref;
      max_number : CORBA.Long)
     return CosNotification.EventBatch
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNotification.EventBatch;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CosNotification.Helper.Internals.Wrap
           (CosNotification.IDL_SEQUENCE_CosNotification_StructuredEvent.Sequence
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_max_number_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (max_number'Unrestricted_Access);
      Arg_Any_max_number_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CORBA.TC_Long,
            Arg_CC_max_number_Ü'Unchecked_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        pull_structured_events_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_Ü,
         pull_structured_events_Arg_Name_max_number_Ü,
         PolyORB.Any.Any
           (Arg_Any_max_number_Ü),
         PolyORB.Any.ARG_IN);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosEventComm.Helper.TC_Disconnected);
      --  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 => "pull_structured_events",
         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 pull_structured_events;

   try_pull_structured_events_Arg_Name_max_number_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("max_number");

   try_pull_structured_events_Arg_Name_has_event_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("has_event");

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

   -----------------------------------------
   -- try_pull_structured_events_Result_Ü --
   -----------------------------------------

   function try_pull_structured_events_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (try_pull_structured_events_Result_Ü);
   begin
      return (Name => try_pull_structured_events_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNotification.Helper.TC_EventBatch),
      Arg_Modes => 0);
   end try_pull_structured_events_Result_Ü;

   --------------------------------
   -- try_pull_structured_events --
   --------------------------------

   procedure try_pull_structured_events
     (Self : Ref;
      max_number : CORBA.Long;
      has_event : out CORBA.Boolean;
      Returns : out CosNotification.EventBatch)
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNotification.EventBatch
        renames Returns;
      pragma Warnings (Off, Returns);
      pragma Suppress (Validity_Check, Returns);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CosNotification.Helper.Internals.Wrap
           (CosNotification.IDL_SEQUENCE_CosNotification_StructuredEvent.Sequence
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_max_number_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (max_number'Unrestricted_Access);
      Arg_Any_max_number_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CORBA.TC_Long,
            Arg_CC_max_number_Ü'Unchecked_Access);
      Arg_CC_has_event_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (has_event'Unrestricted_Access);
      Arg_Any_has_event_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CORBA.TC_Boolean,
            Arg_CC_has_event_Ü'Unchecked_Access);
      pragma Warnings (Off, has_event);
      pragma Suppress (Validity_Check, has_event);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        try_pull_structured_events_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_Ü,
         try_pull_structured_events_Arg_Name_max_number_Ü,
         PolyORB.Any.Any
           (Arg_Any_max_number_Ü),
         PolyORB.Any.ARG_IN);
      PolyORB.Any.NVList.Add_Item
        (Argument_List_Ü,
         try_pull_structured_events_Arg_Name_has_event_Ü,
         PolyORB.Any.Any
           (Arg_Any_has_event_Ü),
         PolyORB.Any.ARG_OUT);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosEventComm.Helper.TC_Disconnected);
      --  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 => "try_pull_structured_events",
         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 try_pull_structured_events;

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

   ------------------------------------------------
   -- disconnect_sequence_pull_supplier_Result_Ü --
   ------------------------------------------------

   function disconnect_sequence_pull_supplier_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (disconnect_sequence_pull_supplier_Result_Ü);
   begin
      return (Name => disconnect_sequence_pull_supplier_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CORBA.TC_Void),
      Arg_Modes => 0);
   end disconnect_sequence_pull_supplier_Result_Ü;

   ---------------------------------------
   -- disconnect_sequence_pull_supplier --
   ---------------------------------------

   procedure disconnect_sequence_pull_supplier
     (Self : Ref)
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Request_Ü : aliased PolyORB.Requests.Request;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        disconnect_sequence_pull_supplier_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_Ü);
      --  Creating the request
      PolyORB.Requests.Setup_Request
        (Req => Request_Ü,
         Target => CORBA.Object.Internals.To_PolyORB_Ref
           (CORBA.Object.Ref
              (Self)),
         Operation => "disconnect_sequence_pull_supplier",
         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_Ü);
   end disconnect_sequence_pull_supplier;

   ----------
   -- 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,
         CosNotifyComm.SequencePullSupplier.Repository_Id)
         or else CORBA.Is_Equivalent
           (Logical_Type_Id,
            "IDL:omg.org/CORBA/Object:1.0"))
         or else CORBA.Is_Equivalent
           (Logical_Type_Id,
            CosNotifyComm.NotifySubscribe.Repository_Id))
         or else False);
   end Is_A;

end CosNotifyComm.SequencePullSupplier;
