Skip to content
Discussion options

You must be logged in to vote

In the case when a class member variable is a pointer that can be null when you serialize to ascii or binary you need a way of declaring this as a nullptr.

You can't just write out pointers and read them back in as the objects will have a different location in memory on the read back, so you have to have a mechanism for writing out the objects associated with the pointer, then on re-load you have to load the object, then any other pointer in the scene graph that also pointed to the same original object also needs to keep pointing to the same pointer. The mechanism is what the objectIDMap[id] is for, but a nullptr is also a valid value that also needs a mechanism which is what the nullptr …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@KAlO2
Comment options

@robertosfield
Comment options

@KAlO2
Comment options

@robertosfield
Comment options

Answer selected by KAlO2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1622 on December 11, 2025 11:29.