* @brief Same as CreateStringWME but for a new WME that has * an int as its value. *************************************************************/
| 872 | * an int as its value. |
| 873 | *************************************************************/ |
| 874 | IntElement* WorkingMemory::CreateIntWME(Identifier* parent, char const* pAttribute, long long value) |
| 875 | { |
| 876 | assert(m_Agent == parent->GetAgent()) ; |
| 877 | |
| 878 | IntElement* pWME = new IntElement(GetAgent(), parent, parent->GetValueAsString(), pAttribute, value, GenerateTimeTag()) ; |
| 879 | |
| 880 | // Record that the identifer owns this new WME |
| 881 | parent->AddChild(pWME) ; |
| 882 | |
| 883 | #ifdef SML_DIRECT |
| 884 | if (GetConnection()->IsDirectConnection()) |
| 885 | { |
| 886 | EmbeddedConnection* pConnection = static_cast<EmbeddedConnection*>(GetConnection()); |
| 887 | pConnection->DirectAddWME_Int(m_AgentSMLHandle, parent->GetValueAsString(), pAttribute, value, pWME->GetTimeTag()); |
| 888 | |
| 889 | // Return immediately, without adding it to the commit list. |
| 890 | return pWME ; |
| 891 | } |
| 892 | #endif |
| 893 | |
| 894 | // Add it to our list of changes that need to be sent to Soar. |
| 895 | m_DeltaList.AddWME(pWME) ; |
| 896 | |
| 897 | // Commit immediately if we're configured that way (makes life simpler for the client) |
| 898 | if (IsAutoCommitEnabled()) |
| 899 | { |
| 900 | Commit() ; |
| 901 | } |
| 902 | |
| 903 | return pWME ; |
| 904 | } |
| 905 | |
| 906 | /************************************************************* |
| 907 | * @brief Same as CreateStringWME but for a new WME that has |
nothing calls this directly
no test coverage detected