diff --git a/.vscode/settings.json b/.vscode/settings.json
index ccb7ebf90f..4f6d7b2e9f 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -18,7 +18,67 @@
"type_traits": "cpp",
"iosfwd": "cpp",
"map": "cpp",
- "stdexcept": "cpp"
+ "stdexcept": "cpp",
+ "__bit_reference": "cpp",
+ "__bits": "cpp",
+ "__errc": "cpp",
+ "__locale": "cpp",
+ "__mutex_base": "cpp",
+ "__node_handle": "cpp",
+ "__split_buffer": "cpp",
+ "__threading_support": "cpp",
+ "__tuple": "cpp",
+ "__verbose_abort": "cpp",
+ "array": "cpp",
+ "bit": "cpp",
+ "bitset": "cpp",
+ "cctype": "cpp",
+ "cinttypes": "cpp",
+ "clocale": "cpp",
+ "cmath": "cpp",
+ "complex": "cpp",
+ "condition_variable": "cpp",
+ "cstdarg": "cpp",
+ "cstddef": "cpp",
+ "cstdint": "cpp",
+ "cstdio": "cpp",
+ "cstdlib": "cpp",
+ "cstring": "cpp",
+ "ctime": "cpp",
+ "cwchar": "cpp",
+ "cwctype": "cpp",
+ "deque": "cpp",
+ "fstream": "cpp",
+ "initializer_list": "cpp",
+ "iomanip": "cpp",
+ "ios": "cpp",
+ "iostream": "cpp",
+ "istream": "cpp",
+ "limits": "cpp",
+ "list": "cpp",
+ "locale": "cpp",
+ "memory": "cpp",
+ "mutex": "cpp",
+ "new": "cpp",
+ "ostream": "cpp",
+ "queue": "cpp",
+ "ratio": "cpp",
+ "set": "cpp",
+ "sstream": "cpp",
+ "stack": "cpp",
+ "streambuf": "cpp",
+ "string_view": "cpp",
+ "system_error": "cpp",
+ "thread": "cpp",
+ "typeinfo": "cpp",
+ "unordered_map": "cpp",
+ "unordered_set": "cpp",
+ "vector": "cpp",
+ "__nullptr": "cpp",
+ "chrono": "cpp",
+ "compare": "cpp",
+ "concepts": "cpp",
+ "algorithm": "cpp"
},
"openInGitHub.defaultBranch": "development",
}
diff --git a/Core/ClientSML/src/sml_ClientKernel.cpp b/Core/ClientSML/src/sml_ClientKernel.cpp
index ad704162f3..d455d78503 100644
--- a/Core/ClientSML/src/sml_ClientKernel.cpp
+++ b/Core/ClientSML/src/sml_ClientKernel.cpp
@@ -2077,6 +2077,7 @@ int Kernel::InternalAddRhsFunction(smlRhsEventId id, char const* pRhsFunctionNam
bool found = m_RhsEventMap.findFirstValueByTest(&test, &optionalFoundHandler) ;
if (found && optionalFoundHandler.m_Handler != 0)
{
+ // TODO: log a warning here to help catch copy/paste errors in the client
return optionalFoundHandler.getCallbackID() ;
}
diff --git a/UnitTests/SoarTestAgents/FullTests/testsml.soar b/UnitTests/SoarTestAgents/FullTests/testsml.soar
index d0fe9e4cdb..1cf4888e8a 100644
--- a/UnitTests/SoarTestAgents/FullTests/testsml.soar
+++ b/UnitTests/SoarTestAgents/FullTests/testsml.soar
@@ -14,13 +14,22 @@ sp {apply*move
(
^move ^alternative ^A )
( ^row ^col )}
+sp {apply*user*exec*cpp
+ (state ^operator ^io.output-link )
+ ( ^name move ^space )
+ ( ^row ^col )
+-->
+ ( ^test (exec test-rhs-cpp | hello | | "ABC DEF" world!|))
+}
+
sp {apply*user*exec
(state ^operator ^io.output-link )
( ^name move ^space )
( ^row ^col )
-->
# use a long string to test the buffer re-allocation logic
- ( ^test (exec test-rhs | hello | | "ABC DEF" world!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |))}
+ ( ^test (exec test-rhs | hello | | "ABC DEF" world!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |))
+}
sp {apply*user*cmd
(state ^operator ^io.output-link )
diff --git a/UnitTests/SoarUnitTests/FullTests.cpp b/UnitTests/SoarUnitTests/FullTests.cpp
index dea78f3afd..b7f316d3a4 100644
--- a/UnitTests/SoarUnitTests/FullTests.cpp
+++ b/UnitTests/SoarUnitTests/FullTests.cpp
@@ -18,6 +18,8 @@
#include "sml_ClientKernel.h"
#include "soar_instance.h"
+#include
+
bool g_Cancel = false;
#ifdef _WIN32
@@ -376,9 +378,11 @@ void FullTests_Parent::testRHSHandler()
int callback_rhs1 = m_pKernel->AddRhsFunction("test-rhs", Handlers::MyRhsFunctionHandler, &rhsFunctionHandlerReceived) ;
int callback_rhs_dup = m_pKernel->AddRhsFunction("test-rhs", Handlers::MyRhsFunctionHandler, &rhsFunctionHandlerReceived) ;
//agent->RegisterForPrintEvent( sml::smlEVENT_PRINT, Handlers::DebugPrintEventHandler, 0) ;
-
no_agent_assertTrue_msg("Duplicate RHS function registration should be detected and be ignored", callback_rhs_dup == callback_rhs1);
+ bool cppRhsHandlerReceived(false);
+ int callback_rhs_cpp = m_pKernel->AddRhsFunctionCPP("test-rhs-cpp", Handlers::GetRhsFunctionHandlerCPP(&cppRhsHandlerReceived)) ;
+
// need this to fire production that calls test-rhs
sml::Identifier* pSquare = agent->GetInputLink()->CreateIdWME("square") ;
no_agent_assertTrue(pSquare);
@@ -396,6 +400,7 @@ void FullTests_Parent::testRHSHandler()
//std::cout << agent->ExecuteCommandLine("p i2 --depth 4") << std::endl;
no_agent_assertTrue(rhsFunctionHandlerReceived);
+ no_agent_assertTrue(cppRhsHandlerReceived);
no_agent_assertTrue(m_pKernel->RemoveRhsFunction(callback_rhs1));
diff --git a/UnitTests/SoarUnitTests/handlers.cpp b/UnitTests/SoarUnitTests/handlers.cpp
index b932273ae1..030f4d5f00 100644
--- a/UnitTests/SoarUnitTests/handlers.cpp
+++ b/UnitTests/SoarUnitTests/handlers.cpp
@@ -32,10 +32,10 @@ void Handlers::MyShutdownTestShutdownHandler(sml::smlSystemEventId, void* pUserD
{
no_agent_assertTrue(pUserData);
no_agent_assertTrue(pKernel);
-
+
pKernel->Shutdown();
delete pKernel;
-
+
soar_thread::Event* pEvent = static_cast< soar_thread::Event* >(pUserData);
pEvent->TriggerEvent();
}
@@ -63,10 +63,10 @@ void Handlers::MyProductionHandler(sml::smlProductionEventId id, void* pUserData
{
no_agent_assertTrue(pUserData);
int* pInt = static_cast< int* >(pUserData);
-
+
// Increase the count
*pInt += 1 ;
-
+
no_agent_assertTrue(id == sml::smlEVENT_BEFORE_PRODUCTION_REMOVED);
}
@@ -74,19 +74,19 @@ const char *Handlers::MyClientMessageHandler(sml::smlRhsEventId, void* pUserData
{
std::stringstream res;
res << "handler-message" << pMessage;
-
- if ( res.str().size() + 1 > *bufSize )
- {
- *bufSize = res.str().size() + 1;
- return NULL;
- }
- strcpy( buf, res.str().c_str() );
-
+
+ if ( res.str().size() + 1 > *bufSize )
+ {
+ *bufSize = res.str().size() + 1;
+ return NULL;
+ }
+ strcpy( buf, res.str().c_str() );
+
no_agent_assertTrue(pUserData);
bool* pHandlerReceived = static_cast< bool* >(pUserData);
*pHandlerReceived = true;
-
- return buf;
+
+ return buf;
}
// This is a very dumb filter--it adds "--depth 2" to all commands passed to it.
@@ -95,40 +95,40 @@ const char *Handlers::MyFilterHandler(sml::smlRhsEventId, void* pUserData, sml::
soarxml::ElementXML* pXML = soarxml::ElementXML::ParseXMLFromString(pCommandLine) ;
no_agent_assertTrue(pXML);
no_agent_assertTrue(pXML->GetAttribute(sml::sml_Names::kFilterCommand));
-
+
std::stringstream commandLine;
commandLine << pXML->GetAttribute(sml::sml_Names::kFilterCommand) << " --depth 2";
-
+
// Replace the command attribute in the XML
no_agent_assertTrue(pXML->AddAttribute(sml::sml_Names::kFilterCommand, commandLine.str().c_str()));
-
+
// Convert the XML back to a string and put it into a std::string ready to return
char* pXMLString = pXML->GenerateXMLString(true) ;
no_agent_assertTrue(pXMLString);
std::string res(pXMLString);
-
+
pXML->DeleteString(pXMLString);
delete pXML ;
- if ( res.size() + 1 > *bufSize )
- {
- *bufSize = res.size() + 1;
- return NULL;
- }
- strcpy( buff, res.c_str() );
-
+ if ( res.size() + 1 > *bufSize )
+ {
+ *bufSize = res.size() + 1;
+ return NULL;
+ }
+ strcpy( buff, res.c_str() );
+
no_agent_assertTrue(pUserData);
bool* pHandlerReceived = static_cast< bool* >(pUserData);
*pHandlerReceived = true;
-
- return buff;
+
+ return buff;
}
void Handlers::MyRunEventHandler(sml::smlRunEventId, void* pUserData, sml::Agent*, sml::smlPhase)
{
no_agent_assertTrue(pUserData);
int* pInt = static_cast< int* >(pUserData);
-
+
// Increase the count
*pInt = *pInt + 1 ;
}
@@ -137,7 +137,7 @@ void Handlers::MyUpdateEventHandler(sml::smlUpdateEventId, void* pUserData, sml:
{
no_agent_assertTrue(pUserData);
int* pInt = static_cast< int* >(pUserData);
-
+
// Increase the count
*pInt = *pInt + 1 ;
}
@@ -146,7 +146,7 @@ void Handlers::MyOutputNotificationHandler(void* pUserData, sml::Agent*)
{
no_agent_assertTrue(pUserData);
int* pInt = static_cast< int* >(pUserData);
-
+
// Increase the count
*pInt = *pInt + 1 ;
}
@@ -155,12 +155,12 @@ void Handlers::MyRunSelfRemovingHandler(sml::smlRunEventId, void* pUserData, sml
{
no_agent_assertTrue(pUserData);
int* myCallback = static_cast< int* >(pUserData);
-
+
// This callback removes itself from the list of callbacks
// as a test to see if we can do that inside a callback handler.
no_agent_assertTrue(*myCallback != -1);
no_agent_assertTrue(pAgent->UnregisterForRunEvent(*myCallback));
-
+
*myCallback = -1 ;
}
@@ -169,7 +169,7 @@ std::string Handlers::MyStringEventHandler(sml::smlStringEventId id, void* pUser
no_agent_assertTrue(pUserData);
bool* pHandlerReceived = static_cast< bool* >(pUserData);
*pHandlerReceived = true;
-
+
// new: string events need to return empty string on success
return "";
}
@@ -193,7 +193,7 @@ void Handlers::MyPrintEventHandler(sml::smlPrintEventId, void* pUserData, sml::A
// In this case the user data is a string we're building up
no_agent_assertTrue(pUserData);
std::stringstream* pTrace = static_cast< std::stringstream* >(pUserData);
-
+
(*pTrace) << pMessage ;
}
@@ -204,33 +204,33 @@ void Handlers::MyXMLEventHandler(sml::smlXMLEventId, void* pUserData, sml::Agent
// We'll start by turning it back into XML so we can look at it in the debugger.
char* pStr = pXML->GenerateXMLString(true) ;
no_agent_assertTrue(pStr);
-
+
// This will always succeed. If this isn't really trace XML
// the methods checking on tag names etc. will just fail
sml::ClientTraceXML* pRootXML = pXML->ConvertToTraceXML() ;
no_agent_assertTrue(pRootXML);
-
+
// The root object is just a tag. The substance is in the children
// so we'll get the first child which should exist.
sml::ClientTraceXML childXML ;
no_agent_assertTrue(pRootXML->GetChild(&childXML, 0));
sml::ClientTraceXML* pTraceXML = &childXML ;
-
+
if (pTraceXML->IsTagState())
{
no_agent_assertTrue(pTraceXML->GetDecisionCycleCount());
std::string count = pTraceXML->GetDecisionCycleCount() ;
-
+
no_agent_assertTrue(pTraceXML->GetStateID());
std::string stateID = pTraceXML->GetStateID() ;
-
+
no_agent_assertTrue(pTraceXML->GetImpasseObject());
std::string impasseObject = pTraceXML->GetImpasseObject() ;
-
+
no_agent_assertTrue(pTraceXML->GetImpasseType());
std::string impasseType = pTraceXML->GetImpasseType() ;
}
-
+
// Make a copy of the object we've been passed which should remain valid
// after the event handler has completed. We only keep the last message
// in this test. This is a stress test for our memory allocation logic.
@@ -242,14 +242,14 @@ void Handlers::MyXMLEventHandler(sml::smlXMLEventId, void* pUserData, sml::Agent
delete *clientXMLStorage ;
}
*clientXMLStorage = new sml::ClientXML(pXML) ;
-
+
pXML->DeleteString(pStr) ;
}
void Handlers::MyInterruptHandler(sml::smlRunEventId, void* pUserData, sml::Agent* pAgent, sml::smlPhase)
{
pAgent->GetKernel()->StopAllAgents() ;
-
+
no_agent_assertTrue(pUserData);
bool* pHandlerReceived = static_cast< bool* >(pUserData);
*pHandlerReceived = true;
@@ -264,18 +264,34 @@ const char *Handlers::MyRhsFunctionHandler(sml::smlRhsEventId, void* pUserData,
bool* pHandlerReceived = static_cast< bool* >(pUserData);
*pHandlerReceived = true;
}
-
+
std::stringstream res;
res << "my rhs result " << pArgument;
- if ( res.str().size() + 1 > *buffSize )
- {
- *buffSize = res.str().size() + 1;
- return NULL;
- }
- strcpy( buff, res.str().c_str() );
-
- return buff;
+ if ( res.str().size() + 1 > *buffSize )
+ {
+ *buffSize = res.str().size() + 1;
+ return NULL;
+ }
+ strcpy( buff, res.str().c_str() );
+
+ return buff;
+}
+
+
+const sml::RhsEventHandlerCPP Handlers::GetRhsFunctionHandlerCPP(bool* receivedFlag)
+{
+ return [receivedFlag](
+ sml::smlRhsEventId,
+ sml::Agent*,
+ char const* pFunctionName,
+ char const* pArgument) -> std::string
+ {
+ *receivedFlag = true;
+ std::stringstream res;
+ res << "my CPP rhs result " << pArgument;
+ return res.str();
+ };
}
void Handlers::MyMemoryLeakUpdateHandlerDestroyChildren(sml::smlUpdateEventId id, void* pUserData, sml::Kernel* pKernel, sml::smlRunFlags runFlags)
@@ -291,13 +307,13 @@ void Handlers::MyMemoryLeakUpdateHandler(sml::smlUpdateEventId id, void* pUserDa
void Handlers::MyMemoryLeakUpdateHandlerInternal(bool destroyChildren, sml::smlUpdateEventId id, void* pUserData, sml::Kernel* pKernel, sml::smlRunFlags runFlags)
{
static int step(0);
-
+
static sml::Identifier* pRootID1(0);
static sml::Identifier* pRootID2(0);
static sml::StringElement* pRootString(0);
static sml::FloatElement* pRootFloat(0);
static sml::IntElement* pRootInt(0);
-
+
static sml::Identifier* pChildID1(0);
static sml::Identifier* pChildID2(0);
static sml::Identifier* pChildID3(0);
@@ -305,14 +321,14 @@ void Handlers::MyMemoryLeakUpdateHandlerInternal(bool destroyChildren, sml::smlU
static sml::StringElement* pChildString(0);
static sml::FloatElement* pChildFloat(0);
static sml::IntElement* pChildInt(0);
-
+
static sml::Identifier* pSharedID(0);
-
+
no_agent_assertTrue(pUserData);
sml::Agent* pAgent = static_cast< sml::Agent* >(pUserData);
-
+
//std::cout << "step: " << step << std::endl;
-
+
switch (step % 3)
{
case 0:
@@ -321,7 +337,7 @@ void Handlers::MyMemoryLeakUpdateHandlerInternal(bool destroyChildren, sml::smlU
pRootString = pAgent->GetInputLink()->CreateStringWME("g", "gvalue") ;
pRootFloat = pAgent->GetInputLink()->CreateFloatWME("h", 1.0) ;
pRootInt = pAgent->GetInputLink()->CreateIntWME("i", 1) ;
-
+
pChildID1 = pRootID1->CreateIdWME("c") ;
pChildID2 = pRootID1->CreateIdWME("d") ;
pChildID3 = pRootID2->CreateIdWME("e") ;
@@ -329,12 +345,12 @@ void Handlers::MyMemoryLeakUpdateHandlerInternal(bool destroyChildren, sml::smlU
pChildString = pRootID1->CreateStringWME("j", "jvalue") ;
pChildFloat = pRootID1->CreateFloatWME("k", 2.0) ;
pChildInt = pRootID1->CreateIntWME("l", 2) ;
-
+
pSharedID = pRootID1->CreateSharedIdWME("m", pChildID1);
-
+
no_agent_assertTrue(pAgent->Commit());
break;
-
+
case 1:
if (destroyChildren)
{
@@ -343,31 +359,31 @@ void Handlers::MyMemoryLeakUpdateHandlerInternal(bool destroyChildren, sml::smlU
no_agent_assertTrue(pChildID2->DestroyWME());
no_agent_assertTrue(pChildID3->DestroyWME());
no_agent_assertTrue(pChildID4->DestroyWME());
-
+
// These three child leaks are not detected by looking at GetIWMObjMapSize
// TODO: figure out how to detect these
no_agent_assertTrue(pChildString->DestroyWME());
no_agent_assertTrue(pChildFloat->DestroyWME());
no_agent_assertTrue(pChildInt->DestroyWME());
}
-
+
// Destroying the original apparently destroys this.
no_agent_assertTrue(pSharedID->DestroyWME());
-
+
no_agent_assertTrue(pRootID1->DestroyWME());
no_agent_assertTrue(pRootID2->DestroyWME());
no_agent_assertTrue(pRootString->DestroyWME());
no_agent_assertTrue(pRootFloat->DestroyWME());
no_agent_assertTrue(pRootInt->DestroyWME());
-
+
no_agent_assertTrue(pAgent->Commit());
-
+
pRootID1 = 0;
pRootID2 = 0;
pRootString = 0;
pRootFloat = 0;
pRootInt = 0;
-
+
pChildID1 = 0;
pChildID2 = 0;
pChildID3 = 0;
@@ -375,14 +391,14 @@ void Handlers::MyMemoryLeakUpdateHandlerInternal(bool destroyChildren, sml::smlU
pChildString = 0;
pChildFloat = 0;
pChildInt = 0;
-
+
pSharedID = 0;
break;
-
+
default:
break;
}
-
+
++step;
}
@@ -395,10 +411,10 @@ void Handlers::MyAgentCreationUpdateEventHandler(sml::smlUpdateEventId, void* pU
{
no_agent_assertTrue(pUserData);
RunningAgentData* pData = static_cast< RunningAgentData* >(pUserData);
-
+
pData->count += 1;
//std::cout << std::endl << "Update: " << pData->count;
-
+
if (pData->count == 2)
{
pData->pOnTheFly = pKernel->CreateAgent("onthefly");
@@ -411,7 +427,7 @@ void Handlers::MyAgentCreationUpdateEventHandler(sml::smlUpdateEventId, void* pU
void Handlers::MyOrderingPrintHandler(sml::smlPrintEventId /*id*/, void* pUserData, sml::Agent* /*pAgent*/, char const* pMessage)
{
no_agent_assertTrue(pMessage);
-
+
no_agent_assertTrue(pUserData);
int* pInt = static_cast< int* >(pUserData);
std::stringstream value;
diff --git a/UnitTests/SoarUnitTests/handlers.hpp b/UnitTests/SoarUnitTests/handlers.hpp
index a0549e3e52..4d4b6e838c 100644
--- a/UnitTests/SoarUnitTests/handlers.hpp
+++ b/UnitTests/SoarUnitTests/handlers.hpp
@@ -5,6 +5,7 @@
#include "sml_Connection.h"
#include "sml_Client.h"
+#include "sml_ClientEvents.h"
#include "sml_Utils.h"
struct RunningAgentData
@@ -37,6 +38,7 @@ class Handlers
static void MyXMLEventHandler(sml::smlXMLEventId id, void* pUserData, sml::Agent* pAgent, sml::ClientXML* pXML);
static void MyInterruptHandler(sml::smlRunEventId id, void* pUserData, sml::Agent* pAgent, sml::smlPhase phase);
static const char *MyRhsFunctionHandler(sml::smlRhsEventId id, void* pUserData, sml::Agent* pAgent, char const* pFunctionName, char const* pArgument, int *buffSize, char *buff);
+ static const sml::RhsEventHandlerCPP GetRhsFunctionHandlerCPP(bool* receivedFlag);
static void MyMemoryLeakUpdateHandlerDestroyChildren(sml::smlUpdateEventId id, void* pUserData, sml::Kernel* pKernel, sml::smlRunFlags runFlags);
static void MyMemoryLeakUpdateHandler(sml::smlUpdateEventId id, void* pUserData, sml::Kernel* pKernel, sml::smlRunFlags runFlags);
static void MyCallStopOnUpdateEventHandler(sml::smlUpdateEventId id, void* pUserData, sml::Kernel* pKernel, sml::smlRunFlags runFlags);
@@ -45,10 +47,10 @@ class Handlers
static void MyOrderingRunHandler(sml::smlRunEventId id, void* pUserData, sml::Agent* pAgent, sml::smlPhase phase);
static const char *MyRhsFunctionFailureHandler(sml::smlRhsEventId id, void* pUserData, sml::Agent* pAgent, char const* pFunctionName, char const* pArgument, int *buffSize, char *buff);
static const char *MySuccessHandler(sml::smlRhsEventId id, void* pUserData, sml::Agent* pAgent, char const* pFunctionName, char const* pArgument, int *buffSize, char *buff);
-
+
private:
static void MyMemoryLeakUpdateHandlerInternal(bool destroyAll, sml::smlUpdateEventId id, void* pUserData, sml::Kernel* pKernel, sml::smlRunFlags runFlags);
-
+
// This class is meant to be used to contain static functions only and never instantiated.
Handlers() {}
Handlers(const Handlers&) {}
diff --git a/UnitTests/TestHarness/testMain.cpp b/UnitTests/TestHarness/testMain.cpp
index ab762e7551..b18aac92a4 100644
--- a/UnitTests/TestHarness/testMain.cpp
+++ b/UnitTests/TestHarness/testMain.cpp
@@ -25,7 +25,6 @@
#include "BuiltinRHSTests.hpp"
#include "ChunkingTests.hpp"
#include "ChunkingDemoTests.hpp"
-#include "C2CPPApi.hpp"
#include "ElementXMLTest.hpp"
#include "EpMemFunctionalTests.hpp"
#include "FullTests.hpp"
@@ -190,7 +189,6 @@ int main(int argc, char** argv)
TEST_DECLARATION(BuiltinRHSTests);
TEST_DECLARATION(ChunkingDemoTests);
TEST_DECLARATION(ChunkingTests);
- TEST_DECLARATION(C2CPPApi)
TEST_DECLARATION(EpMemFunctionalTests);
TEST_DECLARATION(ElementXMLTest);
TEST_DECLARATION(FullTests);