LLOOP Index | GSP Language | GSP Library | Framework Classes | Component Classes

Object Class Reference

#include "universal.h"

Base class for all univesal classes. More...


Deriving Class(es)


Public Functions

~Object ( ) 

Related Functions

  • void 
ptest_assert_error ( std::ostream & os , const char * c_pszMess 
  • void 
ptest_assert_ok ( std::ostream & os , const char * c_pszMess 
  • void 
ptest_func_error ( std::ostream & os , int iRetVal , int iExpectVal , const char * c_szFuncName , int iNotExpected 
  • void 
ptest_func_ok ( std::ostream & os , int iRetVal , const char * c_szFuncName 
  • void 
set_errno ( ) 
  • int 
thread_sleep_nano ( long ims , long inanos 
  • int 
thread_sleep_us ( unsigned long usec 
  • int 
winsynch_wait ( HANDLE handle , long timeout_ms 

Related Types

  • typedef ::iostream  iostream
  • typedef ::istream  istream
  • typedef ::ostream  ostream
  • typedef ::fstream  fstream
  • typedef ::ifstream  ifstream
  • typedef ::ofstream  ofstream
  • typedef ::strstream  strstream
  • typedef ::istrstream  istrstream
  • typedef ::ostrstream  ostrstream
  • typedef ::streampos  streampos

Detailed Description

Base class for all univesal classes.


Files Included

#include "afx.h"
#include <windows.h>
#include <iostream>
#include <fstream>
#include <strstream>
#include <iosfwd>
#include <iostream>

Functions Documentation

int winsynch_wait ( HANDLE handle , long timeout_ms   [  global  ] 

Wrap function for the Windows WaitForSingleObject() which is used by many synchronization objects: mutexes, semaphores..

This function calls WaitForSingleObject on the passed Handler handle of of the windows object to wait for.

timeout_ms is the wait timeout in milliseconds. Special value -1 is for an infinite wait and 0 is for just polling.

Returns 0 if the wait was successful, 1 if there was a timeout and -1 if there was an error.

Only for Windows platforms.

See also:

Back to index

int thread_sleep_us ( unsigned long usec   [  global  ] 

Cross-platform sleep function with microsecond resolution for system-level threading programming in C.

All the range of the input parameter can be used, i.e. the max. sleep time is 4294967296 microseconds or 4294967 ms or 4294 seconds or 71 min.

Returns 0 on success, -1 otherwise and in all cases the errno is set.

See also:

Back to index

int thread_sleep_nano ( long ims , long inanos   [  global  ] 

Cross-platform sleep function with nanosecond resolution for system-level threading programming in C.

The range of input parameter is 2147483648 ms + 2147483648 ns, i.e. 2147483 s + 2147483 micros, or 35791 min + 2147 ms, or 596 h.

Negative values for ims and inanos are considered as 0.

Under UNIX/POSIX platforms, this function ensures that the calling thread is suspended for the exact amount of time specified, even though it may be interrupted by a system signal.

Under Windows platforms, SleepEx() is used and therefore nanos is ignored.

Returns 0 on success, -1 otherwise and in all cases the errno is set.

See also:

Back to index

void ptest_assert_ok ( std::ostream & os , const char * c_pszMess   [  global  ] 

This function is intended to be used in unit tests and allows to print out a OK message for an assertion.

os is the output stream to which are written the message.

c_pszMess contains the printable form of the tested condition.

See also:

Back to index

void ptest_assert_error ( std::ostream & os , const char * c_pszMess   [  global  ] 

This function is intended to be used in unit tests and allows to print out an error message for an assertion.

os is the output stream to which are written the message.

The errno value is additionally printed.

c_pszMess contains the printable form of the tested condition.

See also:

Back to index

void ptest_func_ok ( std::ostream & os , int iRetVal , const char * c_szFuncName   [  global  ] 

This function is intended to be used in unit tests and allows to print out a OK message for a tested function call.

os is the output stream to which are written the message.

iRetVal contains the value actually returned by the called function.

c_szFuncName contains the tested function name.

See also:

Back to index

void ptest_func_error ( std::ostream & os , int iRetVal , int iExpectVal , const char * c_szFuncName , int iNotExpected   [  global  ] 

This function is intended to be used in unit tests and allows to print out an error message for a tested function call.

os iw the output stream to which are written the message.

iRetVal contains the value actually returned by the called function.

iExpectVal contains the value expected to be returned or not by the function.

c_szFuncName contains the tested function name.

iNotExpected tells whether iExpectVal was expected or not in the test.

See also:

Back to index

void set_errno ( )   [  global  ] 

This routine converts a Win32 error to a POSIX errno value.

Following this call, the global system errno value is set.

Only for Windows platforms for POSIX compatibility purposes.

See also:

Back to index

Object ( )   [  protected  ] 

Constructor for base Object class.

See also:

Back to index

~Object ( )   [  virtual  ] 

Destructor for base Object class.

See also:

Back to index


This file is part of the LLOOP Reversible Object-Oriented Parser Generator. Copyright (c) 2005-2006 Michel MEHL, France. All rights reserved. LLOOP is distributed by the company ERSA SaRL.


Copyright (c) 2005-2006 Michel MEHL, Haguenau, France
LLOOP version 1.1


Generated with makedoc.