Defined in:Adds a node link that will be resolved after unpacking is complete.
void AddNodeLink(int32 index, NodeLink::Linker *linker, void *cookie);
||The index of the node to be linked.|
||A pointer to the linker function.|
||A user-defined pointer that is passed to the callback function.|
AddNodeLinkfunction registers a linker function that is called after unpacking is complete in order to resolve a node index to the actual pointer to a node. The
AddNodeLinkfunction should be called from within an overridden
Packable::Unpackfunction or the callback passed to the
indexparameter should be set to the node index, which would typically have just been unpacked.
NodeLink::Linkertype is defined as follows.
typedef void Linker(Node *, void *);
linkerparameter should be set to a pointer to a static function having this prototype, and the
cookieparameter should be any pointer that the calling function needs. The value of the
cookieparameter is passed to the linker function as its second parameter. The node pointer received in the first parameter of the linker function will be the node whose index was previously specified by the
indexparameter when the
AddNodeLinkfunction was called. Note that the node pointer can be
nullptrif the node could not be constructed during the unpacking process.