void CGraphNodeStates::RestoreStates ( const TSavedStates& saved , const CFullGraphNode* node) { // crawl the branch and its sub-tree // restore state of every node that had a state before TSavedStates::const_iterator end = saved.end(); for (; node != NULL; node = node->GetNext()) { // breadth-first for ( const CFullGraphNode::CCopyTarget* target = node->GetFirstCopyTarget() ; target != NULL ; target = target->next()) { RestoreStates (saved, target->value()); } // (rev, path) lookup for this node TNodeDescriptor key (node->GetRevision(), node->GetPath()); TSavedStates::const_iterator iter = saved.find (key); // restore previous state info, if it had one if (iter != end) SetFlags (node, iter->second); } }
void CGraphNodeStates::LoadData ( const CGraphNodeStates::TSavedData& saved , const CFullGraph* graph) { states.clear(); RestoreStates (saved, graph->GetRoot()); }
CStateBlock::~CStateBlock() { RestoreStates(); }