//========================================================================= /// <summary> /// Does a search through the list of msg's /// </summary> /// <param name="msgID">Message ID</param> /// <returns>Returns the MsgTask item or TQueryInfoTracker.Null if not found.</returns> //========================================================================= public MsgTask findMsg(uint msgID) { bool found = false; MsgTask msg = Null; MsgTask queryMsg; if (sentQueryList.Count > 0) { int i = 0; while ((!found) && (i < sentQueryList.Count)) //while more msgs { queryMsg = sentQueryList[i]; if (queryMsg.msgID == msgID) { //if found found = true; msg = sentQueryList[i]; } else { i++; } } } return(msg); }
//========================================================================= /// <summary> /// Adds details of the queryInfo msg to the list of msg's /// </summary> /// <param name="msgID">Message ID.</param> /// <param name="reqCompID">ID of the requesting component.</param> /// <param name="reqName">Name of the requesting component.</param> /// <param name="reqRegID"></param> /// <param name="destCompID"></param> /// <param name="doOnReturn">Do this task on return. See <see cref="UPD_PUBEVENT_CONN"/></param> //========================================================================= public void addQueryMsg(uint msgID, uint reqCompID, string reqName, uint reqRegID, uint destCompID, int doOnReturn) { MsgTask queryMsg = new MsgTask(); queryMsg.msgID = msgID; //queryInfo msg ID queryMsg.requestingCompID = reqCompID; queryMsg.requestingEntity = reqName; //name of entity doing the requesting (e.g. driving property) queryMsg.requestingRegID = reqRegID; queryMsg.destCompID = destCompID; queryMsg.doOnReturn = doOnReturn; //used to determine the which task to perform when a returnInfo arrives sentQueryList.Add(queryMsg); }
//============================================================================ /// <summary> /// Determine if the MsgTask is defined. /// </summary> /// <param name="task">The MsgTask item.</param> /// <returns>True is the task==NULL</returns> //============================================================================ public Boolean IsNull(MsgTask task) { return(task.Equals(Null)); }