[Dune] Typedefs and traits

Adrian_Burri burriad at mathematik.uni-freiburg.de
Mon Jan 31 11:06:41 CET 2005


Hi,

I have a question regarding the type information policy in Dune: where 
should all the typedefs go?

About the typedefs: Outside the grid interface, there is quite a bit of 
a mess with the type definitions and I am not quite sure how to deal 
with it. There are several aspects:
1.) The place to store them
    - in a traits class like it is done in the grid interface now?
    - in the class itself like it is done in most of the cases?
(I prefer the first version; the question is whether the traits classes 
should be independent or part of the classes and how their template 
argument list should look like.)

2.) What to store:
    - a class should offer all type definitions of the type it uses in 
its public interface (makes sense to me, but is not mandatory)
    - one could establish so-called "type-defining entities", as is the 
grid type for the grid interface. (With this notion I mean the fact that 
the choice of the grid type implies the choice of the entity, the 
iterators etc. The same situation holds for the rest of the library, 
e.g. the choice of the discrete function type implies the type of the 
local function and the dof iterator). Each type-defining entity offers 
the related type definitions and serves as the single access point for 
those definitions (either through a traits class or in the public 
interface).

3.) Naming: I used the scheme so far that template parameter end in 
"Imp" and exported type definitions in "Type". (This allows defining the 
same things with the same name at every inheritance level, which makes 
life somewhat easier.)

Are there any general guidelines about this? If so, can we put them in 
the coding style? And if not, what is your opinion on the topic?

Cheers

Adi







More information about the Dune mailing list