axom icon indicating copy to clipboard operation
axom copied to clipboard

Slam: Add polymorphic policies, other changes

Open publixsubfan opened this issue 2 years ago • 1 comments

Summary

Adds a policy tag type for selecting virtual/concrete interfaces when instantiating Slam objects.

  • Two tag types are provided -- slam::policies::VirtualInterface and slam::policies::ConcreteInterface
  • Supported Slam objects inherit from a "selector" type instantiated with the provided tag, which aliases to the correct base class (this is to support selecting between a CRTP class and an abstract base class):
    • OrderedSet/RangeSet: slam::Set if virtual, ConcreteInterface if concrete
    • Map/SubMap/BivariateMap: slam::MapBase if virtual, ConcreteInterface if concrete
    • ProductSet/RangeSet: slam::BivariateSet if virtual, CRTP ConcreteBivariateSet if concrete
  • Adds conversions for Sets and BivariateSets between corresponding concrete and virtual interface types

Also:

  • Access the underlying sets of a BivariateSet directly from the derived classes. For ProductSet, these are stored as member variables, and for RelationSet, these are accessed from the underlying relation.
  • PositionSet and RangeSet now are just template aliases of GenericRangeSet
  • Uses underlying Relation set types as default set template arguments in RelationSet
  • Adds set template arguments to DynamicVariableRelation to correspond to StaticRelation
  • Adds an allocator ID parameter to BivariateMap constructor

publixsubfan avatar Oct 20 '22 00:10 publixsubfan

General comment: this good. It's also in very strong need of documentation showing why you would choose one or the other, and how to use one or the other.

agcapps avatar Oct 20 '22 16:10 agcapps