# FoundationClasses
TKernel
OSD

# OSD Class Reference

Set of Operating Sytem Dependent Tools
(O)perating (S)ystem (D)ependent
.

`#include <OSD.hxx>`

## Public Member Functions

void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)

## Static Public Member Functions

static Standard_EXPORT void | SetSignal (const Standard_Boolean aFloatingSignal=Standard_True)
| 1) Arms some floating point signals, and sets a "Handler" for them. 2) Sets a "Handler" for the "Hardware" signals. For Win32 users: under VC++ you can control which method of handling exceptions is used by means of UseSETranslator method before calling SetSignal
static Standard_EXPORT Standard_Integer | AvailableMemory ()
| Returns available memory in Kilobytes. .
static Standard_EXPORT Standard_Boolean | SetLocale (const Standard_CString aString1, const Standard_CString aString2)
| Changes the program's current locale .
static Standard_EXPORT void | SecSleep (const Standard_Integer aDelay)
| Commands the process to sleep for a number of seconds. .
static Standard_EXPORT void | MilliSecSleep (const Standard_Integer aDelay)
| Commands the process to sleep for a number of milliseconds .
static Standard_EXPORT Standard_Boolean | RealToCString (const Standard_Real aReal, Standard_PCharacter &aString)
| Converts aReal into aCstring in exponential format with a period as decimal point, no thousand separator and no grouping of digits. The conversion is independant from the current locale .
static Standard_EXPORT Standard_Boolean | CStringToReal (const Standard_CString aString, Standard_Real &aReal)
| Converts aCstring representing a real with a period as decimal point, no thousand separator and no grouping of digits into aReal . The conversion is independant from the current locale. .
static Standard_EXPORT Standard_Boolean | IsDivisible (const Standard_Real aDividend, const Standard_Real aDivisor)
| Tests if the quotient theDividend/theDivisor does not overflow .
static Standard_EXPORT Standard_Integer | GetExponent (const Standard_Real aReal)
| Returns the exponent in base 2 of a floating-point number. .
static Standard_EXPORT Standard_Real | GetMantissa (const Standard_Real aReal)
| Returns the mantissa of a floating-point number. .
static Standard_EXPORT void | ControlBreak ()
| since Windows NT does not support 'SIGINT' signal like UNIX, then this method checks whether Ctrl-Break keystroke was or not. If yes then raises Exception_CTRL_BREAK.
static Standard_EXPORT void | UseSETranslator (const Standard_Boolean useSE)

Defines whether SetSignal must use _se_translator_function or
SetUnhandledExceptionFilter and signal to catch system
exceptions. The default behaviour is to use SE translator.
Warning: Using SE translator method SetSignal should be called for each
new created thread, while using the alternative method
the exception handler is established once for the whole
process and all its threads.
This function takes effect only under VC++ compiler.
.

static Standard_EXPORT Standard_Boolean | UseSETranslator ()
| Returns the current value of the flag set by above method. .

## Static Private Member Functions

static Standard_EXPORT void | Handler (const OSD_Signals aSignal, const Standard_Address aSigInfo, const Standard_Address aContext)
static Standard_EXPORT void | SegvHandler (const OSD_Signals aSignal, const Standard_Address aSigInfo, const Standard_Address aContext)
static Standard_EXPORT Standard_Integer | WntHandler (const Standard_Address exceptionInfo)

1) Raises an exception if the exception due to floating point errors.
Flosting point errors:
EXCEPTION_FLT_DENORMAL_OPERAND
EXCEPTION_FLT_DIVIDE_BY_ZERO
EXCEPTION_FLT_INEXACT_RESULT
EXCEPTION_FLT_INVALID_OPERATION
EXCEPTOPN_FLT_OVERFLOW
EXCEPTION_FLT_STACK_CHECK
EXCEPTION_FLT_UNDERFLOW
2) Displays a message box 'Continue' - 'Debugger' - 'Stop' if the environment
variable 'CSF_EXCEPTION_PROMPT' is set and takes appropriate action.
Raises an exception otherwise.

## Member Function Documentation

static Standard_EXPORT Standard_Integer OSD::AvailableMemory | ( |  | ) | `[static]`

static Standard_EXPORT void OSD::ControlBreak | ( |  | ) | `[static]`

static Standard_EXPORT Standard_Boolean OSD::CStringToReal | ( | const Standard_CString | aString,
|  | Standard_Real & | aReal
| ) | `[static]`

static Standard_EXPORT Standard_Integer OSD::GetExponent | ( | const Standard_Real | aReal | ) | `[static]`

static Standard_EXPORT Standard_Real OSD::GetMantissa | ( | const Standard_Real | aReal | ) | `[static]`

static Standard_EXPORT void OSD::Handler | ( | const OSD_Signals | aSignal,
|  | const Standard_Address | aSigInfo,
|  | const Standard_Address | aContext
| ) | `[static, private]`

static Standard_EXPORT Standard_Boolean OSD::IsDivisible | ( | const Standard_Real | aDividend,
|  | const Standard_Real | aDivisor
| ) | `[static]`

static Standard_EXPORT void OSD::MilliSecSleep | ( | const Standard_Integer | aDelay | ) | `[static]`

void OSD::operator delete | ( | void * | anAddress | ) | `[inline]`

void* OSD::operator new | ( | size_t | size | ) | `[inline]`

void* OSD::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

static Standard_EXPORT Standard_Boolean OSD::RealToCString | ( | const Standard_Real | aReal,
|  | Standard_PCharacter & | aString
| ) | `[static]`

static Standard_EXPORT void OSD::SecSleep | ( | const Standard_Integer | aDelay | ) | `[static]`

static Standard_EXPORT void OSD::SegvHandler | ( | const OSD_Signals | aSignal,
|  | const Standard_Address | aSigInfo,
|  | const Standard_Address | aContext
| ) | `[static, private]`

static Standard_EXPORT Standard_Boolean OSD::SetLocale | ( | const Standard_CString | aString1,
|  | const Standard_CString | aString2
| ) | `[static]`

static Standard_EXPORT void OSD::SetSignal | ( | const Standard_Boolean | aFloatingSignal = `Standard_True` | ) | `[static]`

static Standard_EXPORT Standard_Boolean OSD::UseSETranslator | ( |  | ) | `[static]`

static Standard_EXPORT void OSD::UseSETranslator | ( | const Standard_Boolean | useSE | ) | `[static]`

static Standard_EXPORT Standard_Integer OSD::WntHandler | ( | const Standard_Address | exceptionInfo | ) | `[static, private]`

The documentation for this class was generated from the following file:

- OSD.hxx