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:
Alessio Quaglino
2024-03-27 07:36:43 -07:00
committed by Copybara-Service
parent e6bf6fc327
commit dfe2b75378
10 changed files with 199 additions and 163 deletions
+1 -1
View File
@@ -33,7 +33,7 @@
typedef std::map<std::string, int, std::less<> > mjKeyMap;
typedef std::array<mjKeyMap, mjNOBJECT> mjListKeyMap;
class mjCModel_ {
class mjCModel_ : public mjElement {
public:
// attach namespaces
std::string prefix;