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

Method CreateIntWME

Core/ClientSML/src/sml_ClientWorkingMemory.cpp:874–904  ·  view source on GitHub ↗

* @brief Same as CreateStringWME but for a new WME that has * an int as its value. *************************************************************/

Source from the content-addressed store, hash-verified

872* an int as its value.
873*************************************************************/
874IntElement* 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

Callers

nothing calls this directly

Calls 9

DirectAddWME_IntMethod · 0.80
AddWMEMethod · 0.80
GetAgentFunction · 0.70
GetConnectionFunction · 0.70
IsAutoCommitEnabledFunction · 0.70
GetAgentMethod · 0.45
GetValueAsStringMethod · 0.45
AddChildMethod · 0.45
IsDirectConnectionMethod · 0.45

Tested by

no test coverage detected