| 73 | } |
| 74 | |
| 75 | void Clear(bool deleteContents, bool clearJustAdded = false, bool clearChildrenModified = false) |
| 76 | { |
| 77 | //std::cout << "Clearing delta list " << deleteContents << clearJustAdded << clearChildrenModified; |
| 78 | if (m_DeltaList.empty()) |
| 79 | { |
| 80 | //std::cout << " (empty)" << std::endl; |
| 81 | return; |
| 82 | } |
| 83 | |
| 84 | if (clearJustAdded || clearChildrenModified) |
| 85 | { |
| 86 | for (std::vector<WMDelta*>::iterator iter = m_DeltaList.begin(); iter != m_DeltaList.end(); ++iter) |
| 87 | { |
| 88 | WMElement* pWME = (*iter)->getWME(); |
| 89 | //std::string wmeString; |
| 90 | //pWME->DebugString(wmeString); |
| 91 | //std::cout << std::endl << wmeString; |
| 92 | if (clearJustAdded) |
| 93 | { |
| 94 | pWME->SetJustAdded(false); |
| 95 | } |
| 96 | if (clearChildrenModified) |
| 97 | { |
| 98 | if (pWME->IsIdentifier()) |
| 99 | { |
| 100 | Identifier* pID = static_cast< Identifier* >(pWME); |
| 101 | pID->m_pSymbol->SetAreChildrenModified(false); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | if (deleteContents) |
| 108 | { |
| 109 | int size = (int)m_DeltaList.size() ; |
| 110 | for (int i = 0 ; i < size ; i++) |
| 111 | { |
| 112 | delete m_DeltaList[i] ; |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | m_DeltaList.clear() ; |
| 117 | //std::cout << std::endl; |
| 118 | } |
| 119 | |
| 120 | void RemoveWME(WMElement* pWME) |
| 121 | { |
no test coverage detected