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