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/naming/CosNaming.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 PolyORB.Any;
with PolyORB.Types;
with CosNaming.Helper;
with PolyORB.Requests;
with CORBA.ExceptionList;
with CosNaming.NamingContext.Helper;
with CosNaming.NamingContextExt.Helper;
with PolyORB.CORBA_P.Interceptors_Hooks;
with PolyORB.CORBA_P.Exceptions;
with PolyORB.Exceptions;
with CORBA.Object.Helper;

package body CosNaming.NamingContextExt is

   to_string_Arg_Name_n_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("n");

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

   ------------------------
   -- to_string_Result_Ü --
   ------------------------

   function to_string_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (to_string_Result_Ü);
   begin
      return (Name => to_string_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNaming.NamingContextExt.Helper.TC_StringName),
      Arg_Modes => 0);
   end to_string_Result_Ü;

   ---------------
   -- to_string --
   ---------------

   function to_string
     (Self : Ref;
      n : CosNaming.Name)
     return CosNaming.NamingContextExt.StringName
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNaming.NamingContextExt.StringName;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.String
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_n_Ü : aliased PolyORB.Any.Content'Class :=
        CosNaming.Helper.Internals.Wrap
           (CosNaming.IDL_SEQUENCE_CosNaming_NameComponent.Sequence
              (n)'Unrestricted_Access);
      Arg_Any_n_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNaming.Helper.TC_Name,
            Arg_CC_n_Ü'Unchecked_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        to_string_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_Ü,
         to_string_Arg_Name_n_Ü,
         PolyORB.Any.Any
           (Arg_Any_n_Ü),
         PolyORB.Any.ARG_IN);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContext.Helper.TC_InvalidName);
      --  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 => "to_string",
         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 to_string;

   to_name_Arg_Name_sn_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("sn");

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

   ----------------------
   -- to_name_Result_Ü --
   ----------------------

   function to_name_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (to_name_Result_Ü);
   begin
      return (Name => to_name_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNaming.Helper.TC_Name),
      Arg_Modes => 0);
   end to_name_Result_Ü;

   -------------
   -- to_name --
   -------------

   function to_name
     (Self : Ref;
      sn : CosNaming.NamingContextExt.StringName)
     return CosNaming.Name
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNaming.Name;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CosNaming.Helper.Internals.Wrap
           (CosNaming.IDL_SEQUENCE_CosNaming_NameComponent.Sequence
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_sn_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.String
              (sn)'Unrestricted_Access);
      Arg_Any_sn_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNaming.NamingContextExt.Helper.TC_StringName,
            Arg_CC_sn_Ü'Unchecked_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        to_name_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_Ü,
         to_name_Arg_Name_sn_Ü,
         PolyORB.Any.Any
           (Arg_Any_sn_Ü),
         PolyORB.Any.ARG_IN);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContext.Helper.TC_InvalidName);
      --  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 => "to_name",
         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 to_name;

   -----------------
   -- Get_Members --
   -----------------

   procedure Get_Members
     (From : Ada.Exceptions.Exception_Occurrence;
      To : out CosNaming.NamingContextExt.InvalidAddress_Members)
   is
   begin
      PolyORB.Exceptions.User_Get_Members
        (From,
         To);
   end Get_Members;

   to_url_Arg_Name_addr_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("addr");

   to_url_Arg_Name_sn_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("sn");

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

   ---------------------
   -- to_url_Result_Ü --
   ---------------------

   function to_url_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (to_url_Result_Ü);
   begin
      return (Name => to_url_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CosNaming.NamingContextExt.Helper.TC_URLString),
      Arg_Modes => 0);
   end to_url_Result_Ü;

   ------------
   -- to_url --
   ------------

   function to_url
     (Self : Ref;
      addr : CosNaming.NamingContextExt.Address;
      sn : CosNaming.NamingContextExt.StringName)
     return CosNaming.NamingContextExt.URLString
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CosNaming.NamingContextExt.URLString;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.String
              (Result_Ü)'Unrestricted_Access);
      Arg_CC_addr_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.String
              (addr)'Unrestricted_Access);
      Arg_Any_addr_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNaming.NamingContextExt.Helper.TC_Address,
            Arg_CC_addr_Ü'Unchecked_Access);
      Arg_CC_sn_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.String
              (sn)'Unrestricted_Access);
      Arg_Any_sn_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNaming.NamingContextExt.Helper.TC_StringName,
            Arg_CC_sn_Ü'Unchecked_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        to_url_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_Ü,
         to_url_Arg_Name_addr_Ü,
         PolyORB.Any.Any
           (Arg_Any_addr_Ü),
         PolyORB.Any.ARG_IN);
      PolyORB.Any.NVList.Add_Item
        (Argument_List_Ü,
         to_url_Arg_Name_sn_Ü,
         PolyORB.Any.Any
           (Arg_Any_sn_Ü),
         PolyORB.Any.ARG_IN);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContextExt.Helper.TC_InvalidAddress);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContext.Helper.TC_InvalidName);
      --  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 => "to_url",
         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 to_url;

   resolve_str_Arg_Name_sn_Ü : constant PolyORB.Types.Identifier :=
     PolyORB.Types.To_PolyORB_String
        ("sn");

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

   --------------------------
   -- resolve_str_Result_Ü --
   --------------------------

   function resolve_str_Result_Ü return PolyORB.Any.NamedValue is
      pragma Inline (resolve_str_Result_Ü);
   begin
      return (Name => resolve_str_Result_Name_Ü,
      Argument => CORBA.Internals.Get_Empty_Any
        (CORBA.Object.Helper.TC_Object),
      Arg_Modes => 0);
   end resolve_str_Result_Ü;

   -----------------
   -- resolve_str --
   -----------------

   function resolve_str
     (Self : Ref;
      sn : CosNaming.NamingContextExt.StringName)
     return CORBA.Object.Ref
   is
      Argument_List_Ü : PolyORB.Any.NVList.Ref;
      Result_Ü : CORBA.Object.Ref;
      pragma Warnings (Off, Result_Ü);
      pragma Suppress (Validity_Check, Result_Ü);
      Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Object.Helper.Wrap
           (Result_Ü'Unrestricted_Access);
      Arg_CC_sn_Ü : aliased PolyORB.Any.Content'Class :=
        CORBA.Wrap
           (CORBA.String
              (sn)'Unrestricted_Access);
      Arg_Any_sn_Ü : constant CORBA.Any :=
        CORBA.Internals.Get_Wrapper_Any
           (CosNaming.NamingContextExt.Helper.TC_StringName,
            Arg_CC_sn_Ü'Unchecked_Access);
      Request_Ü : aliased PolyORB.Requests.Request;
      Exception_List_Ü : CORBA.ExceptionList.Ref;
      Result_Nv_Ü : PolyORB.Any.NamedValue :=
        resolve_str_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_Ü,
         resolve_str_Arg_Name_sn_Ü,
         PolyORB.Any.Any
           (Arg_Any_sn_Ü),
         PolyORB.Any.ARG_IN);
      --  Create the Exception list
      CORBA.ExceptionList.Create_List
        (Exception_List_Ü);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContext.Helper.TC_NotFound);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContext.Helper.TC_CannotProceed);
      CORBA.ExceptionList.Add
        (Exception_List_Ü,
         CosNaming.NamingContext.Helper.TC_InvalidName);
      --  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 => "resolve_str",
         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 resolve_str;

   procedure Get_Members
     (From : Ada.Exceptions.Exception_Occurrence;
      To : out CosNaming.NamingContextExt.NotFound_Members)
     renames CosNaming.NamingContext.Get_Members;

   procedure Get_Members
     (From : Ada.Exceptions.Exception_Occurrence;
      To : out CosNaming.NamingContextExt.CannotProceed_Members)
     renames CosNaming.NamingContext.Get_Members;

   procedure Get_Members
     (From : Ada.Exceptions.Exception_Occurrence;
      To : out CosNaming.NamingContextExt.InvalidName_Members)
     renames CosNaming.NamingContext.Get_Members;

   procedure Get_Members
     (From : Ada.Exceptions.Exception_Occurrence;
      To : out CosNaming.NamingContextExt.AlreadyBound_Members)
     renames CosNaming.NamingContext.Get_Members;

   procedure Get_Members
     (From : Ada.Exceptions.Exception_Occurrence;
      To : out CosNaming.NamingContextExt.NotEmpty_Members)
     renames CosNaming.NamingContext.Get_Members;

   ----------
   -- 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,
         CosNaming.NamingContextExt.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,
            CosNaming.NamingContext.Repository_Id))
         or else False);
   end Is_A;

end CosNaming.NamingContextExt;
