MRPT logo

mrpt::system::os Namespace Reference

This namespace provides a OS-independent interface to low-level functions. More...


Functions

int MRPTDLLIMPEXP sprintf (char *buf, size_t bufSize, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(3
 An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compilers).
int MRPTDLLIMPEXP int MRPTDLLIMPEXP vsprintf (char *buf, size_t bufSize, const char *format, va_list args) MRPT_NO_THROWS
 An OS-independent version of vsprintf (Notice the bufSize param, which may be ignored in some compilers).
int MRPTDLLIMPEXP vsnprintf (char *buf, size_t bufSize, const char *format, va_list args) MRPT_NO_THROWS
 An OS-independent version of vsnprintf (Notice the bufSize param, which may be ignored in some compilers).
FILE MRPTDLLIMPEXP * fopen (const char *fileName, const char *mode) MRPT_NO_THROWS
 An OS-independent version of fopen.
FILE MRPTDLLIMPEXP * fopen (const std::string &fileName, const char *mode) MRPT_NO_THROWS
 An OS-independent version of fopen (std::string version).
int MRPTDLLIMPEXP fprintf (FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2
 An OS-independent version of fprintf.
int MRPTDLLIMPEXP int MRPTDLLIMPEXP fscanf (FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_scanf_format_check(2
 An OS-independent version of fscanf.
int MRPTDLLIMPEXP int
MRPTDLLIMPEXP void
MRPTDLLIMPEXP 
fclose (FILE *f)
 An OS-independent version of fclose.
char MRPTDLLIMPEXP * strcat (char *dest, size_t destSize, const char *source) MRPT_NO_THROWS
 An OS-independent version of strcat.
char MRPTDLLIMPEXP * strcpy (char *dest, size_t destSize, const char *source) MRPT_NO_THROWS
 An OS-independent version of strcpy.
int MRPTDLLIMPEXP _strcmp (const char *str1, const char *str2) MRPT_NO_THROWS
 An OS-independent version of strcmp.
int MRPTDLLIMPEXP _strcmpi (const char *str1, const char *str2) MRPT_NO_THROWS
 An OS-independent version of strcmpi.
int64_t MRPTDLLIMPEXP _strtoll (const char *nptr, char **endptr, int base)
 An OS-independent version of strtoll.
uint64_t MRPTDLLIMPEXP _strtoull (const char *nptr, char **endptr, int base)
 An OS-independent version of strtoull.
void MRPTDLLIMPEXP memcpy (void *dest, size_t destSize, const void *src, size_t copyCount) MRPT_NO_THROWS
 An OS and compiler independent version of "memcpy".
int MRPTDLLIMPEXP getch () MRPT_NO_THROWS
 An OS-independent version of getch, which waits until a key is pushed.
bool MRPTDLLIMPEXP kbhit () MRPT_NO_THROWS
 An OS-independent version of kbhit, which returns true if a key has been pushed.
Aligned memory management
void MRPTDLLIMPEXP * aligned_malloc (size_t bytes, size_t alignment)
 Returns an aligned memory block.
void MRPTDLLIMPEXP * aligned_calloc (size_t bytes, size_t alignment)
 Identical to aligned_malloc, but it zeroes the reserved memory block.
void MRPTDLLIMPEXP * aligned_realloc (void *old_ptr, size_t bytes, size_t alignment)
 Frees a memory block reserved by aligned_malloc.
void MRPTDLLIMPEXP aligned_free (void *p)
 Frees a memory block reserved by aligned_malloc.


Detailed Description

This namespace provides a OS-independent interface to low-level functions.

Most of these functions are converted into calls to standard functions, unless we are into Visual Studio 2005 (or newer). In that case the secure version of the standard library functions (prefix "_s") are used instead.


Function Documentation

int MRPTDLLIMPEXP mrpt::system::os::_strcmp ( const char *  str1,
const char *  str2 
)

An OS-independent version of strcmp.

Returns:
It will return 0 when both strings are equal, casi sensitive.

int MRPTDLLIMPEXP mrpt::system::os::_strcmpi ( const char *  str1,
const char *  str2 
)

An OS-independent version of strcmpi.

Returns:
It will return 0 when both strings are equal, casi insensitive.

Referenced by mrpt::utils::CMHPropertiesValuesList::getElemental(), and mrpt::utils::CMHPropertiesValuesList::setElemental().

int64_t MRPTDLLIMPEXP mrpt::system::os::_strtoll ( const char *  nptr,
char **  endptr,
int  base 
)

An OS-independent version of strtoll.

uint64_t MRPTDLLIMPEXP mrpt::system::os::_strtoull ( const char *  nptr,
char **  endptr,
int  base 
)

An OS-independent version of strtoull.

void MRPTDLLIMPEXP* mrpt::system::os::aligned_calloc ( size_t  bytes,
size_t  alignment 
)

Identical to aligned_malloc, but it zeroes the reserved memory block.

Referenced by mrpt::math::CMatrixTemplate< TPoint3D >::realloc().

void MRPTDLLIMPEXP mrpt::system::os::aligned_free ( void *  p  ) 

Frees a memory block reserved by aligned_malloc.

See also:
aligned_malloc

Referenced by mrpt::math::CMatrixTemplate< TPoint3D >::realloc().

void MRPTDLLIMPEXP* mrpt::system::os::aligned_malloc ( size_t  bytes,
size_t  alignment 
)

Returns an aligned memory block.

Parameters:
alignment The desired alignment, typ. 8 or 16 bytes. 1 means no alignment required. It must be a power of two.
See also:
aligned_free, aligned_realloc, aligned_calloc
Note:
Based on code by William Chan

void MRPTDLLIMPEXP* mrpt::system::os::aligned_realloc ( void *  old_ptr,
size_t  bytes,
size_t  alignment 
)

Frees a memory block reserved by aligned_malloc.

Parameters:
alignment The desired alignment, typ. 8 or 16 bytes. 1 means no alignment required. If old_ptr is NULL, a new block will be reserved from scratch.
See also:
aligned_malloc, aligned_free

Referenced by mrpt::math::CMatrixTemplate< TPoint3D >::realloc().

int MRPTDLLIMPEXP int MRPTDLLIMPEXP void MRPTDLLIMPEXP mrpt::system::os::fclose ( FILE *  f  ) 

An OS-independent version of fclose.

Exceptions:
std::exception On trying to close a NULL file descriptor.

Referenced by mrpt::math::saveMatrixToTextFile(), mrpt::utils::CDynamicGrid< TCellForLambdaFunction >::saveToTextFile(), and mrpt::reactivenav::CAbstractReactiveNavigationSystem::TDebug::~TDebug().

FILE MRPTDLLIMPEXP* mrpt::system::os::fopen ( const std::string &  fileName,
const char *  mode 
)

An OS-independent version of fopen (std::string version).

Returns:
It will always return NULL on any error.

FILE MRPTDLLIMPEXP* mrpt::system::os::fopen ( const char *  fileName,
const char *  mode 
)

int MRPTDLLIMPEXP mrpt::system::os::fprintf ( FILE *  fil,
const char *  format,
  ... 
)

int MRPTDLLIMPEXP int MRPTDLLIMPEXP mrpt::system::os::fscanf ( FILE *  fil,
const char *  format,
  ... 
)

An OS-independent version of fscanf.

Returns:
The number of fields correctly assigned

int MRPTDLLIMPEXP mrpt::system::os::getch (  ) 

An OS-independent version of getch, which waits until a key is pushed.

Returns:
The pushed key code

bool MRPTDLLIMPEXP mrpt::system::os::kbhit (  ) 

An OS-independent version of kbhit, which returns true if a key has been pushed.

void MRPTDLLIMPEXP mrpt::system::os::memcpy ( void *  dest,
size_t  destSize,
const void *  src,
size_t  copyCount 
)

int MRPTDLLIMPEXP mrpt::system::os::sprintf ( char *  buf,
size_t  bufSize,
const char *  format,
  ... 
)

An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compilers).

See also:
utils::format

char MRPTDLLIMPEXP* mrpt::system::os::strcat ( char *  dest,
size_t  destSize,
const char *  source 
)

An OS-independent version of strcat.

Returns:
It will always return the "dest" pointer.

char MRPTDLLIMPEXP* mrpt::system::os::strcpy ( char *  dest,
size_t  destSize,
const char *  source 
)

An OS-independent version of strcpy.

Returns:
It will always return the "dest" pointer.

int MRPTDLLIMPEXP mrpt::system::os::vsnprintf ( char *  buf,
size_t  bufSize,
const char *  format,
va_list  args 
)

An OS-independent version of vsnprintf (Notice the bufSize param, which may be ignored in some compilers).

int MRPTDLLIMPEXP int MRPTDLLIMPEXP mrpt::system::os::vsprintf ( char *  buf,
size_t  bufSize,
const char *  format,
va_list  args 
)

An OS-independent version of vsprintf (Notice the bufSize param, which may be ignored in some compilers).

Referenced by mrpt::reactivenav::CAbstractReactiveNavigationSystem::TextoDebug().




Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:32:05 EDT 2009