pragma Style_Checks ("NM32766");

---------------------------------------------------
--  This file has been generated automatically from
--  /wrkdirs/usr/ports/net/polyorb/work/polyorb-2.9.0/idls/Interop/CONV_FRAME.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 Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with PolyORB.Utils.Strings;
with PolyORB.Utils.Strings.Lists;
with PolyORB.Initialization;

package body CONV_FRAME.Helper is

   
   package body Internals is

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

      function Wrap
        (X : access CONV_FRAME.CodeSetId)
        return PolyORB.Any.Content'Class
      is
      begin
         return CORBA.Wrap
           (CORBA.Unsigned_Long
              (X.all)'Unrestricted_Access);
      end Wrap;

      CodeSetId_Initialized : PolyORB.Std.Boolean :=
        False;

      --------------------------
      -- Initialize_CodeSetId --
      --------------------------

      procedure Initialize_CodeSetId is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("CodeSetId");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CONV_FRAME/CodeSetId:1.0");
      begin
         if not CodeSetId_Initialized
         then
            CodeSetId_Initialized :=
              True;
            CONV_FRAME.Helper.TC_CodeSetId :=
              CORBA.TypeCode.Internals.Build_Alias_TC
                 (Name => Name_Ü,
                  Id => Id_Ü,
                  Parent => CORBA.TC_Unsigned_Long);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CONV_FRAME.Helper.TC_CodeSetId);
         end if;
      end Initialize_CodeSetId;

      ----------------------------------------------------
      -- IDL_SEQUENCE_CONV_FRAME_CodeSetId_Element_Wrap --
      ----------------------------------------------------

      function IDL_SEQUENCE_CONV_FRAME_CodeSetId_Element_Wrap
        (X : access CONV_FRAME.CodeSetId)
        return PolyORB.Any.Content'Class
      is
      begin
         return CORBA.Wrap
           (CORBA.Unsigned_Long
              (X.all)'Unrestricted_Access);
      end IDL_SEQUENCE_CONV_FRAME_CodeSetId_Element_Wrap;

      function Wrap
        (X : access CONV_FRAME.IDL_SEQUENCE_CONV_FRAME_CodeSetId.Sequence)
        return PolyORB.Any.Content'Class
        renames IDL_SEQUENCE_CONV_FRAME_CodeSetId_Helper.Wrap;

      IDL_SEQUENCE_CONV_FRAME_CodeSetId_Initialized : PolyORB.Std.Boolean :=
        False;

      --------------------------------------------------
      -- Initialize_IDL_SEQUENCE_CONV_FRAME_CodeSetId --
      --------------------------------------------------

      procedure Initialize_IDL_SEQUENCE_CONV_FRAME_CodeSetId is
      begin
         if not IDL_SEQUENCE_CONV_FRAME_CodeSetId_Initialized
         then
            IDL_SEQUENCE_CONV_FRAME_CodeSetId_Initialized :=
              True;
            CONV_FRAME.Helper.Internals.Initialize_CodeSetId;
            CONV_FRAME.Helper.TC_IDL_SEQUENCE_CONV_FRAME_CodeSetId :=
              CORBA.TypeCode.Internals.Build_Sequence_TC
                 (CONV_FRAME.Helper.TC_CodeSetId,
                  0);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CONV_FRAME.Helper.TC_IDL_SEQUENCE_CONV_FRAME_CodeSetId);
            IDL_SEQUENCE_CONV_FRAME_CodeSetId_Helper.Initialize
              (Element_TC => CONV_FRAME.Helper.TC_CodeSetId,
               Sequence_TC => CONV_FRAME.Helper.TC_IDL_SEQUENCE_CONV_FRAME_CodeSetId);
         end if;
      end Initialize_IDL_SEQUENCE_CONV_FRAME_CodeSetId;

      CodeSetIdSeq_Initialized : PolyORB.Std.Boolean :=
        False;

      -----------------------------
      -- Initialize_CodeSetIdSeq --
      -----------------------------

      procedure Initialize_CodeSetIdSeq is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("CodeSetIdSeq");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CONV_FRAME/CodeSetIdSeq:1.0");
      begin
         if not CodeSetIdSeq_Initialized
         then
            CodeSetIdSeq_Initialized :=
              True;
            CONV_FRAME.Helper.Internals.Initialize_IDL_SEQUENCE_CONV_FRAME_CodeSetId;
            CONV_FRAME.Helper.TC_CodeSetIdSeq :=
              CORBA.TypeCode.Internals.Build_Alias_TC
                 (Name => Name_Ü,
                  Id => Id_Ü,
                  Parent => CONV_FRAME.Helper.TC_IDL_SEQUENCE_CONV_FRAME_CodeSetId);
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CONV_FRAME.Helper.TC_CodeSetIdSeq);
         end if;
      end Initialize_CodeSetIdSeq;

      ---------------------------
      -- Get_Aggregate_Element --
      ---------------------------

      function Get_Aggregate_Element
        (Acc : not null access Content_Ü_CodeSetComponent;
         Tc : PolyORB.Any.TypeCode.Object_Ptr;
         Index : PolyORB.Types.Unsigned_Long;
         Mech : not null access PolyORB.Any.Mechanism)
        return PolyORB.Any.Content'Class
      is
         use type PolyORB.Types.Unsigned_Long;
         use type PolyORB.Any.Mechanism;
         pragma Suppress (Validity_Check);
         pragma Unreferenced (Tc);
      begin
         Mech.all :=
           PolyORB.Any.By_Reference;
         case Index is
            when 0 =>
               return CORBA.Wrap
                 (CORBA.Unsigned_Long
                    (Acc.V.native_code_set)'Unrestricted_Access);
            when 1 =>
               return CONV_FRAME.Helper.Internals.Wrap
                 (CONV_FRAME.IDL_SEQUENCE_CONV_FRAME_CodeSetId.Sequence
                    (Acc.V.conversion_code_sets)'Unrestricted_Access);
            pragma Warnings (Off);
            when others =>
               raise Constraint_Error;
            pragma Warnings (On);

         end case;
      end Get_Aggregate_Element;

      -------------------------
      -- Get_Aggregate_Count --
      -------------------------

      function Get_Aggregate_Count
        (Acc : Content_Ü_CodeSetComponent)
        return PolyORB.Types.Unsigned_Long
      is
         pragma Unreferenced (Acc);
      begin
         return 2;
      end Get_Aggregate_Count;

      -------------------------
      -- Set_Aggregate_Count --
      -------------------------

      procedure Set_Aggregate_Count
        (Acc : in out Content_Ü_CodeSetComponent;
         Count : PolyORB.Types.Unsigned_Long)
      is
      begin
         null;
      end Set_Aggregate_Count;

      ---------------------
      -- Unchecked_Get_V --
      ---------------------

      function Unchecked_Get_V
        (Acc : not null access Content_Ü_CodeSetComponent)
        return PolyORB.Types.Address
      is
         function To_Address
           is new Ada.Unchecked_Conversion
              (Ptr_Ü_CodeSetComponent,
               PolyORB.Types.Address);

      begin
         return To_Address
           (Acc.V);
      end Unchecked_Get_V;

      -----------
      -- Clone --
      -----------

      function Clone
        (Acc : Content_Ü_CodeSetComponent;
         Into : PolyORB.Any.Content_Ptr := null)
        return PolyORB.Any.Content_Ptr
      is
         use type PolyORB.Any.Content_Ptr;
         Target : PolyORB.Any.Content_Ptr;
      begin
         if (Into
            /= null)
         then
            if (Into.all
               not in Content_Ü_CodeSetComponent)
            then
               return null;
            end if;
            Target :=
              Into;
            Content_Ü_CodeSetComponent
              (Target.all).V.all :=
              Acc.V.all;
         else
            Target :=
              new Content_Ü_CodeSetComponent;
            Content_Ü_CodeSetComponent
              (Target.all).V :=
              new CONV_FRAME.CodeSetComponent'
                 (Acc.V.all);
         end if;
         return Target;
      end Clone;

      --------------------
      -- Finalize_Value --
      --------------------

      procedure Finalize_Value
        (Acc : in out Content_Ü_CodeSetComponent)
      is
         procedure Free
           is new Ada.Unchecked_Deallocation
              (CONV_FRAME.CodeSetComponent,
               Ptr_Ü_CodeSetComponent);

      begin
         Free
           (Acc.V);
      end Finalize_Value;

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

      function Wrap
        (X : access CONV_FRAME.CodeSetComponent)
        return PolyORB.Any.Content'Class
      is
      begin
         return Content_Ü_CodeSetComponent'
           (PolyORB.Any.Aggregate_Content with
            V => Ptr_Ü_CodeSetComponent
              (X));
      end Wrap;

      CodeSetComponent_Initialized : PolyORB.Std.Boolean :=
        False;

      ---------------------------------
      -- Initialize_CodeSetComponent --
      ---------------------------------

      procedure Initialize_CodeSetComponent is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("CodeSetComponent");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CONV_FRAME/CodeSetComponent:1.0");
         Argument_Name_Ü_native_code_set : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("native_code_set");
         Argument_Name_Ü_conversion_code_sets : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("conversion_code_sets");
      begin
         if not CodeSetComponent_Initialized
         then
            CodeSetComponent_Initialized :=
              True;
            CONV_FRAME.Helper.TC_CodeSetComponent :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Struct);
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponent,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponent,
               CORBA.To_Any
                 (Id_Ü));
            CONV_FRAME.Helper.Internals.Initialize_CodeSetId;
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponent,
               CORBA.To_Any
                 (CONV_FRAME.Helper.TC_CodeSetId));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponent,
               CORBA.To_Any
                 (Argument_Name_Ü_native_code_set));
            CONV_FRAME.Helper.Internals.Initialize_CodeSetIdSeq;
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponent,
               CORBA.To_Any
                 (CONV_FRAME.Helper.TC_CodeSetIdSeq));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponent,
               CORBA.To_Any
                 (Argument_Name_Ü_conversion_code_sets));
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CONV_FRAME.Helper.TC_CodeSetComponent);
         end if;
      end Initialize_CodeSetComponent;

      ---------------------------
      -- Get_Aggregate_Element --
      ---------------------------

      function Get_Aggregate_Element
        (Acc : not null access Content_Ü_CodeSetComponentInfo;
         Tc : PolyORB.Any.TypeCode.Object_Ptr;
         Index : PolyORB.Types.Unsigned_Long;
         Mech : not null access PolyORB.Any.Mechanism)
        return PolyORB.Any.Content'Class
      is
         use type PolyORB.Types.Unsigned_Long;
         use type PolyORB.Any.Mechanism;
         pragma Suppress (Validity_Check);
         pragma Unreferenced (Tc);
      begin
         Mech.all :=
           PolyORB.Any.By_Reference;
         case Index is
            when 0 =>
               return CONV_FRAME.Helper.Internals.Wrap
                 (Acc.V.ForCharData'Unrestricted_Access);
            when 1 =>
               return CONV_FRAME.Helper.Internals.Wrap
                 (Acc.V.ForWcharData'Unrestricted_Access);
            pragma Warnings (Off);
            when others =>
               raise Constraint_Error;
            pragma Warnings (On);

         end case;
      end Get_Aggregate_Element;

      -------------------------
      -- Get_Aggregate_Count --
      -------------------------

      function Get_Aggregate_Count
        (Acc : Content_Ü_CodeSetComponentInfo)
        return PolyORB.Types.Unsigned_Long
      is
         pragma Unreferenced (Acc);
      begin
         return 2;
      end Get_Aggregate_Count;

      -------------------------
      -- Set_Aggregate_Count --
      -------------------------

      procedure Set_Aggregate_Count
        (Acc : in out Content_Ü_CodeSetComponentInfo;
         Count : PolyORB.Types.Unsigned_Long)
      is
      begin
         null;
      end Set_Aggregate_Count;

      ---------------------
      -- Unchecked_Get_V --
      ---------------------

      function Unchecked_Get_V
        (Acc : not null access Content_Ü_CodeSetComponentInfo)
        return PolyORB.Types.Address
      is
         function To_Address
           is new Ada.Unchecked_Conversion
              (Ptr_Ü_CodeSetComponentInfo,
               PolyORB.Types.Address);

      begin
         return To_Address
           (Acc.V);
      end Unchecked_Get_V;

      -----------
      -- Clone --
      -----------

      function Clone
        (Acc : Content_Ü_CodeSetComponentInfo;
         Into : PolyORB.Any.Content_Ptr := null)
        return PolyORB.Any.Content_Ptr
      is
         use type PolyORB.Any.Content_Ptr;
         Target : PolyORB.Any.Content_Ptr;
      begin
         if (Into
            /= null)
         then
            if (Into.all
               not in Content_Ü_CodeSetComponentInfo)
            then
               return null;
            end if;
            Target :=
              Into;
            Content_Ü_CodeSetComponentInfo
              (Target.all).V.all :=
              Acc.V.all;
         else
            Target :=
              new Content_Ü_CodeSetComponentInfo;
            Content_Ü_CodeSetComponentInfo
              (Target.all).V :=
              new CONV_FRAME.CodeSetComponentInfo'
                 (Acc.V.all);
         end if;
         return Target;
      end Clone;

      --------------------
      -- Finalize_Value --
      --------------------

      procedure Finalize_Value
        (Acc : in out Content_Ü_CodeSetComponentInfo)
      is
         procedure Free
           is new Ada.Unchecked_Deallocation
              (CONV_FRAME.CodeSetComponentInfo,
               Ptr_Ü_CodeSetComponentInfo);

      begin
         Free
           (Acc.V);
      end Finalize_Value;

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

      function Wrap
        (X : access CONV_FRAME.CodeSetComponentInfo)
        return PolyORB.Any.Content'Class
      is
      begin
         return Content_Ü_CodeSetComponentInfo'
           (PolyORB.Any.Aggregate_Content with
            V => Ptr_Ü_CodeSetComponentInfo
              (X));
      end Wrap;

      CodeSetComponentInfo_Initialized : PolyORB.Std.Boolean :=
        False;

      -------------------------------------
      -- Initialize_CodeSetComponentInfo --
      -------------------------------------

      procedure Initialize_CodeSetComponentInfo is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("CodeSetComponentInfo");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CONV_FRAME/CodeSetComponentInfo:1.0");
         Argument_Name_Ü_ForCharData : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("ForCharData");
         Argument_Name_Ü_ForWcharData : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("ForWcharData");
      begin
         if not CodeSetComponentInfo_Initialized
         then
            CodeSetComponentInfo_Initialized :=
              True;
            CONV_FRAME.Helper.TC_CodeSetComponentInfo :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Struct);
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponentInfo,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponentInfo,
               CORBA.To_Any
                 (Id_Ü));
            CONV_FRAME.Helper.Internals.Initialize_CodeSetComponent;
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponentInfo,
               CORBA.To_Any
                 (CONV_FRAME.Helper.TC_CodeSetComponent));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponentInfo,
               CORBA.To_Any
                 (Argument_Name_Ü_ForCharData));
            CONV_FRAME.Helper.Internals.Initialize_CodeSetComponent;
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponentInfo,
               CORBA.To_Any
                 (CONV_FRAME.Helper.TC_CodeSetComponent));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetComponentInfo,
               CORBA.To_Any
                 (Argument_Name_Ü_ForWcharData));
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CONV_FRAME.Helper.TC_CodeSetComponentInfo);
         end if;
      end Initialize_CodeSetComponentInfo;

      ---------------------------
      -- Get_Aggregate_Element --
      ---------------------------

      function Get_Aggregate_Element
        (Acc : not null access Content_Ü_CodeSetContext;
         Tc : PolyORB.Any.TypeCode.Object_Ptr;
         Index : PolyORB.Types.Unsigned_Long;
         Mech : not null access PolyORB.Any.Mechanism)
        return PolyORB.Any.Content'Class
      is
         use type PolyORB.Types.Unsigned_Long;
         use type PolyORB.Any.Mechanism;
         pragma Suppress (Validity_Check);
         pragma Unreferenced (Tc);
      begin
         Mech.all :=
           PolyORB.Any.By_Reference;
         case Index is
            when 0 =>
               return CORBA.Wrap
                 (CORBA.Unsigned_Long
                    (Acc.V.char_data)'Unrestricted_Access);
            when 1 =>
               return CORBA.Wrap
                 (CORBA.Unsigned_Long
                    (Acc.V.wchar_data)'Unrestricted_Access);
            pragma Warnings (Off);
            when others =>
               raise Constraint_Error;
            pragma Warnings (On);

         end case;
      end Get_Aggregate_Element;

      -------------------------
      -- Get_Aggregate_Count --
      -------------------------

      function Get_Aggregate_Count
        (Acc : Content_Ü_CodeSetContext)
        return PolyORB.Types.Unsigned_Long
      is
         pragma Unreferenced (Acc);
      begin
         return 2;
      end Get_Aggregate_Count;

      -------------------------
      -- Set_Aggregate_Count --
      -------------------------

      procedure Set_Aggregate_Count
        (Acc : in out Content_Ü_CodeSetContext;
         Count : PolyORB.Types.Unsigned_Long)
      is
      begin
         null;
      end Set_Aggregate_Count;

      ---------------------
      -- Unchecked_Get_V --
      ---------------------

      function Unchecked_Get_V
        (Acc : not null access Content_Ü_CodeSetContext)
        return PolyORB.Types.Address
      is
         function To_Address
           is new Ada.Unchecked_Conversion
              (Ptr_Ü_CodeSetContext,
               PolyORB.Types.Address);

      begin
         return To_Address
           (Acc.V);
      end Unchecked_Get_V;

      -----------
      -- Clone --
      -----------

      function Clone
        (Acc : Content_Ü_CodeSetContext;
         Into : PolyORB.Any.Content_Ptr := null)
        return PolyORB.Any.Content_Ptr
      is
         use type PolyORB.Any.Content_Ptr;
         Target : PolyORB.Any.Content_Ptr;
      begin
         if (Into
            /= null)
         then
            if (Into.all
               not in Content_Ü_CodeSetContext)
            then
               return null;
            end if;
            Target :=
              Into;
            Content_Ü_CodeSetContext
              (Target.all).V.all :=
              Acc.V.all;
         else
            Target :=
              new Content_Ü_CodeSetContext;
            Content_Ü_CodeSetContext
              (Target.all).V :=
              new CONV_FRAME.CodeSetContext'
                 (Acc.V.all);
         end if;
         return Target;
      end Clone;

      --------------------
      -- Finalize_Value --
      --------------------

      procedure Finalize_Value
        (Acc : in out Content_Ü_CodeSetContext)
      is
         procedure Free
           is new Ada.Unchecked_Deallocation
              (CONV_FRAME.CodeSetContext,
               Ptr_Ü_CodeSetContext);

      begin
         Free
           (Acc.V);
      end Finalize_Value;

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

      function Wrap
        (X : access CONV_FRAME.CodeSetContext)
        return PolyORB.Any.Content'Class
      is
      begin
         return Content_Ü_CodeSetContext'
           (PolyORB.Any.Aggregate_Content with
            V => Ptr_Ü_CodeSetContext
              (X));
      end Wrap;

      CodeSetContext_Initialized : PolyORB.Std.Boolean :=
        False;

      -------------------------------
      -- Initialize_CodeSetContext --
      -------------------------------

      procedure Initialize_CodeSetContext is
         Name_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("CodeSetContext");
         Id_Ü : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("IDL:omg.org/CONV_FRAME/CodeSetContext:1.0");
         Argument_Name_Ü_char_data : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("char_data");
         Argument_Name_Ü_wchar_data : constant CORBA.String :=
           CORBA.To_CORBA_String
              ("wchar_data");
      begin
         if not CodeSetContext_Initialized
         then
            CodeSetContext_Initialized :=
              True;
            CONV_FRAME.Helper.TC_CodeSetContext :=
              CORBA.TypeCode.Internals.To_CORBA_Object
                 (PolyORB.Any.TypeCode.Tcf_Struct);
            CORBA.Internals.Add_Parameter
              (TC_CodeSetContext,
               CORBA.To_Any
                 (Name_Ü));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetContext,
               CORBA.To_Any
                 (Id_Ü));
            CONV_FRAME.Helper.Internals.Initialize_CodeSetId;
            CORBA.Internals.Add_Parameter
              (TC_CodeSetContext,
               CORBA.To_Any
                 (CONV_FRAME.Helper.TC_CodeSetId));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetContext,
               CORBA.To_Any
                 (Argument_Name_Ü_char_data));
            CONV_FRAME.Helper.Internals.Initialize_CodeSetId;
            CORBA.Internals.Add_Parameter
              (TC_CodeSetContext,
               CORBA.To_Any
                 (CONV_FRAME.Helper.TC_CodeSetId));
            CORBA.Internals.Add_Parameter
              (TC_CodeSetContext,
               CORBA.To_Any
                 (Argument_Name_Ü_wchar_data));
            CORBA.TypeCode.Internals.Disable_Reference_Counting
              (CONV_FRAME.Helper.TC_CodeSetContext);
         end if;
      end Initialize_CodeSetContext;

   end Internals;

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

   function From_Any
     (Item : CORBA.Any)
     return CONV_FRAME.CodeSetId
   is
      Result : constant CORBA.Unsigned_Long :=
        CORBA.From_Any
           (Item);
   begin
      return CONV_FRAME.CodeSetId
        (Result);
   end From_Any;

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

   function To_Any
     (Item : CONV_FRAME.CodeSetId)
     return CORBA.Any
   is
      Result : CORBA.Any :=
        CORBA.To_Any
           (CORBA.Unsigned_Long
              (Item));
   begin
      CORBA.Internals.Set_Type
        (Result,
         TC_CodeSetId);
      return Result;
   end To_Any;

   function From_Any
     (Item : CORBA.Any)
     return CONV_FRAME.IDL_SEQUENCE_CONV_FRAME_CodeSetId.Sequence
     renames CONV_FRAME.Helper.Internals.IDL_SEQUENCE_CONV_FRAME_CodeSetId_Helper.From_Any;

   function To_Any
     (Item : CONV_FRAME.IDL_SEQUENCE_CONV_FRAME_CodeSetId.Sequence)
     return CORBA.Any
     renames CONV_FRAME.Helper.Internals.IDL_SEQUENCE_CONV_FRAME_CodeSetId_Helper.To_Any;

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

   function From_Any
     (Item : CORBA.Any)
     return CONV_FRAME.CodeSetIdSeq
   is
      Result : constant CONV_FRAME.IDL_SEQUENCE_CONV_FRAME_CodeSetId.Sequence :=
        CONV_FRAME.Helper.From_Any
           (Item);
   begin
      return CONV_FRAME.CodeSetIdSeq
        (Result);
   end From_Any;

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

   function To_Any
     (Item : CONV_FRAME.CodeSetIdSeq)
     return CORBA.Any
   is
      Result : CORBA.Any :=
        CONV_FRAME.Helper.To_Any
           (CONV_FRAME.IDL_SEQUENCE_CONV_FRAME_CodeSetId.Sequence
              (Item));
   begin
      CORBA.Internals.Set_Type
        (Result,
         TC_CodeSetIdSeq);
      return Result;
   end To_Any;

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

   function From_Any
     (Item : CORBA.Any)
     return CONV_FRAME.CodeSetComponent
   is
   begin
      return (native_code_set => CONV_FRAME.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CONV_FRAME.Helper.TC_CodeSetId,
            0)),
      conversion_code_sets => CONV_FRAME.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CONV_FRAME.Helper.TC_CodeSetIdSeq,
            1)));
   end From_Any;

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

   function To_Any
     (Item : CONV_FRAME.CodeSetComponent)
     return CORBA.Any
   is
      Result : CORBA.Any :=
        CORBA.Internals.Get_Empty_Any_Aggregate
           (TC_CodeSetComponent);
   begin
      CORBA.Internals.Add_Aggregate_Element
        (Result,
         CONV_FRAME.Helper.To_Any
           (Item.native_code_set));
      CORBA.Internals.Add_Aggregate_Element
        (Result,
         CONV_FRAME.Helper.To_Any
           (Item.conversion_code_sets));
      return Result;
   end To_Any;

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

   function From_Any
     (Item : CORBA.Any)
     return CONV_FRAME.CodeSetComponentInfo
   is
   begin
      return (ForCharData => CONV_FRAME.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CONV_FRAME.Helper.TC_CodeSetComponent,
            0)),
      ForWcharData => CONV_FRAME.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CONV_FRAME.Helper.TC_CodeSetComponent,
            1)));
   end From_Any;

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

   function To_Any
     (Item : CONV_FRAME.CodeSetComponentInfo)
     return CORBA.Any
   is
      Result : CORBA.Any :=
        CORBA.Internals.Get_Empty_Any_Aggregate
           (TC_CodeSetComponentInfo);
   begin
      CORBA.Internals.Add_Aggregate_Element
        (Result,
         CONV_FRAME.Helper.To_Any
           (Item.ForCharData));
      CORBA.Internals.Add_Aggregate_Element
        (Result,
         CONV_FRAME.Helper.To_Any
           (Item.ForWcharData));
      return Result;
   end To_Any;

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

   function From_Any
     (Item : CORBA.Any)
     return CONV_FRAME.CodeSetContext
   is
   begin
      return (char_data => CONV_FRAME.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CONV_FRAME.Helper.TC_CodeSetId,
            0)),
      wchar_data => CONV_FRAME.Helper.From_Any
        (CORBA.Internals.Get_Aggregate_Element
           (Item,
            CONV_FRAME.Helper.TC_CodeSetId,
            1)));
   end From_Any;

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

   function To_Any
     (Item : CONV_FRAME.CodeSetContext)
     return CORBA.Any
   is
      Result : CORBA.Any :=
        CORBA.Internals.Get_Empty_Any_Aggregate
           (TC_CodeSetContext);
   begin
      CORBA.Internals.Add_Aggregate_Element
        (Result,
         CONV_FRAME.Helper.To_Any
           (Item.char_data));
      CORBA.Internals.Add_Aggregate_Element
        (Result,
         CONV_FRAME.Helper.To_Any
           (Item.wchar_data));
      return Result;
   end To_Any;

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

   procedure Deferred_Initialization is
   begin
      CONV_FRAME.Helper.Internals.Initialize_CodeSetId;
      CONV_FRAME.Helper.Internals.Initialize_IDL_SEQUENCE_CONV_FRAME_CodeSetId;
      CONV_FRAME.Helper.Internals.Initialize_CodeSetIdSeq;
      CONV_FRAME.Helper.Internals.Initialize_CodeSetComponent;
      CONV_FRAME.Helper.Internals.Initialize_CodeSetComponentInfo;
      CONV_FRAME.Helper.Internals.Initialize_CodeSetContext;
   end Deferred_Initialization;

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