MRPT
2.0.1
|
Core functions for MRPT.
Back to list of all libraries | See all modules
[New in MRPT 2.0.0]
This library is part of MRPT and can be installed in Debian-based systems with:
sudo apt install libmrpt-core-dev
See: Using MRPT from your CMake project
See: core_exceptions_example/test.cpp
Output:
Classes | |
class | mrpt::Clock |
Clock that is compatible with MRPT TTimeStamp representation. More... | |
class | mrpt::cpu::internal::CPU_analyzer |
Auxiliary class. More... | |
class | mrpt::LockHelper< T > |
Auxiliary helper structure for mrpt::lockHelper() More... | |
struct | mrpt::safe_ptr_basic< T > |
A wrapper class for pointers that can be safely copied with "=" operator without problems. More... | |
struct | mrpt::safe_ptr< T > |
A wrapper class for pointers that can be safely copied with "=" operator without problems. More... | |
struct | mrpt::non_copiable_ptr_basic< T > |
A wrapper class for pointers that can NOT be copied with "=" operator, raising an exception at runtime if a copy is attempted. More... | |
struct | mrpt::non_copiable_ptr< T > |
A wrapper class for pointers that can NOT be copied with "=" operator, raising an exception at runtime if a copy is attempted. More... | |
struct | mrpt::ignored_copy_ptr< T > |
A wrapper class for pointers whose copy operations from other objects of the same type are ignored, that is, doing "a=b;" has no effect neiter on "a" or "b". More... | |
struct | mrpt::copiable_NULL_ptr_basic< T > |
A wrapper class for pointers that, if copied with the "=" operator, should be set to nullptr in the copy. More... | |
struct | mrpt::copiable_NULL_ptr< T > |
A wrapper class for pointers that, if copied with the "=" operator, should be set to nullptr in the new copy. More... | |
Modules | |
Funtions in #include <mrpt/core/bits_math.h> | |
Templates to declare integers by byte count (in | |
#include <mrpt/core/integer_select.h>) | |
Round functions (in #include <mrpt/core/round.h>) | |
Typedefs | |
template<class T > | |
using | mrpt::optional_ref = std::optional< std::reference_wrapper< T > > |
Shorter name for std::optional<std::reference_wrapper<T>> More... | |
Enumerations | |
enum | mrpt::cpu::feature : unsigned int { mrpt::cpu::feature::MMX = 0, mrpt::cpu::feature::POPCNT, mrpt::cpu::feature::SSE, mrpt::cpu::feature::SSE2, mrpt::cpu::feature::SSE3, mrpt::cpu::feature::SSSE3, mrpt::cpu::feature::SSE4_1, mrpt::cpu::feature::SSE4_2, mrpt::cpu::feature::AVX, mrpt::cpu::feature::AVX2, mrpt::cpu::feature::FEATURE_COUNT } |
OS-portable set of CPU feature definitions, for usage in mrpt::cpu::supports. More... | |
Functions | |
template<class VECTOR_T > | |
void | mrpt::vector_strong_clear (VECTOR_T &v) |
Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory. More... | |
bool | mrpt::cpu::supports (feature f) noexcept |
Returns true if the current CPU (and OS) supports the given CPU feature. More... | |
void | mrpt::cpu::overrideDetectedFeature (feature f, bool newValue) noexcept |
Blindly enables/disables a CPU feature flag in the list of detected features to be reported in subsequent calls to mrpt::cpu::supports(). More... | |
std::string | mrpt::cpu::features_as_string () noexcept |
Returns a string with detected features: "MMX:1 SSE2:0 etc.". More... | |
std::string | mrpt::exception_to_str (const std::exception &e) |
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THROW_EXCEPTION,...) in between MRPT_START/MRPT_END macros, will contain function names and line numbers across the call stack at the original throw point. More... | |
std::string | mrpt::format_impl (const char *fmt,...) MRPT_printf_format_check(1 |
A std::string version of C sprintf. More... | |
template<typename T > | |
std::string | mrpt::to_string (T v) |
Just like std::to_string(), but with an overloaded version for std::string arguments. More... | |
template<typename T > | |
T | mrpt::from_string (const std::string &s, const T &defValue=T{}, bool throw_on_error=true) |
Converts from string to any data type that supports reading (>>) from a text stream. More... | |
template<class T > | |
T | mrpt::get_env (const std::string &varname, const T &defValue=T()) |
Reads an environment variable, with a default value if not present. More... | |
template<class T > | |
LockHelper< T > | mrpt::lockHelper (T &t) |
Syntactic sugar to easily create a locker to any kind of std::mutex. More... | |
void | mrpt::reverseBytesInPlace (bool &v_in_out) |
Reverse the order of the bytes of a given type (useful for transforming btw little/big endian) More... | |
void | mrpt::reverseBytesInPlace (uint8_t &v_in_out) |
void | mrpt::reverseBytesInPlace (int8_t &v_in_out) |
void | mrpt::reverseBytesInPlace (uint16_t &v_in_out) |
void | mrpt::reverseBytesInPlace (int16_t &v_in_out) |
void | mrpt::reverseBytesInPlace (uint32_t &v_in_out) |
void | mrpt::reverseBytesInPlace (int32_t &v_in_out) |
void | mrpt::reverseBytesInPlace (uint64_t &v_in_out) |
void | mrpt::reverseBytesInPlace (int64_t &v_in_out) |
void | mrpt::reverseBytesInPlace (float &v_in_out) |
void | mrpt::reverseBytesInPlace (double &v_in_out) |
void | mrpt::reverseBytesInPlace (long double &v_in_out) |
void | mrpt::reverseBytesInPlace (std::chrono::time_point< mrpt::Clock > &v_in_out) |
template<class T > | |
void | mrpt::reverseBytes (const T &v_in, T &v_out) |
Reverse the order of the bytes of a given type (useful for transforming btw little/big endian) More... | |
template<class T > | |
T | mrpt::reverseBytes (const T &v_in) |
template<class T > | |
T | mrpt::toNativeEndianness (const T &v_in) |
template<typename enum_t , typename underlying_t = typename std::underlying_type<enum_t>::type> | |
void | mrpt::reverseBytesInPlace_enum (enum_t &v) |
using mrpt::optional_ref = typedef std::optional<std::reference_wrapper<T> > |
Shorter name for std::optional<std::reference_wrapper<T>>
Definition at line 20 of file optional_ref.h.
|
strong |
OS-portable set of CPU feature definitions, for usage in mrpt::cpu::supports.
Enumerator | |
---|---|
MMX | |
POPCNT | |
SSE | |
SSE2 | |
SSE3 | |
SSSE3 | |
SSE4_1 | |
SSE4_2 | |
AVX | |
AVX2 | |
FEATURE_COUNT |
std::string mrpt::exception_to_str | ( | const std::exception & | e | ) |
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THROW_EXCEPTION,...) in between MRPT_START/MRPT_END macros, will contain function names and line numbers across the call stack at the original throw point.
See example of use in [mrpt-core] Uses C++11 throw_with_nested(), rethrow_if_nested().
Definition at line 59 of file exceptions.cpp.
References mrpt::internal::impl_excep_to_str().
Referenced by catch(), mrpt::gui::CDisplayWindowGUI::drawContents(), mrpt::gui::MRPT2NanoguiGLCanvas::drawGL(), generic_icp_slam_test(), generic_kf_slam_test(), generic_pf_test(), generic_rbpf_slam_test(), mrpt::obs::CRawlog::getActionObservationPair(), mrpt::obs::CRawlog::getActionObservationPairOrObservation(), mrpt::obs::CRawlog::loadFromRawLogFile(), mrpt::obs::CRawlog::readActionObservationPair(), mrpt::gui::CGlCanvasBase::renderCanvas(), mrpt::obs::CRawlog::saveToRawLogFile(), mrpt::apps::RawlogGrabberApp::SensorThread(), mrpt::apps::ICP_SLAM_App_Live::SensorThread(), TEST(), mrpt::comms::CClientTCPSocket::~CClientTCPSocket(), mrpt::config::CConfigFile::~CConfigFile(), mrpt::hwdrivers::CHokuyoURG::~CHokuyoURG(), mrpt::system::CObservable::~CObservable(), mrpt::opengl::CRenderizableShaderTexturedTriangles::~CRenderizableShaderTexturedTriangles(), mrpt::comms::CSerialPort::~CSerialPort(), mrpt::system::CTimeLoggerEntry::~CTimeLoggerEntry(), and mrpt::system::CTimeLoggerSaveAtDtor::~CTimeLoggerSaveAtDtor().
|
noexcept |
Returns a string with detected features: "MMX:1 SSE2:0 etc.".
Definition at line 95 of file cpu.cpp.
References mrpt::cpu::AVX, mrpt::cpu::AVX2, mrpt::format(), mrpt::cpu::internal::CPU_analyzer::Instance(), mrpt::cpu::MMX, mrpt::cpu::POPCNT, mrpt::cpu::SSE, mrpt::cpu::SSE2, mrpt::cpu::SSE3, mrpt::cpu::SSE4_1, mrpt::cpu::SSE4_2, and mrpt::cpu::SSSE3.
Referenced by TEST().
std::string mrpt::format_impl | ( | const char * | fmt, |
... | |||
) |
A std::string version of C sprintf.
You can call this to obtain a std::string using printf-like syntax.
Definition at line 16 of file format.cpp.
References mrpt::system::os::vsnprintf().
Referenced by mrpt::format().
|
inline |
Converts from string to any data type that supports reading (>>) from a text stream.
In case of error, the given default value is returned, or an exception raised.
Definition at line 32 of file from_string.h.
|
inline |
LockHelper<T> mrpt::lockHelper | ( | T & | t | ) |
Syntactic sugar to easily create a locker to any kind of std::mutex.
Definition at line 50 of file lock_helper.h.
Referenced by mrpt::nav::CAbstractNavigator::cancel(), mrpt::slam::CMetricMapBuilderRBPF::clear(), mrpt::nav::CAbstractPTGBasedReactive::enableLogFile(), mrpt::slam::CMetricMapBuilderICP::getCurrentMapPoints(), mrpt::nav::CAbstractPTGBasedReactive::getLastLogRecord(), mrpt::obs::CSinCosLookUpTableFor2DScans::getSinCosForScan(), mrpt::slam::CMetricMapBuilderICP::initialize(), mrpt::slam::CMetricMapBuilderRBPF::initialize(), mrpt::nav::CAbstractPTGBasedReactive::initialize(), mrpt::nav::CAbstractNavigator::navigationStep(), mrpt::nav::CAbstractNavigator::onNavigateCommandReceived(), mrpt::slam::CMetricMapBuilderRBPF::processActionObservation(), mrpt::nav::CAbstractNavigator::processNavigateCommand(), mrpt::slam::CMetricMapBuilderICP::processObservation(), mrpt::nav::CAbstractNavigator::resetNavError(), mrpt::nav::CAbstractNavigator::resume(), mrpt::apps::RawlogGrabberApp::run(), mrpt::nav::CAbstractPTGBasedReactive::setHolonomicMethod(), mrpt::nav::CAbstractPTGBasedReactive::STEP8_GenerateLogRecord(), mrpt::nav::CAbstractNavigator::suspend(), and TEST().
|
inlinenoexcept |
Blindly enables/disables a CPU feature flag in the list of detected features to be reported in subsequent calls to mrpt::cpu::supports().
Could be used to disable a given CPU feature for benchmarking dynamically-dispatched functions.
Definition at line 91 of file cpu.h.
References mrpt::cpu::internal::CPU_analyzer::Instance().
|
inline |
Reverse the order of the bytes of a given type (useful for transforming btw little/big endian)
Definition at line 39 of file reverse_bytes.h.
References mrpt::reverseBytesInPlace().
Referenced by get_binary_item(), and TEST().
|
inline |
Definition at line 46 of file reverse_bytes.h.
References mrpt::reverseBytesInPlace().
void mrpt::reverseBytesInPlace | ( | bool & | v_in_out | ) |
Reverse the order of the bytes of a given type (useful for transforming btw little/big endian)
Definition at line 93 of file reverse_bytes.cpp.
Referenced by mrpt::obs::gnss::nv_oem6_header_t::fixEndianness(), mrpt::obs::gnss::nv_oem6_short_header_t::fixEndianness(), mrpt::obs::gnss::fixEndianness(), mrpt::obs::gnss::Message_NV_OEM6_VERSION::fixEndianness(), mrpt::serialization::CArchive::ReadBufferFixEndianness(), mrpt::reverseBytes(), mrpt::reverseBytesInPlace_enum(), mrpt::img::CCanvas::selectTextFont(), TEST(), and mrpt::toNativeEndianness().
void mrpt::reverseBytesInPlace | ( | uint8_t & | v_in_out | ) |
Definition at line 98 of file reverse_bytes.cpp.
void mrpt::reverseBytesInPlace | ( | int8_t & | v_in_out | ) |
Definition at line 102 of file reverse_bytes.cpp.
void mrpt::reverseBytesInPlace | ( | uint16_t & | v_in_out | ) |
Definition at line 107 of file reverse_bytes.cpp.
References reverseBytesInPlace_2b().
void mrpt::reverseBytesInPlace | ( | int16_t & | v_in_out | ) |
Definition at line 112 of file reverse_bytes.cpp.
References reverseBytesInPlace_2b().
void mrpt::reverseBytesInPlace | ( | uint32_t & | v_in_out | ) |
Definition at line 117 of file reverse_bytes.cpp.
References reverseBytesInPlace_4b().
void mrpt::reverseBytesInPlace | ( | int32_t & | v_in_out | ) |
Definition at line 122 of file reverse_bytes.cpp.
References reverseBytesInPlace_4b().
void mrpt::reverseBytesInPlace | ( | uint64_t & | v_in_out | ) |
Definition at line 127 of file reverse_bytes.cpp.
References reverseBytesInPlace_8b().
void mrpt::reverseBytesInPlace | ( | int64_t & | v_in_out | ) |
Definition at line 132 of file reverse_bytes.cpp.
References reverseBytesInPlace_8b().
void mrpt::reverseBytesInPlace | ( | float & | v_in_out | ) |
Definition at line 137 of file reverse_bytes.cpp.
References reverseBytesInPlace_4b().
void mrpt::reverseBytesInPlace | ( | double & | v_in_out | ) |
Definition at line 142 of file reverse_bytes.cpp.
References reverseBytesInPlace_8b().
void mrpt::reverseBytesInPlace | ( | long double & | v_in_out | ) |
void mrpt::reverseBytesInPlace | ( | std::chrono::time_point< mrpt::Clock > & | v_in_out | ) |
Definition at line 147 of file reverse_bytes.cpp.
References reverseBytesInPlace_8b(), and val.
|
inline |
Definition at line 68 of file reverse_bytes.h.
References mrpt::reverseBytesInPlace().
Referenced by mrpt::obs::gnss::fixEndianness().
|
inlinenoexcept |
Returns true if the current CPU (and OS) supports the given CPU feature.
Definition at line 75 of file cpu.h.
References mrpt::cpu::internal::CPU_analyzer::Instance().
Referenced by my_img_to_grayscale(), mrpt::obs::detail::range2XYZ_LUT(), mrpt::round(), mrpt::round_long(), mrpt::img::CImage::scaleHalf(), mrpt::tfest::se2_l2(), and TEST().
std::string mrpt::to_string | ( | T | v | ) |
Just like std::to_string(), but with an overloaded version for std::string arguments.
Definition at line 36 of file format.h.
References mrpt::to_string().
Referenced by mrpt::internal::asrt_fail(), mrpt::hwdrivers::CIMUIntersense::doProcess(), mrpt::hwdrivers::CSkeletonTracker::doProcess(), mrpt::internal::exception_line_msg(), mrpt::vision::CFeatureLines::extractLines(), mrpt::internal::impl_excep_to_str(), mrpt::comms::net::Ping(), mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::saveAsDot(), mrpt::system::CTimeLogger::saveToCSVFile(), mrpt::system::CTimeLogger::saveToMFile(), mrpt::io::CPipeBaseEndPoint::serialize(), TEST(), mrpt::typemeta::TEnumType< ENUMTYPE >::value2name(), and mrpt::config::CConfigFileBase::write().
|
inline |
Definition at line 54 of file reverse_bytes.h.
References mrpt::reverseBytesInPlace().
Referenced by mrpt::obs::CObservationVelodyneScan::laser_return_t::distance(), mrpt::obs::CObservationVelodyneScan::TVelodyneRawPacket::gps_timestamp(), mrpt::obs::CObservationVelodyneScan::TVelodynePositionPacket::gps_timestamp(), mrpt::obs::CObservationVelodyneScan::raw_block_t::header(), mrpt::obs::CObservationVelodyneScan::raw_block_t::rotation(), and mrpt::obs::CObservationVelodyneScan::TVelodynePositionPacket::unused2().
|
inline |
Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory.
Definition at line 18 of file bits_mem.h.
Referenced by mrpt::maps::CSimplePointsMap::internal_clear(), mrpt::maps::CWeightedPointsMap::internal_clear(), mrpt::maps::CPointsMapXYZI::internal_clear(), mrpt::maps::CColouredPointsMap::internal_clear(), mrpt::obs::CObservation3DRangeScan::points3D_convertToExternalStorage(), mrpt::obs::CObservation3DRangeScan::resizePoints3DVectors(), and mrpt::obs::CObservation3DRangeScan::unload().
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |