Convert mjElement to struct rather than opaque pointer.
By making mjElement the parent of mjCBase, mjCModel, and mjCDef, this CL enables safer casting using static_cast instead of reinterpret_cast and C-style casting. PiperOrigin-RevId: 619526291 Change-Id: Ifa2b4bd3ecd95bade61f41a7005c62212f456c00
This commit is contained in:
committed by
Copybara-Service
parent
e6bf6fc327
commit
dfe2b75378
@@ -167,7 +167,7 @@ class mjCBoundingVolumeHierarchy : public mjCBoundingVolumeHierarchy_ {
|
||||
//------------------------- class mjCBase ----------------------------------------------------------
|
||||
// Generic functionality for all derived classes
|
||||
|
||||
class mjCBase_ {
|
||||
class mjCBase_ : public mjElement {
|
||||
public:
|
||||
int id; // object id
|
||||
std::string name; // object name
|
||||
@@ -1606,7 +1606,7 @@ class mjCKey : public mjCKey_, private mjsKey {
|
||||
//------------------------- class mjCDef -----------------------------------------------------------
|
||||
// Describes one set of defaults
|
||||
|
||||
class mjCDef {
|
||||
class mjCDef : public mjElement {
|
||||
friend class mjXWriter;
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user