1. --  (c) Copyright, Real-Time Innovations, $Date:: 2012-02-16 #$ 
  2. --  All rights reserved. 
  3. -- 
  4. --  No duplications, whole or partial, manual or electronic, may be made 
  5. --  without express written permission.  Any such copies, or 
  6. --  revisions thereof, must display this notice unaltered. 
  7. --  This code contains trade secrets of Real-Time Innovations, Inc. 
  8.  
  9. pragma Ada_05; 
  10.  
  11. with RTIDDS.Low_Level.config_c_h; 
  12. with RTIDDS.Low_Level.dds_c.infrastructure_h; 
  13. with RTIDDS.Obj_Impl; 
  14.  
  15. --  <module name="NDDSTransportModule" actualName="Pluggable Transport">ndds_transport</module> 
  16. --  <defgroup>TransportUserGroupDocs</defgroup> 
  17. --  <defgroup>TransportBuiltinGroupDocs</defgroup> 
  18. --  <module name="NDDSConfigModule" actualName="Configuration Utilities">ndds_config</module> 
  19. package RTIDDS.Config is 
  20.    use RTIDDS.Low_Level.config_c_h; 
  21.  
  22.    type LogCategory is private; 
  23.    --  <dref>LogCategory</dref> 
  24.  
  25.    Category_PLATFORM      : constant  LogCategory; 
  26.    --  <dref>LogCategory_NDDS_CONFIG_LOG_CATEGORY_PLATFORM</dref> 
  27.  
  28.    Category_COMMUNICATION : constant  LogCategory; 
  29.    --  <dref>LogCategory_NDDS_CONFIG_LOG_CATEGORY_COMMUNICATION</dref> 
  30.  
  31.    Category_DATABASE      : constant  LogCategory; 
  32.    --  <dref>LogCategory_NDDS_CONFIG_LOG_CATEGORY_DATABASE</dref> 
  33.  
  34.    Category_ENTITIES      : constant  LogCategory; 
  35.    --  <dref>LogCategory_NDDS_CONFIG_LOG_CATEGORY_ENTITIES</dref> 
  36.  
  37.    Category_API           : constant  LogCategory; 
  38.    --  <dref>LogCategory_NDDS_CONFIG_LOG_CATEGORY_API</dref> 
  39.  
  40.    Category_ALL           : constant  LogCategory; 
  41.  
  42.    type LogVerbosity is private; 
  43.    --  <dref>LogVerbosity</dref> 
  44.  
  45.    function "+" (left, Right : LogVerbosity) return LogVerbosity; 
  46.  
  47.    VERBOSITY_SILENT        : constant LogVerbosity; 
  48.    --  <dref>LogVerbosity_NDDS_CONFIG_LOG_VERBOSITY_SILENT</dref> 
  49.  
  50.    VERBOSITY_ERROR         : constant LogVerbosity; 
  51.    --  <dref>LogVerbosity_NDDS_CONFIG_LOG_VERBOSITY_ERROR</dref> 
  52.  
  53.    VERBOSITY_WARNING       : constant LogVerbosity; 
  54.    --  <dref>LogVerbosity_NDDS_CONFIG_LOG_VERBOSITY_WARNING</dref> 
  55.  
  56.    VERBOSITY_STATUS_LOCAL  : constant LogVerbosity; 
  57.    --  <dref>LogVerbosity_NDDS_CONFIG_LOG_VERBOSITY_STATUS_LOCAL</dref> 
  58.  
  59.    VERBOSITY_STATUS_REMOTE : constant LogVerbosity; 
  60.    --  <dref>LogVerbosity_NDDS_CONFIG_LOG_VERBOSITY_STATUS_REMOTE</dref> 
  61.  
  62.    VERBOSITY_ALL           : constant LogVerbosity; 
  63.    --  <dref>LogVerbosity_NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL</dref> 
  64.    function image (item : LogVerbosity) return Standard.String; 
  65.    type LogPrintFormat is private; 
  66.    --  <dref>LogPrintFormat</dref> 
  67.  
  68.    function "+" (left, Right : LogPrintFormat) return LogPrintFormat; 
  69.  
  70.    PRINT_BIT_NUMBER                 : constant LogPrintFormat; 
  71.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_NUMBER</dref> 
  72.  
  73.    PRINT_BIT_MESSAGE                : constant LogPrintFormat; 
  74.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_MSG</dref> 
  75.  
  76.    PRINT_BIT_LOCATION_MODULE        : constant LogPrintFormat; 
  77.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_LOCATION_MODULE</dref> 
  78.  
  79.    PRINT_BIT_LOCATION_FILELINE      : constant LogPrintFormat; 
  80.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_LOCATION_FILELINE</dref> 
  81.  
  82.    PRINT_BIT_LOCATION_METHOD        : constant LogPrintFormat; 
  83.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_LOCATION_METHOD</dref> 
  84.  
  85.    PRINT_BIT_TIMESTAMP              : constant LogPrintFormat; 
  86.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_TIMESTAMP</dref> 
  87.  
  88.    PRINT_BIT_THREAD_ID              : constant LogPrintFormat; 
  89.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_THREAD_ID</dref> 
  90.  
  91.    PRINT_BIT_CONTEXT                : constant LogPrintFormat; 
  92.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_CONTEXT</dref> 
  93.  
  94.    PRINT_BIT_TWO_LINES              : constant LogPrintFormat; 
  95.    --  <dref internal="true">LogPrintFormat_NDDS_CONFIG_LOG_PRINT_BIT_TWO_LINES</dref> 
  96.  
  97.    PRINT_FORMAT_DEFAULT             : constant LogPrintFormat; 
  98.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT</dref> 
  99.  
  100.    PRINT_FORMAT_TIMESTAMPED         : constant LogPrintFormat; 
  101.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_TIMESTAMPED</dref> 
  102.  
  103.    PRINT_FORMAT_VERBOSE             : constant LogPrintFormat; 
  104.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE</dref> 
  105.  
  106.    PRINT_FORMAT_VERBOSE_TIMESTAMPED : constant LogPrintFormat; 
  107.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE_TIMESTAMPED</dref> 
  108.  
  109.    PRINT_FORMAT_DEBUG               : constant LogPrintFormat; 
  110.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_DEBUG</dref> 
  111.  
  112.    PRINT_FORMAT_MINIMAL             : constant LogPrintFormat; 
  113.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_MINIMAL</dref> 
  114.  
  115.    PRINT_FORMAT_MAXIMAL             : constant LogPrintFormat; 
  116.    --  <dref>LogPrintFormat_NDDS_CONFIG_LOG_PRINT_FORMAT_MAXIMAL</dref> 
  117.  
  118.    --  <dref>Logger</dref> 
  119.  
  120.  
  121.  
  122.    package Logger is 
  123.       type Ref is new RTIDDS.Obj_Impl.Ref with null record; 
  124.       type Ref_Access is access all Ref'Class; 
  125.  
  126.       function  Get_Instance return access Ref; 
  127.       --  <dref>Logger_get_instance</dref> 
  128.  
  129.       function Get_Verbosity (This      : not null access Ref) return RTIDDS.Config.LogVerbosity; 
  130.       --  <dref>Logger_get_verbosity</dref> 
  131.  
  132.       function get_verbosity (This      : not null access Ref; 
  133.                               Category  : in RTIDDS.Config.LogCategory) return RTIDDS.Config.LogVerbosity; 
  134.       --  <dref>Logger_get_verbosity_by_category</dref> 
  135.  
  136.       procedure Set_Verbosity (This      : not null access Ref; 
  137.                                Verbosity : in RTIDDS.Config.LogVerbosity); 
  138.       --  <dref>Logger_set_verbosity</dref> 
  139.  
  140.       procedure Set_Verbosity (This      : not null access Ref; 
  141.                                Category  : in RTIDDS.Config.LogCategory; 
  142.                                Verbosity : in RTIDDS.Config.LogVerbosity); 
  143.       --  <dref>Logger_set_verbosity_by_category</dref> 
  144.  
  145.       function get_print_format (This      : not null access Ref) return RTIDDS.Config.LogPrintFormat; 
  146.       --  <dref>Logger_get_print_format</dref> 
  147.  
  148.       procedure Set_print_format (This      : not null access Ref; format : RTIDDS.Config.LogPrintFormat); 
  149.       --  <dref>Logger_set_print_format</dref> 
  150.  
  151.  
  152.  
  153.       type LoggerDevice_Interface is limited interface; 
  154.       procedure Write (Self : LoggerDevice_Interface; text : Standard.String; level : LogVerbosity) is abstract; 
  155.       procedure Close (self : LoggerDevice_Interface) is null; 
  156.  
  157.  
  158.       function GetDevice 
  159.         (Self : access LoggerDevice_Interface) return access 
  160.         RTIDDS.Low_Level.config_c_h.NDDS_Config_LoggerDevice is abstract; 
  161.       function GetLogger 
  162.         (Self : access LoggerDevice_Interface) return 
  163.         RTIDDS.Config.Logger.Ref_Access is abstract; 
  164.  
  165.       procedure Set_output_device (Self   : not null access RTIDDS.Config.Logger.Ref; 
  166.                                    device : access LoggerDevice_Interface'Class); 
  167.  
  168.  
  169.    end Logger; 
  170.  
  171.    type LibraryVersion is new NDDS_Config_LibraryVersion_t; 
  172.    --  <dref>LibraryVersion_t</dref> 
  173.    --  <dref name="major">LibraryVersion_t_major</dref> 
  174.    --  <dref name="minor">LibraryVersion_t_minor</dref> 
  175.    --  <dref name="release">LibraryVersion_t_release</dref> 
  176.    --  <dref name="build">LibraryVersion_t_build</dref> 
  177.  
  178.    type ProductVersion is new RTIDDS.Low_Level.dds_c.infrastructure_h.DDS_ProductVersion_t; 
  179.    --  <dref>ProductVersion_t</dref> 
  180.    --  <dref name="major">ProductVersion_t_major</dref> 
  181.    --  <dref name="minor">ProductVersion_t_minor</dref> 
  182.    --  <dref name="release">ProductVersion_t_release</dref> 
  183.    --  <dref name="revision">ProductVersion_t_revision</dref> 
  184.  
  185.    function get_api_version return LibraryVersion; 
  186.    --  <dref>Version_t_get_c_api_version</dref> 
  187.  
  188.    function get_api_version return String; 
  189.    --  <dref>Version_t_get_c_api_version</dref> 
  190.    --  <internal> 
  191.    --  Get the version of the C API library. 
  192.    --  </internal> 
  193.  
  194.    function get_core_version return LibraryVersion; 
  195.    --  <dref>Version_t_get_core_version</dref> 
  196.  
  197.    function get_core_version return String; 
  198.    --  <dref>Version_t_get_core_version</dref> 
  199.    --  <internal> 
  200.    --  Get the version of the core library. 
  201.    --  </internal> 
  202.  
  203.  
  204.    function get_product_version return ProductVersion; 
  205.    --  <dref>Version_t_get_product_version</dref> 
  206.  
  207.    function get_product_version return String; 
  208.    --  <dref>Version_t_get_product_version</dref> 
  209.  
  210.    function Image (Item : LibraryVersion) return String; 
  211.    function Image (Item : ProductVersion) return String; 
  212.  
  213.    function get_core_build_number return Standard.String; 
  214.    function get_C_build_number return Standard.String; 
  215.  
  216.  
  217. private 
  218.  
  219.    type LogCategory is new NDDS_Config_LogCategory; 
  220.    Category_PLATFORM      : constant  LogCategory := LogCategory (RTIDDS.Low_Level.config_c_h.NDDS_CONFIG_LOG_CATEGORY_PLATFORM); 
  221.    Category_COMMUNICATION : constant  LogCategory := LogCategory (RTIDDS.Low_Level.config_c_h.NDDS_CONFIG_LOG_CATEGORY_COMMUNICATION); 
  222.    Category_DATABASE      : constant  LogCategory := LogCategory (RTIDDS.Low_Level.config_c_h.NDDS_CONFIG_LOG_CATEGORY_DATABASE); 
  223.    Category_ENTITIES      : constant  LogCategory := LogCategory (RTIDDS.Low_Level.config_c_h.NDDS_CONFIG_LOG_CATEGORY_ENTITIES); 
  224.    Category_API           : constant  LogCategory := LogCategory (RTIDDS.Low_Level.config_c_h.NDDS_CONFIG_LOG_CATEGORY_API); 
  225.    Category_ALL           : constant  LogCategory := LogCategory (RTIDDS.Low_Level.config_c_h.NDDS_CONFIG_LOG_CATEGORY_ALL); 
  226.  
  227.    type LogVerbosity is new NDDS_Config_LogVerbosity; 
  228.  
  229.    VERBOSITY_SILENT        : constant LogVerbosity := LogVerbosity (NDDS_CONFIG_LOG_VERBOSITY_SILENT); 
  230.    VERBOSITY_ERROR         : constant LogVerbosity := LogVerbosity (NDDS_CONFIG_LOG_VERBOSITY_ERROR); 
  231.    VERBOSITY_WARNING       : constant LogVerbosity := LogVerbosity (NDDS_CONFIG_LOG_VERBOSITY_WARNING); 
  232.    VERBOSITY_STATUS_LOCAL  : constant LogVerbosity := LogVerbosity (NDDS_CONFIG_LOG_VERBOSITY_STATUS_LOCAL); 
  233.    VERBOSITY_STATUS_REMOTE : constant LogVerbosity := LogVerbosity (NDDS_CONFIG_LOG_VERBOSITY_STATUS_REMOTE); 
  234.    VERBOSITY_ALL           : constant LogVerbosity := LogVerbosity (NDDS_CONFIG_LOG_VERBOSITY_STATUS_ALL); 
  235.  
  236.    type LogPrintFormat is new NDDS_Config_LogPrintFormat; 
  237.    PRINT_BIT_NUMBER : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_NUMBER); 
  238.    PRINT_BIT_MESSAGE : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_MESSAGE); 
  239.    PRINT_BIT_LOCATION_MODULE : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_LOCATION_MODULE); 
  240.    PRINT_BIT_LOCATION_FILELINE : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_LOCATION_FILELINE); 
  241.    PRINT_BIT_LOCATION_METHOD : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_LOCATION_METHOD); 
  242.    PRINT_BIT_TIMESTAMP : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_TIMESTAMP); 
  243.    PRINT_BIT_THREAD_ID : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_THREAD_ID); 
  244.    PRINT_BIT_CONTEXT : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_CONTEXT); 
  245.    PRINT_BIT_TWO_LINES : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_BIT_TWO_LINES); 
  246.    PRINT_FORMAT_DEFAULT : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_DEFAULT); 
  247.    PRINT_FORMAT_TIMESTAMPED : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_TIMESTAMPED); 
  248.    PRINT_FORMAT_VERBOSE : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE); 
  249.    PRINT_FORMAT_VERBOSE_TIMESTAMPED : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_VERBOSE_TIMESTAMPED); 
  250.    PRINT_FORMAT_DEBUG : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_DEBUG); 
  251.    PRINT_FORMAT_MINIMAL : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_MINIMAL); 
  252.    PRINT_FORMAT_MAXIMAL : constant LogPrintFormat := LogPrintFormat (NDDS_CONFIG_LOG_PRINT_FORMAT_MAXIMAL); 
  253.  
  254. end RTIDDS.Config;