MCPcopy Create free account
hub / github.com/Kitware/VTK / vtkSessionCreateObject

Function vtkSessionCreateObject

Serialization/Manager/vtkSession.cxx:84–100  ·  view source on GitHub ↗

-------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

82
83 //-------------------------------------------------------------------------------
84 vtkObjectHandle vtkSessionCreateObject(vtkSession session, const char* className)
85 {
86 vtkObjectHandle object;
87 vtkSmartPointer<vtkObjectBase> objectImpl;
88 // Construct the object using the class name
89 if (auto constructor = session->Manager->GetDeserializer()->GetConstructor(className, {}))
90 {
91 objectImpl = vtk::TakeSmartPointer(constructor());
92 object = session->Manager->RegisterObject(objectImpl);
93 }
94 else
95 {
96 object = 0;
97 vtkLog(ERROR, << "Constructor not found for class name: " << className);
98 }
99 return object;
100 }
101
102 //-------------------------------------------------------------------------------
103 vtkSessionResult vtkSessionDestroyObject(vtkSession session, vtkObjectHandle object)

Callers 2

CreateMethod · 0.85
TestSessionFunction · 0.85

Calls 2

GetConstructorMethod · 0.80
RegisterObjectMethod · 0.45

Tested by 1

TestSessionFunction · 0.68