Commits on Source (17)
-
-
Simon Praetorius authored
-
Simon Praetorius authored
-
Andreas Dedner authored
-
Carsten Gräser authored
The new CRTP-mixin class `IteratorFacade` is parameterized by implementation, iterator category, `value_type`, `reference`, `pointer`, and `difference_type`. Discussion of the changes: * Making the iterator category a template parameter, allows to work with the facades class in a more uniform way. E.g. comparisons only need to be defined once for all categories. * Being able to customize `pointer` allows to use the facade classes for proxy-iterators. This was not possible before, because it is not sufficient to simply exchange the `reference` type to support proxies. * The design is in line with the `std::iterator_interface` proposal, in the sense that the template parameters have the same order to avoid surprises. Notice however, that this is not a drop-in replacement because `srd::iterator_interface` avoids classic CRTP by deducing `this`. * Additionally to the old facade classes, `IteratorFacade` also allows to implement the raw analouges of the methods used in the old classes, i.e. * `operator*` instead of `dereference()`, * `operator++` instead of `increment()`, * `operator--` instead of `decrement()`, * `operator+=` instead of `advance()`, * `operator==` instead of `equals()`, * `operator- instead of `distanceTo()`. * If the implementation class provides a `baseIterator()` method returning an underlying internal iterator, the operators of the returned iterator will be used if not dedicated implementation is provided. A major consequence of this change is, that it allows to use the new `IteratorFacade` for proxy-iterators, like e.g. `TransformedRangeIterator`. In this case you have to specify a suitable proxy-type for the pointer. In this case the new helper `Dune::ProxyArrowResult` can be used. This was adopted from the `TransformedRangeIterator`, but the name was adjusted to the `std::iterator_interface` proposal.
-
Carsten Gräser authored
-
Carsten Gräser authored
-
Carsten Gräser authored
This comes with a slight change: The old helper `Dune::Impl::PointerProxy` was dropped in favor of the new `Dune::ProxyArrowResult`. The latter no longer supports storing raw references. This change is deliberately: In the no-proxy case, we can simply use raw pointers instead of the helper to avoid indirection and keep simple cases simple. Furthermore it this make `TransformedRangeIterator` simpler and allows to make it more flexible: * All iterator operations despite dereferencing are now autogenerated, by exporting `baseIterator()`. * Allow to either store a function or a pointer to function. The transformation is evaluated conditionally, if a call `f(z)` is valid, this is used, else `(*f)(z)` is used. * Use `Dune::AutonomousValue` instead of `std::decay_t` to deduce `value_type`. This improves support for types using this mechanism. * Store `reference` instead of `value_type` in `ProxyArrowResult`. This is important if both types are different and the `reference` proxy e.g. forwards to some other storage. * Add checks for free `TransformedRangeIterator` storing functions with value and pointer semantics.
-
Carsten Gräser authored
-
Carsten Gräser authored
-
Carsten Gräser authored
-
Simon Praetorius authored
Move include of config.h from source to some header files See merge request !1313
-
Carsten Gräser authored
We now give detailed error messages for each required feature that is missing in the derived class. To get early diagnotics the static assertions are even issued in the constructor even if the corresponding methods are not called. I.e. whenever you derive from `IteratorFacade<...>` and miss to implement a feature a static assertion will fail listing which methods are missing, if they should be const or mutable, for which iterator category they are required. To make this work from the constructor we have to enforce instanciation of the methods by letting their return type deduce. Otherwise this would fail late, only if the corresponding method is used. Alternatively we could enforce instanciation by obtaining the address of the methods in the constructor. This however would be over-restrictive, since it fixes the full signature and does not leave freedom for automatic conversion of in- and output parameters.
-
Simon Praetorius authored
-
Simon Praetorius authored
Revert changes to python-bindings from "Move include of config.h from source to some header files" See merge request !1402
-
Carsten Gräser authored
Introduce new class IteratorFacade and add proxy iterator support See merge request !1396
-
Andreas Dedner authored
[python] move to pybind11 2.12.0 See merge request !1393
Showing
- CHANGELOG.md 6 additions, 0 deletionsCHANGELOG.md
- dune/common/debugalign.cc 0 additions, 3 deletionsdune/common/debugalign.cc
- dune/common/debugallocator.cc 0 additions, 3 deletionsdune/common/debugallocator.cc
- dune/common/dynmatrixev.hh 2 additions, 0 deletionsdune/common/dynmatrixev.hh
- dune/common/fmatrixev.cc 3 additions, 4 deletionsdune/common/fmatrixev.cc
- dune/common/fmatrixev.hh 1 addition, 0 deletionsdune/common/fmatrixev.hh
- dune/common/ios_state.cc 0 additions, 4 deletionsdune/common/ios_state.cc
- dune/common/iteratorfacades.hh 663 additions, 1 deletiondune/common/iteratorfacades.hh
- dune/common/parallel/test/parmetistest.cc 0 additions, 1 deletiondune/common/parallel/test/parmetistest.cc
- dune/common/parametertree.cc 0 additions, 4 deletionsdune/common/parametertree.cc
- dune/common/parametertreeparser.cc 0 additions, 4 deletionsdune/common/parametertreeparser.cc
- dune/common/path.cc 0 additions, 4 deletionsdune/common/path.cc
- dune/common/rangeutilities.hh 78 additions, 214 deletionsdune/common/rangeutilities.hh
- dune/common/simd/test.cc 0 additions, 2 deletionsdune/common/simd/test.cc
- dune/common/simd/test/looptest.cc.in 0 additions, 4 deletionsdune/common/simd/test/looptest.cc.in
- dune/common/simd/test/looptest_vector.cc.in 0 additions, 2 deletionsdune/common/simd/test/looptest_vector.cc.in
- dune/common/simd/test/standardtest.cc.in 0 additions, 4 deletionsdune/common/simd/test/standardtest.cc.in
- dune/common/simd/test/standardtest_vector.cc.in 0 additions, 2 deletionsdune/common/simd/test/standardtest_vector.cc.in
- dune/common/simd/test/vcarraytest.cc.in 0 additions, 4 deletionsdune/common/simd/test/vcarraytest.cc.in
- dune/common/simd/test/vctest_mask.cc.in 0 additions, 2 deletionsdune/common/simd/test/vctest_mask.cc.in
This diff is collapsed.