#1318 Make GridView implementations arguments to the GridFamily class
|Reported by||Oliver Sander (email@example.com)|
|Reported at||Jun 27, 2013 14:15|
|Version||Git (pre2.4) [autotools]|
|Operating System||Unspecified / All|
GridFamily class in dune/grid/common/grid.h centralizes all types exported by a Dune grid. It has a long list of template parameters (20, at the moment), all of which are implementation classes (For example,
GeometryImp -- the class type that will implement a grid's geometry).
GridFamily then adds the interface wrappers around these types.
An exception to this rule, however, are
GridFamily expects not the implementation class, but a traits class. The wrapper class
GridView is then instantiated with the traits instead of the implementation class. And the wrapper then extract the actual implementation type from the traits.
This exceptional behavior is undesirable because
- it makes the
- the type propagation is more difficult to understand: the wrapper class
has to ask the
Traitsclass for the implementation type
- it is more difficult to write a grid-specific implementation of a grid view, because one is forced to provide a traits class even if there is nothing I would want to parametrize with it.
My proposal: reverse the order. The
GridFamily gets the
DefaultGridView classes take their
Traits classes as arguments.
This change would be visible only to maintainers of grid implementation. A bit of judicious
template magic could probably even make
GridFamily accept both imp classes and traits
for a transition period.