Main Page Modules Namespaces C++ Classes Compound List File List Index
TNL: TNL::Platform Namespace Reference

# TNL::Platform Namespace Reference

## Detailed Description

Platform specific functionality is gathered here to enable easier porting.

If you are embedding TNL in a complex application, you may want to replace these with hooks to your own code - for instance the alerts really should bring up an actual message box; currently they just emit a log item.

## Functions

void | outputDebugString (const char *string)
| Prints a string to the OS specific debug log.
void | debugBreak ()
| Stops the program in the debugger, if it is being debugged.
void | forceQuit ()
| Forces the program to exit immediately.
void | AlertOK (const char *windowTitle, const char *message)
| Brings up a dialog window with a message and an "OK" button.
bool | AlertOKCancel (const char *windowTitle, const char *message)
| Brings up a dialog window with the message, and "OK" and "Cancel" buttons.
bool | AlertRetry (const char *windowTitle, const char *message)
| Brings up a dialog window with the message, and "Retry" and "Cancel" buttons.
U32 | getRealMilliseconds ()
| Elapsed time in milliseconds.
S64 | getHighPrecisionTimerValue ()
| Returns a high-precision time value, in a platform-specific time value.
F64 | getHighPrecisionMilliseconds (S64 timerDelta)
| Converts a high precision timer delta into milliseconds.
void | sleep (U32 msCount)
| Put the process to sleep for the specified millisecond interva.
bool | checkHeap ()
| checks the status of the memory allocation heap

## Function Documentation

void TNL::Platform::outputDebugString | ( | const char * | string | ) |

Prints a string to the OS specific debug log.

void TNL::Platform::debugBreak | ( |  | ) |

Stops the program in the debugger, if it is being debugged.

void TNL::Platform::forceQuit | ( |  | ) |

Forces the program to exit immediately.

Note:
  This is probably a bit strong for a networking library. -- BJG

void TNL::Platform::AlertOK | ( | const char * | windowTitle,
|  | const char * | message |
| ) |  |  |

Brings up a dialog window with a message and an "OK" button.

bool TNL::Platform::AlertOKCancel | ( | const char * | windowTitle,
|  | const char * | message |
| ) |  |  |

Brings up a dialog window with the message, and "OK" and "Cancel" buttons.

bool TNL::Platform::AlertRetry | ( | const char * | windowTitle,
|  | const char * | message |
| ) |  |  |

Brings up a dialog window with the message, and "Retry" and "Cancel" buttons.

U32 TNL::Platform::getRealMilliseconds | ( |  | ) |

Elapsed time in milliseconds.

Usually since last reboot, but it varies from platform to platform. It is guaranteed to always increase, however, up to the limit of a U32 - about 7 weeks worth of time. If you are developing a server you want to run for longer than that, prepared to see wraparounds.

S64 TNL::Platform::getHighPrecisionTimerValue | ( |  | ) |

Returns a high-precision time value, in a platform-specific time value.

F64 TNL::Platform::getHighPrecisionMilliseconds | ( | S64 | timerDelta | ) |

Converts a high precision timer delta into milliseconds.

void TNL::Platform::sleep | ( | U32 | msCount | ) |

Put the process to sleep for the specified millisecond interva.

bool TNL::Platform::checkHeap | ( |  | ) |

checks the status of the memory allocation heap