// File generated by CPPExt (Value)
//
//                     Copyright (C) 1991 - 2000 by  
//                      Matra Datavision SA.  All rights reserved.
//  
//                     Copyright (C) 2001 - 2004 by
//                     Open CASCADE SA.  All rights reserved.
// 
// This file is part of the Open CASCADE Technology software.
//
// This software may be distributed and/or modified under the terms and
// conditions of the Open CASCADE Public License as defined by Open CASCADE SA
// and appearing in the file LICENSE included in the packaging of this file.
//  
// This software is distributed on an "AS IS" basis, without warranty of any
// kind, and Open CASCADE SA hereby disclaims all such warranties,
// including without limitation, any warranties of merchantability, fitness
// for a particular purpose or non-infringement. Please see the License for
// the specific terms and conditions governing rights and limitations under the
// License.

#ifndef _OSD_HeaderFile
#define _OSD_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#include <OSD_Signals.hxx>
#include <Standard_Address.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_CString.hxx>
#include <Standard_Real.hxx>
#include <Standard_PCharacter.hxx>
class OSD_Error;
class OSD_Protection;
class OSD_Path;
class OSD_FileNode;
class OSD_Disk;
class OSD_File;
class OSD_FileIterator;
class OSD_Directory;
class OSD_DirectoryIterator;
class OSD_Chronometer;
class OSD_Timer;
class OSD_Printer;
class OSD_Host;
class OSD_Environment;
class OSD_EnvironmentIterator;
class OSD_Process;
class OSD_SharedMemory;
class OSD_Semaphore;
class OSD_MailBox;
class OSD_SharedLibrary;
class OSD_Thread;
class OSD_Real2String;
class OSD_DataMapOfStringFunction;
class OSD_DataMapNodeOfDataMapOfStringFunction;
class OSD_DataMapIteratorOfDataMapOfStringFunction;


//! Set of Operating Sytem Dependent Tools <br>
//!         (O)perating (S)ystem (D)ependent <br>
class OSD  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  
//!   Sets signal and exception handlers. <br>
  Standard_EXPORT   static  void SetSignal(const Standard_Boolean aFloatingSignal = Standard_True) ;
  //! Returns available memory in Kilobytes. <br>
  Standard_EXPORT   static  Standard_Integer AvailableMemory() ;
  //! Changes the program's current locale <br>
  Standard_EXPORT   static  Standard_Boolean SetLocale(const Standard_CString aString1,const Standard_CString aString2) ;
  //! Commands the process to sleep for a number of seconds. <br>
  Standard_EXPORT   static  void SecSleep(const Standard_Integer aDelay) ;
  //! Commands the process to sleep for a number of milliseconds <br>
  Standard_EXPORT   static  void MilliSecSleep(const Standard_Integer aDelay) ;
  
//!  Converts aReal into aCstring in exponential format with a period as <br>
//!  decimal point, no thousand separator and no grouping of digits. <br>
//!  The conversion is independant from the current locale <br>
  Standard_EXPORT   static  Standard_Boolean RealToCString(const Standard_Real aReal,Standard_PCharacter& aString) ;
  
//!  Converts aCstring representing a real with a period as <br>
//!  decimal point, no thousand separator and no grouping of digits <br>
//!  into aReal . <br>
//!  The conversion is independant from the current locale. <br>
  Standard_EXPORT   static  Standard_Boolean CStringToReal(const Standard_CString aString,Standard_Real& aReal) ;
  //! Tests if the quotient theDividend/theDivisor <br>
//!          does not overflow <br>
  Standard_EXPORT   static  Standard_Boolean IsDivisible(const Standard_Real aDividend,const Standard_Real aDivisor) ;
  //! Returns the exponent in base 2 of a floating-point number. <br>
  Standard_EXPORT   static  Standard_Integer GetExponent(const Standard_Real aReal) ;
  //! Returns the mantissa of a floating-point number. <br>
  Standard_EXPORT   static  Standard_Real GetMantissa(const Standard_Real aReal) ;
  //! since Windows NT does not support 'SIGINT' signal like UNIX, <br>
//!          then this method checks whether Ctrl-Break keystroke was or <br>
//!          not. If yes then raises Exception_CTRL_BREAK. <br>
  Standard_EXPORT   static  void ControlBreak() ;





protected:





private:

  
  Standard_EXPORT   static  void Handler(const OSD_Signals aSignal,const Standard_Address aSigInfo,const Standard_Address aContext) ;
  
  Standard_EXPORT   static  void SegvHandler(const OSD_Signals aSignal,const Standard_Address aSigInfo,const Standard_Address aContext) ;
  
//!  1) Raises an exception if the exception due to floating point errors. <br>
//!     Flosting point errors: <br>
//!     EXCEPTION_FLT_DENORMAL_OPERAND <br>
//!     EXCEPTION_FLT_DIVIDE_BY_ZERO <br>
//!     EXCEPTION_FLT_INEXACT_RESULT <br>
//!     EXCEPTION_FLT_INVALID_OPERATION <br>
//!     EXCEPTOPN_FLT_OVERFLOW <br>
//!     EXCEPTION_FLT_STACK_CHECK <br>
//!     EXCEPTION_FLT_UNDERFLOW <br>
//!  2) Displays a message box 'Continue' - 'Debugger' - 'Stop' if the environment <br>
//!     variable 'CSF_EXCEPTION_PROMPT' is set and takes appropriate action. <br>
//!     Raises an exception otherwise. <br>
  Standard_EXPORT   static  Standard_Integer WntHandler(const Standard_Address exceptionInfo) ;



friend class OSD_Error;
friend class OSD_Protection;
friend class OSD_Path;
friend class OSD_FileNode;
friend class OSD_Disk;
friend class OSD_File;
friend class OSD_FileIterator;
friend class OSD_Directory;
friend class OSD_DirectoryIterator;
friend class OSD_Chronometer;
friend class OSD_Timer;
friend class OSD_Printer;
friend class OSD_Host;
friend class OSD_Environment;
friend class OSD_EnvironmentIterator;
friend class OSD_Process;
friend class OSD_SharedMemory;
friend class OSD_Semaphore;
friend class OSD_MailBox;
friend class OSD_SharedLibrary;
friend class OSD_Thread;
friend class OSD_Real2String;
friend class OSD_DataMapOfStringFunction;
friend class OSD_DataMapNodeOfDataMapOfStringFunction;
friend class OSD_DataMapIteratorOfDataMapOfStringFunction;

};





// other Inline functions and methods (like "C++: function call" methods)


#endif
