Main MRPT website > C++ reference for MRPT 1.9.9
CMemoryChunk_impl.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2018, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 /** \file While refactoring mrpt-base into smaller sublibraries, CMemoryChunk
11  was found to be problematic: it inherited from very low-level classes in both
12  mrpt-io and mrpt-serialization. To keep those two libraries independent of
13  each other, I propose to IMPLEMENT its RTTI stuff here, in mrpt-opengl, as a
14  dirty workaround, while it is DECLARED in mrpt-serialization using CRTP.
15 */
16 
17 #include "opengl-precomp.h" // Precompiled header
18 
19 #include <mrpt/io/CMemoryStream.h>
21 
22 // IMPLEMENTS_SERIALIZABLE(CMemoryChunk, CSerializable, mrpt::serialization)
23 template <class Derived>
26 {
27  return static_cast<mrpt::rtti::CObject*>(
29 }
30 template <class Derived>
33 {
35 }
36 template <class Derived>
39 {
41 }
42 template <class Derived>
45  "CMemoryChunk",
47  &CMemoryChunk::_GetBaseClass};
48 template <class Derived>
51 {
53 }
54 template <class Derived>
58 template <class Derived>
60  const
61 {
62  return static_cast<mrpt::rtti::CObject*>(
64 }
65 
66 // Explicit instantiation
virtual const mrpt::rtti::TRuntimeClassId * GetRuntimeClass() const override
Returns information about the class of an object in runtime.
static const mrpt::rtti::TRuntimeClassId * _GetBaseClass()
Auxiliary structure used for CObject-based RTTI.
Definition: CObject.h:113
A structure that holds runtime class type information.
Definition: CObject.h:30
The virtual base class of all MRPT classes with a unified RTTI system.
Definition: CObject.h:142
A memory buffer (implements CStream) which can be itself serialized.
Definition: CMemoryChunk.h:23
virtual mrpt::rtti::CObject * clone() const override
Returns a deep copy (clone) of the object, indepently of its class.
static mrpt::rtti::CObject * CreateObject()
#define CLASS_ID_NAMESPACE(class_name, namespaceName)
Definition: CObject.h:88
static const mrpt::rtti::TRuntimeClassId & GetRuntimeClassIdStatic()
static mrpt::rtti::CLASSINIT _init_CMemoryChunk
Definition: CMemoryChunk.h:35
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:32



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at lun oct 28 00:14:14 CET 2019