RTI Connext DDS Micro C++ API
Version 4.1.0
|
Abstract System API. More...
Classes | |
struct | OSAPI_SystemI |
System API. More... | |
struct | OSAPI_SystemProperty |
The System Properties. More... |
Macros | |
#define | OSAPI_SYSTEM_MAX_HOSTNAME (64) |
Maximum hostname length. |
Typedefs | |
typedef RTI_BOOL(* | OSAPI_System_start_timer_T )(OSAPI_Timer_T self, OSAPI_TimerTickHandlerFunction tick_handler) |
Start a OSAPI timer. | |
typedef RTI_INT32(* | OSAPI_System_get_timer_resolution_T )(void) |
Get the resolution of the clock driving the timer in nano seconds. | |
typedef RTI_BOOL(* | OSAPI_System_get_time_T )(OSAPI_NtpTime *now) |
Get the current system time. | |
typedef RTI_BOOL(* | OSAPI_System_initialize_T )(void) |
Initialize the system. | |
typedef RTI_BOOL(* | OSAPI_System_get_hostname_T )(char *const hostname) |
Get the hostname. | |
typedef RTI_BOOL(* | OSAPI_System_generate_uuid_T )(struct OSAPI_SystemUUID *uuid_out) |
Generate a unique universal identifier (UUID). | |
typedef RTI_BOOL(* | OSAPI_System_get_ticktime_T )(RTI_INT32 *sec, RTI_UINT32 *nanosec) |
Get current tick time. | |
typedef struct OSAPI_SystemI | OSAPI_SystemI |
System API. |
Abstract System API.
The System is defined as the physical or virtual execution environment and implements functions that are not necessarily provided by the operating system. For example, a custom embedded board may include a special real-time clock which is synchronized via GPS, but is not available via a regular OS system call.
The following functions are not thread-safe:
#define OSAPI_SYSTEM_MAX_HOSTNAME (64) |
Maximum hostname length.
typedef RTI_BOOL(* OSAPI_System_start_timer_T)(OSAPI_Timer_T self, OSAPI_TimerTickHandlerFunction tick_handler) |
Start a OSAPI timer.
[in] | self | Timer object. |
[in] | tick_handler | Timer handle. |
typedef RTI_INT32(* OSAPI_System_get_timer_resolution_T)(void) |
Get the resolution of the clock driving the timer in nano seconds.
This function must return the frequency of the system timer used to implement OSAPI_SystemI::start_timer and OSAPI_SystemI::stop_timer API.
typedef RTI_BOOL(* OSAPI_System_get_time_T)(OSAPI_NtpTime *now) |
Get the current system time.
In general, the system time is used by components to correlate both internal and external events, such as data reception and ordering. Thus, it is recommended that this function returns the real time. However, it is not strictly required.
Notes: - It is assumed that the time returned by get_time is monotonically increasing. It is up to the implementation of this function to ensure this holds true.
- It is ok to return the same time as the last call.
- The clock used to report real-time can be different than the clock used to support start_timer and stop_timer.
[out] | now | Time in NtpTime format. |
typedef RTI_BOOL(* OSAPI_System_initialize_T)(void) |
Initialize the system.
This function initializes the system and calls the port specific initialize method first. The port specific initialization method must return RTI_TRUE on success and RTI_FALSE on failure. A system can only be initialized once.
typedef RTI_BOOL(* OSAPI_System_get_hostname_T)(char *const hostname) |
Get the hostname.
[out] | hostname | The buffer to store the hostname. Must be at least OSAPI_SYSTEM_MAX_HOSTNAME bytes. If the actual hostname is longer than OSAPI_SYSTEM_MAX_HOSTNAME bytes (including the NUL termination) the hostname is truncated. |
typedef RTI_BOOL(* OSAPI_System_generate_uuid_T)(struct OSAPI_SystemUUID *uuid_out) |
Generate a unique universal identifier (UUID).
[out] | uuid_out | The generated UUID value |
typedef RTI_BOOL(* OSAPI_System_get_ticktime_T)(RTI_INT32 *sec, RTI_UINT32 *nanosec) |
Get current tick time.
The ticktime is a time measurement used by Micro to determine how much time has elapsed in a period. It does not have to be an absolute time, but it must be monotonically increasing. For this reason it is important to choose the time source with care. For example, the system time may mbe adjusted backward or forward and this could affect the measure time lapse. The resolution of the tick time is expected to be no less than the system timer, although it is not a requirement.
[out] | sec | The current ticktime in seconds |
[out] | nanosec | Additional nanoseconds in the current ticktime |
typedef struct OSAPI_SystemI OSAPI_SystemI |
System API.
The methods in this interface are called by the corresponding OSAPI_System function. For example, OSAPI_System_get_time() calls system->get_time().