pragma Style_Checks ("NM32766");

---------------------------------------------------
--  This file has been generated automatically from
--  /work/a/ports/net/polyorb/work/polyorb-2.9.0/idls/cos/time/CosTime.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 CosTime.UTO.Impl;
with TimeBase;
with CORBA;
pragma Elaborate_All (CORBA);
with PolyORB.Any;
with TimeBase.Helper;
with CORBA.ServerRequest;
with CORBA.NVList;
with CORBA.Object.Helper;
with CORBA.Object;
with CosTime.UTO.Helper;
with CosTime.Helper;
with CosTime.TIO.Helper;
with PolyORB.CORBA_P.IR_Hooks;
with PolyORB.CORBA_P.Domain_Management;
with CosTime_UTO_Hash;
with PolyORB.Std;
with PortableServer;
with CORBA.ORB;
with PolyORB.CORBA_P.Exceptions;
with PolyORB.Qos.Exception_Informations;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CosTime.UTO.Skel is

   compare_time_Arg_Name_comparison_type_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("comparison_type");

   compare_time_Arg_Name_uto_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("uto");

   time_to_interval_Arg_Name_uto_Ü : constant CORBA.Identifier :=
     CORBA.To_CORBA_String
        ("uto");

   N_Operations : constant PolyORB.Std.Natural :=
     13;

   type String_Ptr is
     access PolyORB.Std.String;

   Invoke_Db : array (0 .. (N_Operations
      - 1)) of String_Ptr :=
     (others => null);

   procedure Register_Procedure
     (Operation_Name : PolyORB.Std.String);

   ------------------------
   -- Register_Procedure --
   ------------------------

   procedure Register_Procedure
     (Operation_Name : PolyORB.Std.String)
   is
      Index_Ü : PolyORB.Std.Natural;
      Invoke_Name_Access : String_Ptr;
   begin
      Index_Ü :=
        CosTime_UTO_Hash.Hash
           (Operation_Name);
      if (Invoke_Db
        (Index_Ü)
         /= null)
      then
         raise Program_Error;
      end if;
      Invoke_Name_Access :=
        new PolyORB.Std.String'
           (Operation_Name);
      Invoke_Db
        (Index_Ü) :=
        Invoke_Name_Access;
   end Register_Procedure;

   procedure Invoke
     (Self : PortableServer.Servant;
      Request : CORBA.ServerRequest.Object_Ptr);

   ------------
   -- Invoke --
   ------------

   procedure Invoke
     (Self : PortableServer.Servant;
      Request : CORBA.ServerRequest.Object_Ptr)
   is
      Operation_Ü : constant PolyORB.Std.String :=
        CORBA.To_Standard_String
           (CORBA.ServerRequest.Operation
              (Request.all));
      Argument_List_Ü : CORBA.NVList.Ref;
      Index_Ü : PolyORB.Std.Natural;
      Invoke_Name_Access : String_Ptr;

      procedure Invoke_Uget_time;

      ----------------------
      -- Invoke_Uget_time --
      ----------------------

      procedure Invoke_Uget_time is
         Result_Ü : TimeBase.TimeT;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Wrap
              (CORBA.Unsigned_Long_Long
                 (Result_Ü)'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (TimeBase.Helper.TC_TimeT,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.get_time
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_Uget_time;

      procedure Invoke_Uget_inaccuracy;

      ----------------------------
      -- Invoke_Uget_inaccuracy --
      ----------------------------

      procedure Invoke_Uget_inaccuracy is
         Result_Ü : TimeBase.InaccuracyT;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Wrap
              (CORBA.Unsigned_Long_Long
                 (Result_Ü)'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (TimeBase.Helper.TC_InaccuracyT,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.get_inaccuracy
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_Uget_inaccuracy;

      procedure Invoke_Uget_tdf;

      ---------------------
      -- Invoke_Uget_tdf --
      ---------------------

      procedure Invoke_Uget_tdf is
         Result_Ü : TimeBase.TdfT;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Wrap
              (CORBA.Short
                 (Result_Ü)'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (TimeBase.Helper.TC_TdfT,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.get_tdf
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_Uget_tdf;

      procedure Invoke_Uget_utc_time;

      --------------------------
      -- Invoke_Uget_utc_time --
      --------------------------

      procedure Invoke_Uget_utc_time is
         Result_Ü : TimeBase.UtcT;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           TimeBase.Helper.Internals.Wrap
              (Result_Ü'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (TimeBase.Helper.TC_UtcT,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.get_utc_time
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_Uget_utc_time;

      procedure Invoke_absolute_time;

      --------------------------
      -- Invoke_absolute_time --
      --------------------------

      procedure Invoke_absolute_time is
         Result_Ü : CosTime.UTO.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_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.UTO.Helper.TC_UTO,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Ref
              (CosTime.UTO.Impl.absolute_time
                 (CosTime.UTO.Impl.Object'Class
                    (Self.all)'Access));
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_absolute_time;

      procedure Invoke_compare_time;

      -------------------------
      -- Invoke_compare_time --
      -------------------------

      procedure Invoke_compare_time is
         Argument_comparison_type_Ü : CosTime.ComparisonType;
         pragma Warnings (Off, Argument_comparison_type_Ü);
         pragma Suppress (Validity_Check, Argument_comparison_type_Ü);
         Arg_CC_comparison_type_Ü : aliased PolyORB.Any.Content'Class :=
           CosTime.Helper.Internals.Wrap
              (Argument_comparison_type_Ü'Unrestricted_Access);
         Arg_Any_comparison_type_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.Helper.TC_ComparisonType,
               Arg_CC_comparison_type_Ü'Unchecked_Access);
         Argument_uto_Ü : CosTime.UTO.Ref;
         pragma Warnings (Off, Argument_uto_Ü);
         pragma Suppress (Validity_Check, Argument_uto_Ü);
         Arg_CC_uto_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Object.Helper.Wrap
              (CORBA.Object.Ref
                 (Argument_uto_Ü)'Unrestricted_Access);
         Arg_Any_uto_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.UTO.Helper.TC_UTO,
               Arg_CC_uto_Ü'Unchecked_Access);
         Result_Ü : CosTime.TimeComparison;
         pragma Warnings (Off, Result_Ü);
         pragma Suppress (Validity_Check, Result_Ü);
         Arg_CC_Result_Ü_Ü : aliased PolyORB.Any.Content'Class :=
           CosTime.Helper.Internals.Wrap
              (Result_Ü'Unrestricted_Access);
         Arg_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.Helper.TC_TimeComparison,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            compare_time_Arg_Name_comparison_type_Ü,
            Arg_Any_comparison_type_Ü,
            CORBA.ARG_IN);
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            compare_time_Arg_Name_uto_Ü,
            Arg_Any_uto_Ü,
            CORBA.ARG_IN);
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.compare_time
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access,
               Argument_comparison_type_Ü,
               Argument_uto_Ü);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_compare_time;

      procedure Invoke_time_to_interval;

      -----------------------------
      -- Invoke_time_to_interval --
      -----------------------------

      procedure Invoke_time_to_interval is
         Argument_uto_Ü : CosTime.UTO.Ref;
         pragma Warnings (Off, Argument_uto_Ü);
         pragma Suppress (Validity_Check, Argument_uto_Ü);
         Arg_CC_uto_Ü : aliased PolyORB.Any.Content'Class :=
           CORBA.Object.Helper.Wrap
              (CORBA.Object.Ref
                 (Argument_uto_Ü)'Unrestricted_Access);
         Arg_Any_uto_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.UTO.Helper.TC_UTO,
               Arg_CC_uto_Ü'Unchecked_Access);
         Result_Ü : CosTime.TIO_Forward.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_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.TIO.Helper.TC_TIO,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            time_to_interval_Arg_Name_uto_Ü,
            Arg_Any_uto_Ü,
            CORBA.ARG_IN);
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.time_to_interval
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access,
               Argument_uto_Ü);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_time_to_interval;

      procedure Invoke_interval;

      ---------------------
      -- Invoke_interval --
      ---------------------

      procedure Invoke_interval is
         Result_Ü : CosTime.TIO_Forward.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_Any_Result_Ü_Ü : constant CORBA.Any :=
           CORBA.Internals.Get_Wrapper_Any
              (CosTime.TIO.Helper.TC_TIO,
               Arg_CC_Result_Ü_Ü'Unchecked_Access);
      begin
         --  Processing request
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         --  Call Implementation
         Result_Ü :=
           CosTime.UTO.Impl.interval
              (CosTime.UTO.Impl.Object'Class
                 (Self.all)'Access);
         --  Setting the result
         CORBA.ServerRequest.Set_Result
           (Request,
            Arg_Any_Result_Ü_Ü);
         CORBA.NVList.Internals.Clone_Out_Args
           (Argument_List_Ü);
      end Invoke_interval;

      procedure Invoke_Uis_a;

      ------------------
      -- Invoke_Uis_a --
      ------------------

      procedure Invoke_Uis_a is
         Type_Id_Ü : CORBA.String;
         Arg_Name_Type_Id_Ü : constant CORBA.Identifier :=
           CORBA.To_CORBA_String
              ("Type_Id_Ü");
         Argument_Type_Id_Ü : constant CORBA.Any :=
           CORBA.To_Any
              (Type_Id_Ü);
         Result_Ü : CORBA.Boolean;
      begin
         CORBA.NVList.Add_Item
           (Argument_List_Ü,
            Arg_Name_Type_Id_Ü,
            Argument_Type_Id_Ü,
            CORBA.ARG_IN);
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         Type_Id_Ü :=
           CORBA.From_Any
              (Argument_Type_Id_Ü);
         Result_Ü :=
           Is_A
              (CORBA.To_Standard_String
                 (Type_Id_Ü));
         CORBA.ServerRequest.Set_Result
           (Request,
            CORBA.To_Any
              (Result_Ü));
      end Invoke_Uis_a;

      procedure Invoke_Uinterface;

      -----------------------
      -- Invoke_Uinterface --
      -----------------------

      procedure Invoke_Uinterface is
      begin
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         CORBA.ServerRequest.Set_Result
           (Request,
            CORBA.Object.Helper.To_Any
              (CORBA.Object.Ref
                 (PolyORB.CORBA_P.IR_Hooks.Get_Interface_Definition
                    (CORBA.To_CORBA_String
                       (Repository_Id)))));
      end Invoke_Uinterface;

      procedure Invoke_Udomain_managers;

      -----------------------------
      -- Invoke_Udomain_managers --
      -----------------------------

      procedure Invoke_Udomain_managers is
      begin
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         CORBA.ServerRequest.Set_Result
           (Request,
            PolyORB.CORBA_P.Domain_Management.Get_Domain_Managers
              (Self));
      end Invoke_Udomain_managers;

      procedure Invoke_Unon_existent;

      --------------------------
      -- Invoke_Unon_existent --
      --------------------------

      procedure Invoke_Unon_existent is
      begin
         CORBA.ServerRequest.Arguments
           (Request,
            Argument_List_Ü);
         CORBA.ServerRequest.Set_Result
           (Request,
            CORBA.To_Any
              (CORBA.Boolean'
                 (False)));
      end Invoke_Unon_existent;

      procedure Dispatch;

      --------------
      -- Dispatch --
      --------------

      procedure Dispatch is
      begin
         case Index_Ü is
            when 0 =>
               Invoke_Uget_time;
            when 1 =>
               Invoke_Uget_inaccuracy;
            when 2 =>
               Invoke_Uget_tdf;
            when 3 =>
               Invoke_Uget_utc_time;
            when 4 =>
               Invoke_absolute_time;
            when 5 =>
               Invoke_compare_time;
            when 6 =>
               Invoke_time_to_interval;
            when 7 =>
               Invoke_interval;
            when 9 =>
               Invoke_Uinterface;
            when 10 =>
               Invoke_Udomain_managers;
            when 11
               | 12 =>
               Invoke_Unon_existent;
            when 8 =>
               Invoke_Uis_a;
            pragma Warnings (Off);
            when others =>
               raise Program_Error;
            pragma Warnings (On);

         end case;
      end Dispatch;

   begin
      CORBA.ORB.Create_List
        (0,
         Argument_List_Ü);
      Index_Ü :=
        CosTime_UTO_Hash.Hash
           (Operation_Ü);
      Invoke_Name_Access :=
        Invoke_Db
           (Index_Ü);
      begin
         if (Operation_Ü
            = Invoke_Name_Access.all)
         then
            Dispatch;
         else
            CORBA.Raise_Bad_Operation
              (CORBA.Default_Sys_Member);
         end if;
      exception
         when E : others =>
            CORBA.ServerRequest.Set_Exception
              (Request,
               PolyORB.CORBA_P.Exceptions.System_Exception_To_Any
                 (E));
            PolyORB.Qos.Exception_Informations.Set_Exception_Information
              (Request.all,
               E);
      end;
   end Invoke;

   function Servant_Is_A
     (Obj : PortableServer.Servant)
     return Boolean;

   ------------------
   -- Servant_Is_A --
   ------------------

   function Servant_Is_A
     (Obj : PortableServer.Servant)
     return Boolean
   is
   begin
      return (Obj.all
         in CosTime.UTO.Impl.Object'Class);
   end Servant_Is_A;

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

   procedure Deferred_Initialization is
   begin
      PortableServer.Internals.Register_Skeleton
        (CosTime.UTO.Repository_Id,
         Servant_Is_A'Access,
         Is_A'Access,
         Invoke'Access);
      Register_Procedure
        ("_get_time");
      Register_Procedure
        ("_get_inaccuracy");
      Register_Procedure
        ("_get_tdf");
      Register_Procedure
        ("_get_utc_time");
      Register_Procedure
        ("absolute_time");
      Register_Procedure
        ("compare_time");
      Register_Procedure
        ("time_to_interval");
      Register_Procedure
        ("interval");
      Register_Procedure
        ("_is_a");
      Register_Procedure
        ("_interface");
      Register_Procedure
        ("_domain_managers");
      Register_Procedure
        ("_non_existent");
      Register_Procedure
        ("_not_existent");
   end Deferred_Initialization;

begin
   declare
      use PolyORB.Utils.Strings;
      use PolyORB.Utils.Strings.Lists;
   begin
      PolyORB.Initialization.Register_Module
        (PolyORB.Initialization.Module_Info'
           (Name => +"CosTime.UTO.Skel",
            Conflicts => PolyORB.Utils.Strings.Lists.Empty,
            Depends => PolyORB.Utils.Strings.Lists.Empty,
            Provides => PolyORB.Utils.Strings.Lists.Empty,
            Implicit => False,
            Init => Deferred_Initialization'Access,
            Shutdown => null));
   end;
end CosTime.UTO.Skel;
