MCPcopy Create free account
hub / github.com/SoarGroup/Soar / keep

Method keep

Core/ClientSML/src/sml_ObjectMap.h:106–122  ·  view source on GitHub ↗

Remove all agents not on this list

Source from the content-addressed store, hash-verified

104
105 // Remove all agents not on this list
106 void keep(std::list<DataType>* pKeepList)
107 {
108 for (InternalMapIter mapIter = m_Map.begin() ; mapIter != m_Map.end() ;)
109 {
110 DataType pObject = mapIter->second ;
111
112 // For lists, you have to use std::find, they don't have a member function
113 if (std::find(pKeepList->begin(), pKeepList->end(), pObject) != pKeepList->end())
114 {
115 mapIter++ ;
116 }
117 else
118 {
119 m_Map.erase(mapIter++) ; // changed by voigtjr
120 }
121 }
122 }
123
124 DataType find(char const* pName) const
125 {

Callers 1

UpdateAgentListMethod · 0.45

Calls 2

findFunction · 0.85
endMethod · 0.80

Tested by

no test coverage detected