2011: Misc. Ideas


[7-26-2011] ... SlotColRef is now actually a RootColRef, and it's implementation uses dynamic cast just to get the Slot pointer out of it. That's a huge inefficiency, as we are almost always just tring to get its Slot* and column components out of a SlotColRef.

RootColRef ended up being used only in one place, in DMI. RoolColRef could remain as it is, but SlotColRef should be its own thing. Mutual implicit constructors could be defined, if necessary, but probably it would just make more sense to recode the single client, if that even turns out to be necessary.

class RootColRef
{ 
   private:
     Root* _root; 
     int _col; // TableSlot / AggSeriesSlot column index
 
   public:
   ... ... ... 
  
     Slot* slot() const // may be null 
        { return (dynamic_cast<Slot*> (_root)); } 
};
 
typedef RootColRef SlotColRef;

This becomes more significant with the Slot class directly supporting column-specific attributes. I would expect this to be significant in GUI operations involving very long time series, e.g. in Slot Dialogs and the SCT.


[7-27-2011] ... The ScaledUnit pointers allocated from the Unit Manager are all delected each time the workspace is cleared. This makes the static construction of any structure which includes ScaledUnit pointers (ScaledUnitPtr) to be very unsafe. (This comes up in creating static NULL values for NumDisplayAttribs which use a ScaledUnitPtr for NOUNITS (1.0 "NONE")).

Perhaps the UnitManager should keep stable instances of ScaledUnits for the Standard RiverWare Units -- i.e. not delete those when the workspace clears.

FWIW, the following is an example of how we need to handle "static" uses of ScaledUnits (and static structures using ScaledUnits). Note that this method returns a reference to a NumDisplayAttribs instance -- so that can't be an automatically allocated instance.

// vitrual from Slot
const NumDisplayAttribs&
   SeriesSlot::localNumDisplayAttribs_prim (int col /*=0*/) const
{
   if (col == 0)
   {
      return (_localNumDispAttribs_prim);
   }

   // Note: This static NumDisplayAttribs default instance needs to be
   // recomputed on each use. ScaledUnit pointers become invalid when
   // the workspace is cleared.
   //
   static NumDisplayAttribs DefaultAttbs;
   DefaultAttbs = NumDisplayAttribs (unitMgr->getScaledUnit (NOUNITS), 'f', 2);
   return (DefaultAttbs);
}

[8-7-2011] ...

  1. RPL Editor "copy" operation should also put the selected text (i.e. the text version of the selected subexpression, or something really similar to that) in the system clipboard.
  2. RPL Editor context menu should support an "Open" operation on selected subexpressions which correspond to an existing Object, Account or Slot.

--- (end) ---