Main MRPT website > C++ reference for MRPT 1.5.7
Classes | Namespaces | Functions
CObject.h File Reference
#include <mrpt/system/memory.h>
#include <mrpt/utils/safe_pointers.h>
#include <vector>
#include <mrpt/otherlibs/stlplus/smart_ptr.hpp>
Include dependency graph for CObject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mrpt::utils::CObjectPtr
 A smart pointer to a CObject object. More...
 
struct  mrpt::utils::TRuntimeClassId
 A structure that holds runtime class type information. More...
 
struct  mrpt::utils::CLASSINIT
 Auxiliary structure used for CObject-based RTTI. More...
 
class  mrpt::utils::CObject
 The virtual base class of all MRPT classes with a unified RTTI system. More...
 
struct  mrpt::ptr_cast< CAST_TO >
 Converts a smart pointer Base::Ptr to Derived::Ptr, in a way compatible with MRPT >=1.5.4 and MRPT 2.x series. More...
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::utils
 Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
 

Functions

void BASE_IMPEXP mrpt::utils::registerAllPendingClasses ()
 Register all pending classes - to be called just before de-serializing an object, for example. More...
 
template<typename T , typename C , typename COUNTER >
bool std::operator== (const stlplus::smart_ptr_base< T, C, COUNTER > &a, const stlplus::smart_ptr_base< T, C, COUNTER > &b)
 This operator enables comparing two smart pointers with "==" to test whether they point to the same object. More...
 
template<typename T , typename C , typename COUNTER >
bool std::operator!= (const stlplus::smart_ptr_base< T, C, COUNTER > &a, const stlplus::smart_ptr_base< T, C, COUNTER > &b)
 This operator enables comparing two smart pointers with "!=" to test whether they don't point to the same object. More...
 

RTTI classes and functions

#define CLASS_ID(class_name)   static_cast<const mrpt::utils::TRuntimeClassId*>(&class_name::class##class_name)
 Access to runtime class ID for a defined class name. More...
 
#define CLASS_ID_NAMESPACE(class_name, namespaceName)   static_cast<const mrpt::utils::TRuntimeClassId*>(&namespaceName::class_name::class##class_name)
 Access to runtime class ID for a defined class name. More...
 
#define CLASS_ID_TEMPLATE(class_name, T)   static_cast<const mrpt::utils::TRuntimeClassId*>(& template <class T> class_name<T>::class##class_name)
 Access to runtime class ID for a defined template class name. More...
 
#define IS_CLASS(ptrObj, class_name)   ((ptrObj)->GetRuntimeClass()==CLASS_ID(class_name))
 Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of the given class. More...
 
#define IS_DERIVED(ptrObj, class_name)   ((ptrObj)->GetRuntimeClass()->derivedFrom(CLASS_ID(class_name)))
 Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is an instance of the given class or any of its derived classes. More...
 
#define DEFINE_MRPT_OBJECT_CUSTOM_LINKAGE(class_name, _STATIC_LINKAGE_, _VIRTUAL_LINKAGE_)
 Just like DEFINE_MRPT_OBJECT but with DLL export/import linkage keywords. More...
 
#define DEFINE_MRPT_OBJECT(class_name)   DEFINE_MRPT_OBJECT_CUSTOM_LINKAGE(class_name, static /*none*/, virtual /*none*/)
 This declaration must be inserted in all CObject classes definition, within the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)   DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name)
 
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)   DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name)
 
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_NO_LINKAGE(class_name, base_name)   DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name)
 
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_NO_LINKAGE(class_name, base_name)   DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name)
 
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
 This declaration must be inserted in all CObject classes definition, before the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name_LINKAGE_)
 This declaration must be inserted in all CObject classes definition, after the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE(class_name, _LINKAGE_)   DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE2(class_name, _LINKAGE_ class_name)
 
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE(class_name, _LINKAGE_)   DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE2(class_name, _LINKAGE_ class_name)
 
#define DEFINE_MRPT_OBJECT_PRE_NO_LINKAGE(class_name)   DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE2(class_name, class_name)
 
#define DEFINE_MRPT_OBJECT_POST_NO_LINKAGE(class_name)   DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE2(class_name, class_name)
 
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE2(class_name, class_name_LINKAGE_)   struct class_name_LINKAGE_##Ptr;
 This declaration must be inserted in all CObject classes definition, before the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE2(class_name, class_name_LINKAGE_)
 This declaration must be inserted in all CObject classes definition, after the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE(class_name, base_name)   DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, BASE_IMPEXP )
 This declaration must be inserted in all CObject classes definition, before the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_PRE(class_name)   DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE(class_name, BASE_IMPEXP )
 This declaration must be inserted in all CObject classes definition, before the class declaration. More...
 
#define DEFINE_MRPT_OBJECT_POST(class_name)   DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE(class_name, BASE_IMPEXP )
 
#define IMPLEMENTS_MRPT_OBJECT(class_name, base, NameSpace)
 This must be inserted in all CObject classes implementation files. More...
 
#define DEFINE_VIRTUAL_MRPT_OBJECT(class_name)
 This declaration must be inserted in virtual CSerializable classes definition: More...
 
#define IMPLEMENTS_VIRTUAL_MRPT_OBJECT(class_name, base_class_name, NameSpace)
 This must be inserted as implementation of some required members for virtual CSerializable classes: More...
 
typedef safe_ptr< TRuntimeClassId > mrpt::utils::TRuntimeClassIdPtr
 A wrapper class for a "TRuntimeClassId *", well-defined with respect to copy operators and constructors. More...
 
class BASE_IMPEXP mrpt::utils::CObject
 
void BASE_IMPEXP mrpt::utils::registerClass (const mrpt::utils::TRuntimeClassId *pNewClass)
 Register a class into the MRPT internal list of "CSerializable" descendents. More...
 
void BASE_IMPEXP mrpt::utils::registerClassCustomName (const char *customName, const TRuntimeClassId *pNewClass)
 Mostly for internal use within mrpt sources, to handle exceptional cases with multiple serialization names for backward compatibility (CMultiMetricMaps, CImage,...) More...
 
std::vector< const mrpt::utils::TRuntimeClassId * > BASE_IMPEXP mrpt::utils::getAllRegisteredClasses ()
 Returns a list with all the classes registered in the system through mrpt::utils::registerClass. More...
 
std::vector< const TRuntimeClassId * > BASE_IMPEXP mrpt::utils::getAllRegisteredClassesChildrenOf (const TRuntimeClassId *parent_id)
 Like getAllRegisteredClasses(), but filters the list to only include children clases of a given base one. More...
 
const TRuntimeClassId BASE_IMPEXPmrpt::utils::findRegisteredClass (const std::string &className)
 Return info about a given class by its name, or NULL if the class is not registered. More...
 

Macro Definition Documentation

#define CLASS_ID (   class_name)    static_cast<const mrpt::utils::TRuntimeClassId*>(&class_name::class##class_name)

Access to runtime class ID for a defined class name.

Definition at line 92 of file CObject.h.

Referenced by mrpt::slam::CGridMapAligner::AlignPDF_correlation(), mrpt::hwdrivers::CGenericSensor::appendObservations(), mrpt::poses::CPoint2DPDFGaussian::bayesianFusion(), mrpt::poses::CPointPDFGaussian::bayesianFusion(), mrpt::poses::CPose3DPDFSOG::bayesianFusion(), mrpt::poses::CPosePDFGaussianInf::bayesianFusion(), mrpt::poses::CPosePDFGaussian::bayesianFusion(), mrpt::poses::CPointPDFSOG::bayesianFusion(), mrpt::poses::CPosePDFSOG::bayesianFusion(), mrpt::hmtslam::CLocalMetricHypothesis::changeCoordinateOrigin(), mrpt::maps::CBeaconMap::compute3DMatchingRatio(), mrpt::maps::CLandmarksMap::compute3DMatchingRatio(), mrpt::maps::CLandmarksMap::computeMatchingWith2D(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_CellsDifference(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_Consensus(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_ConsensusOWA(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_II(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_rayTracing(), mrpt::poses::CPose3DPDFParticles::copyFrom(), mrpt::poses::CPosePDFParticles::copyFrom(), mrpt::poses::CPose3DPDFSOG::copyFrom(), mrpt::poses::CPointPDFSOG::copyFrom(), mrpt::poses::CPosePDFSOG::copyFrom(), mrpt::poses::CPose3DPDF::createFrom2D(), mrpt::maps::CBeaconMap::determineMatching2D(), mrpt::maps::CPointsMap::determineMatching2D(), mrpt::maps::COccupancyGridMap2D::determineMatching2D(), mrpt::maps::CPointsMap::determineMatching3D(), mrpt::obs::CRawlog::findObservationsByClassInRange(), mrpt::obs::CRawlog::getActionObservationPairOrObservation(), mrpt::obs::CRawlog::getAsAction(), mrpt::obs::CRawlog::getAsObservation(), mrpt::obs::CRawlog::getAsObservations(), mrpt::obs::CActionCollection::getBestMovementEstimation(), mrpt::obs::CActionCollection::getMovementEstimationByType(), mrpt::utils::CObject::GetRuntimeClass(), mrpt::obs::CRawlog::getType(), mrpt::obs::CRawlog::iterator::getType(), mrpt::obs::CRawlog::const_iterator::getType(), mrpt::slam::CICP::ICP3D_Method_Classic(), mrpt::slam::CICP::ICP_Method_LM(), mrpt::maps::COccupancyGridMap2D::internal_canComputeObservationLikelihood(), mrpt::maps::CBeaconMap::internal_computeObservationLikelihood(), mrpt::maps::CLandmarksMap::internal_computeObservationLikelihood(), mrpt::maps::CPointsMap::internal_computeObservationLikelihood(), mrpt::maps::COccupancyGridMap2D::internal_computeObservationLikelihood(), mrpt::maps::CBeaconMap::internal_insertObservation(), mrpt::maps::CLandmarksMap::internal_insertObservation(), mrpt::maps::COccupancyGridMap2D::internal_insertObservation(), mrpt::poses::CPose3DPDFParticles::inverse(), mrpt::poses::CPose3DQuatPDFGaussian::inverse(), mrpt::poses::CPose3DQuatPDFGaussianInf::inverse(), mrpt::poses::CPose3DPDFSOG::inverse(), mrpt::poses::CPose3DPDFGaussianInf::inverse(), mrpt::poses::CPosePDFParticles::inverse(), mrpt::poses::CPosePDFGaussianInf::inverse(), mrpt::poses::CPosePDFGaussian::inverse(), mrpt::poses::CPose3DPDFGaussian::inverse(), mrpt::poses::CPosePDFSOG::inverse(), mrpt::obs::CRawlog::loadFromRawLogFile(), mrpt::topography::path_from_rtk_gps(), mrpt::detectors::CDetectorDoorCrossing::process(), mrpt::obs::CRawlog::readActionObservationPair(), mrpt::nav::CAbstractPTGBasedReactive::saveConfigFile(), mrpt::nav::CAbstractPTGBasedReactive::TAbstractPTGNavigatorParams::saveToConfigFile(), TEST(), and mrpt::hmtslam::CHMTSLAM::thread_LSLAM().

#define CLASS_ID_NAMESPACE (   class_name,
  namespaceName 
)    static_cast<const mrpt::utils::TRuntimeClassId*>(&namespaceName::class_name::class##class_name)
#define CLASS_ID_TEMPLATE (   class_name,
 
)    static_cast<const mrpt::utils::TRuntimeClassId*>(& template <class T> class_name<T>::class##class_name)

Access to runtime class ID for a defined template class name.

Definition at line 100 of file CObject.h.

#define DEFINE_MRPT_OBJECT (   class_name)    DEFINE_MRPT_OBJECT_CUSTOM_LINKAGE(class_name, static /*none*/, virtual /*none*/)

This declaration must be inserted in all CObject classes definition, within the class declaration.

Definition at line 172 of file CObject.h.

#define DEFINE_MRPT_OBJECT_CUSTOM_LINKAGE (   class_name,
  _STATIC_LINKAGE_,
  _VIRTUAL_LINKAGE_ 
)
Value:
/*! @name RTTI stuff */ \
/*! @{ */ \
protected: \
_STATIC_LINKAGE_ const mrpt::utils::TRuntimeClassId* _GetBaseClass(); \
_STATIC_LINKAGE_ mrpt::utils::CLASSINIT _init_##class_name;\
public: \
/*! A typedef for the associated smart pointer */ \
typedef class_name##Ptr Ptr; \
typedef class_name##Ptr ConstPtr; \
_STATIC_LINKAGE_ mrpt::utils::TRuntimeClassId class##class_name; \
_STATIC_LINKAGE_ const mrpt::utils::TRuntimeClassId *classinfo; \
_VIRTUAL_LINKAGE_ const mrpt::utils::TRuntimeClassId* GetRuntimeClass() const MRPT_OVERRIDE; \
_STATIC_LINKAGE_ mrpt::utils::CObject* CreateObject(); \
_STATIC_LINKAGE_ class_name##Ptr Create(); \
_VIRTUAL_LINKAGE_ mrpt::utils::CObject *duplicate() const MRPT_OVERRIDE; \
/*! @} */ \
public: \
MRPT_MAKE_ALIGNED_OPERATOR_NEW \
Auxiliary structure used for CObject-based RTTI.
Definition: CObject.h:109
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A structure that holds runtime class type information.
Definition: CObject.h:46

Just like DEFINE_MRPT_OBJECT but with DLL export/import linkage keywords.

Note: The replication of macro arguments is to avoid errors with empty macro arguments

Definition at line 151 of file CObject.h.

#define DEFINE_MRPT_OBJECT_POST (   class_name)    DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE(class_name, BASE_IMPEXP )

Definition at line 252 of file CObject.h.

Referenced by mrpt::utils::CSerializable::writeToMatlab().

#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE (   class_name,
  base_name,
  _LINKAGE_ 
)    DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name)
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2 (   class_name,
  base_name,
  class_name_LINKAGE_ 
)
Value:
/*! The smart pointer type for the associated class */ \
struct class_name_LINKAGE_##Ptr : public base_name##Ptr \
{ \
typedef class_name value_type; \
inline class_name##Ptr() : base_name##Ptr(static_cast<base_name*>(NULL)) { } \
inline explicit class_name##Ptr(class_name* p) : base_name##Ptr( static_cast<base_name*>(p) ) { } \
inline explicit class_name##Ptr(const base_name##Ptr & p) : base_name##Ptr(p) { if(!p.null()) ASSERTMSG_( p->GetRuntimeClass()->derivedFrom(#class_name),::mrpt::format("Wrong typecasting of smart pointers: %s -> %s",p->GetRuntimeClass()->className, #class_name) ) } \
inline explicit class_name##Ptr(const mrpt::utils::CObjectPtr & p) : base_name##Ptr(p) { if(!p.null())ASSERTMSG_( p->GetRuntimeClass()->derivedFrom(#class_name),::mrpt::format("Wrong typecasting of smart pointers: %s -> %s",p->GetRuntimeClass()->className, #class_name) ) } \
inline void setFromPointerDoNotFreeAtDtor(const class_name* p) { this->set(const_cast<mrpt::utils::CObject*>(static_cast<const mrpt::utils::CObject*>(p))); m_holder->increment(); } \
/*! Return the internal plain C++ pointer */ \
inline class_name * pointer() { return dynamic_cast<class_name*>(base_name##Ptr::pointer()); } \
inline class_name * get() { return this->pointer(); } \
/*! Return the internal plain C++ pointer (const) */ \
inline const class_name * pointer() const { return dynamic_cast<const class_name*>(base_name##Ptr::pointer()); } \
inline const class_name * get() const { return this->pointer(); } \
inline class_name* operator ->(void) { return dynamic_cast<class_name*>( base_name##Ptr::operator ->() ); } \
inline const class_name* operator ->(void) const { return dynamic_cast<const class_name*>( base_name##Ptr::operator ->() ); } \
inline class_name& operator *(void) { return *dynamic_cast<class_name*>( base_name##Ptr::operator ->() ); } \
inline const class_name& operator *(void) const { return *dynamic_cast<const class_name*>( base_name##Ptr::operator ->() ); } \
};
A smart pointer to a CObject object.
Definition: CObject.h:32
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1168
GLfloat GLfloat p
Definition: glew.h:10113
GLsizei const GLvoid * pointer
Definition: glew.h:1428
The virtual base class of all MRPT classes with a unified RTTI system.
Definition: CObject.h:123
#define ASSERTMSG_(f, __ERROR_MSG)
std::vector< T1 > operator*(const std::vector< T1 > &a, const std::vector< T2 > &b)
a*b (element-wise multiplication)
Definition: ops_vectors.h:59

This declaration must be inserted in all CObject classes definition, after the class declaration.

Definition at line 189 of file CObject.h.

Referenced by mrpt::math::CMatrix::CMatrix(), and mrpt::math::CMatrixD::CMatrixD().

#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_NO_LINKAGE (   class_name,
  base_name 
)    DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name)

Definition at line 181 of file CObject.h.

#define DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE (   class_name,
  _LINKAGE_ 
)    DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE2(class_name, _LINKAGE_ class_name)

Definition at line 214 of file CObject.h.

Referenced by mrpt::gui::CBaseGUIWindow::clearKeyHitFlag().

#define DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE2 (   class_name,
  class_name_LINKAGE_ 
)
Value:
/*! The smart pointer type for the associated class */ \
struct class_name_LINKAGE_##Ptr : public mrpt::utils::CObjectPtr \
{ \
inline class_name##Ptr() : mrpt::utils::CObjectPtr(static_cast<mrpt::utils::CObject*>(NULL)) { } \
inline explicit class_name##Ptr(class_name* p) : mrpt::utils::CObjectPtr( static_cast<mrpt::utils::CObject*>(p) ) { } \
inline explicit class_name##Ptr(const mrpt::utils::CObjectPtr & p) : mrpt::utils::CObjectPtr(p) { ASSERTMSG_( p->GetRuntimeClass()->derivedFrom(#class_name),::mrpt::format("Wrong typecasting of smart pointers: %s -> %s",p->GetRuntimeClass()->className, #class_name) ) } \
inline void setFromPointerDoNotFreeAtDtor(const class_name* p) { this->set(const_cast<mrpt::utils::CObject*>(static_cast<const mrpt::utils::CObject*>(p))); m_holder->increment(); } \
/*! Return the internal plain C++ pointer */ \
inline class_name * pointer() { return dynamic_cast<class_name*>(mrpt::utils::CObjectPtr::pointer()); } \
/*! Return the internal plain C++ pointer (const) */ \
inline const class_name * pointer() const { return dynamic_cast<const class_name*>(mrpt::utils::CObjectPtr::pointer()); } \
inline class_name* operator ->(void) { return dynamic_cast<class_name*>( mrpt::utils::CObjectPtr::operator ->() ); } \
inline const class_name* operator ->(void) const { return dynamic_cast<const class_name*>( mrpt::utils::CObjectPtr::operator ->() ); } \
inline class_name& operator *(void) { return *dynamic_cast<class_name*>( mrpt::utils::CObjectPtr::operator ->() ); } \
inline const class_name& operator *(void) const { return *dynamic_cast<const class_name*>( mrpt::utils::CObjectPtr::operator ->() ); } \
};
A smart pointer to a CObject object.
Definition: CObject.h:32
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1168
GLfloat GLfloat p
Definition: glew.h:10113
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLsizei const GLvoid * pointer
Definition: glew.h:1428
The virtual base class of all MRPT classes with a unified RTTI system.
Definition: CObject.h:123
#define ASSERTMSG_(f, __ERROR_MSG)
std::vector< T1 > operator*(const std::vector< T1 > &a, const std::vector< T2 > &b)
a*b (element-wise multiplication)
Definition: ops_vectors.h:59

This declaration must be inserted in all CObject classes definition, after the class declaration.

Definition at line 226 of file CObject.h.

#define DEFINE_MRPT_OBJECT_POST_NO_LINKAGE (   class_name)    DEFINE_MRPT_OBJECT_POST_CUSTOM_LINKAGE2(class_name, class_name)

Definition at line 218 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE (   class_name)    DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE(class_name, BASE_IMPEXP )

This declaration must be inserted in all CObject classes definition, before the class declaration.

Definition at line 251 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE (   class_name,
  base_name 
)    DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, BASE_IMPEXP )

This declaration must be inserted in all CObject classes definition, before the class declaration.

Definition at line 246 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE (   class_name,
  base_name,
  _LINKAGE_ 
)    DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, _LINKAGE_ class_name)

Definition at line 176 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2 (   class_name,
  base_name,
  class_name_LINKAGE_ 
)
Value:
class class_name_LINKAGE_; \
struct class_name_LINKAGE_##Ptr;

This declaration must be inserted in all CObject classes definition, before the class declaration.

Definition at line 184 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_NO_LINKAGE (   class_name,
  base_name 
)    DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE2(class_name, base_name, class_name)

Definition at line 180 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE (   class_name,
  _LINKAGE_ 
)    DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE2(class_name, _LINKAGE_ class_name)

Definition at line 213 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE2 (   class_name,
  class_name_LINKAGE_ 
)    struct class_name_LINKAGE_##Ptr;

This declaration must be inserted in all CObject classes definition, before the class declaration.

Definition at line 222 of file CObject.h.

#define DEFINE_MRPT_OBJECT_PRE_NO_LINKAGE (   class_name)    DEFINE_MRPT_OBJECT_PRE_CUSTOM_LINKAGE2(class_name, class_name)

Definition at line 217 of file CObject.h.

#define DEFINE_VIRTUAL_MRPT_OBJECT (   class_name)
Value:
/*! @name RTTI stuff */ \
/*! @{ */ \
protected: \
static const mrpt::utils::TRuntimeClassId* _GetBaseClass(); \
public: \
static const mrpt::utils::TRuntimeClassId class##class_name; \
virtual const mrpt::utils::TRuntimeClassId* GetRuntimeClass() const MRPT_OVERRIDE; \
friend class mrpt::utils::CStream; \
typedef class_name##Ptr Ptr; \
typedef class_name##Ptr ConstPtr; \
/*! @} */ \
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
A structure that holds runtime class type information.
Definition: CObject.h:46

This declaration must be inserted in virtual CSerializable classes definition:

Definition at line 275 of file CObject.h.

#define IMPLEMENTS_MRPT_OBJECT (   class_name,
  base,
  NameSpace 
)
Value:
mrpt::utils::CObject* NameSpace::class_name::CreateObject() \
{ return static_cast<mrpt::utils::CObject*>( new NameSpace::class_name ); } \
NameSpace::class_name##Ptr NameSpace::class_name::Create() \
{ return NameSpace::class_name##Ptr( new NameSpace::class_name ); } \
const mrpt::utils::TRuntimeClassId* NameSpace::class_name::_GetBaseClass() \
{ return CLASS_ID(base); } \
mrpt::utils::TRuntimeClassId NameSpace::class_name::class##class_name = { \
#class_name, NameSpace::class_name::CreateObject, &class_name::_GetBaseClass }; \
const mrpt::utils::TRuntimeClassId *NameSpace::class_name::classinfo = & NameSpace::class_name::class##class_name; \
const mrpt::utils::TRuntimeClassId* NameSpace::class_name::GetRuntimeClass() const \
{ return CLASS_ID_NAMESPACE(class_name,NameSpace); } \
mrpt::utils::CLASSINIT NameSpace::class_name::_init_##class_name(CLASS_ID(base)); \
mrpt::utils::CObject * NameSpace::class_name::duplicate() const \
{ return static_cast<mrpt::utils::CObject*>( new NameSpace::class_name(*this) ); }
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
Definition: CObject.h:92
A structure that holds runtime class type information.
Definition: CObject.h:46
The virtual base class of all MRPT classes with a unified RTTI system.
Definition: CObject.h:123

This must be inserted in all CObject classes implementation files.

Definition at line 256 of file CObject.h.

#define IMPLEMENTS_VIRTUAL_MRPT_OBJECT (   class_name,
  base_class_name,
  NameSpace 
)
Value:
const mrpt::utils::TRuntimeClassId* class_name::_GetBaseClass() \
{ return CLASS_ID(base_class_name); } \
const mrpt::utils::TRuntimeClassId class_name::class##class_name = { \
#class_name, NULL, &class_name::_GetBaseClass }; \
const mrpt::utils::TRuntimeClassId* class_name::GetRuntimeClass() const \
{ return CLASS_ID(class_name); }
#define CLASS_ID(class_name)
Access to runtime class ID for a defined class name.
Definition: CObject.h:92
A structure that holds runtime class type information.
Definition: CObject.h:46

This must be inserted as implementation of some required members for virtual CSerializable classes:

Definition at line 291 of file CObject.h.

#define IS_CLASS (   ptrObj,
  class_name 
)    ((ptrObj)->GetRuntimeClass()==CLASS_ID(class_name))

Evaluates to true if the given pointer to an object (derived from mrpt::utils::CSerializable) is of the given class.

Definition at line 103 of file CObject.h.

Referenced by mrpt::graphslam::CGraphSlamEngine< GRAPH_T >::_execGraphSlamStep(), mrpt::obs::CRawlog::addObservationMemoryReference(), mrpt::slam::CGridMapAligner::AlignPDF_robustMatch(), mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::checkOptimizerExists(), mrpt::graphslam::apps::TUserOptionsChecker< GRAPH_t >::checkRegistrationDeciderExists(), mrpt::maps::CMultiMetricMapPDF::clear(), mrpt::maps::COccupancyGridMap2D::computeObservationLikelihood_likelihoodField_Thrun(), mrpt::poses::CPosePDFGaussianInf::copyFrom(), mrpt::poses::CPose3DPDFGaussianInf::copyFrom(), mrpt::maps::CHeightGridMap2D_Base::dem_internal_insertObservation(), mrpt::detectors::CCascadeClassifierDetection::detectObjects_Impl(), mrpt::detectors::CFaceDetection::detectObjects_Impl(), mrpt::poses::CPoseRandomSampler::do_sample_2D(), mrpt::poses::CPoseRandomSampler::do_sample_3D(), mrpt::hmtslam::CHierarchicalMHMap::dumpAsXMLfile(), mrpt::obs::CRawlog::getActionObservationPairOrObservation(), mrpt::hwdrivers::CCameraSensor::getNextFrame(), mrpt::opengl::CSetOfObjects::initializeAllTextures(), mrpt::opengl::COpenGLViewport::initializeAllTextures(), mrpt::maps::COctoMapBase< octree_t, octree_node_t >::internal_build_PointCloud_for_observation(), mrpt::obs::CSensoryFrame::internal_buildAuxPointsMap(), mrpt::maps::CReflectivityGridMap2D::internal_computeObservationLikelihood(), mrpt::maps::CWirelessPowerGridMap2D::internal_insertObservation(), mrpt::maps::CReflectivityGridMap2D::internal_insertObservation(), mrpt::maps::CGasConcentrationGridMap2D::internal_insertObservation(), mrpt::maps::CColouredOctoMap::internal_insertObservation(), mrpt::maps::CPointsMap::internal_insertObservation(), mrpt::opengl::COpenGLScene::internal_visitAllObjects(), mrpt::obs::CRawlog::loadFromRawLogFile(), mrpt::slam::observationsOverlap(), mrpt::opengl::CSetOfObjects::posePDF2opengl(), mrpt::maps::CMultiMetricMapPDF::prediction_and_update_pfOptimalProposal(), mrpt::obs::CActionRobotMovement2D::prepareFastDrawSingleSample_modelGaussian(), mrpt::slam::CMetricMapBuilderICP::processObservation(), mrpt::poses::CPoseRandomSampler::setPosePDF(), mrpt::hmtslam::CHMTSLAM::TBI_main_method(), TEST(), mrpt::hwdrivers::CCameraSensor::thread_save_images(), mrpt::graphslam::deciders::CFixedIntervalsNRD< GRAPH_T >::updateState(), mrpt::graphslam::deciders::CICPCriteriaERD< GRAPH_T >::updateState(), and mrpt::graphslam::deciders::CICPCriteriaNRD< GRAPH_T >::updateState().

#define IS_DERIVED (   ptrObj,
  class_name 
)    ((ptrObj)->GetRuntimeClass()->derivedFrom(CLASS_ID(class_name)))

Function Documentation

template<typename T , typename C , typename COUNTER >
bool std::operator!= ( const stlplus::smart_ptr_base< T, C, COUNTER > &  a,
const stlplus::smart_ptr_base< T, C, COUNTER > &  b 
)
inline

This operator enables comparing two smart pointers with "!=" to test whether they don't point to the same object.

Definition at line 336 of file CObject.h.

template<typename T , typename C , typename COUNTER >
bool std::operator== ( const stlplus::smart_ptr_base< T, C, COUNTER > &  a,
const stlplus::smart_ptr_base< T, C, COUNTER > &  b 
)
inline

This operator enables comparing two smart pointers with "==" to test whether they point to the same object.

Definition at line 330 of file CObject.h.




Page generated by Doxygen 1.8.11 for MRPT 1.5.7 Git: 2190203 Tue May 15 02:01:15 2018 +0200 at mié may 16 12:40:16 CEST 2018