Fixing up contract stuff for queries

This page is just a nicely formatted e-mail from Hank to Kathleen

Kathleen said:

   I can 'fix' the bug and get the query to return the correct values,
   by using the DataAttributes instead of the DataRequest, but if
   the query isn't using the correct pipeline data when applying other
   filters, what other hidden side-effects are being generated??
   Your idea for a solution mentions querying directly on the data object.
   In the bug I'm investigating that isn't really the case, as other filters
   are being used (the bug references avtWeightedVariableSummationQuery,
   but there are at least a few other queries operating similarly).
   Do you think your idea would still work here?

Hank responds:

 So your point that the variable name may just be the tip of the iceberg is a really good one.
 I still think we should store off a contract that is appropriate for that pipeline ... the question is where and how.
 It seems like we want the contract to be associated with the thing we query.  And we keep track of what we query by marking it as "not transient".  

Your main question was whether or not the approach I was suggesting was a match for the problem you have. I think we have one of two possible problems: (1) I'm missing something ... which is likely, or, (2), I have a good idea that I've communicated poorly ... also very possible. Some I'm going to provide some more details below. If it is case (1), we'll have something a little more tangible that you can point out my mistake with ... if it is case (2), then this should help improve the situation.

  • Add a new data member to avtDataObject called "contractFromUpdate"
  • Add method to avtDataObject called "GetContractFromUpdate()" (or something) that returns that data member.
  • Reimplement avtDataObject::Update(avtContract_p c0) to have logic at the top of the method like: if (transient) then "store off a copy of c0 as my data member contractFromUpdate".
 avtDataObject::Update(avtContract_p spec)
   // NEW CODE
   if (!transient)
       contractFromUpdate = spec;
   bool rv = false;
   if (source == NULL)
       // This object has nothing upstream, so no action item.
       rv = false;
  • Replace the instance of GetGeneralContract with GetInput()->GetContractFromUpdate() ... where input would be the non-transient object ... which would have the "contractFromUpdate" or maybe some conditional thing where it checks for NULL and if it is NULL then it falls back to GetGeneralContract.
   avtContract_p contract = GetInput()->GetContractFromUpdate();
   if (*contract == NULL)
       contract = GetGeneralContract();