void DataSignal :: SetMessageValue (int scope, int location, bool value) { int myScope = GetObjectScope (); if (myScope == scope) { SmartMessage* msg = SmartMessage::GetSmartMessageForScopeAndElement (scope, location); msg->SetMessageValue (mMessageArray, mValueArray, location, value); if (value) { bool call = msg->EvaluateCall (mMessageArray); if (!call) mDoNotCall = true; } } }
void DataSignal :: SetMessageValue (int scope, int location, bool value, bool useVirtualMethod) { if (useVirtualMethod) SetMessageValue (scope, location, value); else if (scope == GetObjectScope ()) { mMessageArray [location] = value; if (value) { SmartMessage* msg = SmartMessage::GetSmartMessageForScopeAndElement (scope, location); bool call = msg->EvaluateCall (mMessageArray); if (!call) mDoNotCall = true; } } }
void DataSignal :: SetMessageValue (const SmartNotice& notice, bool value) { int scope = GetObjectScope (); if (notice.GetScope () == scope) { int index = notice.GetMessageIndex (); mMessageArray [index] = value; if (value) { SmartMessage* msg = SmartMessage::GetSmartMessageForScopeAndElement (scope, index); bool call = msg->EvaluateCall (mMessageArray); if (!call) mDoNotCall = true; } } }
int DataSignal :: AddAllSmartMessageReporters () { int k = GetObjectScope (); int size = SmartMessage::GetSizeOfArrayForScope (k); int i; int nMsgs = 0; SmartMessageReporter* newMsg; SmartMessage* nextSmartMsg; SmartMessageData target; SmartMessageData* smd; bool call; for (i=0; i<size; i++) { if (!mMessageArray [i]) continue; nextSmartMsg = SmartMessage::GetSmartMessageForScopeAndElement (k, i); call = nextSmartMsg->EvaluateCall (mMessageArray); if (!call) mDoNotCall = true; if (!nextSmartMsg->EvaluateReport (mMessageArray)) continue; target.SetIndex (i); smd = (SmartMessageData*) mMessageDataTable->Find (&target); newMsg = new SmartMessageReporter; newMsg->SetSmartMessage (nextSmartMsg); if (smd != NULL) newMsg->SetData (smd); newMsg->SetPriorityLevel (nextSmartMsg->EvaluateReportLevel (mMessageArray)); newMsg->SetRestrictionLevel (nextSmartMsg->EvaluateRestrictionLevel (mMessageArray)); newMsg->SetDoNotCall (!call); nMsgs = AddSmartMessageReporter (newMsg); } MergeAllSmartMessageReporters (); return nMsgs; }
int DataSignal :: AddAllSmartMessageReporters (SmartMessagingComm& comm, int numHigherObjects) { if (mReportersAdded) return 0; mReportersAdded = true; int k = GetObjectScope (); int size = SmartMessage::GetSizeOfArrayForScope (k); int i; int nMsgs = 0; SmartMessageReporter* newMsg; SmartMessage* nextSmartMsg; SmartMessageData target; SmartMessageData* smd; bool call; RGString exportProtocol; bool editable; bool enabled; bool hasExportProtocolInfo; bool report; bool mirror; bool displayExport; comm.SMOStack [numHigherObjects] = (SmartMessagingObject*) this; int topNum = numHigherObjects + 1; for (i=0; i<size; i++) { nextSmartMsg = SmartMessage::GetSmartMessageForScopeAndElement (k, i); editable = nextSmartMsg->IsEditable (); hasExportProtocolInfo = nextSmartMsg->HasExportProtocolInfo (); if (!mMessageArray [i]) { enabled = false; if (!editable) continue; if (!hasExportProtocolInfo) continue; } else enabled = true; call = nextSmartMsg->EvaluateCall (comm, topNum); if (!call) mDoNotCall = true; if (!nextSmartMsg->GetAllowPeakEdit ()) mAllowPeakEdit = false; report = nextSmartMsg->EvaluateReportContingent (comm, topNum); mirror = nextSmartMsg->UseDefaultExportDisplayMode (); if (mirror) displayExport = report; else displayExport = nextSmartMsg->DisplayExportInfo (); if (!report && !displayExport) continue; target.SetIndex (i); smd = (SmartMessageData*) mMessageDataTable->Find (&target); newMsg = new SmartMessageReporter; newMsg->SetSmartMessage (nextSmartMsg); if (smd != NULL) newMsg->SetData (smd); newMsg->SetPriorityLevel (nextSmartMsg->EvaluateReportLevel (comm, topNum)); newMsg->SetRestrictionLevel (nextSmartMsg->EvaluateRestrictionLevel (comm, topNum)); newMsg->SetDoNotCall (!call); newMsg->SetEditable (editable); newMsg->SetEnabled (enabled); newMsg->SetDisplayExportInfo (displayExport); newMsg->SetDisplayOsirisInfo (report); if (hasExportProtocolInfo) { newMsg->SetExportProtocolInformation (nextSmartMsg->GetExportProtocolList ()); SmartMessagingObject::InsertExportSpecificationsIntoTable (nextSmartMsg); } newMsg->ComputeViabilityOfExportInfo (); nMsgs = AddSmartMessageReporter (newMsg); } MergeAllSmartMessageReporters (); return nMsgs; }