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

Method installRHS

Tests/Prototype-UnitTesting/kernel/FunctionalTestHarness.cpp:181–205  ·  view source on GitHub ↗

* Set up the agent with RHS functions common to these * FunctionalTests. */

Source from the content-addressed store, hash-verified

179 * FunctionalTests.
180 */
181void FunctionalTestHarness::installRHS(sml::Agent* agent)
182{
183 // set up the agent with common RHS functions
184 ::rhs_function* halt_function = lookup_rhs_function(internal_agent, make_str_constant(internal_agent, "halt"));
185 halt_routine = halt_function->f;
186
187 auto call_routine = [](::agent* thisAgent, ::list* args, void* user_data) -> Symbol* {
188 return static_cast<user_data_struct*>(user_data)->function();
189 };
190
191 halt_function->user_data = &haltData;
192 halt_function->f = call_routine;
193
194 add_rhs_function(internal_agent,
195 make_str_constant(internal_agent, "failed"),
196 call_routine,
197 0, false, true,
198 &failedData);
199
200 add_rhs_function(internal_agent,
201 make_str_constant(internal_agent, "succeeded"),
202 call_routine,
203 0, false, true,
204 &succeededData);
205}
206

Callers

nothing calls this directly

Calls 3

lookup_rhs_functionFunction · 0.85
make_str_constantFunction · 0.85
add_rhs_functionFunction · 0.85

Tested by

no test coverage detected