axom
axom copied to clipboard
Slam: Add polymorphic policies, other changes
Summary
Adds a policy tag type for selecting virtual/concrete interfaces when instantiating Slam objects.
- Two tag types are provided --
slam::policies::VirtualInterface
andslam::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, CRTPConcreteBivariateSet
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 forRelationSet
, these are accessed from the underlying relation. -
PositionSet
andRangeSet
now are just template aliases ofGenericRangeSet
- Uses underlying Relation set types as default set template arguments in
RelationSet
- Adds set template arguments to
DynamicVariableRelation
to correspond toStaticRelation
- Adds an allocator ID parameter to
BivariateMap
constructor
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.