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

Method UpdateStatesFromObjects

Serialization/Manager/vtkObjectManager.cxx:716–761  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

714
715//------------------------------------------------------------------------------
716void vtkObjectManager::UpdateStatesFromObjects()
717{
718 // Reset dependency cache as it will be rebuilt.
719 this->Context->ResetDirectDependencies();
720 // All objects go under the top level root node
721 vtkMarshalContext::ScopedParentTracker rootNodeTracker(this->Context, vtkObjectManager::ROOT());
722 // serializes all objects with strong references held by the manager.
723 const auto managerStrongObjectsIter = this->Context->StrongObjects().find(this->OWNERSHIP_KEY());
724 // serializes all objects with strong references held by the deserializer.
725 const auto deserializerOwnershipKey = this->Deserializer->GetObjectDescription();
726 const auto deserStrongObjectsIter = this->Context->StrongObjects().find(deserializerOwnershipKey);
727 // serializes all objects with strong references held by the invoker.
728 const auto invokerOwnershipKey = this->Invoker->GetObjectDescription();
729 const auto invokerStrongObjectsIter = this->Context->StrongObjects().find(invokerOwnershipKey);
730 if (managerStrongObjectsIter != this->Context->StrongObjects().end())
731 {
732 for (const auto& object : managerStrongObjectsIter->second)
733 {
734 auto stateId = this->Serializer->SerializeJSON(object);
735 auto idIter = stateId.find("Id");
736 if ((idIter != stateId.end()) && idIter->is_number_unsigned())
737 {
738 auto& state = this->Context->GetState(idIter->get<vtkTypeUInt32>());
739 state["vtk-object-manager-kept-alive"] = true;
740 }
741 }
742 }
743 if (deserStrongObjectsIter != this->Context->StrongObjects().end())
744 {
745 for (const auto& object : deserStrongObjectsIter->second)
746 {
747 this->Serializer->SerializeJSON(object);
748 }
749 }
750 if (invokerStrongObjectsIter != this->Context->StrongObjects().end())
751 {
752 for (const auto& object : invokerStrongObjectsIter->second)
753 {
754 this->Serializer->SerializeJSON(object);
755 }
756 }
757 // Remove unused states
758 this->PruneUnusedStates();
759 // Remove unused objects
760 this->PruneUnusedObjects();
761}
762
763//------------------------------------------------------------------------------
764void vtkObjectManager::UpdateStatesFromObjects(const std::vector<vtkTypeUInt32>& identifiers)

Callers 15

serializeMethod · 0.45
serializeMethod · 0.45
testMethod · 0.45
serializeMethod · 0.45
test1Method · 0.45
serializeMethod · 0.45
serializeMethod · 0.45
serializeMethod · 0.45
serializeFunction · 0.45
serializeMethod · 0.45
test2Method · 0.45

Calls 12

PruneUnusedStatesMethod · 0.95
PruneUnusedObjectsMethod · 0.95
GetAllDependenciesMethod · 0.95
ROOTFunction · 0.85
SerializeJSONMethod · 0.80
findMethod · 0.45
GetObjectDescriptionMethod · 0.45
endMethod · 0.45
GetStateMethod · 0.45
GetIdMethod · 0.45

Tested by 15

serializeMethod · 0.36
serializeMethod · 0.36
testMethod · 0.36
serializeMethod · 0.36
test1Method · 0.36
serializeMethod · 0.36
serializeMethod · 0.36
serializeMethod · 0.36
serializeFunction · 0.36
serializeMethod · 0.36
test2Method · 0.36
test3Method · 0.36