1. --   (c) Copyright, Real-Time Innovations, 2025. 
  2. --   All rights reserved. 
  3. --   No duplications, whole or partial, manual or electronic, may be made 
  4. --   without express written permission.  Any such copies, or 
  5. --   revisions thereof, must display this notice unaltered. 
  6. --   This code contains trade secrets of Real-Time Innovations, Inc. 
  7.  
  8.  
  9. package DDS.Ximages  is 
  10.  
  11.    function Image (Item : DDS.SampleFlag) return Standard.String is (Item'Img); 
  12.    function Image (Item : DDS.Boolean) return Standard.String is (Item'Img); 
  13.    function Image (Item : DDS.Short) return Standard.String is (Item'Img); 
  14.    function Image (Item : DDS.Unsigned_Short) return Standard.String is (Item'Img); 
  15.    function Image (Item : DDS.Long) return Standard.String is (Item'Img); 
  16.    function Image (Item : DDS.Long_Long) return Standard.String is (Item'Img); 
  17.    function Image (Item : DDS.Unsigned_Long) return Standard.String is (Item'Img); 
  18.    function Image (Item : DDS.Unsigned_Long_Long) return Standard.String is (Item'Img); 
  19.    function Image (Item : DDS.Enum) return Standard.String is (Item'Img); 
  20.    function Image (Item : DDS.Float) return Standard.String is (Item'Img); 
  21.    function Image (Item : DDS.Double) return Standard.String is (Item'Img); 
  22.    function Image (Item : DDS.String) return Standard.String is (To_Standard_String (Item)); 
  23.  
  24.    function Image (Item : DDS.SampleLostStatusKind) return Standard.String is 
  25.      (case Item is 
  26.          when DDS.NOT_LOST                                              => "NOT_LOST", 
  27.          when DDS.LOST_BY_WRITER                                        => "WRITER", 
  28.          when DDS.LOST_BY_INSTANCES_LIMIT                               => "INSTANCES", 
  29.          when DDS.LOST_BY_REMOTE_WRITERS_PER_INSTANCE_LIMIT             => "REMOTE_WRITERS_PER_INSTANCE", 
  30.          when DDS.LOST_BY_INCOMPLETE_COHERENT_SET                       => "INCOMPLETE_COHERENT_SET", 
  31.          when DDS.LOST_BY_LARGE_COHERENT_SET                            => "LARGE_COHERENT_SET", 
  32.          when DDS.LOST_BY_SAMPLES_PER_REMOTE_WRITER_LIMIT               => "SAMPLES_PER_REMOTE_WRITER", 
  33.          when DDS.LOST_BY_VIRTUAL_WRITERS_LIMIT                         => "VIRTUAL_WRITERS", 
  34.          when DDS.LOST_BY_REMOTE_WRITERS_PER_SAMPLE_LIMIT               => "REMOTE_WRITERS_PER_SAMPLE", 
  35.          when DDS.LOST_BY_AVAILABILITY_WAITING_TIME                     => "AVAILABILITY_WAITING_TIME", 
  36.          when DDS.LOST_BY_REMOTE_WRITER_SAMPLES_PER_VIRTUAL_QUEUE_LIMIT => "REMOTE_WRITER_SAMPLES_PER_VIRTUAL_QUEUE", 
  37.          when others                                                    => "lost_by_unkown_reason"); 
  38.  
  39.    function Image (Item : DDS.SampleLostStatus) return Standard.String is 
  40.      ("(Total_Count => " & Image (Item.Total_Count) & 
  41.          "Total_Count_Change => " &  Image (Item.Total_Count_Change) & 
  42.          "Last_Reason =>" & Image (Item.Last_Reason) & ")"); 
  43.  
  44.  
  45.    type SampleInfoField is (Sample_State, 
  46.                             View_State, 
  47.                             Instance_State, 
  48.                             Source_Timestamp, 
  49.                             Instance_Handle, 
  50.                             Publication_Handle, 
  51.                             Disposed_Generation_Count, 
  52.                             No_Writers_Generation_Count, 
  53.                             Sample_Rank, 
  54.                             Generation_Rank, 
  55.                             Absolute_Generation_Rank, 
  56.                             Valid_Data, 
  57.                             Reception_Timestamp, 
  58.                             Publication_Sequence_Number, 
  59.                             Reception_Sequence_Number, 
  60.                             Publication_Virtual_Guid, 
  61.                             Publication_Virtual_Sequence_Number, 
  62.                             Original_Publication_Virtual_Guid, 
  63.                             Original_Publication_Virtual_Sequence_Number, 
  64.                             Related_Original_Publication_Virtual_Guid, 
  65.                             Related_Original_Publication_Virtual_Sequence_Number, 
  66.                             Flag, 
  67.                             Source_Guid, 
  68.                             Related_Source_Guid, 
  69.                             Related_Subscription_Guid, 
  70.                             Topic_Query_Guid, 
  71.                             Sample_Info_Hash, 
  72.                             Sample_Signature); 
  73.    type SampleInfoFields is array (SampleInfoField) of Boolean; 
  74.  
  75.    function Image (Item : DDS.SampleStateKind) return Standard.String is 
  76.      (case Item is 
  77.          when DDS.READ_SAMPLE_STATE     => "READ", 
  78.          when DDS.NOT_READ_SAMPLE_STATE => "NOT_READ", 
  79.          when DDS.ANY_SAMPLE_STATE      => "ANY", 
  80.          when others                    => "UNKOWMN"); 
  81.  
  82.    function Image (Item : DDS.ViewStateKind) return Standard.String is 
  83.      (case Item is 
  84.          when DDS.NEW_VIEW_STATE        => "NEW", 
  85.          when DDS.NOT_NEW_VIEW_STATE    => "NOT_NEW", 
  86.          when DDS.ANY_VIEW_STATE        => "ANY", 
  87.          when others                    => "UNKOWMN_VIWE_STATE"); 
  88.  
  89.    function Image (Item : DDS.InstanceStateKind) return Standard.String is 
  90.      (case Item is 
  91.          when DDS.ALIVE_INSTANCE_STATE                     => "ALIVE", 
  92.          when DDS.NOT_ALIVE_DISPOSED_INSTANCE_STATE        => "NOT_ALIVE_DISPOSED", 
  93.          when DDS.NOT_ALIVE_NO_WRITERS_INSTANCE_STATE      => "NOT_ALIVE_NO_WRITERS", 
  94.          when DDS.NOT_ALIVE_INSTANCE_STATE                 => "NOT_ALIVE", 
  95.          when DDS.ANY_INSTANCE_STATE                       => "ANY", 
  96.          when others                                       => "UNKOWMN"); 
  97.  
  98.    function Image (Item : DDS.Time_T) return Standard.String is (Image (Item.Sec) & "." & Image (Item.Nanosec)); 
  99.    function Image (Item : DDS.SequenceNumber_T) return Standard.String is (Image (Item.High) & "." & Image (Item.Low)); 
  100.  
  101.    function Image (Item : DDS.KeyHash_T) return Standard.String; 
  102.    pragma Warnings (Off); 
  103.    function Image (Item : RTIDDS.Low_Level.ndds_osapi_osapi_hash_h.RTIOsapiHash) return Standard.String is ("RTIOsapiHash<UNIMPLEMENTED>"); 
  104.  
  105.    function Image (Item : RTIDDS.Low_Level.ndds_pres_pres_common_impl_h.PRESSampleSignature) return Standard.String is ("PRESSampleSignature<UNIMPLEMENTED>"); 
  106.  
  107.    function Image (Item : DDS.InstanceHandle_T) return Standard.String is (if Item.isValid  then Image (Item.keyHash) else "<INVALID_HANDLE>"); 
  108.    function Image (Item : DDS.Guid_T) return Standard.String is ("Guid_T<UNIMPLEMENTED>"); 
  109.    pragma Warnings (on); 
  110.  
  111.  
  112.    function Image (Item : DDS.SampleInfo; Fields : SampleInfoFields := (others => True)) return Standard.String is 
  113.      ((if Fields (Sample_State) then " Sample_State =>" & Image (Item.Sample_State) else "") & 
  114.       (if Fields (View_State) then " View_State =>" & Image (Item.View_State) else "") & 
  115.       (if Fields (Instance_State) then " Instance_State =>" & Image (Item.Instance_State) else "") & 
  116.       (if Fields (Source_Timestamp) then " Source_Timestamp =>" & Image (Item.Source_Timestamp) else "") & 
  117.       (if Fields (Instance_Handle) then " Instance_Handle =>" & Image (Item.Instance_Handle) else "") & 
  118.       (if Fields (Publication_Handle) then " Publication_Handle =>" & Image (Item.Publication_Handle) else "") & 
  119.       (if Fields (Disposed_Generation_Count) then " Disposed_Generation_Count =>" & Image (Item.Disposed_Generation_Count) else "") & 
  120.       (if Fields (No_Writers_Generation_Count) then " No_Writers_Generation_Count =>" & Image (Item.No_Writers_Generation_Count) else "") & 
  121.       (if Fields (Sample_Rank) then " Sample_Rank =>" & Image (Item.Sample_Rank) else "") & 
  122.       (if Fields (Generation_Rank) then " Generation_Rank =>" & Image (Item.Generation_Rank) else "") & 
  123.       (if Fields (Absolute_Generation_Rank) then " Absolute_Generation_Rank =>" & Image (Item.Absolute_Generation_Rank) else "") & 
  124.       (if Fields (Valid_Data) then " Valid_Data =>" & Image (Item.Valid_Data) else "") & 
  125.       (if Fields (Reception_Timestamp) then " Reception_Timestamp =>" & Image (Item.Reception_Timestamp) else "") & 
  126.       (if Fields (Publication_Sequence_Number) then " Publication_Sequence_Number =>" & Image (Item.Publication_Sequence_Number) else "") & 
  127.       (if Fields (Reception_Sequence_Number) then " Reception_Sequence_Number =>" & Image (Item.Reception_Sequence_Number) else "") & 
  128.       (if Fields (Publication_Virtual_Guid) then (" Publication_Virtual_Guid =>" & Standard.String'(Image (Item.Publication_Virtual_Guid))) else "") & 
  129.       (if Fields (Publication_Virtual_Sequence_Number) then " Publication_Virtual_Sequence_Number =>" & Image (Item.Publication_Virtual_Sequence_Number) else "") & 
  130.       (if Fields (Original_Publication_Virtual_Guid) then " Original_Publication_Virtual_Guid =>" & Standard.String'(Image (Item.Original_Publication_Virtual_Guid)) else "") & 
  131.       (if Fields (Original_Publication_Virtual_Sequence_Number) then " Original_Publication_Virtual_Sequence_Number =>" & Image (Item.Original_Publication_Virtual_Sequence_Number) else "") & 
  132.       (if Fields (Related_Original_Publication_Virtual_Guid) then " Related_Original_Publication_Virtual_Guid =>" & Standard.String'(Image (Item.Related_Original_Publication_Virtual_Guid)) else "") & 
  133.       (if Fields (Related_Original_Publication_Virtual_Sequence_Number) then " Related_Original_Publication_Virtual_Sequence_Number =>" & Image (Item.Related_Original_Publication_Virtual_Sequence_Number) else "") & 
  134.       (if Fields (Flag) then " Flag =>" & Image (Item.Flag) else "") & 
  135.       (if Fields (Source_Guid) then " Source_Guid =>" & Standard.String'(Image (Item.Source_Guid)) else "") & 
  136.       (if Fields (Related_Source_Guid) then " Related_Source_Guid =>" & Standard.String'(Image (Item.Related_Source_Guid)) else "") & 
  137.       (if Fields (Related_Subscription_Guid) then " Related_Subscription_Guid =>" & Standard.String'(Image (Item.Related_Subscription_Guid)) else "") & 
  138.       (if Fields (Topic_Query_Guid) then " Topic_Query_Guid =>" & Standard.String'(Image (Item.Topic_Query_Guid)) else "") & 
  139.       (if Fields (Sample_Info_Hash) then " Sample_Info_Hash =>" & Image (Item.Sample_Info_Hash) else "") & 
  140.       (if Fields (Sample_Signature) then " Sample_Signature =>" & Standard.String'(Image (Item.Sample_Signature.all)) else "")); 
  141.  
  142. end DDS.Ximages;