ezEngine Release 26.3
Loading...
Searching...
No Matches
ezApplyNativePropertyChangesContext Class Reference

Specialized context for tracking and applying native object changes to abstract object graphs. More...

#include <ApplyNativePropertyChangesContext.h>

Inheritance diagram for ezApplyNativePropertyChangesContext:

Public Member Functions

 ezApplyNativePropertyChangesContext (ezRttiConverterContext &ref_source, const ezAbstractObjectGraph &originalGraph)
 
virtual ezUuid GenerateObjectGuid (const ezUuid &parentGuid, const ezAbstractProperty *pProp, ezVariant index, void *pObject) const override
 Generates a guid for a new object. Default implementation generates stable guids derived from parentGuid + property name + index and ignores the address of pObject.
 
- Public Member Functions inherited from ezRttiConverterContext
virtual void Clear ()
 Clears all cached objects and resets the context state.
 
virtual ezInternal::NewInstance< void > CreateObject (const ezUuid &guid, const ezRTTI *pRtti)
 
virtual void DeleteObject (const ezUuid &guid)
 
virtual void RegisterObject (const ezUuid &guid, const ezRTTI *pRtti, void *pObject)
 
virtual void UnregisterObject (const ezUuid &guid)
 
virtual ezRttiConverterObject GetObjectByGUID (const ezUuid &guid) const
 
virtual ezUuid GetObjectGUID (const ezRTTI *pRtti, const void *pObject) const
 
virtual const ezRTTIFindTypeByName (ezStringView sName) const
 
template<typename T >
void GetObjectsByType (ezDynamicArray< T * > &out_objects, ezDynamicArray< ezUuid > *out_pUuids=nullptr)
 
virtual ezUuid EnqueObject (const ezUuid &guid, const ezRTTI *pRtti, void *pObject)
 
virtual ezRttiConverterObject DequeueObject ()
 
virtual void OnUnknownTypeError (ezStringView sTypeName)
 

Additional Inherited Members

- Protected Attributes inherited from ezRttiConverterContext
ezHashTable< ezUuid, ezRttiConverterObjectm_GuidToObject
 
ezHashTable< const void *, ezUuidm_ObjectToGuid
 
ezSet< ezUuidm_QueuedObjects
 

Detailed Description

Specialized context for tracking and applying native object changes to abstract object graphs.

This context enables a sophisticated bidirectional synchronization workflow between native C++ objects and their serialized representations in ezAbstractObjectGraph form. It ensures that modifications made to native objects can be properly tracked and applied back to the abstract representation while maintaining object identity through consistent GUID generation.

The key capability is generating GUIDs for native objects that exactly match the GUIDs used in the original abstract object graph. This allows the system to correlate changes made to native objects with their counterparts in the serialized form.

Typical workflow:

  1. Deserialize an abstract object graph to native objects
  2. Create this context to track GUID relationships
  3. Modify the native objects through normal C++ operations
  4. Use the context to detect and apply changes back to the abstract graph
  5. Serialize the updated abstract graph for persistence

This is particularly useful for:

  • Editor scenarios where objects are modified through UI and need to be saved
  • Undo/redo systems that operate on abstract object graphs
  • Network synchronization where changes need to be transmitted efficiently
  • Asset pipeline where native modifications need to be persisted
See also
ezAbstractObjectGraph::ModifyNodeViaNativeCounterpart

Member Function Documentation

◆ GenerateObjectGuid()

ezUuid ezApplyNativePropertyChangesContext::GenerateObjectGuid ( const ezUuid parentGuid,
const ezAbstractProperty pProp,
ezVariant  index,
void *  pObject 
) const
overridevirtual

Generates a guid for a new object. Default implementation generates stable guids derived from parentGuid + property name + index and ignores the address of pObject.

Reimplemented from ezRttiConverterContext.


The documentation for this class was generated from the following files: