18 #ifndef vtkMarshalContext_h
19 #define vtkMarshalContext_h
23 #include "vtkCommonCoreModule.h"
25 #include "vtkTypeUInt8Array.h"
29 #include "vtk_nlohmannjson.h"
30 #include VTK_NLOHMANN_JSON(json.hpp) // for json
37 void* ser,
void* deser,
void* invoker,
const char** error);
39 VTK_ABI_NAMESPACE_BEGIN
58 static bool CallRegistrars(
void* ser,
void* deser,
void* invoker,
const char** error);
63 const nlohmann::json& Blobs()
const;
68 const nlohmann::json& States()
const;
103 bool RegisterState(nlohmann::json state);
110 bool UnRegisterState(vtkTypeUInt32 identifier);
117 nlohmann::json& GetState(vtkTypeUInt32 identifier)
const;
127 bool RegisterObject(
vtkObjectBase* objectBase, vtkTypeUInt32& identifier);
134 bool UnRegisterObject(vtkTypeUInt32 identifier);
187 std::vector<vtkTypeUInt32> GetDirectDependencies(vtkTypeUInt32 identifier)
const;
192 void ResetDirectDependencies();
197 void ResetDirectDependenciesForNode(vtkTypeUInt32 identifier);
202 vtkTypeUInt32 MakeId();
243 void PushParent(vtkTypeUInt32 identifier);
263 bool HasId(
vtkObjectBase* objectBase, vtkTypeUInt32& identifier);
269 bool IsProcessing(vtkTypeUInt32 identifier);
275 bool IsProcessed(vtkTypeUInt32 identifier);
287 void AddChild(vtkTypeUInt32 identifier);
297 std::unique_ptr<vtkInternals> Internals;
299 static std::vector<vtkMarshalContextRegistrarFunc>& GetSerDesRegistrars();
302 VTK_ABI_NAMESPACE_END
Deserialize VTK objects from JSON.
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::map< vtkTypeUInt32, vtkWeakPointer< vtkObjectBase >> WeakObjectStore
Hold a reference to a vtkObjectBase instance.
ScopedParentTracker(vtkMarshalContext *context, vtkTypeUInt32 identifier)
void PushParent(vtkTypeUInt32 identifier)
Make identifier the active identifier.
a simple class to control print indentation
int(* vtkMarshalContextRegistrarFunc)(void *ser, void *deser, void *invoker, const char **error)
abstract base class for most VTK objects
Shared context used by vtkSerializer and vtkDeserializer
std::map< std::string, std::set< vtkSmartPointer< vtkObjectBase >>> StrongObjectStore
void PopParent()
Adds the 'active' identifier into the genealogy.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Serialize VTK objects to JSON.
Convenient to push a parent as the 'active' identifier and add children to that parent when (de)seria...