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

Method Clear

Core/KernelSML/src/sml_AgentSML.cpp:127–159  ·  view source on GitHub ↗

Release any objects or other data we are keeping. We do this just prior to deleting AgentSML, but before the underlying gSKI agent has been deleted 'deletingThisAgent' should only be true when we're actually in the destructor.

Source from the content-addressed store, hash-verified

125// prior to deleting AgentSML, but before the underlying gSKI agent has been deleted
126// 'deletingThisAgent' should only be true when we're actually in the destructor.
127void AgentSML::Clear(bool deletingThisAgent)
128{
129#ifdef DEBUG_UPDATE
130 sml::PrintDebugFormat("AgentSML::Clear start %s", deletingThisAgent ? "deleting this agent." : "not deleting this agent.") ;
131#endif
132
133 // Release any WME objects we still own.
134 // (Don't flush removes in this case as we're shutting down rather than just doing an init-soar).
135 ReleaseAllWmes(!deletingThisAgent) ;
136
137 RemoveRHSFunction(m_pRhsInterrupt) ;
138 delete m_pRhsInterrupt ;
139 m_pRhsInterrupt = NULL ;
140 RemoveRHSFunction(m_pRhsConcat) ;
141 delete m_pRhsConcat ;
142 m_pRhsConcat = NULL ;
143 RemoveRHSFunction(m_pRhsExec) ;
144 delete m_pRhsExec ;
145 m_pRhsExec = NULL ;
146 RemoveRHSFunction(m_pRhsCmd) ;
147 delete m_pRhsCmd ;
148 m_pRhsCmd = NULL ;
149
150 m_ProductionListener.Clear();
151 m_RunListener.Clear();
152 m_PrintListener.Clear();
153 m_OutputListener.Clear() ;
154 m_XMLListener.Clear() ;
155
156#ifdef DEBUG_UPDATE
157 sml::PrintDebugFormat("AgentSML::Clear end %s", deletingThisAgent ? "deleting this agent." : "not deleting this agent.") ;
158#endif
159}
160
161// Release all of the WMEs that we currently have references to
162// It's a little less severe than clear() which releases everything we own, not just wmes.

Callers 2

DeleteSelfMethod · 0.95
~KernelSMLMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected