Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Static Protected Attributes
mrpt::rtti::CObject Class Referenceabstract

Detailed Description

The virtual base class of all MRPT classes with a unified RTTI system.

For each class named CMyClass, a new type CMyClass::Ptr is defined as a smart pointer (std::shared_ptr) suitable for keeping reference-counting smart pointers to objects of the class.

It is recommended to use MRPT-defined mrpt::make_aligned_shared<> instead of std::make_shared<> to create objects, to avoid memory alignment problems caused by classes containing Eigen vectors or matrices. Example:

CFoo::Ptr o = mrpt::make_aligned_shared<CFoo>();

Or using the shorter auxiliary static method ::Create() to keep compatibility with MRPT 1.5.* code bases:

CFoo::Ptr o = CFoo::Create();
See also
mrpt::rtti::CObject
Examples
rtti_example1/test.cpp.

Definition at line 142 of file CObject.h.

#include <mrpt/rtti/CObject.h>

Inheritance diagram for mrpt::rtti::CObject:
Inheritance graph

Public Types

using Ptr = std::shared_ptr< CObject >
 
using ConstPtr = std::shared_ptr< const CObject >
 

Public Member Functions

virtual const mrpt::rtti::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual CObjectclone () const =0
 Returns a deep copy (clone) of the object, indepently of its class. More...
 
virtual ~CObject ()
 

Static Public Member Functions

static const mrpt::rtti::TRuntimeClassIdGetRuntimeClassIdStatic ()
 

Static Protected Member Functions

static mrpt::rtti::TRuntimeClassId_GetBaseClass ()
 

Static Protected Attributes

static const mrpt::rtti::TRuntimeClassId runtimeClassId
 

Member Typedef Documentation

◆ ConstPtr

using mrpt::rtti::CObject::ConstPtr = std::shared_ptr<const CObject>

Definition at line 150 of file CObject.h.

◆ Ptr

using mrpt::rtti::CObject::Ptr = std::shared_ptr<CObject>

Definition at line 149 of file CObject.h.

Constructor & Destructor Documentation

◆ ~CObject()

virtual mrpt::rtti::CObject::~CObject ( )
inlinevirtual

Definition at line 166 of file CObject.h.

Member Function Documentation

◆ _GetBaseClass()

TRuntimeClassId * CObject::_GetBaseClass ( )
staticprotected

Definition at line 105 of file CObject.cpp.

◆ clone()

virtual CObject* mrpt::rtti::CObject::clone ( ) const
pure virtual

Returns a deep copy (clone) of the object, indepently of its class.

Implemented in mrpt::obs::CObservation3DRangeScan, mrpt::nav::CLogFileRecord_FullEval, mrpt::nav::CLogFileRecord_ND, mrpt::maps::CMultiMetricMap, mrpt::img::CImage, mrpt::db::CSimpleDatabase, mrpt::obs::CObservationIMU, mrpt::maps::TMapGenericParams, mrpt::poses::CPose3D, mrpt::obs::CObservationRGBD360, mrpt::maps::CRandomFieldGridMap3D, mrpt::detectors::CDetectable3D, mrpt::hmtslam::THypothesisIDSet, mrpt::obs::CObservationVelodyneScan, mrpt::maps::CLandmarksMap, mrpt::hmtslam::CHMTSLAM, mrpt::hmtslam::CLocalMetricHypothesis, mrpt::kinematics::CKinematicChain, mrpt::obs::CObservationGPS, mrpt::opengl::COctoMapVoxels, mrpt::maps::COccupancyGridMap2D, mrpt::obs::CRawlog, mrpt::maps::CMultiMetricMapPDF, mrpt::maps::CHeightGridMap2D, mrpt::slam::CIncrementalMapPartitioner, mrpt::opengl::COpenGLViewport, mrpt::opengl::COpenGLScene, mrpt::vision::CFeature, mrpt::opengl::CPlanarLaserScan, mrpt::nav::CHolonomicFullEval, mrpt::obs::CObservation2DRangeScan, mrpt::nav::CHolonomicND, mrpt::obs::CSensoryFrame, mrpt::opengl::CFrustum, mrpt::poses::CPose2DInterpolator, mrpt::nav::CHolonomicVFF, mrpt::opengl::CEllipsoidInverseDepth3D, mrpt::poses::CPose3DInterpolator, mrpt::poses::CPose3DQuat, mrpt::opengl::CPointCloud, mrpt::opengl::CEllipsoid, mrpt::opengl::CEllipsoidInverseDepth2D, mrpt::opengl::CPointCloudColoured, mrpt::pbmap::PbMap, mrpt::detectors::CDetectable2D, mrpt::maps::CBeaconMap, mrpt::pbmap::Plane, mrpt::poses::CPose3DQuatPDFGaussianInf, mrpt::opengl::CText3D, mrpt::poses::CPose3DRotVec, mrpt::opengl::CAngularObservationMesh, mrpt::opengl::CEllipsoidRangeBearing2D, mrpt::opengl::CPolyhedron, mrpt::poses::CPose3DQuatPDFGaussian, mrpt::hmtslam::CLSLAMParticleData, mrpt::maps::CReflectivityGridMap2D, mrpt::poses::CPose3DPDFGaussianInf, mrpt::nav::CPTG_DiffDrive_C, mrpt::opengl::CAssimpModel, mrpt::opengl::CBox, mrpt::obs::CObservationStereoImages, mrpt::opengl::CMeshFast, mrpt::opengl::CVectorField3D, mrpt::poses::CPose2D, mrpt::poses::CPosePDFParticles, mrpt::hmtslam::CHMHMapNode, mrpt::hmtslam::CRobotPosesGraph, mrpt::poses::CPose3DPDFGaussian, mrpt::obs::CObservationStereoImagesFeatures, mrpt::opengl::CMesh, mrpt::poses::CPose3DPDFParticles, mrpt::hmtslam::CMHPropertiesValuesList, mrpt::maps::CBeacon, mrpt::opengl::CMesh3D, mrpt::opengl::CText, MyNS::Bar, mrpt::maps::CHeightGridMap2D_MRF, mrpt::nav::CPTG_DiffDrive_alpha, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFSOG, mrpt::hmtslam::CHMHMapArc, mrpt::maps::COctoMap, mrpt::opengl::CColorBar, mrpt::opengl::CVectorField2D, mrpt::poses::CPoint2D, mrpt::poses::CPointPDFSOG, mrpt::maps::CRBPFParticleData, mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CWirelessPowerGridMap2D, mrpt::maps::CSimpleMap, mrpt::obs::CObservationImage, mrpt::maps::CLandmark, mrpt::poses::CPoint3D, mrpt::poses::CPose3DPDFSOG, mrpt::hmtslam::CHierarchicalMHMap, mrpt::maps::CColouredOctoMap, mrpt::obs::CObservationBatteryState, mrpt::opengl::CDisk, mrpt::opengl::CSetOfLines, mrpt::nav::CLogFileRecord, mrpt::obs::CActionRobotMovement2D, mrpt::obs::CObservationOdometry, mrpt::obs::CObservationRawDAQ, mrpt::opengl::CCamera, mrpt::opengl::CCylinder, mrpt::opengl::CGridPlaneXY, mrpt::opengl::CGridPlaneXZ, mrpt::poses::CPointPDFParticles, mrpt::maps::CSimplePointsMap, mrpt::obs::CObservationBearingRange, mrpt::obs::CObservationWindSensor, mrpt::opengl::CArrow, mrpt::opengl::CAxis, mrpt::opengl::CGeneralizedCylinder, mrpt::opengl::CSphere, mrpt::poses::CPosePDFGaussian, mrpt::maps::CWeightedPointsMap, mrpt::obs::CObservationRange, mrpt::img::TCamera, mrpt::maps::CColouredPointsMap, mrpt::obs::CActionRobotMovement3D, mrpt::obs::CObservationWirelessPower, mrpt::nav::CLogFileRecord_VFF, mrpt::nav::CMultiObjMotionOpt_Scalarization, mrpt::nav::CPTG_Holo_Blend, mrpt::obs::CActionCollection, mrpt::obs::CObservation6DFeatures, mrpt::obs::CObservationSkeleton, mrpt::opengl::CSetOfObjects, mrpt::obs::CObservationVisualLandmarks, mrpt::nav::CPTG_DiffDrive_CC, mrpt::nav::CPTG_DiffDrive_CCS, mrpt::nav::CPTG_DiffDrive_CS, mrpt::obs::CObservationBeaconRanges, mrpt::obs::CObservationComment, mrpt::obs::CObservationGasSensors, mrpt::obs::CObservationReflectivity, mrpt::obs::CObservationRFID, mrpt::poses::CPosePDFGrid, mrpt::math::CSplineInterpolator1D, mrpt::opengl::COpenGLStandardObject, mrpt::poses::CPoses2DSequence, mrpt::poses::CPoses3DSequence, mrpt::img::TStereoCamera, mrpt::math::CMatrixD, mrpt::opengl::CSetOfTriangles, mrpt::poses::CPointPDFGaussian, mrpt::hmtslam::CPropertiesValuesList, mrpt::math::CMatrix, mrpt::obs::CObservationCANBusJ1939, mrpt::obs::CObservationRobotPose, mrpt::math::CMatrixB, mrpt::opengl::CSetOfTexturedTriangles, mrpt::poses::CPoint2DPDFGaussian, mrpt::math::CPolygon, mrpt::opengl::CSimpleLine, mrpt::opengl::CTexturedPlane, mrpt::db::CSimpleDatabaseTable, mrpt::kinematics::CVehicleVelCmd_DiffDriven, mrpt::kinematics::CVehicleVelCmd_Holo, MyNS::Foo, MyNS::Foo, and MyNS::MyDerived1.

Referenced by duplicateGetSmartPtr(), mrpt::maps::CSimpleMap::insert(), mrpt::obs::CActionCollection::insert(), and mrpt::poses::CPoseRandomSampler::setPosePDF().

◆ duplicateGetSmartPtr()

mrpt::rtti::CObject::Ptr CObject::duplicateGetSmartPtr ( ) const
inline

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 169 of file CObject.h.

References clone().

Referenced by mrpt::obs::CRawlog::addActions(), and mrpt::obs::CRawlog::addObservations().

◆ GetRuntimeClass()

virtual const mrpt::rtti::TRuntimeClassId* mrpt::rtti::CObject::GetRuntimeClass ( ) const
inlinevirtual

Returns information about the class of an object in runtime.

Reimplemented in mrpt::obs::CObservation3DRangeScan, mrpt::nav::CLogFileRecord_FullEval, mrpt::nav::CLogFileRecord_ND, mrpt::maps::CRandomFieldGridMap2D, mrpt::maps::CMultiMetricMap, mrpt::img::CImage, mrpt::db::CSimpleDatabase, mrpt::obs::CObservationIMU, mrpt::maps::TMapGenericParams, mrpt::poses::CPose3D, mrpt::obs::CObservationRGBD360, mrpt::maps::CRandomFieldGridMap3D, mrpt::detectors::CDetectable3D, mrpt::hmtslam::THypothesisIDSet, mrpt::nav::CParameterizedTrajectoryGenerator, mrpt::obs::CObservationVelodyneScan, mrpt::maps::CLandmarksMap, mrpt::hmtslam::CHMTSLAM, mrpt::hmtslam::CLocalMetricHypothesis, mrpt::kinematics::CKinematicChain, mrpt::obs::CObservationGPS, mrpt::opengl::COctoMapVoxels, mrpt::maps::COccupancyGridMap2D, mrpt::obs::CRawlog, mrpt::maps::CMultiMetricMapPDF, mrpt::maps::CPointsMap, mrpt::maps::CHeightGridMap2D, mrpt::slam::CIncrementalMapPartitioner, mrpt::opengl::COpenGLViewport, mrpt::opengl::COpenGLScene, mrpt::vision::CFeature, mrpt::opengl::CPlanarLaserScan, mrpt::nav::CHolonomicFullEval, mrpt::maps::CMetricMap, mrpt::obs::CObservation2DRangeScan, mrpt::nav::CHolonomicND, mrpt::obs::CSensoryFrame, mrpt::opengl::CFrustum, mrpt::poses::CPose2DInterpolator, mrpt::nav::CHolonomicVFF, mrpt::opengl::CEllipsoidInverseDepth3D, mrpt::poses::CPose3DInterpolator, mrpt::poses::CPose3DQuat, mrpt::opengl::CPointCloud, mrpt::poses::CPose3DQuatPDF, mrpt::opengl::CEllipsoid, mrpt::opengl::CEllipsoidInverseDepth2D, mrpt::opengl::CPointCloudColoured, mrpt::pbmap::PbMap, mrpt::detectors::CDetectable2D, mrpt::maps::CBeaconMap, mrpt::pbmap::Plane, mrpt::poses::CPose3DQuatPDFGaussianInf, mrpt::opengl::CText3D, mrpt::poses::CPose3DRotVec, mrpt::opengl::CAngularObservationMesh, mrpt::opengl::CEllipsoidRangeBearing2D, mrpt::opengl::CPolyhedron, mrpt::poses::CPose3DQuatPDFGaussian, mrpt::hmtslam::CLSLAMParticleData, mrpt::maps::CReflectivityGridMap2D, mrpt::obs::CObservation, mrpt::opengl::CRenderizable, mrpt::poses::CPose3DPDF, mrpt::poses::CPose3DPDFGaussianInf, mrpt::nav::CPTG_DiffDrive_C, mrpt::opengl::CAssimpModel, mrpt::opengl::CBox, mrpt::poses::CPosePDF, mrpt::obs::CObservationStereoImages, mrpt::opengl::CMeshFast, mrpt::opengl::CVectorField3D, mrpt::poses::CPose2D, mrpt::poses::CPosePDFParticles, mrpt::hmtslam::CHMHMapNode, mrpt::hmtslam::CRobotPosesGraph, mrpt::poses::CPointPDF, mrpt::poses::CPose3DPDFGaussian, mrpt::obs::CObservationStereoImagesFeatures, mrpt::opengl::CMesh, mrpt::opengl::CRenderizableDisplayList, mrpt::poses::CPose3DPDFParticles, mrpt::hmtslam::CMHPropertiesValuesList, mrpt::maps::CBeacon, mrpt::opengl::CMesh3D, mrpt::opengl::CText, MyNS::Bar, mrpt::maps::CHeightGridMap2D_MRF, mrpt::nav::CPTG_DiffDrive_alpha, mrpt::poses::CPosePDFGaussianInf, mrpt::poses::CPosePDFSOG, mrpt::hmtslam::CHMHMapArc, mrpt::maps::COctoMap, mrpt::opengl::CColorBar, mrpt::opengl::CVectorField2D, mrpt::poses::CPoint2D, mrpt::poses::CPoint2DPDF, mrpt::poses::CPointPDFSOG, mrpt::maps::CRBPFParticleData, mrpt::maps::CGasConcentrationGridMap2D, mrpt::maps::CWirelessPowerGridMap2D, mrpt::maps::CSimpleMap, mrpt::obs::CObservationImage, mrpt::serialization::CSerializable, mrpt::maps::CLandmark, mrpt::poses::CPoint3D, mrpt::poses::CPose3DPDFSOG, mrpt::hmtslam::CHierarchicalMHMap, mrpt::maps::CColouredOctoMap, mrpt::nav::CAbstractHolonomicReactiveMethod, mrpt::obs::CObservationBatteryState, mrpt::opengl::CDisk, mrpt::opengl::CSetOfLines, mrpt::nav::CLogFileRecord, mrpt::obs::CActionRobotMovement2D, mrpt::obs::CObservationOdometry, mrpt::obs::CObservationRawDAQ, mrpt::opengl::CCamera, mrpt::opengl::CCylinder, mrpt::opengl::CGridPlaneXY, mrpt::opengl::CGridPlaneXZ, mrpt::poses::CPointPDFParticles, mrpt::maps::CSimplePointsMap, mrpt::obs::CObservationBearingRange, mrpt::obs::CObservationWindSensor, mrpt::opengl::CArrow, mrpt::opengl::CAxis, mrpt::opengl::CGeneralizedCylinder, mrpt::opengl::CSphere, mrpt::poses::CPosePDFGaussian, mrpt::maps::CWeightedPointsMap, mrpt::obs::CObservationRange, mrpt::img::TCamera, mrpt::maps::CColouredPointsMap, mrpt::obs::CActionRobotMovement3D, mrpt::obs::CObservationWirelessPower, MyNS::BarBase, mrpt::detectors::CDetectableObject, mrpt::nav::CLogFileRecord_VFF, mrpt::nav::CMultiObjMotionOpt_Scalarization, mrpt::nav::CPTG_Holo_Blend, mrpt::obs::CActionCollection, mrpt::obs::CObservation6DFeatures, mrpt::obs::CObservationSkeleton, mrpt::opengl::CSetOfObjects, mrpt::obs::CObservationVisualLandmarks, mrpt::nav::CHolonomicLogFileRecord, mrpt::nav::CPTG_DiffDrive_CC, mrpt::nav::CPTG_DiffDrive_CCS, mrpt::nav::CPTG_DiffDrive_CS, mrpt::obs::CAction, mrpt::obs::CObservationBeaconRanges, mrpt::obs::CObservationComment, mrpt::obs::CObservationGasSensors, mrpt::obs::CObservationReflectivity, mrpt::obs::CObservationRFID, mrpt::poses::CPosePDFGrid, mrpt::math::CSplineInterpolator1D, mrpt::nav::CMultiObjectiveMotionOptimizerBase, mrpt::opengl::COpenGLStandardObject, mrpt::poses::CPoses2DSequence, mrpt::poses::CPoses3DSequence, mrpt::img::TStereoCamera, mrpt::math::CMatrixD, mrpt::opengl::CSetOfTriangles, mrpt::opengl::CTexturedObject, mrpt::poses::CPointPDFGaussian, mrpt::hmtslam::CPropertiesValuesList, mrpt::math::CMatrix, mrpt::obs::CObservationCANBusJ1939, mrpt::obs::CObservationRobotPose, mrpt::math::CMatrixB, mrpt::opengl::CSetOfTexturedTriangles, mrpt::poses::CPoint2DPDFGaussian, mrpt::kinematics::CVehicleVelCmd, mrpt::math::CPolygon, mrpt::opengl::CSimpleLine, mrpt::opengl::CTexturedPlane, mrpt::db::CSimpleDatabaseTable, mrpt::kinematics::CVehicleVelCmd_DiffDriven, mrpt::kinematics::CVehicleVelCmd_Holo, MyNS::Foo, MyNS::Foo, and MyNS::MyDerived1.

Definition at line 153 of file CObject.h.

References CLASS_ID.

◆ GetRuntimeClassIdStatic()

const mrpt::rtti::TRuntimeClassId & CObject::GetRuntimeClassIdStatic ( )
static

Definition at line 19 of file CObject.cpp.

References runtimeClassId.

Referenced by TEST().

Member Data Documentation

◆ runtimeClassId

const mrpt::rtti::TRuntimeClassId mrpt::rtti::CObject::runtimeClassId
staticprotected

Definition at line 146 of file CObject.h.

Referenced by GetRuntimeClassIdStatic().




Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST