Skip to content
  • Kenneth Moreland's avatar
    Simplify and unify cast interface. · ed43dad6
    Kenneth Moreland authored
    Previously, DynamicArrayHandle and DynamicCellSet had slightly different
    interfaces to their CastTo feature. It was a bit confusing and not all
    that easy to use.
    
    This change simplifies and unifies them by making each class have a single
    CopyTo method that takes a reference to a cast object (an ArrayHandle or
    CellSet, respectively) and fills that object with the data contained if
    the cast is successfull. This interface gets around having to declare
    strange types.
    
    Each object also has a Cast method that has to have a template parameter
    specified and returns a reference of that type (if possible).
    
    In addition, the old behavior is preserved for DynamicArrayHandle (but
    not DynamicCellSet). To avoid confusion, the name of that cast method is
    CastToTypeStorage. However, the method was chaned to not take parameters
    to make it consistent with the other Cast method.
    
    Also, the IsType methods have been modified to reflect changes in
    cast/copy. IsType now no longer takes arguments. However, an alternate
    IsSameType does the same thing but does take an argument.
    ed43dad6