Free Electron
Classes | Enumerations | Functions
Platform Abstraction

Classes

class  fe::SystemTicker
 High precision timer. More...
 
class  fe::DL_Loader
 Raw access to a dynamic library. More...
 
class  fe::Exception
 Generic exception carrying a fe::String payload. More...
 
class  fe::String
 Automatically reference-counted string container. More...
 
class  fe::System
 System call wrappers. More...
 
class  fe::UnitTest
 Counts success and failures in a style similar to assertions. More...
 

Enumerations

enum  fe::Result {
  e_ok =0x00000000,
  e_cancel,
  e_poison,
  e_alreadyAvailable,
  e_notNeeded,
  e_undefinedFailure =FE_FAILURE,
  e_unsupported,
  e_refused,
  e_outOfMemory,
  e_invalidFile,
  e_invalidHandle,
  e_invalidPointer,
  e_invalidRange,
  e_notInitialized,
  e_cannotChange,
  e_aborted,
  e_writeFailed,
  e_readFailed,
  e_cannotFind,
  e_cannotCreate,
  e_unsolvable,
  e_impossible,
  e_usage,
  e_system,
  e_typeMismatch,
  e_corrupt
}
 Generalized return value indicating success or failure, and why. More...
 

Functions

void fe::milliSleep (long milliseconds)
 Sleep the current process for the given number of milliseconds. More...
 
void fe::microSleep (long microseconds)
 Sleep the current process for the given number of microseconds. More...
 
void fe::minimumSleep (long microseconds=1)
 Sleep the current process for the given number of microseconds or the minimum that the OS can resolve, whichever is larger. More...
 
void fe::nanoSpin (long nanoseconds)
 Delay the current thread for the given number of nanoseconds. More...
 
BWORD fe::successful (Result result)
 Returns TRUE if the result value indicates a success. More...
 
BWORD fe::failure (Result result)
 Returns TRUE if the result value indicates a failure. More...
 
const char * fe::resultString (Result result)
 Return a string for a result code. More...
 
String fe::errorString (int errnum)
 Return a string for an FE_ERRNO code. More...
 
unsigned long fe::systemTick (void)
 Sleep the current thread for the given number of seconds and nanoseconds. More...
 
unsigned long fe::systemMicroseconds (void)
 Get the high precision microsecond timer. More...
 

Detailed Description

Enumeration Type Documentation

◆ Result

enum fe::Result

Generalized return value indicating success or failure, and why.

The functions fe::succeeded and fe::failed can quickly determine which category the result belongs to.

Todo:
eventually grep code for usage a remove useless ones

Function Documentation

◆ errorString()

FE_DL_PUBLIC String fe::errorString ( int  error)

Return a string for an FE_ERRNO code.

Referenced by fe::ext::DrawOpenGL::flush().

◆ failure()

BWORD fe::failure ( Result  result)
inline

◆ microSleep()

void FE_DL_EXPORT fe::microSleep ( long  microseconds)

Sleep the current process for the given number of microseconds.

This can sleep all the threads for the process.

References fe::milliSleep().

Referenced by fe::minimumSleep().

◆ milliSleep()

void FE_DL_EXPORT fe::milliSleep ( long  milliseconds)

Sleep the current process for the given number of milliseconds.

This can sleep all the threads for the process.

Referenced by fe::microSleep(), and fe::ext::QuickViewer::run().

◆ minimumSleep()

void FE_DL_EXPORT fe::minimumSleep ( long  microseconds = 1)

Sleep the current process for the given number of microseconds or the minimum that the OS can resolve, whichever is larger.

This can sleep all the threads for the process.

References fe::microSleep().

◆ nanoSpin()

void FE_DL_EXPORT fe::nanoSpin ( long  nanoseconds)

Delay the current thread for the given number of nanoseconds.

This function may involve an active polling of clock ticks.

This should not sleep other threads.

◆ resultString()

FE_DL_EXPORT const char * fe::resultString ( Result  result)

Return a string for a result code.

◆ successful()

BWORD fe::successful ( Result  result)
inline

Returns TRUE if the result value indicates a success.

◆ systemMicroseconds()

unsigned long fe::systemMicroseconds ( void  )
inline

Get the high precision microsecond timer.

This is a convenience function utilizing fe::systemTick(). You must call fe::SystemTicker::calibrate() once prior to use.

References fe::SystemTicker::microsecondsPerTick(), and fe::systemTick().

◆ systemTick()

unsigned long fe::systemTick ( void  )
inline

Sleep the current thread for the given number of seconds and nanoseconds.

This should not sleep other threads. Yield the current thread

This should not yield other threads.

Get the high precision tick count from the processor

See fe::SystemTicker for utilities and interpreted results, including calibration.

Referenced by fe::systemMicroseconds().