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.
Functions | |
int BASE_IMPEXP | 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 BASE_IMPEXP int BASE_IMPEXP | 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 BASE_IMPEXP | 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 BASE_IMPEXP * | fopen (const char *fileName, const char *mode) MRPT_NO_THROWS |
An OS-independent version of fopen. | |
FILE BASE_IMPEXP * | fopen (const std::string &fileName, const char *mode) MRPT_NO_THROWS |
An OS-independent version of fopen (std::string version) | |
int BASE_IMPEXP | fprintf (FILE *fil, const char *format,...) MRPT_NO_THROWS MRPT_printf_format_check(2 |
An OS-independent version of fprintf. | |
int BASE_IMPEXP void BASE_IMPEXP | fclose (FILE *f) |
An OS-independent version of fscanf. | |
char BASE_IMPEXP * | strcat (char *dest, size_t destSize, const char *source) MRPT_NO_THROWS |
An OS-independent version of strcat. | |
char BASE_IMPEXP * | strcpy (char *dest, size_t destSize, const char *source) MRPT_NO_THROWS |
An OS-independent version of strcpy. | |
int BASE_IMPEXP | _strcmp (const char *str1, const char *str2) MRPT_NO_THROWS |
An OS-independent version of strcmp. | |
int BASE_IMPEXP | _strcmpi (const char *str1, const char *str2) MRPT_NO_THROWS |
An OS-independent version of strcmpi. | |
int BASE_IMPEXP | _strncmp (const char *str, const char *subStr, size_t count) MRPT_NO_THROWS |
An OS-independent version of strncmp. | |
int BASE_IMPEXP | _strnicmp (const char *str, const char *subStr, size_t count) MRPT_NO_THROWS |
An OS-independent version of strnicmp. | |
int64_t BASE_IMPEXP | _strtoll (const char *nptr, char **endptr, int base) |
An OS-independent version of strtoll. | |
uint64_t BASE_IMPEXP | _strtoull (const char *nptr, char **endptr, int base) |
An OS-independent version of strtoull. | |
time_t BASE_IMPEXP | timegm (struct tm *tm) |
An OS-independent version of timegm (which is not present in all compilers): converts a time structure into an UTM time_t. | |
void BASE_IMPEXP | memcpy (void *dest, size_t destSize, const void *src, size_t copyCount) MRPT_NO_THROWS |
An OS and compiler independent version of "memcpy". | |
int BASE_IMPEXP | getch () MRPT_NO_THROWS |
An OS-independent version of getch, which waits until a key is pushed. | |
bool BASE_IMPEXP | kbhit () MRPT_NO_THROWS |
An OS-independent version of kbhit, which returns true if a key has been pushed. | |
Aligned memory management | |
void BASE_IMPEXP * | aligned_malloc (size_t bytes, size_t alignment) |
Returns an aligned memory block. | |
void * | aligned_calloc (size_t bytes, size_t alignment) |
Identical to aligned_malloc, but it zeroes the reserved memory block. | |
void BASE_IMPEXP * | aligned_realloc (void *old_ptr, size_t bytes, size_t alignment) |
Frees a memory block reserved by aligned_malloc. | |
void BASE_IMPEXP | aligned_free (void *p) |
Frees a memory block reserved by aligned_malloc. | |
template<typename _Tp > | |
_Tp * | align_ptr (_Tp *ptr, int n=(int) sizeof(_Tp)) |
Returns a pointer a bit forward in memory so it's aligned for the given boundary size. |
int BASE_IMPEXP mrpt::system::os::_strcmp | ( | const char * | str1, |
const char * | str2 | ||
) |
An OS-independent version of strcmp.
int BASE_IMPEXP mrpt::system::os::_strcmpi | ( | const char * | str1, |
const char * | str2 | ||
) |
An OS-independent version of strcmpi.
Referenced by mrpt::utils::CMHPropertiesValuesList::getElemental(), and mrpt::utils::CMHPropertiesValuesList::setElemental().
int BASE_IMPEXP mrpt::system::os::_strncmp | ( | const char * | str, |
const char * | subStr, | ||
size_t | count | ||
) |
An OS-independent version of strncmp.
int BASE_IMPEXP mrpt::system::os::_strnicmp | ( | const char * | str, |
const char * | subStr, | ||
size_t | count | ||
) |
An OS-independent version of strnicmp.
int64_t BASE_IMPEXP mrpt::system::os::_strtoll | ( | const char * | nptr, |
char ** | endptr, | ||
int | base | ||
) |
An OS-independent version of strtoll.
uint64_t BASE_IMPEXP mrpt::system::os::_strtoull | ( | const char * | nptr, |
char ** | endptr, | ||
int | base | ||
) |
An OS-independent version of strtoull.
_Tp* mrpt::system::os::align_ptr | ( | _Tp * | ptr, |
int | n = (int)sizeof(_Tp) |
||
) | [inline] |
void* mrpt::system::os::aligned_calloc | ( | size_t | bytes, |
size_t | alignment | ||
) | [inline] |
Identical to aligned_malloc, but it zeroes the reserved memory block.
Definition at line 83 of file memory.h.
References aligned_malloc().
Referenced by mrpt::math::CMatrixTemplate< TPoint3D >::realloc().
void BASE_IMPEXP mrpt::system::os::aligned_free | ( | void * | p | ) | [inline] |
Frees a memory block reserved by aligned_malloc.
Definition at line 202 of file Memory.h.
References internal::handmade_aligned_free().
Referenced by internal::aligned_delete(), internal::conditional_aligned_free(), aligned_allocator< T >::deallocate(), internal::generic_aligned_realloc(), and mrpt::math::CMatrixTemplate< TPoint3D >::realloc().
void BASE_IMPEXP* mrpt::system::os::aligned_malloc | ( | size_t | bytes, |
size_t | alignment | ||
) |
Returns an aligned memory block.
alignment | The desired alignment, typ. 8 or 16 bytes. 1 means no alignment required. It must be a power of two. |
Referenced by aligned_calloc(), and aligned_allocator< T >::allocate().
void BASE_IMPEXP* mrpt::system::os::aligned_realloc | ( | void * | old_ptr, |
size_t | bytes, | ||
size_t | alignment | ||
) | [inline] |
Frees a memory block reserved by aligned_malloc.
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. |
Definition at line 224 of file Memory.h.
References EIGEN_UNUSED_VARIABLE, internal::generic_aligned_realloc(), and internal::handmade_aligned_realloc().
Referenced by internal::conditional_aligned_realloc(), and mrpt::math::CMatrixTemplate< TPoint3D >::realloc().
int BASE_IMPEXP void BASE_IMPEXP mrpt::system::os::fclose | ( | FILE * | f | ) |
An OS-independent version of fscanf.
std::exception | On trying to close a NULL file descriptor. |
Referenced by MatrixBase< Derived >::saveToTextFile(), and mrpt::utils::CDynamicGrid< TGasConcentrationCell >::saveToTextFile().
FILE BASE_IMPEXP* mrpt::system::os::fopen | ( | const char * | fileName, |
const char * | mode | ||
) |
An OS-independent version of fopen.
Referenced by MatrixBase< Derived >::saveToTextFile(), and mrpt::utils::CDynamicGrid< TGasConcentrationCell >::saveToTextFile().
FILE BASE_IMPEXP* mrpt::system::os::fopen | ( | const std::string & | fileName, |
const char * | mode | ||
) |
An OS-independent version of fopen (std::string version)
int BASE_IMPEXP mrpt::system::os::fprintf | ( | FILE * | fil, |
const char * | format, | ||
... | |||
) |
An OS-independent version of fprintf.
Referenced by MatrixBase< Derived >::saveToTextFile(), and mrpt::utils::CDynamicGrid< TGasConcentrationCell >::saveToTextFile().
int BASE_IMPEXP mrpt::system::os::getch | ( | ) |
An OS-independent version of getch, which waits until a key is pushed.
bool BASE_IMPEXP mrpt::system::os::kbhit | ( | ) |
An OS-independent version of kbhit, which returns true if a key has been pushed.
void BASE_IMPEXP mrpt::system::os::memcpy | ( | void * | dest, |
size_t | destSize, | ||
const void * | src, | ||
size_t | copyCount | ||
) |
An OS and compiler independent version of "memcpy".
Referenced by mrpt::math::CSparseMatrix::construct_from_mrpt_mat(), internal::generic_aligned_realloc(), mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::KF_aux_estimate_obs_Hx_jacobian(), mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::KF_aux_estimate_obs_Hy_jacobian(), SparseMatrix< _Scalar, _Options, _Index >::operator=(), SparseInnerVectorSet< SparseMatrix< _Scalar, _Options, _Index >, Size >::operator=(), CompressedStorage< Scalar, Index >::operator=(), CompressedStorage< Scalar, Index >::reallocate(), AmbiVector< _Scalar, _Index >::reallocateSparse(), mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration(), and mrpt::math::detail::stub_kmeans().
int BASE_IMPEXP 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)
Referenced by mrpt::gui::CDisplayWindow::showImagesAndMatchedPoints().
char BASE_IMPEXP* mrpt::system::os::strcat | ( | char * | dest, |
size_t | destSize, | ||
const char * | source | ||
) |
An OS-independent version of strcat.
char BASE_IMPEXP* mrpt::system::os::strcpy | ( | char * | dest, |
size_t | destSize, | ||
const char * | source | ||
) |
An OS-independent version of strcpy.
time_t BASE_IMPEXP mrpt::system::os::timegm | ( | struct tm * | tm | ) |
An OS-independent version of timegm (which is not present in all compilers): converts a time structure into an UTM time_t.
int BASE_IMPEXP 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 BASE_IMPEXP int BASE_IMPEXP 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)
Page generated by Doxygen 1.7.3 for MRPT 0.9.4 SVN:exported at Tue Jan 25 21:56:31 UTC 2011 |