--- /srv/reproducible-results/rbuild-debian/r-b-build.f9zshb7s/b1/dune-typetree_2.9.0-2_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.f9zshb7s/b2/dune-typetree_2.9.0-2_armhf.changes ├── Files │ @@ -1,3 +1,3 @@ │ │ fd206993f9d5c62e980f0cde2ad3767f 38676 libdevel optional libdune-typetree-dev_2.9.0-2_armhf.deb │ - 706f540f984321bf76071429650ef0ab 811640 doc optional libdune-typetree-doc_2.9.0-2_all.deb │ + ebc7e0bf193c16f1c9ef6056cd19b1e0 811772 doc optional libdune-typetree-doc_2.9.0-2_all.deb ├── libdune-typetree-doc_2.9.0-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-01-12 22:23:12.000000 debian-binary │ │ --rw-r--r-- 0 0 0 9716 2023-01-12 22:23:12.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 801732 2023-01-12 22:23:12.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 9568 2023-01-12 22:23:12.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 802012 2023-01-12 22:23:12.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -5,68 +5,68 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 758 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/changelog.Debian.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2362 2022-11-16 12:31:04.000000 ./usr/share/doc/libdune-typetree-doc/changelog.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3031 2023-01-12 15:07:35.000000 ./usr/share/doc/libdune-typetree-doc/copyright │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2877 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00002.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2875 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00005.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5014 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6192 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6765 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26765 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6687 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 86739 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11032 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 42298 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6035 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8498 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7200 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39570 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6712 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14713 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10780 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 54148 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5711 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 48067 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9529 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67275 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5711 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 48067 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4927 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13856 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 3524 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5126 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8617 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19660 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4951 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 30674 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 31519 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 92477 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6687 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 86739 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7306 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17090 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8538 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 54968 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14818 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 100891 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5851 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 48376 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17085 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 72652 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4951 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 30674 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5405 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 37677 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8617 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19660 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4679 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8483 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14575 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55719 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5402 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 47700 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 31519 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 92477 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7306 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17090 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15101 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 51659 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4927 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13856 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 3524 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5126 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5996 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 67112 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10332 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 47176 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9529 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 67275 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11032 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 42298 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10332 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 47176 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10780 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 54148 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14575 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55719 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5402 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 47700 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6035 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8498 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5851 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 48376 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17085 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 72652 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6712 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14713 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5014 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6192 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5996 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 67112 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6765 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26765 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4679 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8483 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15101 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 51659 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5405 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 37677 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14818 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 100891 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7200 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39570 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4066 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00089.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 16365 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00090.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 11848 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00090.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 40666 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00091.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4072 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00091.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 21362 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00092.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3049 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00092.png │ │ │ │ @@ -373,15 +373,15 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2374 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_04f2ecc425faf0d475a3caf484e551f3_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3482 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e69be5995c9f5d42bf491ae6f29600e.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12439 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e74c06688912037f4b476b8dc05fab9.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2105 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e74c06688912037f4b476b8dc05fab9_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3478 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_e68e8157741866f444e17edd764ebbae.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 746 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/doc.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 33676 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/doxygen.css │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26143 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26145 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4452 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dynsections.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 11908 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/files.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 616 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/folderclosed.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 597 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/folderopen.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3270 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3789 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions_b.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7236 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions_c.html │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: exceptions.hh File Reference │ │ │ │ +dune-typetree: proxynode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,39 +65,60 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
exceptions.hh File Reference
│ │ │ │ +
proxynode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ -

TypeTree-specific exceptions. │ │ │ │ -More...

│ │ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/common/std/type_traits.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::TypeTree::Exception
 Base class for all TypeTree exceptions. More...
class  Dune::TypeTree::StaticChildAccessors< ProxiedNode >
 Mixin class providing methods for child access with compile-time parameter. More...
 
struct  Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k >
 Access to the type and storage type of the i-th child. More...
 
class  Dune::TypeTree::DynamicChildAccessors< ProxiedNode >
 Mixin class providing methods for child access with run-time parameter. More...
 
struct  Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag >
 ProxyNode base class for LeafNode. More...
 
struct  Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag >
 ProxyNode base class for CompositeNode. More...
 
struct  Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag >
 ProxyNode base class for PowerNode. More...
 
struct  Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag >
 ProxyNode base class for DynamicPowerNode. More...
 
class  Dune::TypeTree::ProxyNode< Node >
 Base class for nodes acting as a proxy for an existing node. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

TypeTree-specific exceptions.

│ │ │ │ -
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,25 +5,50 @@ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -exceptions.hh File Reference │ │ │ │ │ -TypeTree-specific exceptions. More... │ │ │ │ │ -#include │ │ │ │ │ +proxynode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::TypeTree::Exception │ │ │ │ │ -  Base class for all TypeTree exceptions. More... │ │ │ │ │ + class  Dune::TypeTree::StaticChildAccessors<_ProxiedNode_> │ │ │ │ │ +  Mixin class providing methods for child access with compile-time │ │ │ │ │ + parameter. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::StaticChildAccessors<_ProxiedNode_>::Child<_k_> │ │ │ │ │ +  Access to the type and storage type of the i-th child. More... │ │ │ │ │ +  │ │ │ │ │ + class  Dune::TypeTree::DynamicChildAccessors<_ProxiedNode_> │ │ │ │ │ +  Mixin class providing methods for child access with run-time │ │ │ │ │ + parameter. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::ProxyNodeBase<_Node,_LeafNodeTag_> │ │ │ │ │ +  ProxyNode base class for LeafNode. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_> │ │ │ │ │ +  ProxyNode base class for CompositeNode. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_> │ │ │ │ │ +  ProxyNode base class for PowerNode. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_> │ │ │ │ │ +  ProxyNode base class for DynamicPowerNode. More... │ │ │ │ │ +  │ │ │ │ │ + class  Dune::TypeTree::ProxyNode<_Node_> │ │ │ │ │ +  Base class for nodes acting as a proxy for an existing node. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -TypeTree-specific exceptions. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: exceptions.hh Source File │ │ │ │ +dune-typetree: proxynode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,37 +62,351 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
exceptions.hh
│ │ │ │ +
proxynode.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │ -
3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH
│ │ │ │ -
4#define DUNE_TYPETREE_EXCEPTIONS_HH
│ │ │ │ -
5
│ │ │ │ -
6#include <dune/common/exceptions.hh>
│ │ │ │ -
7
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14 namespace TypeTree {
│ │ │ │ -
15
│ │ │ │ - │ │ │ │ -
18 : public Dune::Exception
│ │ │ │ -
19 {};
│ │ │ │ -
20
│ │ │ │ -
21 } // namespace TypeTree
│ │ │ │ -
22} // namespace Dune
│ │ │ │ -
23
│ │ │ │ -
24#endif // DUNE_TYPETREE_EXCEPTIONS_HH
│ │ │ │ +
3
│ │ │ │ +
4#ifndef DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ +
6
│ │ │ │ +
7#include <type_traits>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
10#include <dune/common/shared_ptr.hh>
│ │ │ │ +
11#include <dune/common/indices.hh>
│ │ │ │ +
12#include <dune/common/std/type_traits.hh>
│ │ │ │ +
13
│ │ │ │ +
14namespace Dune {
│ │ │ │ +
15 namespace TypeTree {
│ │ │ │ +
16
│ │ │ │ +
22 template<typename Node>
│ │ │ │ +
23 class ProxyNode;
│ │ │ │ +
24
│ │ │ │ +
26 template<typename ProxiedNode>
│ │ │ │ + │ │ │ │ +
28 {
│ │ │ │ +
29
│ │ │ │ +
30 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
│ │ │ │ +
31
│ │ │ │ +
32 template<std::size_t k>
│ │ │ │ +
33 struct lazy_enabled
│ │ │ │ +
34 {
│ │ │ │ +
35 static const bool value = !proxiedNodeIsConst;
│ │ │ │ +
36 };
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
39
│ │ │ │ +
40 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ +
41 typename std::enable_if<enabled,Node&>::type
│ │ │ │ +
42 node ()
│ │ │ │ +
43 {
│ │ │ │ +
44 return static_cast<Node&>(*this);
│ │ │ │ +
45 }
│ │ │ │ +
46
│ │ │ │ +
47 const Node& node () const
│ │ │ │ +
48 {
│ │ │ │ +
49 return static_cast<const Node&>(*this);
│ │ │ │ +
50 }
│ │ │ │ +
51
│ │ │ │ +
52 public:
│ │ │ │ +
53
│ │ │ │ +
55 template<std::size_t k>
│ │ │ │ +
56 struct Child
│ │ │ │ +
57 : public ProxiedNode::template Child<k>
│ │ │ │ +
58 {};
│ │ │ │ +
59
│ │ │ │ +
62
│ │ │ │ +
64
│ │ │ │ +
67 template<std::size_t k,
│ │ │ │ +
68 typename std::enable_if<lazy_enabled<k>::value, int>::type = 0>
│ │ │ │ +
69 auto& child (index_constant<k> = {})
│ │ │ │ +
70 {
│ │ │ │ +
71 return node().proxiedNode().template child<k>();
│ │ │ │ +
72 }
│ │ │ │ +
73
│ │ │ │ +
75
│ │ │ │ +
78 template<std::size_t k>
│ │ │ │ +
79 const auto& child (index_constant<k> = {}) const
│ │ │ │ +
80 {
│ │ │ │ +
81 return node().proxiedNode().template child<k>();
│ │ │ │ +
82 }
│ │ │ │ +
83
│ │ │ │ +
85
│ │ │ │ +
88 template<std::size_t k,
│ │ │ │ +
89 typename std::enable_if<lazy_enabled<k>::value, int>::type = 0>
│ │ │ │ +
90 auto childStorage (index_constant<k> = {})
│ │ │ │ +
91 {
│ │ │ │ +
92 return node().proxiedNode().template childStorage<k>();
│ │ │ │ +
93 }
│ │ │ │ +
94
│ │ │ │ +
96
│ │ │ │ +
102 template<std::size_t k>
│ │ │ │ +
103 auto childStorage (index_constant<k> = {}) const
│ │ │ │ +
104 {
│ │ │ │ +
105 return node().proxiedNode().template childStorage<k>();
│ │ │ │ +
106 }
│ │ │ │ +
107
│ │ │ │ +
109 template<std::size_t k, class ProxyChild>
│ │ │ │ +
110 void setChild (ProxyChild&& child, typename std::enable_if<lazy_enabled<k>::value,void*>::type = 0)
│ │ │ │ +
111 {
│ │ │ │ +
112 node().proxiedNode().template setChild<k>(std::forward<ProxyChild>(child));
│ │ │ │ +
113 }
│ │ │ │ +
114
│ │ │ │ +
115 const typename ProxiedNode::NodeStorage& nodeStorage () const
│ │ │ │ +
116 {
│ │ │ │ +
117 return node().proxiedNode().nodeStorage();
│ │ │ │ +
118 }
│ │ │ │ +
119
│ │ │ │ +
120 };
│ │ │ │ +
121
│ │ │ │ +
123
│ │ │ │ +
128 template<typename ProxiedNode>
│ │ │ │ + │ │ │ │ +
130 : public StaticChildAccessors<ProxiedNode>
│ │ │ │ +
131 {
│ │ │ │ +
132
│ │ │ │ + │ │ │ │ +
134
│ │ │ │ +
135 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
│ │ │ │ +
136
│ │ │ │ +
137 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ +
138 typename std::enable_if<enabled,Node&>::type
│ │ │ │ +
139 node ()
│ │ │ │ +
140 {
│ │ │ │ +
141 return static_cast<Node&>(*this);
│ │ │ │ +
142 }
│ │ │ │ +
143
│ │ │ │ +
144 const Node& node () const
│ │ │ │ +
145 {
│ │ │ │ +
146 return static_cast<const Node&>(*this);
│ │ │ │ +
147 }
│ │ │ │ +
148
│ │ │ │ +
149 public:
│ │ │ │ +
150
│ │ │ │ +
153
│ │ │ │ +
155
│ │ │ │ +
158 template<bool enabled = !proxiedNodeIsConst,
│ │ │ │ +
159 typename std::enable_if<enabled, int>::type = 0>
│ │ │ │ +
160 auto& child (std::size_t i)
│ │ │ │ +
161 {
│ │ │ │ +
162 return node().proxiedNode().child(i);
│ │ │ │ +
163 }
│ │ │ │ +
164
│ │ │ │ +
166
│ │ │ │ +
169 const auto& child (std::size_t i) const
│ │ │ │ +
170 {
│ │ │ │ +
171 return node().proxiedNode().child(i);
│ │ │ │ +
172 }
│ │ │ │ +
173
│ │ │ │ +
175
│ │ │ │ +
178 template<bool enabled = !proxiedNodeIsConst,
│ │ │ │ +
179 typename std::enable_if<enabled, int>::type = 0>
│ │ │ │ +
180 auto childStorage (std::size_t i)
│ │ │ │ +
181 {
│ │ │ │ +
182 return node().proxiedNode().childStorage(i);
│ │ │ │ +
183 }
│ │ │ │ +
184
│ │ │ │ +
186
│ │ │ │ +
192 auto childStorage (std::size_t i) const
│ │ │ │ +
193 {
│ │ │ │ +
194 return node().proxiedNode().childStorage(i);
│ │ │ │ +
195 }
│ │ │ │ +
196
│ │ │ │ +
198 template<class ProxyChild, bool enabled = !proxiedNodeIsConst>
│ │ │ │ +
199 void setChild (std::size_t i, ProxyChild&& child, typename std::enable_if<enabled,void*>::type = 0)
│ │ │ │ +
200 {
│ │ │ │ +
201 node().proxiedNode().setChild(i, std::forward<ProxyChild>(child));
│ │ │ │ +
202 }
│ │ │ │ +
203
│ │ │ │ +
204 };
│ │ │ │ +
205
│ │ │ │ +
207 template<typename Node, typename NodeTag>
│ │ │ │ + │ │ │ │ +
209
│ │ │ │ +
211 template<typename Node>
│ │ │ │ + │ │ │ │ +
213 {
│ │ │ │ +
214 };
│ │ │ │ +
215
│ │ │ │ +
217 template<typename Node>
│ │ │ │ + │ │ │ │ +
219 : public StaticChildAccessors<Node>
│ │ │ │ +
220 {
│ │ │ │ +
221 typedef typename Node::ChildTypes ChildTypes;
│ │ │ │ +
222 typedef typename Node::NodeStorage NodeStorage;
│ │ │ │ +
223 };
│ │ │ │ +
224
│ │ │ │ +
226 template<typename Node>
│ │ │ │ + │ │ │ │ +
228 : public DynamicChildAccessors<Node>
│ │ │ │ +
229 {
│ │ │ │ +
230 typedef typename Node::ChildType ChildType;
│ │ │ │ +
231 typedef typename Node::NodeStorage NodeStorage;
│ │ │ │ +
232 };
│ │ │ │ +
233
│ │ │ │ +
235 template<typename Node>
│ │ │ │ + │ │ │ │ +
237 : public DynamicChildAccessors<Node>
│ │ │ │ +
238 {
│ │ │ │ +
239 typedef typename Node::ChildType ChildType;
│ │ │ │ +
240 typedef typename Node::NodeStorage NodeStorage;
│ │ │ │ +
241 };
│ │ │ │ +
242
│ │ │ │ +
244
│ │ │ │ +
250 template<typename Node>
│ │ │ │ + │ │ │ │ +
252 : public ProxyNodeBase<Node,NodeTag<Node>>
│ │ │ │ +
253 {
│ │ │ │ +
254 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
│ │ │ │ +
255
│ │ │ │ +
256 template <class N>
│ │ │ │ +
257 using HasStaticDegree = index_constant<N::degree()>;
│ │ │ │ +
258
│ │ │ │ +
259 template <class N>
│ │ │ │ +
260 static constexpr bool hasStaticDegree = Std::is_detected<HasStaticDegree, N>::value;
│ │ │ │ +
261
│ │ │ │ +
262 // accessor mixins need to be friends for access to proxiedNode()
│ │ │ │ +
263 friend class StaticChildAccessors<Node>;
│ │ │ │ +
264 friend class DynamicChildAccessors<Node>;
│ │ │ │ +
265
│ │ │ │ +
266 public:
│ │ │ │ +
267
│ │ │ │ +
268 typedef Node ProxiedNode;
│ │ │ │ +
269
│ │ │ │ + │ │ │ │ +
271
│ │ │ │ +
273 static const bool isLeaf = Node::isLeaf;
│ │ │ │ +
274
│ │ │ │ +
276 static const bool isPower = Node::isPower;
│ │ │ │ +
277
│ │ │ │ +
279 static const bool isComposite = Node::isComposite;
│ │ │ │ +
280
│ │ │ │ +
282 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ +
283 static const std::size_t CHILDREN = Dune::Std::detected_or_t<
│ │ │ │ +
284 std::integral_constant<std::size_t,std::numeric_limits<std::size_t>::max()>,
│ │ │ │ + │ │ │ │ +
286 Node
│ │ │ │ +
287 >::value;
│ │ │ │ +
288
│ │ │ │ +
289 template <class N = Node,
│ │ │ │ +
290 std::enable_if_t<hasStaticDegree<N>, int> = 0>
│ │ │ │ +
291 static constexpr auto degree ()
│ │ │ │ +
292 {
│ │ │ │ +
293 return N::degree();
│ │ │ │ +
294 }
│ │ │ │ +
295
│ │ │ │ +
296 template <class N = Node,
│ │ │ │ +
297 std::enable_if_t<not hasStaticDegree<N>, int> = 0>
│ │ │ │ +
298 auto degree () const
│ │ │ │ +
299 {
│ │ │ │ +
300 return proxiedNode().degree();
│ │ │ │ +
301 }
│ │ │ │ +
302
│ │ │ │ +
303
│ │ │ │ +
304 protected:
│ │ │ │ +
305
│ │ │ │ +
308
│ │ │ │ +
310 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ +
311 typename std::enable_if<enabled,Node&>::type
│ │ │ │ + │ │ │ │ +
313 {
│ │ │ │ +
314 return *_node;
│ │ │ │ +
315 }
│ │ │ │ +
316
│ │ │ │ +
318 const Node& proxiedNode () const
│ │ │ │ +
319 {
│ │ │ │ +
320 return *_node;
│ │ │ │ +
321 }
│ │ │ │ +
322
│ │ │ │ +
324 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ +
325 typename std::enable_if<enabled,std::shared_ptr<Node> >::type
│ │ │ │ + │ │ │ │ +
327 {
│ │ │ │ +
328 return _node;
│ │ │ │ +
329 }
│ │ │ │ +
330
│ │ │ │ +
332 std::shared_ptr<const Node> proxiedNodeStorage () const
│ │ │ │ +
333 {
│ │ │ │ +
334 return _node;
│ │ │ │ +
335 }
│ │ │ │ +
336
│ │ │ │ +
338
│ │ │ │ +
341
│ │ │ │ +
342 ProxyNode (Node& node)
│ │ │ │ +
343 : _node(stackobject_to_shared_ptr(node))
│ │ │ │ +
344 {}
│ │ │ │ +
345
│ │ │ │ +
346 ProxyNode (std::shared_ptr<Node> node)
│ │ │ │ +
347 : _node(std::move(node))
│ │ │ │ +
348 {}
│ │ │ │ +
349
│ │ │ │ +
351
│ │ │ │ +
352 private:
│ │ │ │ +
353
│ │ │ │ +
354 std::shared_ptr<Node> _node;
│ │ │ │ +
355 };
│ │ │ │ +
356
│ │ │ │ +
358
│ │ │ │ +
359 } // namespace TypeTree
│ │ │ │ +
360} //namespace Dune
│ │ │ │ +
361
│ │ │ │ +
362#endif // DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ +
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ +
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:113
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Base class for all TypeTree exceptions.
Definition: exceptions.hh:19
│ │ │ │ +
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ +
Tag designating a power node.
Definition: nodetags.hh:19
│ │ │ │ +
Tag designating a power node with runtime degree.
Definition: nodetags.hh:22
│ │ │ │ +
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │ +
Base class for nodes acting as a proxy for an existing node.
Definition: proxynode.hh:253
│ │ │ │ +
ProxyNode(Node &node)
Definition: proxynode.hh:342
│ │ │ │ +
Dune::TypeTree::NodeTag< Node > NodeTag
Definition: proxynode.hh:270
│ │ │ │ +
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: proxynode.hh:279
│ │ │ │ +
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: proxynode.hh:273
│ │ │ │ +
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: proxynode.hh:276
│ │ │ │ +
auto degree() const
Definition: proxynode.hh:298
│ │ │ │ +
std::enable_if< enabled, Node & >::type proxiedNode()
Returns the proxied node.
Definition: proxynode.hh:312
│ │ │ │ +
static const std::size_t CHILDREN
The number of children.
Definition: proxynode.hh:283
│ │ │ │ +
std::shared_ptr< const Node > proxiedNodeStorage() const
Returns the storage of the proxied node (const version).
Definition: proxynode.hh:332
│ │ │ │ +
Node ProxiedNode
Definition: proxynode.hh:268
│ │ │ │ +
std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage()
Returns the storage of the proxied node.
Definition: proxynode.hh:326
│ │ │ │ +
static constexpr auto degree()
Definition: proxynode.hh:291
│ │ │ │ +
ProxyNode(std::shared_ptr< Node > node)
Definition: proxynode.hh:346
│ │ │ │ +
const Node & proxiedNode() const
Returns the proxied node (const version).
Definition: proxynode.hh:318
│ │ │ │ +
Mixin class providing methods for child access with compile-time parameter.
Definition: proxynode.hh:28
│ │ │ │ +
auto & child(index_constant< k >={})
Returns the i-th child.
Definition: proxynode.hh:69
│ │ │ │ +
void setChild(ProxyChild &&child, typename std::enable_if< lazy_enabled< k >::value, void * >::type=0)
Sets the i-th child to the passed-in value.
Definition: proxynode.hh:110
│ │ │ │ +
const ProxiedNode::NodeStorage & nodeStorage() const
Definition: proxynode.hh:115
│ │ │ │ +
auto childStorage(index_constant< k >={})
Returns the storage of the i-th child.
Definition: proxynode.hh:90
│ │ │ │ +
const auto & child(index_constant< k >={}) const
Returns the i-th child (const version).
Definition: proxynode.hh:79
│ │ │ │ +
auto childStorage(index_constant< k >={}) const
Returns the storage of the i-th child (const version).
Definition: proxynode.hh:103
│ │ │ │ +
Access to the type and storage type of the i-th child.
Definition: proxynode.hh:58
│ │ │ │ +
Mixin class providing methods for child access with run-time parameter.
Definition: proxynode.hh:131
│ │ │ │ +
auto & child(std::size_t i)
Returns the i-th child.
Definition: proxynode.hh:160
│ │ │ │ +
auto childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition: proxynode.hh:192
│ │ │ │ +
void setChild(std::size_t i, ProxyChild &&child, typename std::enable_if< enabled, void * >::type=0)
Sets the i-th child to the passed-in value.
Definition: proxynode.hh:199
│ │ │ │ +
const auto & child(std::size_t i) const
Returns the i-th child (const version).
Definition: proxynode.hh:169
│ │ │ │ +
auto childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition: proxynode.hh:180
│ │ │ │ +
Tag-based dispatch to appropriate base class that provides necessary functionality.
Definition: proxynode.hh:208
│ │ │ │ +
Node::NodeStorage NodeStorage
Definition: proxynode.hh:222
│ │ │ │ +
Node::ChildTypes ChildTypes
Definition: proxynode.hh:221
│ │ │ │ +
Node::NodeStorage NodeStorage
Definition: proxynode.hh:231
│ │ │ │ +
Node::ChildType ChildType
Definition: proxynode.hh:230
│ │ │ │ +
Node::NodeStorage NodeStorage
Definition: proxynode.hh:240
│ │ │ │ +
Node::ChildType ChildType
Definition: proxynode.hh:239
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,35 +4,466 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -exceptions.hh │ │ │ │ │ +proxynode.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ - 3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ - 4#define DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7 │ │ │ │ │ - 13namespace Dune { │ │ │ │ │ - 14 namespace TypeTree { │ │ │ │ │ - 15 │ │ │ │ │ -17 class Exception │ │ │ │ │ - 18 : public Dune::Exception │ │ │ │ │ - 19 {}; │ │ │ │ │ - 20 │ │ │ │ │ - 21 } // namespace TypeTree │ │ │ │ │ - 22} // namespace Dune │ │ │ │ │ - 23 │ │ │ │ │ - 24#endif // DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ + 3 │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ + 6 │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13 │ │ │ │ │ + 14namespace Dune { │ │ │ │ │ + 15 namespace TypeTree { │ │ │ │ │ + 16 │ │ │ │ │ + 22 template │ │ │ │ │ + 23 class ProxyNode; │ │ │ │ │ + 24 │ │ │ │ │ + 26 template │ │ │ │ │ +27 class StaticChildAccessors │ │ │ │ │ + 28 { │ │ │ │ │ + 29 │ │ │ │ │ + 30 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ + 31 │ │ │ │ │ + 32 template │ │ │ │ │ + 33 struct lazy_enabled │ │ │ │ │ + 34 { │ │ │ │ │ + 35 static const bool value = !proxiedNodeIsConst; │ │ │ │ │ + 36 }; │ │ │ │ │ + 37 │ │ │ │ │ + 38 typedef ProxyNode Node; │ │ │ │ │ + 39 │ │ │ │ │ + 40 template │ │ │ │ │ + 41 typename std::enable_if::type │ │ │ │ │ + 42 node () │ │ │ │ │ + 43 { │ │ │ │ │ + 44 return static_cast(*this); │ │ │ │ │ + 45 } │ │ │ │ │ + 46 │ │ │ │ │ + 47 const Node& node () const │ │ │ │ │ + 48 { │ │ │ │ │ + 49 return static_cast(*this); │ │ │ │ │ + 50 } │ │ │ │ │ + 51 │ │ │ │ │ + 52 public: │ │ │ │ │ + 53 │ │ │ │ │ + 55 template │ │ │ │ │ +56 struct Child │ │ │ │ │ + 57 : public ProxiedNode::template Child │ │ │ │ │ + 58 {}; │ │ │ │ │ + 59 │ │ │ │ │ + 62 │ │ │ │ │ + 64 │ │ │ │ │ + 67 template::value, int>::type = 0> │ │ │ │ │ +69 auto& child (index_constant = {}) │ │ │ │ │ + 70 { │ │ │ │ │ + 71 return node().proxiedNode().template child(); │ │ │ │ │ + 72 } │ │ │ │ │ + 73 │ │ │ │ │ + 75 │ │ │ │ │ + 78 template │ │ │ │ │ +79 const auto& child (index_constant = {}) const │ │ │ │ │ + 80 { │ │ │ │ │ + 81 return node().proxiedNode().template child(); │ │ │ │ │ + 82 } │ │ │ │ │ + 83 │ │ │ │ │ + 85 │ │ │ │ │ + 88 template::value, int>::type = 0> │ │ │ │ │ +90 auto childStorage (index_constant = {}) │ │ │ │ │ + 91 { │ │ │ │ │ + 92 return node().proxiedNode().template childStorage(); │ │ │ │ │ + 93 } │ │ │ │ │ + 94 │ │ │ │ │ + 96 │ │ │ │ │ + 102 template │ │ │ │ │ +103 auto childStorage (index_constant = {}) const │ │ │ │ │ + 104 { │ │ │ │ │ + 105 return node().proxiedNode().template childStorage(); │ │ │ │ │ + 106 } │ │ │ │ │ + 107 │ │ │ │ │ + 109 template │ │ │ │ │ +110 void setChild (ProxyChild&& child, typename std:: │ │ │ │ │ +enable_if::value,void*>::type = 0) │ │ │ │ │ + 111 { │ │ │ │ │ + 112 node().proxiedNode().template setChild(std::forward │ │ │ │ │ +(child)); │ │ │ │ │ + 113 } │ │ │ │ │ + 114 │ │ │ │ │ +115 const typename ProxiedNode::NodeStorage& nodeStorage () const │ │ │ │ │ + 116 { │ │ │ │ │ + 117 return node().proxiedNode().nodeStorage(); │ │ │ │ │ + 118 } │ │ │ │ │ + 119 │ │ │ │ │ + 120 }; │ │ │ │ │ + 121 │ │ │ │ │ + 123 │ │ │ │ │ + 128 template │ │ │ │ │ +129 class DynamicChildAccessors │ │ │ │ │ + 130 : public StaticChildAccessors │ │ │ │ │ + 131 { │ │ │ │ │ + 132 │ │ │ │ │ + 133 typedef ProxyNode Node; │ │ │ │ │ + 134 │ │ │ │ │ + 135 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ + 136 │ │ │ │ │ + 137 template │ │ │ │ │ + 138 typename std::enable_if::type │ │ │ │ │ + 139 node () │ │ │ │ │ + 140 { │ │ │ │ │ + 141 return static_cast(*this); │ │ │ │ │ + 142 } │ │ │ │ │ + 143 │ │ │ │ │ + 144 const Node& node () const │ │ │ │ │ + 145 { │ │ │ │ │ + 146 return static_cast(*this); │ │ │ │ │ + 147 } │ │ │ │ │ + 148 │ │ │ │ │ + 149 public: │ │ │ │ │ + 150 │ │ │ │ │ + 153 │ │ │ │ │ + 155 │ │ │ │ │ + 158 template::type = 0> │ │ │ │ │ +160 auto& child (std::size_t i) │ │ │ │ │ + 161 { │ │ │ │ │ + 162 return node().proxiedNode().child(i); │ │ │ │ │ + 163 } │ │ │ │ │ + 164 │ │ │ │ │ + 166 │ │ │ │ │ +169 const auto& child (std::size_t i) const │ │ │ │ │ + 170 { │ │ │ │ │ + 171 return node().proxiedNode().child(i); │ │ │ │ │ + 172 } │ │ │ │ │ + 173 │ │ │ │ │ + 175 │ │ │ │ │ + 178 template::type = 0> │ │ │ │ │ +180 auto childStorage (std::size_t i) │ │ │ │ │ + 181 { │ │ │ │ │ + 182 return node().proxiedNode().childStorage(i); │ │ │ │ │ + 183 } │ │ │ │ │ + 184 │ │ │ │ │ + 186 │ │ │ │ │ +192 auto childStorage (std::size_t i) const │ │ │ │ │ + 193 { │ │ │ │ │ + 194 return node().proxiedNode().childStorage(i); │ │ │ │ │ + 195 } │ │ │ │ │ + 196 │ │ │ │ │ + 198 template │ │ │ │ │ +199 void setChild (std::size_t i, ProxyChild&& child, typename std:: │ │ │ │ │ +enable_if::type = 0) │ │ │ │ │ + 200 { │ │ │ │ │ + 201 node().proxiedNode().setChild(i, std::forward(child)); │ │ │ │ │ + 202 } │ │ │ │ │ + 203 │ │ │ │ │ + 204 }; │ │ │ │ │ + 205 │ │ │ │ │ + 207 template │ │ │ │ │ +208 struct ProxyNodeBase; │ │ │ │ │ + 209 │ │ │ │ │ + 211 template │ │ │ │ │ +212 struct ProxyNodeBase │ │ │ │ │ + 213 { │ │ │ │ │ + 214 }; │ │ │ │ │ + 215 │ │ │ │ │ + 217 template │ │ │ │ │ +218 struct ProxyNodeBase │ │ │ │ │ + 219 : public StaticChildAccessors │ │ │ │ │ + 220 { │ │ │ │ │ +221 typedef typename Node::ChildTypes ChildTypes; │ │ │ │ │ +222 typedef typename Node::NodeStorage NodeStorage; │ │ │ │ │ + 223 }; │ │ │ │ │ + 224 │ │ │ │ │ + 226 template │ │ │ │ │ +227 struct ProxyNodeBase │ │ │ │ │ + 228 : public DynamicChildAccessors │ │ │ │ │ + 229 { │ │ │ │ │ +230 typedef typename Node::ChildType ChildType; │ │ │ │ │ +231 typedef typename Node::NodeStorage NodeStorage; │ │ │ │ │ + 232 }; │ │ │ │ │ + 233 │ │ │ │ │ + 235 template │ │ │ │ │ +236 struct ProxyNodeBase │ │ │ │ │ + 237 : public DynamicChildAccessors │ │ │ │ │ + 238 { │ │ │ │ │ +239 typedef typename Node::ChildType ChildType; │ │ │ │ │ +240 typedef typename Node::NodeStorage NodeStorage; │ │ │ │ │ + 241 }; │ │ │ │ │ + 242 │ │ │ │ │ + 244 │ │ │ │ │ + 250 template │ │ │ │ │ +251 class ProxyNode │ │ │ │ │ + 252 : public ProxyNodeBase> │ │ │ │ │ + 253 { │ │ │ │ │ + 254 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ + 255 │ │ │ │ │ + 256 template │ │ │ │ │ + 257 using HasStaticDegree = index_constant; │ │ │ │ │ + 258 │ │ │ │ │ + 259 template │ │ │ │ │ +260 static constexpr bool hasStaticDegree = Std::is_detected::value; │ │ │ │ │ + 261 │ │ │ │ │ + 262 // accessor mixins need to be friends for access to proxiedNode() │ │ │ │ │ + 263 friend class StaticChildAccessors; │ │ │ │ │ + 264 friend class DynamicChildAccessors; │ │ │ │ │ + 265 │ │ │ │ │ + 266 public: │ │ │ │ │ + 267 │ │ │ │ │ +268 typedef Node ProxiedNode; │ │ │ │ │ + 269 │ │ │ │ │ +270 typedef Dune::TypeTree::NodeTag NodeTag; │ │ │ │ │ + 271 │ │ │ │ │ +273 static const bool isLeaf = Node::isLeaf; │ │ │ │ │ + 274 │ │ │ │ │ +276 static const bool isPower = Node::isPower; │ │ │ │ │ + 277 │ │ │ │ │ +279 static const bool isComposite = Node::isComposite; │ │ │ │ │ + 280 │ │ │ │ │ + 282 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +283 static const std::size_t CHILDREN = Dune::Std::detected_or_t< │ │ │ │ │ + 284 std::integral_constant::max │ │ │ │ │ +()>, │ │ │ │ │ + 285 StaticDegree, │ │ │ │ │ + 286 Node │ │ │ │ │ + 287 >::value; │ │ │ │ │ + 288 │ │ │ │ │ + 289 template , int> = 0> │ │ │ │ │ +291 static constexpr auto degree () │ │ │ │ │ + 292 { │ │ │ │ │ + 293 return N::degree(); │ │ │ │ │ + 294 } │ │ │ │ │ + 295 │ │ │ │ │ + 296 template , int> = 0> │ │ │ │ │ +298 auto degree () const │ │ │ │ │ + 299 { │ │ │ │ │ + 300 return proxiedNode().degree(); │ │ │ │ │ + 301 } │ │ │ │ │ + 302 │ │ │ │ │ + 303 │ │ │ │ │ + 304 protected: │ │ │ │ │ + 305 │ │ │ │ │ + 308 │ │ │ │ │ + 310 template │ │ │ │ │ + 311 typename std::enable_if::type │ │ │ │ │ +312 proxiedNode () │ │ │ │ │ + 313 { │ │ │ │ │ + 314 return *_node; │ │ │ │ │ + 315 } │ │ │ │ │ + 316 │ │ │ │ │ +318 const Node& proxiedNode () const │ │ │ │ │ + 319 { │ │ │ │ │ + 320 return *_node; │ │ │ │ │ + 321 } │ │ │ │ │ + 322 │ │ │ │ │ + 324 template │ │ │ │ │ + 325 typename std::enable_if >::type │ │ │ │ │ +326 proxiedNodeStorage () │ │ │ │ │ + 327 { │ │ │ │ │ + 328 return _node; │ │ │ │ │ + 329 } │ │ │ │ │ + 330 │ │ │ │ │ +332 std::shared_ptr proxiedNodeStorage () const │ │ │ │ │ + 333 { │ │ │ │ │ + 334 return _node; │ │ │ │ │ + 335 } │ │ │ │ │ + 336 │ │ │ │ │ + 338 │ │ │ │ │ + 341 │ │ │ │ │ +342 ProxyNode (Node& node) │ │ │ │ │ + 343 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ + 344 {} │ │ │ │ │ + 345 │ │ │ │ │ +346 ProxyNode (std::shared_ptr node) │ │ │ │ │ + 347 : _node(std::move(node)) │ │ │ │ │ + 348 {} │ │ │ │ │ + 349 │ │ │ │ │ + 351 │ │ │ │ │ + 352 private: │ │ │ │ │ + 353 │ │ │ │ │ + 354 std::shared_ptr _node; │ │ │ │ │ + 355 }; │ │ │ │ │ + 356 │ │ │ │ │ + 358 │ │ │ │ │ + 359 } // namespace TypeTree │ │ │ │ │ + 360} //namespace Dune │ │ │ │ │ + 361 │ │ │ │ │ + 362#endif // DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ +Dune::TypeTree::degree │ │ │ │ │ +std::size_t degree(const Node &node) │ │ │ │ │ +Returns the degree of node as run time information. │ │ │ │ │ +Definition: nodeinterface.hh:85 │ │ │ │ │ +Dune::TypeTree::NodeTag │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +Definition: nodeinterface.hh:76 │ │ │ │ │ +Dune::TypeTree::StaticDegree │ │ │ │ │ +decltype(Node::degree()) StaticDegree │ │ │ │ │ +Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +Definition: nodeinterface.hh:113 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::Exception │ │ │ │ │ -Base class for all TypeTree exceptions. │ │ │ │ │ -Definition: exceptions.hh:19 │ │ │ │ │ +Dune::TypeTree::LeafNodeTag │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +Definition: nodetags.hh:16 │ │ │ │ │ +Dune::TypeTree::PowerNodeTag │ │ │ │ │ +Tag designating a power node. │ │ │ │ │ +Definition: nodetags.hh:19 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ +Tag designating a power node with runtime degree. │ │ │ │ │ +Definition: nodetags.hh:22 │ │ │ │ │ +Dune::TypeTree::CompositeNodeTag │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +Definition: nodetags.hh:25 │ │ │ │ │ +Dune::TypeTree::ProxyNode │ │ │ │ │ +Base class for nodes acting as a proxy for an existing node. │ │ │ │ │ +Definition: proxynode.hh:253 │ │ │ │ │ +Dune::TypeTree::ProxyNode::ProxyNode │ │ │ │ │ +ProxyNode(Node &node) │ │ │ │ │ +Definition: proxynode.hh:342 │ │ │ │ │ +Dune::TypeTree::ProxyNode::NodeTag │ │ │ │ │ +Dune::TypeTree::NodeTag< Node > NodeTag │ │ │ │ │ +Definition: proxynode.hh:270 │ │ │ │ │ +Dune::TypeTree::ProxyNode::isComposite │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a composite in the dune-typetree. │ │ │ │ │ +Definition: proxynode.hh:279 │ │ │ │ │ +Dune::TypeTree::ProxyNode::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +Definition: proxynode.hh:273 │ │ │ │ │ +Dune::TypeTree::ProxyNode::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +Definition: proxynode.hh:276 │ │ │ │ │ +Dune::TypeTree::ProxyNode::degree │ │ │ │ │ +auto degree() const │ │ │ │ │ +Definition: proxynode.hh:298 │ │ │ │ │ +Dune::TypeTree::ProxyNode::proxiedNode │ │ │ │ │ +std::enable_if< enabled, Node & >::type proxiedNode() │ │ │ │ │ +Returns the proxied node. │ │ │ │ │ +Definition: proxynode.hh:312 │ │ │ │ │ +Dune::TypeTree::ProxyNode::CHILDREN │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +Definition: proxynode.hh:283 │ │ │ │ │ +Dune::TypeTree::ProxyNode::proxiedNodeStorage │ │ │ │ │ +std::shared_ptr< const Node > proxiedNodeStorage() const │ │ │ │ │ +Returns the storage of the proxied node (const version). │ │ │ │ │ +Definition: proxynode.hh:332 │ │ │ │ │ +Dune::TypeTree::ProxyNode::ProxiedNode │ │ │ │ │ +Node ProxiedNode │ │ │ │ │ +Definition: proxynode.hh:268 │ │ │ │ │ +Dune::TypeTree::ProxyNode::proxiedNodeStorage │ │ │ │ │ +std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage() │ │ │ │ │ +Returns the storage of the proxied node. │ │ │ │ │ +Definition: proxynode.hh:326 │ │ │ │ │ +Dune::TypeTree::ProxyNode::degree │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +Definition: proxynode.hh:291 │ │ │ │ │ +Dune::TypeTree::ProxyNode::ProxyNode │ │ │ │ │ +ProxyNode(std::shared_ptr< Node > node) │ │ │ │ │ +Definition: proxynode.hh:346 │ │ │ │ │ +Dune::TypeTree::ProxyNode::proxiedNode │ │ │ │ │ +const Node & proxiedNode() const │ │ │ │ │ +Returns the proxied node (const version). │ │ │ │ │ +Definition: proxynode.hh:318 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors │ │ │ │ │ +Mixin class providing methods for child access with compile-time parameter. │ │ │ │ │ +Definition: proxynode.hh:28 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::child │ │ │ │ │ +auto & child(index_constant< k >={}) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +Definition: proxynode.hh:69 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::setChild │ │ │ │ │ +void setChild(ProxyChild &&child, typename std::enable_if< lazy_enabled< k >:: │ │ │ │ │ +value, void * >::type=0) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +Definition: proxynode.hh:110 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::nodeStorage │ │ │ │ │ +const ProxiedNode::NodeStorage & nodeStorage() const │ │ │ │ │ +Definition: proxynode.hh:115 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::childStorage │ │ │ │ │ +auto childStorage(index_constant< k >={}) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +Definition: proxynode.hh:90 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::child │ │ │ │ │ +const auto & child(index_constant< k >={}) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +Definition: proxynode.hh:79 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::childStorage │ │ │ │ │ +auto childStorage(index_constant< k >={}) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +Definition: proxynode.hh:103 │ │ │ │ │ +Dune::TypeTree::StaticChildAccessors::Child │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +Definition: proxynode.hh:58 │ │ │ │ │ +Dune::TypeTree::DynamicChildAccessors │ │ │ │ │ +Mixin class providing methods for child access with run-time parameter. │ │ │ │ │ +Definition: proxynode.hh:131 │ │ │ │ │ +Dune::TypeTree::DynamicChildAccessors::child │ │ │ │ │ +auto & child(std::size_t i) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +Definition: proxynode.hh:160 │ │ │ │ │ +Dune::TypeTree::DynamicChildAccessors::childStorage │ │ │ │ │ +auto childStorage(std::size_t i) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +Definition: proxynode.hh:192 │ │ │ │ │ +Dune::TypeTree::DynamicChildAccessors::setChild │ │ │ │ │ +void setChild(std::size_t i, ProxyChild &&child, typename std::enable_if< │ │ │ │ │ +enabled, void * >::type=0) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +Definition: proxynode.hh:199 │ │ │ │ │ +Dune::TypeTree::DynamicChildAccessors::child │ │ │ │ │ +const auto & child(std::size_t i) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +Definition: proxynode.hh:169 │ │ │ │ │ +Dune::TypeTree::DynamicChildAccessors::childStorage │ │ │ │ │ +auto childStorage(std::size_t i) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +Definition: proxynode.hh:180 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase │ │ │ │ │ +Tag-based dispatch to appropriate base class that provides necessary │ │ │ │ │ +functionality. │ │ │ │ │ +Definition: proxynode.hh:208 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>::NodeStorage │ │ │ │ │ +Node::NodeStorage NodeStorage │ │ │ │ │ +Definition: proxynode.hh:222 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>::ChildTypes │ │ │ │ │ +Node::ChildTypes ChildTypes │ │ │ │ │ +Definition: proxynode.hh:221 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>::NodeStorage │ │ │ │ │ +Node::NodeStorage NodeStorage │ │ │ │ │ +Definition: proxynode.hh:231 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>::ChildType │ │ │ │ │ +Node::ChildType ChildType │ │ │ │ │ +Definition: proxynode.hh:230 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>::NodeStorage │ │ │ │ │ +Node::NodeStorage NodeStorage │ │ │ │ │ +Definition: proxynode.hh:240 │ │ │ │ │ +Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>::ChildType │ │ │ │ │ +Node::ChildType ChildType │ │ │ │ │ +Definition: proxynode.hh:239 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: pairtraversal.hh File Reference │ │ │ │ +dune-typetree: compositenode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,46 +63,43 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
pairtraversal.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
compositenode.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/std/type_traits.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ -#include <dune/typetree/visitor.hh>
│ │ │ │ -#include <dune/typetree/traversal.hh>
│ │ │ │ +
#include <tuple>
│ │ │ │ +#include <memory>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/childextraction.hh>
│ │ │ │ +#include <dune/typetree/typetraits.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  Dune::TypeTree::CompositeNode< Children >
 Base class for composite nodes based on variadic templates. More...
 
struct  Dune::TypeTree::CompositeNode< Children >::Child< k >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Detail
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<class T1 , class T2 , class TreePath , class V , std::enable_if_t<(std::decay_t< T1 >::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0>
void Dune::TypeTree::Detail::applyToTreePair (T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)
 
template<typename Tree1 , typename Tree2 , typename Visitor >
void Dune::TypeTree::applyToTreePair (Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)
 Apply visitor to a pair of TypeTrees. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,37 +4,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -pairtraversal.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +compositenode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ + class  Dune::TypeTree::CompositeNode<_Children_> │ │ │ │ │ +  Base class for composite nodes based on variadic templates. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::CompositeNode<_Children_>::Child<_k_> │ │ │ │ │ +  Access to the type and storage type of the i-th child. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::Detail │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0> │ │ │ │ │ -void Dune::TypeTree::Detail::applyToTreePair (T1 &&tree1, T2 &&tree2, TreePath │ │ │ │ │ - treePath, V &&visitor) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::TypeTree::applyToTreePair (Tree1 &&tree1, Tree2 &&tree2, Visitor │ │ │ │ │ - &&visitor) │ │ │ │ │ -  Apply visitor to a pair of TypeTrees. More... │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: pairtraversal.hh Source File │ │ │ │ +dune-typetree: compositenode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,146 +62,237 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
pairtraversal.hh
│ │ │ │ +
compositenode.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │ -
5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │
6
│ │ │ │ -
7#include <dune/common/std/type_traits.hh>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
7#include <tuple>
│ │ │ │ +
8#include <memory>
│ │ │ │ +
9#include <type_traits>
│ │ │ │ +
10
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
14
│ │ │ │
15namespace Dune {
│ │ │ │
16 namespace TypeTree {
│ │ │ │
17
│ │ │ │ -
23 namespace Detail {
│ │ │ │ -
24
│ │ │ │ -
25 /* The signature is the same as for the public applyToTreePair
│ │ │ │ -
26 * function in Dune::Typtree, despite the additionally passed
│ │ │ │ -
27 * treePath argument. The path passed here is associated to
│ │ │ │ -
28 * the tree and the relative paths of the children (wrt. to tree)
│ │ │ │ -
29 * are appended to this. Hence the behavior of the public function
│ │ │ │ -
30 * is resembled by passing an empty treePath.
│ │ │ │ -
31 */
│ │ │ │ +
24 template<typename... Children>
│ │ │ │ + │ │ │ │ +
26 {
│ │ │ │ +
27
│ │ │ │ +
28 public:
│ │ │ │ +
29
│ │ │ │ + │ │ │ │
32
│ │ │ │ -
33 /*
│ │ │ │ -
34 * This is the overload for leaf traversal
│ │ │ │ -
35 */
│ │ │ │ -
36 template<class T1, class T2, class TreePath, class V,
│ │ │ │ -
37 std::enable_if_t<(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
│ │ │ │ -
38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
│ │ │ │ -
39 {
│ │ │ │ -
40 visitor.leaf(tree1, tree2, treePath);
│ │ │ │ -
41 }
│ │ │ │ -
42
│ │ │ │ -
43 /*
│ │ │ │ -
44 * This is the general overload doing static child traversal.
│ │ │ │ -
45 */
│ │ │ │ -
46 template<class T1, class T2, class TreePath, class V,
│ │ │ │ -
47 std::enable_if_t<not(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
│ │ │ │ -
48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
│ │ │ │ -
49 {
│ │ │ │ -
50 // Do we really want to take care for const-ness of the Tree
│ │ │ │ -
51 // when instanciating VisitChild below? I'd rather expect this:
│ │ │ │ -
52 // using Tree1 = std::decay_t<T1>;
│ │ │ │ -
53 // using Tree2 = std::decay_t<T2>;
│ │ │ │ -
54 // using Visitor = std::decay_t<V>;
│ │ │ │ -
55 using Tree1 = std::remove_reference_t<T1>;
│ │ │ │ -
56 using Tree2 = std::remove_reference_t<T2>;
│ │ │ │ -
57 using Visitor = std::remove_reference_t<V>;
│ │ │ │ -
58 visitor.pre(tree1, tree2, treePath);
│ │ │ │ -
59
│ │ │ │ -
60 // check which type of traversal is supported by the trees
│ │ │ │ -
61 using allowDynamicTraversal = std::conjunction<
│ │ │ │ -
62 Dune::Std::is_detected<DynamicTraversalConcept,Tree1>,
│ │ │ │ -
63 Dune::Std::is_detected<DynamicTraversalConcept,Tree2>>;
│ │ │ │ -
64 using allowStaticTraversal = std::conjunction<
│ │ │ │ -
65 Dune::Std::is_detected<StaticTraversalConcept,Tree1>,
│ │ │ │ -
66 Dune::Std::is_detected<StaticTraversalConcept,Tree2>>;
│ │ │ │ -
67
│ │ │ │ -
68 // both trees must support either dynamic or static traversal
│ │ │ │ -
69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ -
70
│ │ │ │ -
71 // the visitor may specify preferred dynamic traversal
│ │ │ │ -
72 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
│ │ │ │ -
73
│ │ │ │ -
74 // create a dynamic or static index range
│ │ │ │ -
75 auto indices = [&]{
│ │ │ │ -
76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
│ │ │ │ -
77 return Dune::range(std::size_t(tree1.degree()));
│ │ │ │ -
78 else
│ │ │ │ -
79 return Dune::range(tree1.degree());
│ │ │ │ -
80 }();
│ │ │ │ -
81
│ │ │ │ -
82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
│ │ │ │ -
83 Dune::Hybrid::forEach(indices, [&](auto i) {
│ │ │ │ -
84 auto&& child1 = tree1.child(i);
│ │ │ │ -
85 auto&& child2 = tree2.child(i);
│ │ │ │ -
86 using Child1 = std::decay_t<decltype(child1)>;
│ │ │ │ -
87 using Child2 = std::decay_t<decltype(child2)>;
│ │ │ │ -
88
│ │ │ │ -
89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i);
│ │ │ │ -
90
│ │ │ │ -
91 // This requires that visitor.in(...) can always be instantiated,
│ │ │ │ -
92 // even if there's a single child only.
│ │ │ │ -
93 if (i>0)
│ │ │ │ -
94 visitor.in(tree1, tree2, treePath);
│ │ │ │ -
95
│ │ │ │ -
96 constexpr bool visitChild = Visitor::template VisitChild<Tree1,Child1,Tree2,Child2,TreePath>::value;
│ │ │ │ -
97 if constexpr(visitChild) {
│ │ │ │ -
98 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ -
99 applyToTreePair(child1, child2, childTreePath, visitor);
│ │ │ │ -
100 }
│ │ │ │ -
101
│ │ │ │ -
102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i);
│ │ │ │ -
103 });
│ │ │ │ -
104 }
│ │ │ │ -
105 visitor.post(tree1, tree2, treePath);
│ │ │ │ -
106 }
│ │ │ │ -
107
│ │ │ │ -
108 } // namespace Detail
│ │ │ │ -
109
│ │ │ │ -
111
│ │ │ │ -
125 template<typename Tree1, typename Tree2, typename Visitor>
│ │ │ │ -
126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor)
│ │ │ │ -
127 {
│ │ │ │ -
128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor);
│ │ │ │ -
129 }
│ │ │ │ -
130
│ │ │ │ -
132
│ │ │ │ -
133 } // namespace TypeTree
│ │ │ │ -
134} //namespace Dune
│ │ │ │ -
135
│ │ │ │ -
136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)
Apply visitor to a pair of TypeTrees.
Definition: pairtraversal.hh:126
│ │ │ │ -
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ -
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ -
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ -
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │ +
34 typedef std::tuple<std::shared_ptr<Children>... > NodeStorage;
│ │ │ │ +
35
│ │ │ │ +
37 typedef std::tuple<Children...> ChildTypes;
│ │ │ │ +
38
│ │ │ │ +
40 static const bool isLeaf = false;
│ │ │ │ +
41
│ │ │ │ +
43 static const bool isPower = false;
│ │ │ │ +
44
│ │ │ │ +
46 static const bool isComposite = true;
│ │ │ │ +
47
│ │ │ │ +
49 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ +
50 static const std::size_t CHILDREN = sizeof...(Children);
│ │ │ │ +
51
│ │ │ │ +
52 static constexpr auto degree ()
│ │ │ │ +
53 {
│ │ │ │ +
54 return std::integral_constant<std::size_t,sizeof...(Children)>{};
│ │ │ │ +
55 }
│ │ │ │ +
56
│ │ │ │ +
58 template<std::size_t k>
│ │ │ │ +
59 struct Child {
│ │ │ │ +
60
│ │ │ │ +
61 static_assert((k < degree()), "child index out of range");
│ │ │ │ +
62
│ │ │ │ +
64 typedef typename std::tuple_element<k,ChildTypes>::type Type;
│ │ │ │ +
65
│ │ │ │ +
67 typedef typename std::tuple_element<k,ChildTypes>::type type;
│ │ │ │ +
68 };
│ │ │ │ +
69
│ │ │ │ +
72
│ │ │ │ +
74
│ │ │ │ +
77 template<std::size_t k>
│ │ │ │ +
78 typename Child<k>::Type& child (index_constant<k> = {})
│ │ │ │ +
79 {
│ │ │ │ +
80 return *std::get<k>(_children);
│ │ │ │ +
81 }
│ │ │ │ +
82
│ │ │ │ +
84
│ │ │ │ +
87 template<std::size_t k>
│ │ │ │ +
88 const typename Child<k>::Type& child (index_constant<k> = {}) const
│ │ │ │ +
89 {
│ │ │ │ +
90 return *std::get<k>(_children);
│ │ │ │ +
91 }
│ │ │ │ +
92
│ │ │ │ +
94
│ │ │ │ +
97 template<std::size_t k>
│ │ │ │ + │ │ │ │ +
99 {
│ │ │ │ +
100 return std::get<k>(_children);
│ │ │ │ +
101 }
│ │ │ │ +
102
│ │ │ │ +
104
│ │ │ │ +
107 template<std::size_t k>
│ │ │ │ + │ │ │ │ +
109 {
│ │ │ │ +
110 return std::get<k>(_children);
│ │ │ │ +
111 }
│ │ │ │ +
112
│ │ │ │ +
114 template<std::size_t k>
│ │ │ │ +
115 void setChild (typename Child<k>::Type& child, index_constant<k> = {})
│ │ │ │ +
116 {
│ │ │ │ +
117 std::get<k>(_children) = stackobject_to_shared_ptr(child);
│ │ │ │ +
118 }
│ │ │ │ +
119
│ │ │ │ +
121 template<std::size_t k>
│ │ │ │ +
122 void setChild (typename Child<k>::Type&& child, index_constant<k> = {})
│ │ │ │ +
123 {
│ │ │ │ +
124 std::get<k>(_children) = convert_arg(std::move(child));
│ │ │ │ +
125 }
│ │ │ │ +
126
│ │ │ │ +
128 template<std::size_t k>
│ │ │ │ +
129 void setChild (std::shared_ptr<typename Child<k>::Type> child, index_constant<k> = {})
│ │ │ │ +
130 {
│ │ │ │ +
131 std::get<k>(_children) = std::move(child);
│ │ │ │ +
132 }
│ │ │ │ +
133
│ │ │ │ +
134 const NodeStorage& nodeStorage () const
│ │ │ │ +
135 {
│ │ │ │ +
136 return _children;
│ │ │ │ +
137 }
│ │ │ │ +
138
│ │ │ │ +
140
│ │ │ │ +
143
│ │ │ │ +
144 // The following two methods require a little bit of SFINAE trickery to work correctly:
│ │ │ │ +
145 // We have to make sure that they don't shadow the methods for direct child access because
│ │ │ │ +
146 // those get called by the generic child() machinery. If that machinery picks up the methods
│ │ │ │ +
147 // defined below, we have an infinite recursion.
│ │ │ │ +
148 // So the methods make sure that either
│ │ │ │ +
149 //
│ │ │ │ +
150 // * there are more than one argument. In that case, we got multiple indices and can forward
│ │ │ │ +
151 // to the general machine.
│ │ │ │ +
152 //
│ │ │ │ +
153 // * the first argument is not a valid flat index, i.e. either a std::size_t or an index_constant.
│ │ │ │ +
154 // The argument thus has to be some kind of TreePath instance that we can also pass to the
│ │ │ │ +
155 // generic machine.
│ │ │ │ +
156 //
│ │ │ │ +
157 // The above SFINAE logic works, but there is still a problem with the return type deduction.
│ │ │ │ +
158 // We have to do a lazy lookup of the return type after SFINAE has succeeded, otherwise the return
│ │ │ │ +
159 // type deduction will trigger the infinite recursion.
│ │ │ │ +
160
│ │ │ │ +
162
│ │ │ │ +
166#ifdef DOXYGEN
│ │ │ │ +
167 template<typename... Indices>
│ │ │ │ +
168 ImplementationDefined& child (Indices... indices)
│ │ │ │ +
169#else
│ │ │ │ +
170 template<typename I0, typename... I,
│ │ │ │ +
171 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ +
172 decltype(auto) child (I0 i0, I... i)
│ │ │ │ +
173#endif
│ │ │ │ +
174 {
│ │ │ │ +
175 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ +
176 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ +
177 );
│ │ │ │ +
178 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ +
179 }
│ │ │ │ +
180
│ │ │ │ +
182
│ │ │ │ +
186#ifdef DOXYGEN
│ │ │ │ +
187 template<typename... Indices>
│ │ │ │ +
188 const ImplementationDefined& child (Indices... indices)
│ │ │ │ +
189#else
│ │ │ │ +
190 template<typename I0, typename... I,
│ │ │ │ +
191 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ +
192 decltype(auto) child (I0 i0, I... i) const
│ │ │ │ +
193#endif
│ │ │ │ +
194 {
│ │ │ │ +
195 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ +
196 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ +
197 );
│ │ │ │ +
198 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ +
199 }
│ │ │ │ +
200
│ │ │ │ +
202
│ │ │ │ +
203 protected:
│ │ │ │ +
204
│ │ │ │ +
207
│ │ │ │ +
209
│ │ │ │ + │ │ │ │ +
217 {}
│ │ │ │ +
218
│ │ │ │ +
220 template<typename... Args, typename = typename std::enable_if<(sizeof...(Args) == degree())>::type>
│ │ │ │ +
221 CompositeNode (Args&&... args)
│ │ │ │ +
222 : _children(convert_arg(std::forward<Args>(args))...)
│ │ │ │ +
223 {}
│ │ │ │ +
224
│ │ │ │ +
226 CompositeNode (std::shared_ptr<Children>... children)
│ │ │ │ +
227 : _children(std::move(children)...)
│ │ │ │ +
228 {}
│ │ │ │ +
229
│ │ │ │ +
231 CompositeNode (const NodeStorage& children)
│ │ │ │ +
232 : _children(children)
│ │ │ │ +
233 {}
│ │ │ │ +
234
│ │ │ │ +
236
│ │ │ │ +
237 private:
│ │ │ │ +
238 NodeStorage _children;
│ │ │ │ +
239 };
│ │ │ │ +
240
│ │ │ │ +
242
│ │ │ │ +
243 } // namespace TypeTree
│ │ │ │ +
244} //namespace Dune
│ │ │ │ +
245
│ │ │ │ +
246#endif // DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)
Definition: pairtraversal.hh:38
│ │ │ │ -
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ +
Type
Definition: treepath.hh:30
│ │ │ │ +
Base class for composite nodes based on variadic templates.
Definition: compositenode.hh:26
│ │ │ │ +
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: compositenode.hh:40
│ │ │ │ +
ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: compositenode.hh:168
│ │ │ │ +
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: compositenode.hh:46
│ │ │ │ +
static const std::size_t CHILDREN
The number of children.
Definition: compositenode.hh:50
│ │ │ │ +
CompositeNode()
Default constructor.
Definition: compositenode.hh:216
│ │ │ │ +
CompositeNodeTag NodeTag
The type tag that describes a CompositeNode.
Definition: compositenode.hh:31
│ │ │ │ +
void setChild(typename Child< k >::Type &child, index_constant< k >={})
Sets the k-th child to the passed-in value.
Definition: compositenode.hh:115
│ │ │ │ +
void setChild(typename Child< k >::Type &&child, index_constant< k >={})
Store the passed value in k-th child.
Definition: compositenode.hh:122
│ │ │ │ +
static constexpr auto degree()
Definition: compositenode.hh:52
│ │ │ │ +
const NodeStorage & nodeStorage() const
Definition: compositenode.hh:134
│ │ │ │ +
CompositeNode(std::shared_ptr< Children >... children)
Initialize the CompositeNode with copies of the passed in Storage objects.
Definition: compositenode.hh:226
│ │ │ │ +
std::shared_ptr< typename Child< k >::Type > childStorage(index_constant< k >={})
Returns the storage of the k-th child.
Definition: compositenode.hh:98
│ │ │ │ +
std::tuple< Children... > ChildTypes
A tuple storing the types of all children.
Definition: compositenode.hh:37
│ │ │ │ +
void setChild(std::shared_ptr< typename Child< k >::Type > child, index_constant< k >={})
Sets the storage of the k-th child to the passed-in value.
Definition: compositenode.hh:129
│ │ │ │ +
const ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: compositenode.hh:188
│ │ │ │ +
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: compositenode.hh:43
│ │ │ │ +
std::shared_ptr< const typename Child< k >::Type > childStorage(index_constant< k >={}) const
Returns the storage of the k-th child (const version).
Definition: compositenode.hh:108
│ │ │ │ +
Child< k >::Type & child(index_constant< k >={})
Returns the k-th child.
Definition: compositenode.hh:78
│ │ │ │ +
CompositeNode(const NodeStorage &children)
Initialize the CompositeNode with a copy of the passed-in storage type.
Definition: compositenode.hh:231
│ │ │ │ +
std::tuple< std::shared_ptr< Children >... > NodeStorage
The type used for storing the children.
Definition: compositenode.hh:34
│ │ │ │ +
const Child< k >::Type & child(index_constant< k >={}) const
Returns the k-th child (const version).
Definition: compositenode.hh:88
│ │ │ │ +
Access to the type and storage type of the i-th child.
Definition: compositenode.hh:59
│ │ │ │ +
std::tuple_element< k, ChildTypes >::type Type
The type of the child.
Definition: compositenode.hh:64
│ │ │ │ +
std::tuple_element< k, ChildTypes >::type type
The type of the child.
Definition: compositenode.hh:67
│ │ │ │ +
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │ +
Check if type represents a tree path.
Definition: typetraits.hh:182
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,167 +4,331 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -pairtraversal.hh │ │ │ │ │ +compositenode.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ 14 │ │ │ │ │ 15namespace Dune { │ │ │ │ │ 16 namespace TypeTree { │ │ │ │ │ 17 │ │ │ │ │ -23 namespace Detail { │ │ │ │ │ - 24 │ │ │ │ │ - 25 /* The signature is the same as for the public applyToTreePair │ │ │ │ │ - 26 * function in Dune::Typtree, despite the additionally passed │ │ │ │ │ - 27 * treePath argument. The path passed here is associated to │ │ │ │ │ - 28 * the tree and the relative paths of the children (wrt. to tree) │ │ │ │ │ - 29 * are appended to this. Hence the behavior of the public function │ │ │ │ │ - 30 * is resembled by passing an empty treePath. │ │ │ │ │ - 31 */ │ │ │ │ │ + 24 template │ │ │ │ │ +25 class CompositeNode │ │ │ │ │ + 26 { │ │ │ │ │ + 27 │ │ │ │ │ + 28 public: │ │ │ │ │ + 29 │ │ │ │ │ +31 typedef CompositeNodeTag NodeTag; │ │ │ │ │ 32 │ │ │ │ │ - 33 /* │ │ │ │ │ - 34 * This is the overload for leaf traversal │ │ │ │ │ - 35 */ │ │ │ │ │ - 36 template::isLeaf or std::decay_t::isLeaf), │ │ │ │ │ -int> = 0> │ │ │ │ │ -38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor) │ │ │ │ │ - 39 { │ │ │ │ │ - 40 visitor.leaf(tree1, tree2, treePath); │ │ │ │ │ - 41 } │ │ │ │ │ - 42 │ │ │ │ │ - 43 /* │ │ │ │ │ - 44 * This is the general overload doing static child traversal. │ │ │ │ │ - 45 */ │ │ │ │ │ - 46 template::isLeaf or std::decay_t::isLeaf), │ │ │ │ │ -int> = 0> │ │ │ │ │ - 48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& │ │ │ │ │ -visitor) │ │ │ │ │ - 49 { │ │ │ │ │ - 50 // Do we really want to take care for const-ness of the Tree │ │ │ │ │ - 51 // when instanciating VisitChild below? I'd rather expect this: │ │ │ │ │ - 52 // using Tree1 = std::decay_t; │ │ │ │ │ - 53 // using Tree2 = std::decay_t; │ │ │ │ │ - 54 // using Visitor = std::decay_t; │ │ │ │ │ - 55 using Tree1 = std::remove_reference_t; │ │ │ │ │ - 56 using Tree2 = std::remove_reference_t; │ │ │ │ │ - 57 using Visitor = std::remove_reference_t; │ │ │ │ │ - 58 visitor.pre(tree1, tree2, treePath); │ │ │ │ │ - 59 │ │ │ │ │ - 60 // check which type of traversal is supported by the trees │ │ │ │ │ - 61 using allowDynamicTraversal = std::conjunction< │ │ │ │ │ - 62 Dune::Std::is_detected, │ │ │ │ │ - 63 Dune::Std::is_detected>; │ │ │ │ │ - 64 using allowStaticTraversal = std::conjunction< │ │ │ │ │ - 65 Dune::Std::is_detected, │ │ │ │ │ - 66 Dune::Std::is_detected>; │ │ │ │ │ - 67 │ │ │ │ │ - 68 // both trees must support either dynamic or static traversal │ │ │ │ │ - 69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value); │ │ │ │ │ - 70 │ │ │ │ │ - 71 // the visitor may specify preferred dynamic traversal │ │ │ │ │ - 72 using preferDynamicTraversal = std::bool_constant; │ │ │ │ │ - 73 │ │ │ │ │ - 74 // create a dynamic or static index range │ │ │ │ │ - 75 auto indices = [&]{ │ │ │ │ │ - 76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value) │ │ │ │ │ - 77 return Dune::range(std::size_t(tree1.degree())); │ │ │ │ │ - 78 else │ │ │ │ │ - 79 return Dune::range(tree1.degree()); │ │ │ │ │ - 80 }(); │ │ │ │ │ - 81 │ │ │ │ │ - 82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) { │ │ │ │ │ - 83 Dune::Hybrid::forEach(indices, [&](auto i) { │ │ │ │ │ - 84 auto&& child1 = tree1.child(i); │ │ │ │ │ - 85 auto&& child2 = tree2.child(i); │ │ │ │ │ - 86 using Child1 = std::decay_t; │ │ │ │ │ - 87 using Child2 = std::decay_t; │ │ │ │ │ - 88 │ │ │ │ │ - 89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i); │ │ │ │ │ - 90 │ │ │ │ │ - 91 // This requires that visitor.in(...) can always be instantiated, │ │ │ │ │ - 92 // even if there's a single child only. │ │ │ │ │ - 93 if (i>0) │ │ │ │ │ - 94 visitor.in(tree1, tree2, treePath); │ │ │ │ │ - 95 │ │ │ │ │ - 96 constexpr bool visitChild = Visitor::template │ │ │ │ │ -VisitChild::value; │ │ │ │ │ - 97 if constexpr(visitChild) { │ │ │ │ │ - 98 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ - 99 applyToTreePair(child1, child2, childTreePath, visitor); │ │ │ │ │ - 100 } │ │ │ │ │ - 101 │ │ │ │ │ - 102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i); │ │ │ │ │ - 103 }); │ │ │ │ │ - 104 } │ │ │ │ │ - 105 visitor.post(tree1, tree2, treePath); │ │ │ │ │ - 106 } │ │ │ │ │ - 107 │ │ │ │ │ - 108 } // namespace Detail │ │ │ │ │ - 109 │ │ │ │ │ - 111 │ │ │ │ │ - 125 template │ │ │ │ │ -126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor) │ │ │ │ │ - 127 { │ │ │ │ │ - 128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor); │ │ │ │ │ - 129 } │ │ │ │ │ - 130 │ │ │ │ │ - 132 │ │ │ │ │ - 133 } // namespace TypeTree │ │ │ │ │ - 134} //namespace Dune │ │ │ │ │ - 135 │ │ │ │ │ - 136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ +34 typedef std::tuple... > NodeStorage; │ │ │ │ │ + 35 │ │ │ │ │ +37 typedef std::tuple ChildTypes; │ │ │ │ │ + 38 │ │ │ │ │ +40 static const bool isLeaf = false; │ │ │ │ │ + 41 │ │ │ │ │ +43 static const bool isPower = false; │ │ │ │ │ + 44 │ │ │ │ │ +46 static const bool isComposite = true; │ │ │ │ │ + 47 │ │ │ │ │ + 49 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +50 static const std::size_t CHILDREN = sizeof...(Children); │ │ │ │ │ + 51 │ │ │ │ │ +52 static constexpr auto degree () │ │ │ │ │ + 53 { │ │ │ │ │ + 54 return std::integral_constant{}; │ │ │ │ │ + 55 } │ │ │ │ │ + 56 │ │ │ │ │ + 58 template │ │ │ │ │ +59 struct Child { │ │ │ │ │ + 60 │ │ │ │ │ + 61 static_assert((k < degree()), "child index out of range"); │ │ │ │ │ + 62 │ │ │ │ │ +64 typedef typename std::tuple_element::type Type; │ │ │ │ │ + 65 │ │ │ │ │ +67 typedef typename std::tuple_element::type type; │ │ │ │ │ + 68 }; │ │ │ │ │ + 69 │ │ │ │ │ + 72 │ │ │ │ │ + 74 │ │ │ │ │ + 77 template │ │ │ │ │ +78 typename Child::Type& child (index_constant = {}) │ │ │ │ │ + 79 { │ │ │ │ │ + 80 return *std::get(_children); │ │ │ │ │ + 81 } │ │ │ │ │ + 82 │ │ │ │ │ + 84 │ │ │ │ │ + 87 template │ │ │ │ │ +88 const typename Child::Type& child (index_constant = {}) const │ │ │ │ │ + 89 { │ │ │ │ │ + 90 return *std::get(_children); │ │ │ │ │ + 91 } │ │ │ │ │ + 92 │ │ │ │ │ + 94 │ │ │ │ │ + 97 template │ │ │ │ │ +98 std::shared_ptr::Type> childStorage (index_constant = │ │ │ │ │ +{}) │ │ │ │ │ + 99 { │ │ │ │ │ + 100 return std::get(_children); │ │ │ │ │ + 101 } │ │ │ │ │ + 102 │ │ │ │ │ + 104 │ │ │ │ │ + 107 template │ │ │ │ │ +108 std::shared_ptr::Type> childStorage │ │ │ │ │ +(index_constant = {}) const │ │ │ │ │ + 109 { │ │ │ │ │ + 110 return std::get(_children); │ │ │ │ │ + 111 } │ │ │ │ │ + 112 │ │ │ │ │ + 114 template │ │ │ │ │ +115 void setChild (typename Child::Type& child, index_constant = {}) │ │ │ │ │ + 116 { │ │ │ │ │ + 117 std::get(_children) = stackobject_to_shared_ptr(child); │ │ │ │ │ + 118 } │ │ │ │ │ + 119 │ │ │ │ │ + 121 template │ │ │ │ │ +122 void setChild (typename Child::Type&& child, index_constant = {}) │ │ │ │ │ + 123 { │ │ │ │ │ + 124 std::get(_children) = convert_arg(std::move(child)); │ │ │ │ │ + 125 } │ │ │ │ │ + 126 │ │ │ │ │ + 128 template │ │ │ │ │ +129 void setChild (std::shared_ptr::Type> child, │ │ │ │ │ +index_constant = {}) │ │ │ │ │ + 130 { │ │ │ │ │ + 131 std::get(_children) = std::move(child); │ │ │ │ │ + 132 } │ │ │ │ │ + 133 │ │ │ │ │ +134 const NodeStorage& nodeStorage () const │ │ │ │ │ + 135 { │ │ │ │ │ + 136 return _children; │ │ │ │ │ + 137 } │ │ │ │ │ + 138 │ │ │ │ │ + 140 │ │ │ │ │ + 143 │ │ │ │ │ + 144 // The following two methods require a little bit of SFINAE trickery to │ │ │ │ │ +work correctly: │ │ │ │ │ + 145 // We have to make sure that they don't shadow the methods for direct │ │ │ │ │ +child access because │ │ │ │ │ + 146 // those get called by the generic child() machinery. If that machinery │ │ │ │ │ +picks up the methods │ │ │ │ │ + 147 // defined below, we have an infinite recursion. │ │ │ │ │ + 148 // So the methods make sure that either │ │ │ │ │ + 149 // │ │ │ │ │ + 150 // * there are more than one argument. In that case, we got multiple │ │ │ │ │ +indices and can forward │ │ │ │ │ + 151 // to the general machine. │ │ │ │ │ + 152 // │ │ │ │ │ + 153 // * the first argument is not a valid flat index, i.e. either a std:: │ │ │ │ │ +size_t or an index_constant. │ │ │ │ │ + 154 // The argument thus has to be some kind of TreePath instance that we can │ │ │ │ │ +also pass to the │ │ │ │ │ + 155 // generic machine. │ │ │ │ │ + 156 // │ │ │ │ │ + 157 // The above SFINAE logic works, but there is still a problem with the │ │ │ │ │ +return type deduction. │ │ │ │ │ + 158 // We have to do a lazy lookup of the return type after SFINAE has │ │ │ │ │ +succeeded, otherwise the return │ │ │ │ │ + 159 // type deduction will trigger the infinite recursion. │ │ │ │ │ + 160 │ │ │ │ │ + 162 │ │ │ │ │ + 166#ifdef DOXYGEN │ │ │ │ │ + 167 template │ │ │ │ │ +168 ImplementationDefined& child (Indices... indices) │ │ │ │ │ + 169#else │ │ │ │ │ + 170 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ + 172 decltype(auto) child (I0 i0, I... i) │ │ │ │ │ + 173#endif │ │ │ │ │ + 174 { │ │ │ │ │ + 175 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ + 176 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ +the freestanding version child(node,treePath) instead." │ │ │ │ │ + 177 ); │ │ │ │ │ + 178 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ + 179 } │ │ │ │ │ + 180 │ │ │ │ │ + 182 │ │ │ │ │ + 186#ifdef DOXYGEN │ │ │ │ │ + 187 template │ │ │ │ │ +188 const ImplementationDefined& child (Indices... indices) │ │ │ │ │ + 189#else │ │ │ │ │ + 190 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ + 192 decltype(auto) child (I0 i0, I... i) const │ │ │ │ │ + 193#endif │ │ │ │ │ + 194 { │ │ │ │ │ + 195 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ + 196 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ +the freestanding version child(node,treePath) instead." │ │ │ │ │ + 197 ); │ │ │ │ │ + 198 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ + 199 } │ │ │ │ │ + 200 │ │ │ │ │ + 202 │ │ │ │ │ + 203 protected: │ │ │ │ │ + 204 │ │ │ │ │ + 207 │ │ │ │ │ + 209 │ │ │ │ │ +216 CompositeNode () │ │ │ │ │ + 217 {} │ │ │ │ │ + 218 │ │ │ │ │ + 220 template::type> │ │ │ │ │ +221 CompositeNode (Args&&... args) │ │ │ │ │ + 222 : _children(convert_arg(std::forward(args))...) │ │ │ │ │ + 223 {} │ │ │ │ │ + 224 │ │ │ │ │ +226 CompositeNode (std::shared_ptr... children) │ │ │ │ │ + 227 : _children(std::move(children)...) │ │ │ │ │ + 228 {} │ │ │ │ │ + 229 │ │ │ │ │ +231 CompositeNode (const NodeStorage& children) │ │ │ │ │ + 232 : _children(children) │ │ │ │ │ + 233 {} │ │ │ │ │ + 234 │ │ │ │ │ + 236 │ │ │ │ │ + 237 private: │ │ │ │ │ + 238 NodeStorage _children; │ │ │ │ │ + 239 }; │ │ │ │ │ + 240 │ │ │ │ │ + 242 │ │ │ │ │ + 243 } // namespace TypeTree │ │ │ │ │ + 244} //namespace Dune │ │ │ │ │ + 245 │ │ │ │ │ + 246#endif // DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ +childextraction.hh │ │ │ │ │ nodetags.hh │ │ │ │ │ -visitor.hh │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ -traversal.hh │ │ │ │ │ -treepath.hh │ │ │ │ │ -Dune::TypeTree::applyToTreePair │ │ │ │ │ -void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor) │ │ │ │ │ -Apply visitor to a pair of TypeTrees. │ │ │ │ │ -Definition: pairtraversal.hh:126 │ │ │ │ │ -Dune::TypeTree::push_back │ │ │ │ │ -constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t i) │ │ │ │ │ -Appends a run time index to a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:281 │ │ │ │ │ -Dune::TypeTree::hybridTreePath │ │ │ │ │ -constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:180 │ │ │ │ │ -Dune::TypeTree::treePath │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:191 │ │ │ │ │ -Dune::TypeTree::TreePath │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -Definition: treepath.hh:521 │ │ │ │ │ +typetraits.hh │ │ │ │ │ +Dune::TypeTree::child │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: childextraction.hh:126 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::Detail::applyToTreePair │ │ │ │ │ -void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor) │ │ │ │ │ -Definition: pairtraversal.hh:38 │ │ │ │ │ -Dune::TypeTree::HybridTreePath │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: treepath.hh:79 │ │ │ │ │ +Dune::TypeTree::TreePathType::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::CompositeNode │ │ │ │ │ +Base class for composite nodes based on variadic templates. │ │ │ │ │ +Definition: compositenode.hh:26 │ │ │ │ │ +Dune::TypeTree::CompositeNode::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +Definition: compositenode.hh:40 │ │ │ │ │ +Dune::TypeTree::CompositeNode::child │ │ │ │ │ +ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +Definition: compositenode.hh:168 │ │ │ │ │ +Dune::TypeTree::CompositeNode::isComposite │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a composite in the dune-typetree. │ │ │ │ │ +Definition: compositenode.hh:46 │ │ │ │ │ +Dune::TypeTree::CompositeNode::CHILDREN │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +Definition: compositenode.hh:50 │ │ │ │ │ +Dune::TypeTree::CompositeNode::CompositeNode │ │ │ │ │ +CompositeNode() │ │ │ │ │ +Default constructor. │ │ │ │ │ +Definition: compositenode.hh:216 │ │ │ │ │ +Dune::TypeTree::CompositeNode::NodeTag │ │ │ │ │ +CompositeNodeTag NodeTag │ │ │ │ │ +The type tag that describes a CompositeNode. │ │ │ │ │ +Definition: compositenode.hh:31 │ │ │ │ │ +Dune::TypeTree::CompositeNode::setChild │ │ │ │ │ +void setChild(typename Child< k >::Type &child, index_constant< k >={}) │ │ │ │ │ +Sets the k-th child to the passed-in value. │ │ │ │ │ +Definition: compositenode.hh:115 │ │ │ │ │ +Dune::TypeTree::CompositeNode::setChild │ │ │ │ │ +void setChild(typename Child< k >::Type &&child, index_constant< k >={}) │ │ │ │ │ +Store the passed value in k-th child. │ │ │ │ │ +Definition: compositenode.hh:122 │ │ │ │ │ +Dune::TypeTree::CompositeNode::degree │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +Definition: compositenode.hh:52 │ │ │ │ │ +Dune::TypeTree::CompositeNode::nodeStorage │ │ │ │ │ +const NodeStorage & nodeStorage() const │ │ │ │ │ +Definition: compositenode.hh:134 │ │ │ │ │ +Dune::TypeTree::CompositeNode::CompositeNode │ │ │ │ │ +CompositeNode(std::shared_ptr< Children >... children) │ │ │ │ │ +Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ +Definition: compositenode.hh:226 │ │ │ │ │ +Dune::TypeTree::CompositeNode::childStorage │ │ │ │ │ +std::shared_ptr< typename Child< k >::Type > childStorage(index_constant< k >= │ │ │ │ │ +{}) │ │ │ │ │ +Returns the storage of the k-th child. │ │ │ │ │ +Definition: compositenode.hh:98 │ │ │ │ │ +Dune::TypeTree::CompositeNode::ChildTypes │ │ │ │ │ +std::tuple< Children... > ChildTypes │ │ │ │ │ +A tuple storing the types of all children. │ │ │ │ │ +Definition: compositenode.hh:37 │ │ │ │ │ +Dune::TypeTree::CompositeNode::setChild │ │ │ │ │ +void setChild(std::shared_ptr< typename Child< k >::Type > child, │ │ │ │ │ +index_constant< k >={}) │ │ │ │ │ +Sets the storage of the k-th child to the passed-in value. │ │ │ │ │ +Definition: compositenode.hh:129 │ │ │ │ │ +Dune::TypeTree::CompositeNode::child │ │ │ │ │ +const ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +Definition: compositenode.hh:188 │ │ │ │ │ +Dune::TypeTree::CompositeNode::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +Definition: compositenode.hh:43 │ │ │ │ │ +Dune::TypeTree::CompositeNode::childStorage │ │ │ │ │ +std::shared_ptr< const typename Child< k >::Type > childStorage(index_constant< │ │ │ │ │ +k >={}) const │ │ │ │ │ +Returns the storage of the k-th child (const version). │ │ │ │ │ +Definition: compositenode.hh:108 │ │ │ │ │ +Dune::TypeTree::CompositeNode::child │ │ │ │ │ +Child< k >::Type & child(index_constant< k >={}) │ │ │ │ │ +Returns the k-th child. │ │ │ │ │ +Definition: compositenode.hh:78 │ │ │ │ │ +Dune::TypeTree::CompositeNode::CompositeNode │ │ │ │ │ +CompositeNode(const NodeStorage &children) │ │ │ │ │ +Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ +Definition: compositenode.hh:231 │ │ │ │ │ +Dune::TypeTree::CompositeNode::NodeStorage │ │ │ │ │ +std::tuple< std::shared_ptr< Children >... > NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +Definition: compositenode.hh:34 │ │ │ │ │ +Dune::TypeTree::CompositeNode::child │ │ │ │ │ +const Child< k >::Type & child(index_constant< k >={}) const │ │ │ │ │ +Returns the k-th child (const version). │ │ │ │ │ +Definition: compositenode.hh:88 │ │ │ │ │ +Dune::TypeTree::CompositeNode::Child │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +Definition: compositenode.hh:59 │ │ │ │ │ +Dune::TypeTree::CompositeNode::Child::Type │ │ │ │ │ +std::tuple_element< k, ChildTypes >::type Type │ │ │ │ │ +The type of the child. │ │ │ │ │ +Definition: compositenode.hh:64 │ │ │ │ │ +Dune::TypeTree::CompositeNode::Child::type │ │ │ │ │ +std::tuple_element< k, ChildTypes >::type type │ │ │ │ │ +The type of the child. │ │ │ │ │ +Definition: compositenode.hh:67 │ │ │ │ │ +Dune::TypeTree::CompositeNodeTag │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +Definition: nodetags.hh:25 │ │ │ │ │ +Dune::TypeTree::IsTreePath │ │ │ │ │ +Check if type represents a tree path. │ │ │ │ │ +Definition: typetraits.hh:182 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: transformation.hh File Reference │ │ │ │ +dune-typetree: leafnode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,52 +64,36 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
transformation.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
leafnode.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/typetree/typetraits.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/utility.hh>
│ │ │ │ +
#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <cstddef>
│ │ │ │ +#include <type_traits>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive >
 Transform a TypeTree. More...
class  Dune::TypeTree::LeafNode
 Base class for leaf nodes in a dune-typetree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<typename SourceNode , typename Transformation , typename Tag >
void Dune::TypeTree::registerNodeTransformation (SourceNode *, Transformation *, Tag *)
 Register transformation descriptor to transform SourceNode with Transformation. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,41 +4,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -transformation.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +leafnode.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::TransformTree<_SourceTree,_Transformation,_Tag, │ │ │ │ │ - recursive_> │ │ │ │ │ -  Transform a TypeTree. More... │ │ │ │ │ +class  Dune::TypeTree::LeafNode │ │ │ │ │ +  Base class for leaf nodes in a dune-typetree. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::TypeTree::registerNodeTransformation (SourceNode *, Transformation │ │ │ │ │ - *, Tag *) │ │ │ │ │ -  Register transformation descriptor to transform SourceNode with │ │ │ │ │ - Transformation. More... │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: transformation.hh Source File │ │ │ │ +dune-typetree: leafnode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,497 +62,73 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
transformation.hh
│ │ │ │ +
leafnode.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │
6
│ │ │ │ -
7#include <array>
│ │ │ │ -
8#include <tuple>
│ │ │ │ -
9#include <memory>
│ │ │ │ -
10#include <utility>
│ │ │ │ -
11
│ │ │ │ -
12#include <dune/common/hybridutilities.hh>
│ │ │ │ -
13#include <dune/common/exceptions.hh>
│ │ │ │ -
14#include <dune/common/typetraits.hh>
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21namespace Dune {
│ │ │ │ -
22 namespace TypeTree {
│ │ │ │ -
23
│ │ │ │ -
29#ifdef DOXYGEN
│ │ │ │ -
30
│ │ │ │ + │ │ │ │ +
8#include <cstddef>
│ │ │ │ +
9#include <type_traits>
│ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12 namespace TypeTree {
│ │ │ │ +
13
│ │ │ │ + │ │ │ │ +
26 {
│ │ │ │ +
27
│ │ │ │ +
28 public:
│ │ │ │ +
29
│ │ │ │ +
31 static const bool isLeaf = true;
│ │ │ │
32
│ │ │ │ -
51 template<typename SourceNode, typename Transformation, typename Tag>
│ │ │ │ -
52 void registerNodeTransformation(SourceNode*, Transformation*, Tag*);
│ │ │ │ -
53
│ │ │ │ -
54#else // DOXYGEN
│ │ │ │ -
55
│ │ │ │ -
66 template<typename S, typename T, typename Tag>
│ │ │ │ -
67 struct LookupNodeTransformation
│ │ │ │ -
68 {
│ │ │ │ -
69
│ │ │ │ -
70 typedef decltype(registerNodeTransformation(declptr<S>(),declptr<T>(),declptr<Tag>())) lookup_type;
│ │ │ │ -
71
│ │ │ │ -
72 typedef typename evaluate_if_meta_function<
│ │ │ │ -
73 lookup_type
│ │ │ │ -
74 >::type type;
│ │ │ │ -
75
│ │ │ │ -
76 static_assert((!std::is_same<type,void>::value), "Unable to find valid transformation descriptor");
│ │ │ │ -
77 };
│ │ │ │ -
78
│ │ │ │ -
79#endif // DOXYGEN
│ │ │ │ -
80
│ │ │ │ -
81
│ │ │ │ -
83
│ │ │ │ -
92 template<typename SourceTree, typename Transformation, typename Tag = StartTag, bool recursive = true>
│ │ │ │ - │ │ │ │ -
94 {
│ │ │ │ -
95
│ │ │ │ -
96#ifndef DOXYGEN
│ │ │ │ -
97
│ │ │ │ -
98 typedef typename LookupNodeTransformation<SourceTree,Transformation,typename SourceTree::ImplementationTag>::type NodeTransformation;
│ │ │ │ -
99
│ │ │ │ -
100 // the type of the new tree that will result from this transformation
│ │ │ │ -
101 typedef typename TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transformed_type transformed_type;
│ │ │ │ -
102
│ │ │ │ -
103 // the storage type of the new tree that will result from this transformation
│ │ │ │ -
104 typedef typename TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transformed_storage_type transformed_storage_type;
│ │ │ │ -
105
│ │ │ │ -
106#endif // DOXYGEN
│ │ │ │ -
107
│ │ │ │ -
109 typedef transformed_type type;
│ │ │ │ -
110
│ │ │ │ -
111 typedef type Type;
│ │ │ │ -
112
│ │ │ │ -
114 static transformed_type transform(const SourceTree& s, const Transformation& t = Transformation())
│ │ │ │ -
115 {
│ │ │ │ -
116 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(s,t);
│ │ │ │ -
117 }
│ │ │ │ -
118
│ │ │ │ -
120 static transformed_type transform(const SourceTree& s, Transformation& t)
│ │ │ │ -
121 {
│ │ │ │ -
122 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(s,t);
│ │ │ │ -
123 }
│ │ │ │ -
124
│ │ │ │ -
126 static transformed_type transform(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
│ │ │ │ -
127 {
│ │ │ │ -
128 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(sp,t);
│ │ │ │ -
129 }
│ │ │ │ -
130
│ │ │ │ -
132 static transformed_type transform(std::shared_ptr<const SourceTree> sp, Transformation& t)
│ │ │ │ -
133 {
│ │ │ │ -
134 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(sp,t);
│ │ │ │ -
135 }
│ │ │ │ -
136
│ │ │ │ -
139 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
│ │ │ │ -
140 {
│ │ │ │ - │ │ │ │ -
142 }
│ │ │ │ -
143
│ │ │ │ -
146 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, Transformation& t)
│ │ │ │ -
147 {
│ │ │ │ - │ │ │ │ -
149 }
│ │ │ │ -
150
│ │ │ │ -
151
│ │ │ │ -
152 };
│ │ │ │ -
153
│ │ │ │ -
154#ifndef DOXYGEN // internal per-node implementations of the transformation algorithm
│ │ │ │ -
155
│ │ │ │ -
156 // handle a leaf node - this is easy
│ │ │ │ -
157 template<typename S, typename T, bool recursive>
│ │ │ │ -
158 struct TransformTree<S,T,LeafNodeTag,recursive>
│ │ │ │ -
159 {
│ │ │ │ -
160 // get transformed type from specification
│ │ │ │ -
161 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>::type NodeTransformation;
│ │ │ │ -
162
│ │ │ │ -
163 typedef typename NodeTransformation::transformed_type transformed_type;
│ │ │ │ -
164 typedef typename NodeTransformation::transformed_storage_type transformed_storage_type;
│ │ │ │ -
165
│ │ │ │ -
166 // delegate instance transformation to per-node specification
│ │ │ │ -
167 static transformed_type transform(const S& s, T& t)
│ │ │ │ -
168 {
│ │ │ │ -
169 return NodeTransformation::transform(s,t);
│ │ │ │ -
170 }
│ │ │ │ -
171
│ │ │ │ -
172 // delegate instance transformation to per-node specification
│ │ │ │ -
173 static transformed_type transform(const S& s, const T& t)
│ │ │ │ -
174 {
│ │ │ │ -
175 return NodeTransformation::transform(s,t);
│ │ │ │ -
176 }
│ │ │ │ -
177
│ │ │ │ -
178 // delegate instance transformation to per-node specification
│ │ │ │ -
179 static transformed_type transform(std::shared_ptr<const S> sp, T& t)
│ │ │ │ -
180 {
│ │ │ │ -
181 return NodeTransformation::transform(sp,t);
│ │ │ │ -
182 }
│ │ │ │ -
183
│ │ │ │ -
184 // delegate instance transformation to per-node specification
│ │ │ │ -
185 static transformed_type transform(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ -
186 {
│ │ │ │ -
187 return NodeTransformation::transform(sp,t);
│ │ │ │ -
188 }
│ │ │ │ -
189
│ │ │ │ -
190 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ -
191 {
│ │ │ │ -
192 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ -
193 }
│ │ │ │ -
194
│ │ │ │ -
195 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ -
196 {
│ │ │ │ -
197 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ -
198 }
│ │ │ │ -
199
│ │ │ │ -
200 };
│ │ │ │ -
201
│ │ │ │ -
202
│ │ │ │ -
203 // common implementation for non-recursive transformation of non-leaf nodes
│ │ │ │ -
204 template<typename S, typename T>
│ │ │ │ -
205 struct TransformTreeNonRecursive
│ │ │ │ -
206 {
│ │ │ │ -
207 // get transformed type from specification
│ │ │ │ -
208 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>::type NodeTransformation;
│ │ │ │ -
209
│ │ │ │ -
210 typedef typename NodeTransformation::transformed_type transformed_type;
│ │ │ │ -
211 typedef typename NodeTransformation::transformed_storage_type transformed_storage_type;
│ │ │ │ -
212
│ │ │ │ -
213 // delegate instance transformation to per-node specification
│ │ │ │ -
214 static transformed_type transform(const S& s, T& t)
│ │ │ │ -
215 {
│ │ │ │ -
216 return NodeTransformation::transform(s,t);
│ │ │ │ -
217 }
│ │ │ │ -
218
│ │ │ │ -
219 // delegate instance transformation to per-node specification
│ │ │ │ -
220 static transformed_type transform(const S& s, const T& t)
│ │ │ │ -
221 {
│ │ │ │ -
222 return NodeTransformation::transform(s,t);
│ │ │ │ -
223 }
│ │ │ │ -
224
│ │ │ │ -
225 // delegate instance transformation to per-node specification
│ │ │ │ -
226 static transformed_type transform(std::shared_ptr<const S> sp, T& t)
│ │ │ │ -
227 {
│ │ │ │ -
228 return NodeTransformation::transform(sp,t);
│ │ │ │ -
229 }
│ │ │ │ -
230
│ │ │ │ -
231 // delegate instance transformation to per-node specification
│ │ │ │ -
232 static transformed_type transform(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ -
233 {
│ │ │ │ -
234 return NodeTransformation::transform(sp,t);
│ │ │ │ -
235 }
│ │ │ │ -
236
│ │ │ │ -
237 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ -
238 {
│ │ │ │ -
239 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ -
240 }
│ │ │ │ -
241
│ │ │ │ -
242 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ -
243 {
│ │ │ │ -
244 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ -
245 }
│ │ │ │ -
246
│ │ │ │ -
247 };
│ │ │ │ -
248
│ │ │ │ -
249
│ │ │ │ -
250 namespace Impl {
│ │ │ │ -
251
│ │ │ │ -
252 // Helper class to handle recursive power nodes
│ │ │ │ -
253 template<class Source, class Transformation, class Tag>
│ │ │ │ -
254 class RecursivePowerTransformTree
│ │ │ │ -
255 {
│ │ │ │ -
256 // We only know two types of tags!
│ │ │ │ -
257 static_assert(std::is_same_v<Tag,PowerNodeTag> or std::is_same_v<Tag,DynamicPowerNodeTag>);
│ │ │ │ -
258
│ │ │ │ -
259 using ChildType = typename Source::ChildType;
│ │ │ │ -
260
│ │ │ │ -
261 // in case degree is dynamic, provid a vector correctly initialized
│ │ │ │ -
262 template<class NodeStorage>
│ │ │ │ -
263 static auto node_storage_provider(const std::size_t& degree)
│ │ │ │ -
264 {
│ │ │ │ -
265 return std::vector<NodeStorage>(degree);
│ │ │ │ -
266 }
│ │ │ │ -
267
│ │ │ │ -
268 // in case degree is static, provid an array
│ │ │ │ -
269 template<class NodeStorage, class StaticIndex>
│ │ │ │ -
270 static auto node_storage_provider(StaticIndex)
│ │ │ │ -
271 {
│ │ │ │ -
272 return std::array<NodeStorage,std::size_t(StaticIndex{})>();
│ │ │ │ -
273 }
│ │ │ │ -
274
│ │ │ │ -
275 public:
│ │ │ │ -
276 // get transformed type from specification
│ │ │ │ -
277 // Handling this transformation in a way that makes the per-node specification easy to write
│ │ │ │ -
278 // is a little involved:
│ │ │ │ -
279 // The problem is that the transformed power node must be parameterized on the transformed child
│ │ │ │ -
280 // type. So we need to transform the child type and pass the transformed child type to an inner
│ │ │ │ -
281 // template of the node transformation struct called result (see example of such a specification
│ │ │ │ -
282 // further down).
│ │ │ │ -
283 using NodeTransformation = typename LookupNodeTransformation<Source,Transformation,ImplementationTag<Source>>::type;
│ │ │ │ -
284 using ChildNodeTransformation = typename LookupNodeTransformation<ChildType,Transformation,ImplementationTag<ChildType>>::type;
│ │ │ │ -
285
│ │ │ │ -
286 private:
│ │ │ │ -
287 // Since every child is same type, is enough to get transformation once
│ │ │ │ -
288 using ChildTreeTransformation = TransformTree<ChildType,
│ │ │ │ -
289 Transformation,
│ │ │ │ -
290 NodeTag<ChildType>,
│ │ │ │ -
291 ChildNodeTransformation::recursive>;
│ │ │ │ -
292
│ │ │ │ -
293 // Get transformed type of children
│ │ │ │ -
294 using transformed_child_type = typename ChildTreeTransformation::transformed_type;
│ │ │ │ -
295 using transformed_child_storage_type = typename ChildTreeTransformation::transformed_storage_type;
│ │ │ │ -
296 public:
│ │ │ │ -
297 // Apply transformation from children to current node
│ │ │ │ -
298 using transformed_type = typename NodeTransformation::template result<transformed_child_type>::type;
│ │ │ │ -
299 using transformed_storage_type = typename NodeTransformation::template result<transformed_child_type>::storage_type;
│ │ │ │ -
300
│ │ │ │ -
301 // Transform an instance of source tree.
│ │ │ │ -
302 static transformed_type transform(const Source& source, Transformation& transformation)
│ │ │ │ -
303 {
│ │ │ │ -
304 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source.degree());
│ │ │ │ -
305 for (std::size_t k = 0; k < source.degree(); ++k) {
│ │ │ │ -
306 children_storage[k] = ChildTreeTransformation::transform_storage(source.childStorage(k),transformation);
│ │ │ │ -
307 }
│ │ │ │ -
308 return NodeTransformation::transform(source,transformation,children_storage);
│ │ │ │ -
309 }
│ │ │ │ -
310
│ │ │ │ -
311 // Transform an instance of source tree.
│ │ │ │ -
312 static transformed_type transform(const Source& source, const Transformation& transformation)
│ │ │ │ -
313 {
│ │ │ │ -
314 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source.degree());
│ │ │ │ -
315 for (std::size_t k = 0; k < source.degree(); ++k) {
│ │ │ │ -
316 children_storage[k] = ChildTreeTransformation::transform_storage(source.childStorage(k),transformation);
│ │ │ │ -
317 }
│ │ │ │ -
318 return NodeTransformation::transform(source,transformation,children_storage);
│ │ │ │ -
319 }
│ │ │ │ -
320
│ │ │ │ -
321 // Transform an instance of source tree.
│ │ │ │ -
322 static transformed_type transform(std::shared_ptr<const Source> source_ptr, Transformation& transformation)
│ │ │ │ -
323 {
│ │ │ │ -
324 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source_ptr->degree());
│ │ │ │ -
325 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ -
326 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ -
327 }
│ │ │ │ -
328 return NodeTransformation::transform(source_ptr,transformation,children_storage);
│ │ │ │ -
329 }
│ │ │ │ -
330
│ │ │ │ -
331 // Transform an instance of source tree.
│ │ │ │ -
332 static transformed_type transform(std::shared_ptr<const Source> source_ptr, const Transformation& transformation)
│ │ │ │ -
333 {
│ │ │ │ -
334 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source_ptr->degree());
│ │ │ │ -
335 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ -
336 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ -
337 }
│ │ │ │ -
338 return NodeTransformation::transform(source_ptr,transformation,children_storage);
│ │ │ │ -
339 }
│ │ │ │ -
340
│ │ │ │ -
341 // Transform an instance of source tree ptr.
│ │ │ │ -
342 static transformed_storage_type transform_storage(std::shared_ptr<const Source> source_ptr, Transformation& transformation)
│ │ │ │ -
343 {
│ │ │ │ -
344 auto children_storage = node_storage_provider<transformed_child_storage_type>(source_ptr->degree());
│ │ │ │ -
345 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ -
346 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ -
347 }
│ │ │ │ -
348 return NodeTransformation::transform_storage(source_ptr,transformation,children_storage);
│ │ │ │ -
349 }
│ │ │ │ -
350
│ │ │ │ -
351 // Transform an instance of source tree ptr.
│ │ │ │ -
352 static transformed_storage_type transform_storage(std::shared_ptr<const Source> source_ptr, const Transformation& transformation)
│ │ │ │ -
353 {
│ │ │ │ -
354 auto children_storage = node_storage_provider<transformed_child_storage_type>(source_ptr->degree());
│ │ │ │ -
355 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ -
356 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ -
357 }
│ │ │ │ -
358 return NodeTransformation::transform_storage(source_ptr,transformation,children_storage);
│ │ │ │ -
359 }
│ │ │ │ -
360
│ │ │ │ -
361 };
│ │ │ │ -
362 } // namespace Impl
│ │ │ │ -
363
│ │ │ │ -
364 // Recursive version of the PowerNode transformation for static nodes.
│ │ │ │ -
365 template<typename Source, typename Transformation>
│ │ │ │ -
366 struct TransformTree<Source,Transformation,PowerNodeTag,true>
│ │ │ │ -
367 : public Impl::RecursivePowerTransformTree<Source,Transformation,PowerNodeTag>
│ │ │ │ -
368 {};
│ │ │ │ -
369
│ │ │ │ -
370 // Recursive version of the DynamicPowerNode transformation for static nodes.
│ │ │ │ -
371 template<typename Source, typename Transformation>
│ │ │ │ -
372 struct TransformTree<Source,Transformation,DynamicPowerNodeTag,true>
│ │ │ │ -
373 : public Impl::RecursivePowerTransformTree<Source,Transformation,DynamicPowerNodeTag>
│ │ │ │ -
374 {};
│ │ │ │ -
375
│ │ │ │ -
376 // non-recursive version of the PowerNode transformation.
│ │ │ │ -
377 template<typename S, typename T>
│ │ │ │ -
378 struct TransformTree<S,T,PowerNodeTag,false>
│ │ │ │ -
379 : public TransformTreeNonRecursive<S,T>
│ │ │ │ -
380 {};
│ │ │ │ -
381
│ │ │ │ -
382 // non-recursive version of the DynamicPowerNodeTag transformation.
│ │ │ │ -
383 template<typename S, typename T>
│ │ │ │ -
384 struct TransformTree<S,T,DynamicPowerNodeTag,false>
│ │ │ │ -
385 : public TransformTreeNonRecursive<S,T>
│ │ │ │ -
386 {};
│ │ │ │ -
387
│ │ │ │ -
388 // helper struct that does the actual transformation for a composite node. We need this additional struct
│ │ │ │ -
389 // to extract the template argument list with the types of all children from the node, which we cannot do
│ │ │ │ -
390 // directly in the transformation<> template, as the type passed to transformation<> will usually be a
│ │ │ │ -
391 // derived type and will normally have more template arguments than just the children. This declaration
│ │ │ │ -
392 // just introduces the type of the helper struct, we always instantiate the specialization defined below;
│ │ │ │ -
393 template<typename S, typename Children, typename T>
│ │ │ │ -
394 struct transform_composite_node;
│ │ │ │ -
395
│ │ │ │ -
396 // specialized version of the helper struct which extracts the template argument list with the children from
│ │ │ │ -
397 // its second template parameter, which has to be CompositeNode::ChildTypes. Apart from that, the struct is
│ │ │ │ -
398 // similar to the one for a PowerNode, but it obviously delegates transformation of the children to the TMP.
│ │ │ │ -
399 template<typename S, typename T, typename... C>
│ │ │ │ -
400 struct transform_composite_node<S,std::tuple<C...>,T>
│ │ │ │ -
401 {
│ │ │ │ -
402
│ │ │ │ -
403 // transformed type, using the same nested struct trick as the PowerNode
│ │ │ │ -
404 typedef ImplementationTag<S> Tag;
│ │ │ │ -
405 typedef typename LookupNodeTransformation<S,T,Tag>::type NodeTransformation;
│ │ │ │ -
406 typedef typename NodeTransformation::template result<typename TransformTree<C,
│ │ │ │ -
407 T,
│ │ │ │ -
408 NodeTag<C>,
│ │ │ │ -
409 LookupNodeTransformation<C,T,ImplementationTag<C>>::type::recursive
│ │ │ │ -
410 >::transformed_type...
│ │ │ │ -
411 >::type transformed_type;
│ │ │ │ -
412
│ │ │ │ -
413 typedef typename NodeTransformation::template result<typename TransformTree<C,
│ │ │ │ -
414 T,
│ │ │ │ -
415 NodeTag<C>,
│ │ │ │ -
416 LookupNodeTransformation<C,T,ImplementationTag<C>>::type::recursive
│ │ │ │ -
417 >::transformed_type...
│ │ │ │ -
418 >::storage_type transformed_storage_type;
│ │ │ │ -
419
│ │ │ │ -
420 // Retrieve the transformation descriptor for the child with index i.
│ │ │ │ -
421 // This little helper improves really improves the readability of the
│ │ │ │ -
422 // transformation functions.
│ │ │ │ -
423 template<std::size_t i>
│ │ │ │ -
424 struct ChildTransformation
│ │ │ │ -
425 : public TransformTree<typename S::template Child<i>::Type,
│ │ │ │ -
426 T,
│ │ │ │ -
427 NodeTag<typename S::template Child<i>::Type>,
│ │ │ │ -
428 LookupNodeTransformation<
│ │ │ │ -
429 typename S::template Child<i>::Type,
│ │ │ │ -
430 T,
│ │ │ │ -
431 ImplementationTag<typename S::template Child<i>::Type>
│ │ │ │ -
432 >::type::recursive
│ │ │ │ -
433 >
│ │ │ │ -
434 {};
│ │ │ │ -
435
│ │ │ │ -
436 template<std::size_t i, typename Tuple, typename Value>
│ │ │ │ -
437 static void setElement(Tuple& tuple, Value&& value)
│ │ │ │ -
438 {
│ │ │ │ -
439 std::get<i>(tuple) = std::forward<Value>(value);
│ │ │ │ -
440 }
│ │ │ │ -
441
│ │ │ │ -
442 template<typename Trafo, std::size_t... i>
│ │ │ │ -
443 static transformed_type transform(const S& s, Trafo&& t, std::index_sequence<i...> indices)
│ │ │ │ -
444 {
│ │ │ │ -
445 std::tuple<typename ChildTransformation<i>::transformed_storage_type...> storage;
│ │ │ │ -
446 Dune::Hybrid::Impl::evaluateFoldExpression<int>({(setElement<i>(storage, ChildTransformation<i>::transform_storage(s.template childStorage<i>(), std::forward<Trafo>(t))),0)...});
│ │ │ │ -
447 return NodeTransformation::transform(s, std::forward<Trafo>(t), std::get<i>(storage)...);
│ │ │ │ -
448 }
│ │ │ │ -
449
│ │ │ │ -
450 template<typename Trafo, std::size_t... i>
│ │ │ │ -
451 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, Trafo&& t, std::index_sequence<i...> indices)
│ │ │ │ -
452 {
│ │ │ │ -
453 std::tuple<typename ChildTransformation<i>::transformed_storage_type...> storage;
│ │ │ │ -
454 Dune::Hybrid::Impl::evaluateFoldExpression<int>({(setElement<i>(storage, ChildTransformation<i>::transform_storage(sp->template childStorage<i>(), std::forward<Trafo>(t))),0)...});
│ │ │ │ -
455 return NodeTransformation::transform_storage(sp, std::forward<Trafo>(t), std::get<i>(storage)...);
│ │ │ │ -
456 }
│ │ │ │ -
457 };
│ │ │ │ -
458
│ │ │ │ -
459
│ │ │ │ -
460 // the specialization of transformation<> for the CompositeNode. This just extracts the
│ │ │ │ -
461 // CompositeNode::ChildTypes member and forwards to the helper struct
│ │ │ │ -
462 template<typename S, typename T>
│ │ │ │ -
463 struct TransformTree<S,T,CompositeNodeTag,true>
│ │ │ │ -
464 {
│ │ │ │ -
465
│ │ │ │ -
466 private:
│ │ │ │ -
467
│ │ │ │ -
468 typedef typename S::ChildTypes ChildTypes;
│ │ │ │ -
469
│ │ │ │ -
470 static auto child_indices()
│ │ │ │ -
471 {
│ │ │ │ -
472 return std::make_index_sequence<S::degree()>();
│ │ │ │ -
473 }
│ │ │ │ -
474
│ │ │ │ -
475 public:
│ │ │ │ -
476
│ │ │ │ -
477 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_type transformed_type;
│ │ │ │ -
478 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_storage_type transformed_storage_type;
│ │ │ │ -
479
│ │ │ │ -
480 static transformed_type transform(const S& s, T& t)
│ │ │ │ -
481 {
│ │ │ │ -
482 return transform_composite_node<S,ChildTypes,T>::transform(s,t,child_indices());
│ │ │ │ -
483 }
│ │ │ │ -
484
│ │ │ │ -
485 static transformed_type transform(const S& s, const T& t)
│ │ │ │ -
486 {
│ │ │ │ -
487 return transform_composite_node<S,ChildTypes,T>::transform(s,t,child_indices());
│ │ │ │ -
488 }
│ │ │ │ -
489
│ │ │ │ -
490 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ -
491 {
│ │ │ │ -
492 return transform_composite_node<S,ChildTypes,T>::transform_storage(sp,t,child_indices());
│ │ │ │ -
493 }
│ │ │ │ -
494
│ │ │ │ -
495 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ -
496 {
│ │ │ │ -
497 return transform_composite_node<S,ChildTypes,T>::transform_storage(sp,t,child_indices());
│ │ │ │ -
498 }
│ │ │ │ -
499
│ │ │ │ -
500 };
│ │ │ │ -
501
│ │ │ │ -
502 // non-recursive version of the CompositeNode transformation.
│ │ │ │ -
503 template<typename S, typename T>
│ │ │ │ -
504 struct TransformTree<S,T,CompositeNodeTag,false>
│ │ │ │ -
505 : public TransformTreeNonRecursive<S,T>
│ │ │ │ -
506 {};
│ │ │ │ -
507
│ │ │ │ -
508#endif // DOXYGEN
│ │ │ │ -
509
│ │ │ │ -
511
│ │ │ │ -
512 } // namespace TypeTree
│ │ │ │ -
513} //namespace Dune
│ │ │ │ -
514
│ │ │ │ -
515#endif // DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ - │ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
void registerNodeTransformation(SourceNode *, Transformation *, Tag *)
Register transformation descriptor to transform SourceNode with Transformation.
│ │ │ │ +
34 static const bool isPower = false;
│ │ │ │ +
35
│ │ │ │ +
37 static const bool isComposite = false;
│ │ │ │ +
38
│ │ │ │ +
40 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ +
41 static const std::size_t CHILDREN = 0;
│ │ │ │ +
42
│ │ │ │ + │ │ │ │ +
45
│ │ │ │ +
46 static constexpr auto degree()
│ │ │ │ +
47 {
│ │ │ │ +
48 return std::integral_constant<std::size_t,0>{};
│ │ │ │ +
49 }
│ │ │ │ +
50
│ │ │ │ +
51 protected:
│ │ │ │ +
52
│ │ │ │ +
54
│ │ │ │ + │ │ │ │ +
60 };
│ │ │ │ +
61
│ │ │ │ +
63
│ │ │ │ +
64 } // namespace TypeTree
│ │ │ │ +
65} //namespace Dune
│ │ │ │ +
66
│ │ │ │ +
67#endif // DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ + │ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Transform a TypeTree.
Definition: transformation.hh:94
│ │ │ │ -
type Type
Definition: transformation.hh:111
│ │ │ │ -
static transformed_type transform(std::shared_ptr< const SourceTree > sp, Transformation &t)
Apply transformation to an existing tree s.
Definition: transformation.hh:132
│ │ │ │ -
static transformed_type transform(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition: transformation.hh:126
│ │ │ │ -
static transformed_type transform(const SourceTree &s, Transformation &t)
Apply transformation to an existing tree s.
Definition: transformation.hh:120
│ │ │ │ -
transformed_type type
The type of the transformed tree.
Definition: transformation.hh:109
│ │ │ │ -
static transformed_type transform(const SourceTree &s, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition: transformation.hh:114
│ │ │ │ -
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Definition: transformation.hh:139
│ │ │ │ -
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, Transformation &t)
Definition: transformation.hh:146
│ │ │ │ -
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:140
│ │ │ │ +
Base class for leaf nodes in a dune-typetree.
Definition: leafnode.hh:26
│ │ │ │ +
LeafNodeTag NodeTag
The type tag that describes a LeafNode.
Definition: leafnode.hh:44
│ │ │ │ +
static const bool isLeaf
Mark this class as a leaf in a dune-typetree.
Definition: leafnode.hh:31
│ │ │ │ +
static const std::size_t CHILDREN
Leafs have no children.
Definition: leafnode.hh:41
│ │ │ │ +
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: leafnode.hh:34
│ │ │ │ +
LeafNode()
Default constructor.
Definition: leafnode.hh:59
│ │ │ │ +
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: leafnode.hh:37
│ │ │ │ +
static constexpr auto degree()
Definition: leafnode.hh:46
│ │ │ │ +
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,637 +4,93 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -transformation.hh │ │ │ │ │ +leafnode.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_LEAFNODE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_LEAFNODE_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11 │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19 │ │ │ │ │ - 20 │ │ │ │ │ - 21namespace Dune { │ │ │ │ │ - 22 namespace TypeTree { │ │ │ │ │ - 23 │ │ │ │ │ - 29#ifdef DOXYGEN │ │ │ │ │ - 30 │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11namespace Dune { │ │ │ │ │ + 12 namespace TypeTree { │ │ │ │ │ + 13 │ │ │ │ │ +25 class LeafNode │ │ │ │ │ + 26 { │ │ │ │ │ + 27 │ │ │ │ │ + 28 public: │ │ │ │ │ + 29 │ │ │ │ │ +31 static const bool isLeaf = true; │ │ │ │ │ 32 │ │ │ │ │ - 51 template │ │ │ │ │ -52 void registerNodeTransformation(SourceNode*, Transformation*, Tag*); │ │ │ │ │ - 53 │ │ │ │ │ - 54#else // DOXYGEN │ │ │ │ │ - 55 │ │ │ │ │ - 66 template │ │ │ │ │ - 67 struct LookupNodeTransformation │ │ │ │ │ - 68 { │ │ │ │ │ - 69 │ │ │ │ │ - 70 typedef decltype(registerNodeTransformation(declptr(),declptr │ │ │ │ │ -(),declptr())) lookup_type; │ │ │ │ │ - 71 │ │ │ │ │ - 72 typedef typename evaluate_if_meta_function< │ │ │ │ │ - 73 lookup_type │ │ │ │ │ - 74 >::type type; │ │ │ │ │ - 75 │ │ │ │ │ - 76 static_assert((!std::is_same::value), "Unable to find valid │ │ │ │ │ -transformation descriptor"); │ │ │ │ │ - 77 }; │ │ │ │ │ - 78 │ │ │ │ │ - 79#endif // DOXYGEN │ │ │ │ │ - 80 │ │ │ │ │ - 81 │ │ │ │ │ - 83 │ │ │ │ │ - 92 template │ │ │ │ │ -93 struct TransformTree │ │ │ │ │ - 94 { │ │ │ │ │ - 95 │ │ │ │ │ - 96#ifndef DOXYGEN │ │ │ │ │ - 97 │ │ │ │ │ - 98 typedef typename │ │ │ │ │ -LookupNodeTransformation::type NodeTransformation; │ │ │ │ │ - 99 │ │ │ │ │ - 100 // the type of the new tree that will result from this transformation │ │ │ │ │ - 101 typedef typename │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transformed_type transformed_type; │ │ │ │ │ - 102 │ │ │ │ │ - 103 // the storage type of the new tree that will result from this │ │ │ │ │ -transformation │ │ │ │ │ - 104 typedef typename │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transformed_storage_type transformed_storage_type; │ │ │ │ │ - 105 │ │ │ │ │ - 106#endif // DOXYGEN │ │ │ │ │ - 107 │ │ │ │ │ -109 typedef transformed_type type; │ │ │ │ │ - 110 │ │ │ │ │ -111 typedef type Type; │ │ │ │ │ - 112 │ │ │ │ │ -114 static transformed_type transform(const SourceTree& s, const │ │ │ │ │ -Transformation& t = Transformation()) │ │ │ │ │ - 115 { │ │ │ │ │ - 116 return │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transform(s,t); │ │ │ │ │ - 117 } │ │ │ │ │ - 118 │ │ │ │ │ -120 static transformed_type transform(const SourceTree& s, Transformation& t) │ │ │ │ │ - 121 { │ │ │ │ │ - 122 return │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transform(s,t); │ │ │ │ │ - 123 } │ │ │ │ │ - 124 │ │ │ │ │ -126 static transformed_type transform(std::shared_ptr sp, │ │ │ │ │ -const Transformation& t = Transformation()) │ │ │ │ │ - 127 { │ │ │ │ │ - 128 return │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transform(sp,t); │ │ │ │ │ - 129 } │ │ │ │ │ - 130 │ │ │ │ │ -132 static transformed_type transform(std::shared_ptr sp, │ │ │ │ │ -Transformation& t) │ │ │ │ │ - 133 { │ │ │ │ │ - 134 return │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transform(sp,t); │ │ │ │ │ - 135 } │ │ │ │ │ - 136 │ │ │ │ │ -139 static transformed_storage_type transform_storage(std::shared_ptr sp, const Transformation& t = Transformation()) │ │ │ │ │ - 140 { │ │ │ │ │ - 141 return │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transform_storage(sp,t); │ │ │ │ │ - 142 } │ │ │ │ │ - 143 │ │ │ │ │ -146 static transformed_storage_type transform_storage(std::shared_ptr sp, Transformation& t) │ │ │ │ │ - 147 { │ │ │ │ │ - 148 return │ │ │ │ │ -TransformTree,NodeTransformation:: │ │ │ │ │ -recursive>::transform_storage(sp,t); │ │ │ │ │ - 149 } │ │ │ │ │ - 150 │ │ │ │ │ - 151 │ │ │ │ │ - 152 }; │ │ │ │ │ - 153 │ │ │ │ │ - 154#ifndef DOXYGEN // internal per-node implementations of the transformation │ │ │ │ │ -algorithm │ │ │ │ │ - 155 │ │ │ │ │ - 156 // handle a leaf node - this is easy │ │ │ │ │ - 157 template │ │ │ │ │ - 158 struct TransformTree │ │ │ │ │ - 159 { │ │ │ │ │ - 160 // get transformed type from specification │ │ │ │ │ - 161 typedef typename LookupNodeTransformation>::type │ │ │ │ │ -NodeTransformation; │ │ │ │ │ - 162 │ │ │ │ │ - 163 typedef typename NodeTransformation::transformed_type transformed_type; │ │ │ │ │ - 164 typedef typename NodeTransformation::transformed_storage_type │ │ │ │ │ -transformed_storage_type; │ │ │ │ │ - 165 │ │ │ │ │ - 166 // delegate instance transformation to per-node specification │ │ │ │ │ - 167 static transformed_type transform(const S& s, T& t) │ │ │ │ │ - 168 { │ │ │ │ │ - 169 return NodeTransformation::transform(s,t); │ │ │ │ │ - 170 } │ │ │ │ │ - 171 │ │ │ │ │ - 172 // delegate instance transformation to per-node specification │ │ │ │ │ - 173 static transformed_type transform(const S& s, const T& t) │ │ │ │ │ - 174 { │ │ │ │ │ - 175 return NodeTransformation::transform(s,t); │ │ │ │ │ - 176 } │ │ │ │ │ - 177 │ │ │ │ │ - 178 // delegate instance transformation to per-node specification │ │ │ │ │ - 179 static transformed_type transform(std::shared_ptr sp, T& t) │ │ │ │ │ - 180 { │ │ │ │ │ - 181 return NodeTransformation::transform(sp,t); │ │ │ │ │ - 182 } │ │ │ │ │ - 183 │ │ │ │ │ - 184 // delegate instance transformation to per-node specification │ │ │ │ │ - 185 static transformed_type transform(std::shared_ptr sp, const T& t) │ │ │ │ │ - 186 { │ │ │ │ │ - 187 return NodeTransformation::transform(sp,t); │ │ │ │ │ - 188 } │ │ │ │ │ - 189 │ │ │ │ │ - 190 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, T& t) │ │ │ │ │ - 191 { │ │ │ │ │ - 192 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ - 193 } │ │ │ │ │ - 194 │ │ │ │ │ - 195 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, const T& t) │ │ │ │ │ - 196 { │ │ │ │ │ - 197 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ - 198 } │ │ │ │ │ - 199 │ │ │ │ │ - 200 }; │ │ │ │ │ - 201 │ │ │ │ │ - 202 │ │ │ │ │ - 203 // common implementation for non-recursive transformation of non-leaf │ │ │ │ │ -nodes │ │ │ │ │ - 204 template │ │ │ │ │ - 205 struct TransformTreeNonRecursive │ │ │ │ │ - 206 { │ │ │ │ │ - 207 // get transformed type from specification │ │ │ │ │ - 208 typedef typename LookupNodeTransformation>::type │ │ │ │ │ -NodeTransformation; │ │ │ │ │ - 209 │ │ │ │ │ - 210 typedef typename NodeTransformation::transformed_type transformed_type; │ │ │ │ │ - 211 typedef typename NodeTransformation::transformed_storage_type │ │ │ │ │ -transformed_storage_type; │ │ │ │ │ - 212 │ │ │ │ │ - 213 // delegate instance transformation to per-node specification │ │ │ │ │ - 214 static transformed_type transform(const S& s, T& t) │ │ │ │ │ - 215 { │ │ │ │ │ - 216 return NodeTransformation::transform(s,t); │ │ │ │ │ - 217 } │ │ │ │ │ - 218 │ │ │ │ │ - 219 // delegate instance transformation to per-node specification │ │ │ │ │ - 220 static transformed_type transform(const S& s, const T& t) │ │ │ │ │ - 221 { │ │ │ │ │ - 222 return NodeTransformation::transform(s,t); │ │ │ │ │ - 223 } │ │ │ │ │ - 224 │ │ │ │ │ - 225 // delegate instance transformation to per-node specification │ │ │ │ │ - 226 static transformed_type transform(std::shared_ptr sp, T& t) │ │ │ │ │ - 227 { │ │ │ │ │ - 228 return NodeTransformation::transform(sp,t); │ │ │ │ │ - 229 } │ │ │ │ │ - 230 │ │ │ │ │ - 231 // delegate instance transformation to per-node specification │ │ │ │ │ - 232 static transformed_type transform(std::shared_ptr sp, const T& t) │ │ │ │ │ - 233 { │ │ │ │ │ - 234 return NodeTransformation::transform(sp,t); │ │ │ │ │ - 235 } │ │ │ │ │ - 236 │ │ │ │ │ - 237 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, T& t) │ │ │ │ │ - 238 { │ │ │ │ │ - 239 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ - 240 } │ │ │ │ │ - 241 │ │ │ │ │ - 242 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, const T& t) │ │ │ │ │ - 243 { │ │ │ │ │ - 244 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ - 245 } │ │ │ │ │ - 246 │ │ │ │ │ - 247 }; │ │ │ │ │ - 248 │ │ │ │ │ - 249 │ │ │ │ │ - 250 namespace Impl { │ │ │ │ │ - 251 │ │ │ │ │ - 252 // Helper class to handle recursive power nodes │ │ │ │ │ - 253 template │ │ │ │ │ - 254 class RecursivePowerTransformTree │ │ │ │ │ - 255 { │ │ │ │ │ - 256 // We only know two types of tags! │ │ │ │ │ - 257 static_assert(std::is_same_v or std:: │ │ │ │ │ -is_same_v); │ │ │ │ │ - 258 │ │ │ │ │ - 259 using ChildType = typename Source::ChildType; │ │ │ │ │ - 260 │ │ │ │ │ - 261 // in case degree is dynamic, provid a vector correctly initialized │ │ │ │ │ - 262 template │ │ │ │ │ - 263 static auto node_storage_provider(const std::size_t& degree) │ │ │ │ │ - 264 { │ │ │ │ │ - 265 return std::vector(degree); │ │ │ │ │ - 266 } │ │ │ │ │ - 267 │ │ │ │ │ - 268 // in case degree is static, provid an array │ │ │ │ │ - 269 template │ │ │ │ │ - 270 static auto node_storage_provider(StaticIndex) │ │ │ │ │ - 271 { │ │ │ │ │ - 272 return std::array(); │ │ │ │ │ - 273 } │ │ │ │ │ - 274 │ │ │ │ │ - 275 public: │ │ │ │ │ - 276 // get transformed type from specification │ │ │ │ │ - 277 // Handling this transformation in a way that makes the per-node │ │ │ │ │ -specification easy to write │ │ │ │ │ - 278 // is a little involved: │ │ │ │ │ - 279 // The problem is that the transformed power node must be parameterized on │ │ │ │ │ -the transformed child │ │ │ │ │ - 280 // type. So we need to transform the child type and pass the transformed │ │ │ │ │ -child type to an inner │ │ │ │ │ - 281 // template of the node transformation struct called result (see example │ │ │ │ │ -of such a specification │ │ │ │ │ - 282 // further down). │ │ │ │ │ - 283 using NodeTransformation = typename │ │ │ │ │ -LookupNodeTransformation>:: │ │ │ │ │ -type; │ │ │ │ │ - 284 using ChildNodeTransformation = typename │ │ │ │ │ -LookupNodeTransformation>:: │ │ │ │ │ -type; │ │ │ │ │ - 285 │ │ │ │ │ - 286 private: │ │ │ │ │ - 287 // Since every child is same type, is enough to get transformation once │ │ │ │ │ - 288 using ChildTreeTransformation = TransformTree, │ │ │ │ │ - 291 ChildNodeTransformation::recursive>; │ │ │ │ │ - 292 │ │ │ │ │ - 293 // Get transformed type of children │ │ │ │ │ - 294 using transformed_child_type = typename ChildTreeTransformation:: │ │ │ │ │ -transformed_type; │ │ │ │ │ - 295 using transformed_child_storage_type = typename ChildTreeTransformation:: │ │ │ │ │ -transformed_storage_type; │ │ │ │ │ - 296 public: │ │ │ │ │ - 297 // Apply transformation from children to current node │ │ │ │ │ - 298 using transformed_type = typename NodeTransformation::template │ │ │ │ │ -result::type; │ │ │ │ │ - 299 using transformed_storage_type = typename NodeTransformation::template │ │ │ │ │ -result::storage_type; │ │ │ │ │ - 300 │ │ │ │ │ - 301 // Transform an instance of source tree. │ │ │ │ │ - 302 static transformed_type transform(const Source& source, Transformation& │ │ │ │ │ -transformation) │ │ │ │ │ - 303 { │ │ │ │ │ - 304 auto children_storage = node_storage_provider>(source.degree()); │ │ │ │ │ - 305 for (std::size_t k = 0; k < source.degree(); ++k) { │ │ │ │ │ - 306 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ -(source.childStorage(k),transformation); │ │ │ │ │ - 307 } │ │ │ │ │ - 308 return NodeTransformation::transform │ │ │ │ │ -(source,transformation,children_storage); │ │ │ │ │ - 309 } │ │ │ │ │ - 310 │ │ │ │ │ - 311 // Transform an instance of source tree. │ │ │ │ │ - 312 static transformed_type transform(const Source& source, const │ │ │ │ │ -Transformation& transformation) │ │ │ │ │ - 313 { │ │ │ │ │ - 314 auto children_storage = node_storage_provider>(source.degree()); │ │ │ │ │ - 315 for (std::size_t k = 0; k < source.degree(); ++k) { │ │ │ │ │ - 316 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ -(source.childStorage(k),transformation); │ │ │ │ │ - 317 } │ │ │ │ │ - 318 return NodeTransformation::transform │ │ │ │ │ -(source,transformation,children_storage); │ │ │ │ │ - 319 } │ │ │ │ │ - 320 │ │ │ │ │ - 321 // Transform an instance of source tree. │ │ │ │ │ - 322 static transformed_type transform(std::shared_ptr │ │ │ │ │ -source_ptr, Transformation& transformation) │ │ │ │ │ - 323 { │ │ │ │ │ - 324 auto children_storage = node_storage_provider>(source_ptr->degree()); │ │ │ │ │ - 325 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ - 326 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ -(source_ptr->childStorage(k),transformation); │ │ │ │ │ - 327 } │ │ │ │ │ - 328 return NodeTransformation::transform │ │ │ │ │ -(source_ptr,transformation,children_storage); │ │ │ │ │ - 329 } │ │ │ │ │ - 330 │ │ │ │ │ - 331 // Transform an instance of source tree. │ │ │ │ │ - 332 static transformed_type transform(std::shared_ptr │ │ │ │ │ -source_ptr, const Transformation& transformation) │ │ │ │ │ - 333 { │ │ │ │ │ - 334 auto children_storage = node_storage_provider>(source_ptr->degree()); │ │ │ │ │ - 335 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ - 336 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ -(source_ptr->childStorage(k),transformation); │ │ │ │ │ - 337 } │ │ │ │ │ - 338 return NodeTransformation::transform │ │ │ │ │ -(source_ptr,transformation,children_storage); │ │ │ │ │ - 339 } │ │ │ │ │ - 340 │ │ │ │ │ - 341 // Transform an instance of source tree ptr. │ │ │ │ │ - 342 static transformed_storage_type transform_storage(std::shared_ptr source_ptr, Transformation& transformation) │ │ │ │ │ - 343 { │ │ │ │ │ - 344 auto children_storage = │ │ │ │ │ -node_storage_provider(source_ptr->degree()); │ │ │ │ │ - 345 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ - 346 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ -(source_ptr->childStorage(k),transformation); │ │ │ │ │ - 347 } │ │ │ │ │ - 348 return NodeTransformation::transform_storage │ │ │ │ │ -(source_ptr,transformation,children_storage); │ │ │ │ │ - 349 } │ │ │ │ │ - 350 │ │ │ │ │ - 351 // Transform an instance of source tree ptr. │ │ │ │ │ - 352 static transformed_storage_type transform_storage(std::shared_ptr source_ptr, const Transformation& transformation) │ │ │ │ │ - 353 { │ │ │ │ │ - 354 auto children_storage = │ │ │ │ │ -node_storage_provider(source_ptr->degree()); │ │ │ │ │ - 355 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ - 356 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ -(source_ptr->childStorage(k),transformation); │ │ │ │ │ - 357 } │ │ │ │ │ - 358 return NodeTransformation::transform_storage │ │ │ │ │ -(source_ptr,transformation,children_storage); │ │ │ │ │ - 359 } │ │ │ │ │ - 360 │ │ │ │ │ - 361 }; │ │ │ │ │ - 362 } // namespace Impl │ │ │ │ │ - 363 │ │ │ │ │ - 364 // Recursive version of the PowerNode transformation for static nodes. │ │ │ │ │ - 365 template │ │ │ │ │ - 366 struct TransformTree │ │ │ │ │ - 367 : public Impl:: │ │ │ │ │ -RecursivePowerTransformTree │ │ │ │ │ - 368 {}; │ │ │ │ │ - 369 │ │ │ │ │ - 370 // Recursive version of the DynamicPowerNode transformation for static │ │ │ │ │ -nodes. │ │ │ │ │ - 371 template │ │ │ │ │ - 372 struct TransformTree │ │ │ │ │ - 373 : public Impl:: │ │ │ │ │ -RecursivePowerTransformTree │ │ │ │ │ - 374 {}; │ │ │ │ │ - 375 │ │ │ │ │ - 376 // non-recursive version of the PowerNode transformation. │ │ │ │ │ - 377 template │ │ │ │ │ - 378 struct TransformTree │ │ │ │ │ - 379 : public TransformTreeNonRecursive │ │ │ │ │ - 380 {}; │ │ │ │ │ - 381 │ │ │ │ │ - 382 // non-recursive version of the DynamicPowerNodeTag transformation. │ │ │ │ │ - 383 template │ │ │ │ │ - 384 struct TransformTree │ │ │ │ │ - 385 : public TransformTreeNonRecursive │ │ │ │ │ - 386 {}; │ │ │ │ │ - 387 │ │ │ │ │ - 388 // helper struct that does the actual transformation for a composite node. │ │ │ │ │ -We need this additional struct │ │ │ │ │ - 389 // to extract the template argument list with the types of all children │ │ │ │ │ -from the node, which we cannot do │ │ │ │ │ - 390 // directly in the transformation<> template, as the type passed to │ │ │ │ │ -transformation<> will usually be a │ │ │ │ │ - 391 // derived type and will normally have more template arguments than just │ │ │ │ │ -the children. This declaration │ │ │ │ │ - 392 // just introduces the type of the helper struct, we always instantiate │ │ │ │ │ -the specialization defined below; │ │ │ │ │ - 393 template │ │ │ │ │ - 394 struct transform_composite_node; │ │ │ │ │ - 395 │ │ │ │ │ - 396 // specialized version of the helper struct which extracts the template │ │ │ │ │ -argument list with the children from │ │ │ │ │ - 397 // its second template parameter, which has to be CompositeNode:: │ │ │ │ │ -ChildTypes. Apart from that, the struct is │ │ │ │ │ - 398 // similar to the one for a PowerNode, but it obviously delegates │ │ │ │ │ -transformation of the children to the TMP. │ │ │ │ │ - 399 template │ │ │ │ │ - 400 struct transform_composite_node,T> │ │ │ │ │ - 401 { │ │ │ │ │ - 402 │ │ │ │ │ - 403 // transformed type, using the same nested struct trick as the PowerNode │ │ │ │ │ - 404 typedef ImplementationTag Tag; │ │ │ │ │ - 405 typedef typename LookupNodeTransformation::type │ │ │ │ │ -NodeTransformation; │ │ │ │ │ - 406 typedef typename NodeTransformation::template result, │ │ │ │ │ - 409 LookupNodeTransformation>::type::recursive │ │ │ │ │ - 410 >::transformed_type... │ │ │ │ │ - 411 >::type transformed_type; │ │ │ │ │ - 412 │ │ │ │ │ - 413 typedef typename NodeTransformation::template result, │ │ │ │ │ - 416 LookupNodeTransformation>::type::recursive │ │ │ │ │ - 417 >::transformed_type... │ │ │ │ │ - 418 >::storage_type transformed_storage_type; │ │ │ │ │ - 419 │ │ │ │ │ - 420 // Retrieve the transformation descriptor for the child with index i. │ │ │ │ │ - 421 // This little helper improves really improves the readability of the │ │ │ │ │ - 422 // transformation functions. │ │ │ │ │ - 423 template │ │ │ │ │ - 424 struct ChildTransformation │ │ │ │ │ - 425 : public TransformTree::Type, │ │ │ │ │ - 426 T, │ │ │ │ │ - 427 NodeTag::Type>, │ │ │ │ │ - 428 LookupNodeTransformation< │ │ │ │ │ - 429 typename S::template Child::Type, │ │ │ │ │ - 430 T, │ │ │ │ │ - 431 ImplementationTag::Type> │ │ │ │ │ - 432 >::type::recursive │ │ │ │ │ - 433 > │ │ │ │ │ - 434 {}; │ │ │ │ │ - 435 │ │ │ │ │ - 436 template │ │ │ │ │ - 437 static void setElement(Tuple& tuple, Value&& value) │ │ │ │ │ - 438 { │ │ │ │ │ - 439 std::get(tuple) = std::forward(value); │ │ │ │ │ - 440 } │ │ │ │ │ - 441 │ │ │ │ │ - 442 template │ │ │ │ │ - 443 static transformed_type transform(const S& s, Trafo&& t, std:: │ │ │ │ │ -index_sequence indices) │ │ │ │ │ - 444 { │ │ │ │ │ - 445 std::tuple::transformed_storage_type...> │ │ │ │ │ -storage; │ │ │ │ │ - 446 Dune::Hybrid::Impl::evaluateFoldExpression({(setElement(storage, │ │ │ │ │ -ChildTransformation::transform_storage(s.template childStorage(), std:: │ │ │ │ │ -forward(t))),0)...}); │ │ │ │ │ - 447 return NodeTransformation::transform(s, std::forward(t), std:: │ │ │ │ │ -get(storage)...); │ │ │ │ │ - 448 } │ │ │ │ │ - 449 │ │ │ │ │ - 450 template │ │ │ │ │ - 451 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, Trafo&& t, std::index_sequence indices) │ │ │ │ │ - 452 { │ │ │ │ │ - 453 std::tuple::transformed_storage_type...> │ │ │ │ │ -storage; │ │ │ │ │ - 454 Dune::Hybrid::Impl::evaluateFoldExpression({(setElement(storage, │ │ │ │ │ -ChildTransformation::transform_storage(sp->template childStorage(), std:: │ │ │ │ │ -forward(t))),0)...}); │ │ │ │ │ - 455 return NodeTransformation::transform_storage(sp, std::forward(t), │ │ │ │ │ -std::get(storage)...); │ │ │ │ │ - 456 } │ │ │ │ │ - 457 }; │ │ │ │ │ - 458 │ │ │ │ │ - 459 │ │ │ │ │ - 460 // the specialization of transformation<> for the CompositeNode. This just │ │ │ │ │ -extracts the │ │ │ │ │ - 461 // CompositeNode::ChildTypes member and forwards to the helper struct │ │ │ │ │ - 462 template │ │ │ │ │ - 463 struct TransformTree │ │ │ │ │ - 464 { │ │ │ │ │ - 465 │ │ │ │ │ - 466 private: │ │ │ │ │ - 467 │ │ │ │ │ - 468 typedef typename S::ChildTypes ChildTypes; │ │ │ │ │ - 469 │ │ │ │ │ - 470 static auto child_indices() │ │ │ │ │ - 471 { │ │ │ │ │ - 472 return std::make_index_sequence(); │ │ │ │ │ - 473 } │ │ │ │ │ - 474 │ │ │ │ │ - 475 public: │ │ │ │ │ - 476 │ │ │ │ │ - 477 typedef typename transform_composite_node:: │ │ │ │ │ -transformed_type transformed_type; │ │ │ │ │ - 478 typedef typename transform_composite_node:: │ │ │ │ │ -transformed_storage_type transformed_storage_type; │ │ │ │ │ - 479 │ │ │ │ │ - 480 static transformed_type transform(const S& s, T& t) │ │ │ │ │ - 481 { │ │ │ │ │ - 482 return transform_composite_node::transform │ │ │ │ │ -(s,t,child_indices()); │ │ │ │ │ - 483 } │ │ │ │ │ - 484 │ │ │ │ │ - 485 static transformed_type transform(const S& s, const T& t) │ │ │ │ │ - 486 { │ │ │ │ │ - 487 return transform_composite_node::transform │ │ │ │ │ -(s,t,child_indices()); │ │ │ │ │ - 488 } │ │ │ │ │ - 489 │ │ │ │ │ - 490 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, T& t) │ │ │ │ │ - 491 { │ │ │ │ │ - 492 return transform_composite_node::transform_storage │ │ │ │ │ -(sp,t,child_indices()); │ │ │ │ │ - 493 } │ │ │ │ │ - 494 │ │ │ │ │ - 495 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ -sp, const T& t) │ │ │ │ │ - 496 { │ │ │ │ │ - 497 return transform_composite_node::transform_storage │ │ │ │ │ -(sp,t,child_indices()); │ │ │ │ │ - 498 } │ │ │ │ │ - 499 │ │ │ │ │ - 500 }; │ │ │ │ │ - 501 │ │ │ │ │ - 502 // non-recursive version of the CompositeNode transformation. │ │ │ │ │ - 503 template │ │ │ │ │ - 504 struct TransformTree │ │ │ │ │ - 505 : public TransformTreeNonRecursive │ │ │ │ │ - 506 {}; │ │ │ │ │ - 507 │ │ │ │ │ - 508#endif // DOXYGEN │ │ │ │ │ - 509 │ │ │ │ │ - 511 │ │ │ │ │ - 512 } // namespace TypeTree │ │ │ │ │ - 513} //namespace Dune │ │ │ │ │ - 514 │ │ │ │ │ - 515#endif // DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ +34 static const bool isPower = false; │ │ │ │ │ + 35 │ │ │ │ │ +37 static const bool isComposite = false; │ │ │ │ │ + 38 │ │ │ │ │ + 40 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +41 static const std::size_t CHILDREN = 0; │ │ │ │ │ + 42 │ │ │ │ │ +44 typedef LeafNodeTag NodeTag; │ │ │ │ │ + 45 │ │ │ │ │ +46 static constexpr auto degree() │ │ │ │ │ + 47 { │ │ │ │ │ + 48 return std::integral_constant{}; │ │ │ │ │ + 49 } │ │ │ │ │ + 50 │ │ │ │ │ + 51 protected: │ │ │ │ │ + 52 │ │ │ │ │ + 54 │ │ │ │ │ +59 LeafNode() {} │ │ │ │ │ + 60 }; │ │ │ │ │ + 61 │ │ │ │ │ + 63 │ │ │ │ │ + 64 } // namespace TypeTree │ │ │ │ │ + 65} //namespace Dune │ │ │ │ │ + 66 │ │ │ │ │ + 67#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ nodetags.hh │ │ │ │ │ -result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:110 │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ -utility.hh │ │ │ │ │ -typetraits.hh │ │ │ │ │ -Dune::TypeTree::degree │ │ │ │ │ -std::size_t degree(const Node &node) │ │ │ │ │ -Returns the degree of node as run time information. │ │ │ │ │ -Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::registerNodeTransformation │ │ │ │ │ -void registerNodeTransformation(SourceNode *, Transformation *, Tag *) │ │ │ │ │ -Register transformation descriptor to transform SourceNode with Transformation. │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::TransformTree │ │ │ │ │ -Transform a TypeTree. │ │ │ │ │ -Definition: transformation.hh:94 │ │ │ │ │ -Dune::TypeTree::TransformTree::Type │ │ │ │ │ -type Type │ │ │ │ │ -Definition: transformation.hh:111 │ │ │ │ │ -Dune::TypeTree::TransformTree::transform │ │ │ │ │ -static transformed_type transform(std::shared_ptr< const SourceTree > sp, │ │ │ │ │ -Transformation &t) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -Definition: transformation.hh:132 │ │ │ │ │ -Dune::TypeTree::TransformTree::transform │ │ │ │ │ -static transformed_type transform(std::shared_ptr< const SourceTree > sp, const │ │ │ │ │ -Transformation &t=Transformation()) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -Definition: transformation.hh:126 │ │ │ │ │ -Dune::TypeTree::TransformTree::transform │ │ │ │ │ -static transformed_type transform(const SourceTree &s, Transformation &t) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -Definition: transformation.hh:120 │ │ │ │ │ -Dune::TypeTree::TransformTree::type │ │ │ │ │ -transformed_type type │ │ │ │ │ -The type of the transformed tree. │ │ │ │ │ -Definition: transformation.hh:109 │ │ │ │ │ -Dune::TypeTree::TransformTree::transform │ │ │ │ │ -static transformed_type transform(const SourceTree &s, const Transformation │ │ │ │ │ -&t=Transformation()) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -Definition: transformation.hh:114 │ │ │ │ │ -Dune::TypeTree::TransformTree::transform_storage │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceTree > sp, const Transformation &t=Transformation()) │ │ │ │ │ -Definition: transformation.hh:139 │ │ │ │ │ -Dune::TypeTree::TransformTree::transform_storage │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceTree > sp, Transformation &t) │ │ │ │ │ -Definition: transformation.hh:146 │ │ │ │ │ -Dune::TypeTree::evaluate_if_meta_function │ │ │ │ │ -Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ -Definition: typetraits.hh:140 │ │ │ │ │ +Dune::TypeTree::LeafNode │ │ │ │ │ +Base class for leaf nodes in a dune-typetree. │ │ │ │ │ +Definition: leafnode.hh:26 │ │ │ │ │ +Dune::TypeTree::LeafNode::NodeTag │ │ │ │ │ +LeafNodeTag NodeTag │ │ │ │ │ +The type tag that describes a LeafNode. │ │ │ │ │ +Definition: leafnode.hh:44 │ │ │ │ │ +Dune::TypeTree::LeafNode::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as a leaf in a dune-typetree. │ │ │ │ │ +Definition: leafnode.hh:31 │ │ │ │ │ +Dune::TypeTree::LeafNode::CHILDREN │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +Leafs have no children. │ │ │ │ │ +Definition: leafnode.hh:41 │ │ │ │ │ +Dune::TypeTree::LeafNode::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +Definition: leafnode.hh:34 │ │ │ │ │ +Dune::TypeTree::LeafNode::LeafNode │ │ │ │ │ +LeafNode() │ │ │ │ │ +Default constructor. │ │ │ │ │ +Definition: leafnode.hh:59 │ │ │ │ │ +Dune::TypeTree::LeafNode::isComposite │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a non composite in the dune-typetree. │ │ │ │ │ +Definition: leafnode.hh:37 │ │ │ │ │ +Dune::TypeTree::LeafNode::degree │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +Definition: leafnode.hh:46 │ │ │ │ │ +Dune::TypeTree::LeafNodeTag │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +Definition: nodetags.hh:16 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filters.hh File Reference │ │ │ │ +dune-typetree: transformationutilities.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,73 +62,21 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
filters.hh File Reference
│ │ │ │ +
transformationutilities.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <tuple>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ + │ │ │ │

Go to the source code of this file.

│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

struct  Dune::TypeTree::FilterEntry< new_k, old_k >
 A filter entry describing the mapping of one child in the filtered node. More...
 
struct  Dune::TypeTree::FilterResult< FilterEntries >
 The result of a filter. More...
 
struct  Dune::TypeTree::FilterResult< FilterEntries >::apply< Node >
 
struct  Dune::TypeTree::SimpleFilterTag
 Tag describing a simple filter that can only decide whether or not to include a single given child. More...
 
struct  Dune::TypeTree::AdvancedFilterTag
 Tag describing an advanced filter that has full control over the construction of the list of FilterEntries. More...
 
struct  Dune::TypeTree::AdvancedFilter
 Base class for advanced filters. More...
 
struct  Dune::TypeTree::AdvancedFilter::apply< Node, Children >
 Apply this filter to the given node and children. More...
 
struct  Dune::TypeTree::SimpleFilter
 Default simple filter that accepts any node and leaves its child structure unchanged. More...
 
struct  Dune::TypeTree::SimpleFilter::validate< Node >
 Validates the combination of filter and node. More...
 
struct  Dune::TypeTree::SimpleFilter::apply< Child, new_index, old_index >
 Applies the filter to the given child node. More...
 
struct  Dune::TypeTree::IndexFilter< indices >
 Filter class for FilteredCompositeNode that selects the children with the given indices. More...
 
struct  Dune::TypeTree::filter< Filter >
 Adapter class that takes a SimpleFilter, validated it and turns it into an AdvancedFilter. More...
 
struct  Dune::TypeTree::filter< Filter >::apply< Node, Children >
 Apply the filter. More...
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,65 +4,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -filters.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +transformationutilities.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -struct  Dune::TypeTree::FilterEntry<_new_k,_old_k_> │ │ │ │ │ -  A filter entry describing the mapping of one child in the filtered │ │ │ │ │ - node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::FilterResult<_FilterEntries_> │ │ │ │ │ -  The result of a filter. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::FilterResult<_FilterEntries_>::apply<_Node_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleFilterTag │ │ │ │ │ -  Tag describing a simple filter that can only decide whether or not to │ │ │ │ │ - include a single given child. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::AdvancedFilterTag │ │ │ │ │ -  Tag describing an advanced filter that has full control over the │ │ │ │ │ - construction of the list of FilterEntries. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::AdvancedFilter │ │ │ │ │ -  Base class for advanced filters. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::AdvancedFilter::apply<_Node,_Children_> │ │ │ │ │ -  Apply this filter to the given node and children. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleFilter │ │ │ │ │ -  Default simple filter that accepts any node and leaves its child │ │ │ │ │ - structure unchanged. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleFilter::validate<_Node_> │ │ │ │ │ -  Validates the combination of filter and node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleFilter::apply<_Child,_new_index,_old_index_> │ │ │ │ │ -  Applies the filter to the given child node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::IndexFilter<_indices_> │ │ │ │ │ -  Filter class for FilteredCompositeNode that selects the children with │ │ │ │ │ - the given indices. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::filter<_Filter_> │ │ │ │ │ -  Adapter class that takes a SimpleFilter, validated it and turns it │ │ │ │ │ - into an AdvancedFilter. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::filter<_Filter_>::apply<_Node,_Children_> │ │ │ │ │ -  Apply the filter. More... │ │ │ │ │ -  │ │ │ │ │ - Namespaces │ │ │ │ │ -namespace  Dune │ │ │ │ │ -  │ │ │ │ │ -namespace  Dune::TypeTree │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filters.hh Source File │ │ │ │ +dune-typetree: transformationutilities.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,238 +62,29 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
filters.hh
│ │ │ │ +
transformationutilities.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_FILTERS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_FILTERS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │
6
│ │ │ │ -
7#include <tuple>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/typetraits.hh>
│ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12 namespace TypeTree {
│ │ │ │ -
13
│ │ │ │ -
20 template<std::size_t new_k, std::size_t old_k>
│ │ │ │ - │ │ │ │ -
22 {
│ │ │ │ -
23
│ │ │ │ -
24#ifndef DOXYGEN
│ │ │ │ -
25
│ │ │ │ -
26 // The precise contents of this class is an implementation detail.
│ │ │ │ -
27
│ │ │ │ -
28 static const std::size_t filtered_index = new_k;
│ │ │ │ -
29 static const std::size_t original_index = old_k;
│ │ │ │ -
30
│ │ │ │ -
31#endif // DOXYGEN
│ │ │ │ -
32
│ │ │ │ -
33 };
│ │ │ │ -
34
│ │ │ │ -
36 template<typename... FilterEntries>
│ │ │ │ - │ │ │ │ -
38 {
│ │ │ │ -
39
│ │ │ │ -
40 static const std::size_t size = sizeof...(FilterEntries);
│ │ │ │ -
41
│ │ │ │ -
42 typedef std::tuple<FilterEntries...> IndexMap;
│ │ │ │ -
43
│ │ │ │ -
44 template<typename Node>
│ │ │ │ -
45 struct apply
│ │ │ │ -
46 {
│ │ │ │ -
47 typedef std::tuple<typename Node::template Child<FilterEntries::original_index>...> Children;
│ │ │ │ - │ │ │ │ - │ │ │ │ -
50 };
│ │ │ │ -
51
│ │ │ │ -
52 };
│ │ │ │ -
53
│ │ │ │ -
55 struct SimpleFilterTag {};
│ │ │ │ -
56
│ │ │ │ - │ │ │ │ -
59
│ │ │ │ -
60
│ │ │ │ - │ │ │ │ -
63 {
│ │ │ │ -
64
│ │ │ │ - │ │ │ │ -
67
│ │ │ │ -
68#ifdef DOXYGEN
│ │ │ │ -
69
│ │ │ │ -
71 template<typename Node, typename... Children>
│ │ │ │ -
72 struct apply
│ │ │ │ -
73 {
│ │ │ │ -
75
│ │ │ │ -
78 typedef implementation-defined type;
│ │ │ │ -
79 };
│ │ │ │ -
80
│ │ │ │ -
81#endif // DOXYGEN
│ │ │ │ -
82
│ │ │ │ -
83 };
│ │ │ │ -
84
│ │ │ │ -
86
│ │ │ │ - │ │ │ │ -
92 {
│ │ │ │ -
93
│ │ │ │ - │ │ │ │ -
96
│ │ │ │ -
97
│ │ │ │ -
99 template<typename Node>
│ │ │ │ -
100 struct validate
│ │ │ │ -
101 {
│ │ │ │ -
103 static const bool value = true;
│ │ │ │ -
104 };
│ │ │ │ -
105
│ │ │ │ -
107
│ │ │ │ -
115 template<typename Child, std::size_t new_index, std::size_t old_index>
│ │ │ │ -
116 struct apply
│ │ │ │ -
117 {
│ │ │ │ -
119 static const bool value = true;
│ │ │ │ -
120 };
│ │ │ │ -
121
│ │ │ │ -
122 };
│ │ │ │ -
123
│ │ │ │ -
124 namespace {
│ │ │ │ -
125
│ │ │ │ -
126 // ********************************************************************************
│ │ │ │ -
127 // IndexFilter helpers
│ │ │ │ -
128 // ********************************************************************************
│ │ │ │ -
129
│ │ │ │ -
130 template<typename Node, std::size_t new_index, std::size_t... indices>
│ │ │ │ -
131 struct index_filter_helper
│ │ │ │ -
132 {
│ │ │ │ -
133 template<typename... FilterEntries>
│ │ │ │ -
134 struct apply
│ │ │ │ -
135 {
│ │ │ │ -
136 typedef FilterResult<FilterEntries...> type;
│ │ │ │ -
137 };
│ │ │ │ -
138 };
│ │ │ │ -
139
│ │ │ │ -
140 template<typename Node, std::size_t new_index, std::size_t old_index, std::size_t... indices>
│ │ │ │ -
141 struct index_filter_helper<Node,new_index,old_index,indices...>
│ │ │ │ -
142 {
│ │ │ │ -
143 template<typename... FilterEntries>
│ │ │ │ -
144 struct apply
│ │ │ │ -
145 : public index_filter_helper<Node,new_index+1,indices...>::template apply<FilterEntries...,
│ │ │ │ -
146 FilterEntry<new_index,
│ │ │ │ -
147 old_index>
│ │ │ │ -
148 >
│ │ │ │ -
149 {};
│ │ │ │ -
150 };
│ │ │ │ -
151
│ │ │ │ -
152 } // anonymous namespace
│ │ │ │ -
153
│ │ │ │ -
154
│ │ │ │ -
156 template<std::size_t... indices>
│ │ │ │ - │ │ │ │ -
158 : public AdvancedFilter
│ │ │ │ -
159 {
│ │ │ │ -
160
│ │ │ │ -
161#ifndef DOXYGEN
│ │ │ │ -
162
│ │ │ │ -
163 template<typename Node, typename... Children>
│ │ │ │ -
164 struct apply
│ │ │ │ -
165 {
│ │ │ │ -
166 typedef typename index_filter_helper<Node,0,indices...>::template apply<>::type type;
│ │ │ │ -
167 };
│ │ │ │ -
168
│ │ │ │ -
169#endif // DOXYGEN
│ │ │ │ -
170
│ │ │ │ -
171 };
│ │ │ │ -
172
│ │ │ │ -
173
│ │ │ │ -
174 // ********************************************************************************
│ │ │ │ -
175 // filter: Wrapper class for turning a simple filter into an advanced filter
│ │ │ │ -
176 // usable by FilteredCompositeNode
│ │ │ │ -
177 // ********************************************************************************
│ │ │ │ -
178
│ │ │ │ -
179 namespace {
│ │ │ │ -
180
│ │ │ │ -
181 template<typename Filter, std::size_t new_k, std::size_t old_k, typename... tail>
│ │ │ │ -
182 struct filter_helper
│ │ │ │ -
183 {
│ │ │ │ -
184 template<typename... FilterDescriptors>
│ │ │ │ -
185 struct apply
│ │ │ │ -
186 {
│ │ │ │ -
187 typedef FilterResult<FilterDescriptors...> type;
│ │ │ │ -
188 };
│ │ │ │ -
189 };
│ │ │ │ -
190
│ │ │ │ -
191 template<typename Filter, std::size_t new_k, std::size_t old_k, typename child, typename... tail>
│ │ │ │ -
192 struct filter_helper<Filter,new_k,old_k,child,tail...>
│ │ │ │ -
193 {
│ │ │ │ -
194
│ │ │ │ -
195 template<typename... FilterDescriptors>
│ │ │ │ -
196 struct apply
│ │ │ │ -
197 : public std::conditional<Filter::template apply<child,new_k,old_k>::value,
│ │ │ │ -
198 typename filter_helper<Filter,new_k+1,old_k+1,tail...>::template apply<FilterDescriptors...,FilterEntry<new_k,old_k> >,
│ │ │ │ -
199 typename filter_helper<Filter,new_k,old_k+1,tail...>::template apply<FilterDescriptors...>
│ │ │ │ -
200 >::type
│ │ │ │ -
201 {};
│ │ │ │ -
202
│ │ │ │ -
203 };
│ │ │ │ -
204
│ │ │ │ -
205 } // anonymous namespace
│ │ │ │ -
206
│ │ │ │ -
208 template<typename Filter>
│ │ │ │ -
209 struct filter
│ │ │ │ -
210 {
│ │ │ │ -
211
│ │ │ │ -
213 template<typename Node, typename... Children>
│ │ │ │ -
214 struct apply
│ │ │ │ -
215 {
│ │ │ │ -
216
│ │ │ │ -
217 static_assert((Filter::template validate<Node>::value),"Invalid simple filter");
│ │ │ │ -
218
│ │ │ │ -
219 typedef typename filter_helper<Filter,0,0,Children...>::template apply<>::type type;
│ │ │ │ -
220
│ │ │ │ -
221 };
│ │ │ │ -
222
│ │ │ │ -
223 };
│ │ │ │ -
224
│ │ │ │ -
226
│ │ │ │ -
227 } // namespace TypeTree
│ │ │ │ -
228} //namespace Dune
│ │ │ │ -
229
│ │ │ │ -
230#endif // DUNE_TYPETREE_FILTERS_HH
│ │ │ │ -
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ -
Definition: accumulate_static.hh:13
│ │ │ │ -
Type
Definition: treepath.hh:30
│ │ │ │ -
A filter entry describing the mapping of one child in the filtered node.
Definition: filters.hh:22
│ │ │ │ -
The result of a filter.
Definition: filters.hh:38
│ │ │ │ -
std::tuple< FilterEntries... > IndexMap
Definition: filters.hh:42
│ │ │ │ -
static const std::size_t size
Definition: filters.hh:40
│ │ │ │ -
Definition: filters.hh:46
│ │ │ │ -
std::tuple< typename Node::template Child< FilterEntries::original_index >... > Children
Definition: filters.hh:47
│ │ │ │ -
std::tuple< typename Node::template Child< FilterEntries::original_index >::Type... > ChildTypes
Definition: filters.hh:48
│ │ │ │ -
std::tuple< std::shared_ptr< typename Node::template Child< FilterEntries::original_index >::Type >... > NodeStorage
Definition: filters.hh:49
│ │ │ │ -
Tag describing a simple filter that can only decide whether or not to include a single given child.
Definition: filters.hh:55
│ │ │ │ -
Tag describing an advanced filter that has full control over the construction of the list of FilterEn...
Definition: filters.hh:58
│ │ │ │ -
Base class for advanced filters.
Definition: filters.hh:63
│ │ │ │ -
AdvancedFilterTag FilterTag
Filter tag for deciding on filter application mechanism.
Definition: filters.hh:66
│ │ │ │ -
Apply this filter to the given node and children.
Definition: filters.hh:73
│ │ │ │ -
implementation defined type
The result of the filtering process.
Definition: filters.hh:78
│ │ │ │ -
Default simple filter that accepts any node and leaves its child structure unchanged.
Definition: filters.hh:92
│ │ │ │ -
SimpleFilterTag FilterTag
Filter tag for deciding on filter application mechanism.
Definition: filters.hh:95
│ │ │ │ -
Validates the combination of filter and node.
Definition: filters.hh:101
│ │ │ │ -
static const bool value
True if the combination of filter and node is valid.
Definition: filters.hh:103
│ │ │ │ -
Applies the filter to the given child node.
Definition: filters.hh:117
│ │ │ │ -
static const bool value
True if the child will be included in the filtered node.
Definition: filters.hh:119
│ │ │ │ -
Filter class for FilteredCompositeNode that selects the children with the given indices.
Definition: filters.hh:159
│ │ │ │ -
Adapter class that takes a SimpleFilter, validated it and turns it into an AdvancedFilter.
Definition: filters.hh:210
│ │ │ │ -
Apply the filter.
Definition: filters.hh:215
│ │ │ │ -
filter_helper< Filter, 0, 0, Children... >::template apply ::type type
Definition: filters.hh:219
│ │ │ │ + │ │ │ │ + │ │ │ │ +
9
│ │ │ │ +
10#endif // DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,322 +4,24 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -filters.hh │ │ │ │ │ +transformationutilities.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11namespace Dune { │ │ │ │ │ - 12 namespace TypeTree { │ │ │ │ │ - 13 │ │ │ │ │ - 20 template │ │ │ │ │ -21 struct FilterEntry │ │ │ │ │ - 22 { │ │ │ │ │ - 23 │ │ │ │ │ - 24#ifndef DOXYGEN │ │ │ │ │ - 25 │ │ │ │ │ - 26 // The precise contents of this class is an implementation detail. │ │ │ │ │ - 27 │ │ │ │ │ - 28 static const std::size_t filtered_index = new_k; │ │ │ │ │ - 29 static const std::size_t original_index = old_k; │ │ │ │ │ - 30 │ │ │ │ │ - 31#endif // DOXYGEN │ │ │ │ │ - 32 │ │ │ │ │ - 33 }; │ │ │ │ │ - 34 │ │ │ │ │ - 36 template │ │ │ │ │ -37 struct FilterResult │ │ │ │ │ - 38 { │ │ │ │ │ - 39 │ │ │ │ │ -40 static const std::size_t size = sizeof...(FilterEntries); │ │ │ │ │ - 41 │ │ │ │ │ -42 typedef std::tuple IndexMap; │ │ │ │ │ - 43 │ │ │ │ │ - 44 template │ │ │ │ │ -45 struct apply │ │ │ │ │ - 46 { │ │ │ │ │ -47 typedef std::tuple...> Children; │ │ │ │ │ -48 typedef std::tuple::Type...> ChildTypes; │ │ │ │ │ -49 typedef std::tuple::Type>...> NodeStorage; │ │ │ │ │ - 50 }; │ │ │ │ │ - 51 │ │ │ │ │ - 52 }; │ │ │ │ │ - 53 │ │ │ │ │ -55 struct SimpleFilterTag {}; │ │ │ │ │ - 56 │ │ │ │ │ -58 struct AdvancedFilterTag {}; │ │ │ │ │ - 59 │ │ │ │ │ - 60 │ │ │ │ │ -62 struct AdvancedFilter │ │ │ │ │ - 63 { │ │ │ │ │ - 64 │ │ │ │ │ -66 typedef AdvancedFilterTag FilterTag; │ │ │ │ │ - 67 │ │ │ │ │ - 68#ifdef DOXYGEN │ │ │ │ │ - 69 │ │ │ │ │ - 71 template │ │ │ │ │ -72 struct apply │ │ │ │ │ - 73 { │ │ │ │ │ - 75 │ │ │ │ │ -78 typedef implementation-defined type; │ │ │ │ │ - 79 }; │ │ │ │ │ - 80 │ │ │ │ │ - 81#endif // DOXYGEN │ │ │ │ │ - 82 │ │ │ │ │ - 83 }; │ │ │ │ │ - 84 │ │ │ │ │ - 86 │ │ │ │ │ -91 struct SimpleFilter │ │ │ │ │ - 92 { │ │ │ │ │ - 93 │ │ │ │ │ -95 typedef SimpleFilterTag FilterTag; │ │ │ │ │ - 96 │ │ │ │ │ - 97 │ │ │ │ │ - 99 template │ │ │ │ │ -100 struct validate │ │ │ │ │ - 101 { │ │ │ │ │ -103 static const bool value = true; │ │ │ │ │ - 104 }; │ │ │ │ │ - 105 │ │ │ │ │ - 107 │ │ │ │ │ - 115 template │ │ │ │ │ -116 struct apply │ │ │ │ │ - 117 { │ │ │ │ │ -119 static const bool value = true; │ │ │ │ │ - 120 }; │ │ │ │ │ - 121 │ │ │ │ │ - 122 }; │ │ │ │ │ - 123 │ │ │ │ │ - 124 namespace { │ │ │ │ │ - 125 │ │ │ │ │ - 126 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 127 // IndexFilter helpers │ │ │ │ │ - 128 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 129 │ │ │ │ │ - 130 template │ │ │ │ │ - 131 struct index_filter_helper │ │ │ │ │ - 132 { │ │ │ │ │ - 133 template │ │ │ │ │ - 134 struct apply │ │ │ │ │ - 135 { │ │ │ │ │ - 136 typedef FilterResult type; │ │ │ │ │ - 137 }; │ │ │ │ │ - 138 }; │ │ │ │ │ - 139 │ │ │ │ │ - 140 template │ │ │ │ │ - 141 struct index_filter_helper │ │ │ │ │ - 142 { │ │ │ │ │ - 143 template │ │ │ │ │ - 144 struct apply │ │ │ │ │ - 145 : public index_filter_helper::template │ │ │ │ │ -apply │ │ │ │ │ - 148 > │ │ │ │ │ - 149 {}; │ │ │ │ │ - 150 }; │ │ │ │ │ - 151 │ │ │ │ │ - 152 } // anonymous namespace │ │ │ │ │ - 153 │ │ │ │ │ - 154 │ │ │ │ │ - 156 template │ │ │ │ │ -157 struct IndexFilter │ │ │ │ │ - 158 : public AdvancedFilter │ │ │ │ │ - 159 { │ │ │ │ │ - 160 │ │ │ │ │ - 161#ifndef DOXYGEN │ │ │ │ │ - 162 │ │ │ │ │ - 163 template │ │ │ │ │ - 164 struct apply │ │ │ │ │ - 165 { │ │ │ │ │ - 166 typedef typename index_filter_helper::template │ │ │ │ │ -apply<>::type type; │ │ │ │ │ - 167 }; │ │ │ │ │ - 168 │ │ │ │ │ - 169#endif // DOXYGEN │ │ │ │ │ - 170 │ │ │ │ │ - 171 }; │ │ │ │ │ - 172 │ │ │ │ │ - 173 │ │ │ │ │ - 174 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 175 // filter: Wrapper class for turning a simple filter into an advanced │ │ │ │ │ -filter │ │ │ │ │ - 176 // usable by FilteredCompositeNode │ │ │ │ │ - 177 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 178 │ │ │ │ │ - 179 namespace { │ │ │ │ │ - 180 │ │ │ │ │ - 181 template │ │ │ │ │ - 182 struct filter_helper │ │ │ │ │ - 183 { │ │ │ │ │ - 184 template │ │ │ │ │ - 185 struct apply │ │ │ │ │ - 186 { │ │ │ │ │ - 187 typedef FilterResult type; │ │ │ │ │ - 188 }; │ │ │ │ │ - 189 }; │ │ │ │ │ - 190 │ │ │ │ │ - 191 template │ │ │ │ │ - 192 struct filter_helper │ │ │ │ │ - 193 { │ │ │ │ │ - 194 │ │ │ │ │ - 195 template │ │ │ │ │ - 196 struct apply │ │ │ │ │ - 197 : public std::conditional:: │ │ │ │ │ -value, │ │ │ │ │ - 198 typename filter_helper::template │ │ │ │ │ -apply >, │ │ │ │ │ - 199 typename filter_helper::template │ │ │ │ │ -apply │ │ │ │ │ - 200 >::type │ │ │ │ │ - 201 {}; │ │ │ │ │ - 202 │ │ │ │ │ - 203 }; │ │ │ │ │ - 204 │ │ │ │ │ - 205 } // anonymous namespace │ │ │ │ │ - 206 │ │ │ │ │ - 208 template │ │ │ │ │ -209 struct filter │ │ │ │ │ - 210 { │ │ │ │ │ - 211 │ │ │ │ │ - 213 template │ │ │ │ │ -214 struct apply │ │ │ │ │ - 215 { │ │ │ │ │ - 216 │ │ │ │ │ - 217 static_assert((Filter::template validate::value),"Invalid simple │ │ │ │ │ -filter"); │ │ │ │ │ - 218 │ │ │ │ │ -219 typedef typename filter_helper::template apply<>:: │ │ │ │ │ -type type; │ │ │ │ │ - 220 │ │ │ │ │ - 221 }; │ │ │ │ │ - 222 │ │ │ │ │ - 223 }; │ │ │ │ │ - 224 │ │ │ │ │ - 226 │ │ │ │ │ - 227 } // namespace TypeTree │ │ │ │ │ - 228} //namespace Dune │ │ │ │ │ - 229 │ │ │ │ │ - 230#endif // DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ -Dune::TypeTree::child │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: childextraction.hh:126 │ │ │ │ │ -Dune │ │ │ │ │ -Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::TreePathType::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::FilterEntry │ │ │ │ │ -A filter entry describing the mapping of one child in the filtered node. │ │ │ │ │ -Definition: filters.hh:22 │ │ │ │ │ -Dune::TypeTree::FilterResult │ │ │ │ │ -The result of a filter. │ │ │ │ │ -Definition: filters.hh:38 │ │ │ │ │ -Dune::TypeTree::FilterResult::IndexMap │ │ │ │ │ -std::tuple< FilterEntries... > IndexMap │ │ │ │ │ -Definition: filters.hh:42 │ │ │ │ │ -Dune::TypeTree::FilterResult::size │ │ │ │ │ -static const std::size_t size │ │ │ │ │ -Definition: filters.hh:40 │ │ │ │ │ -Dune::TypeTree::FilterResult::apply │ │ │ │ │ -Definition: filters.hh:46 │ │ │ │ │ -Dune::TypeTree::FilterResult::apply::Children │ │ │ │ │ -std::tuple< typename Node::template Child< FilterEntries::original_index >... > │ │ │ │ │ -Children │ │ │ │ │ -Definition: filters.hh:47 │ │ │ │ │ -Dune::TypeTree::FilterResult::apply::ChildTypes │ │ │ │ │ -std::tuple< typename Node::template Child< FilterEntries::original_index >:: │ │ │ │ │ -Type... > ChildTypes │ │ │ │ │ -Definition: filters.hh:48 │ │ │ │ │ -Dune::TypeTree::FilterResult::apply::NodeStorage │ │ │ │ │ -std::tuple< std::shared_ptr< typename Node::template Child< FilterEntries:: │ │ │ │ │ -original_index >::Type >... > NodeStorage │ │ │ │ │ -Definition: filters.hh:49 │ │ │ │ │ -Dune::TypeTree::SimpleFilterTag │ │ │ │ │ -Tag describing a simple filter that can only decide whether or not to include a │ │ │ │ │ -single given child. │ │ │ │ │ -Definition: filters.hh:55 │ │ │ │ │ -Dune::TypeTree::AdvancedFilterTag │ │ │ │ │ -Tag describing an advanced filter that has full control over the construction │ │ │ │ │ -of the list of FilterEn... │ │ │ │ │ -Definition: filters.hh:58 │ │ │ │ │ -Dune::TypeTree::AdvancedFilter │ │ │ │ │ -Base class for advanced filters. │ │ │ │ │ -Definition: filters.hh:63 │ │ │ │ │ -Dune::TypeTree::AdvancedFilter::FilterTag │ │ │ │ │ -AdvancedFilterTag FilterTag │ │ │ │ │ -Filter tag for deciding on filter application mechanism. │ │ │ │ │ -Definition: filters.hh:66 │ │ │ │ │ -Dune::TypeTree::AdvancedFilter::apply │ │ │ │ │ -Apply this filter to the given node and children. │ │ │ │ │ -Definition: filters.hh:73 │ │ │ │ │ -Dune::TypeTree::AdvancedFilter::apply::type │ │ │ │ │ -implementation defined type │ │ │ │ │ -The result of the filtering process. │ │ │ │ │ -Definition: filters.hh:78 │ │ │ │ │ -Dune::TypeTree::SimpleFilter │ │ │ │ │ -Default simple filter that accepts any node and leaves its child structure │ │ │ │ │ -unchanged. │ │ │ │ │ -Definition: filters.hh:92 │ │ │ │ │ -Dune::TypeTree::SimpleFilter::FilterTag │ │ │ │ │ -SimpleFilterTag FilterTag │ │ │ │ │ -Filter tag for deciding on filter application mechanism. │ │ │ │ │ -Definition: filters.hh:95 │ │ │ │ │ -Dune::TypeTree::SimpleFilter::validate │ │ │ │ │ -Validates the combination of filter and node. │ │ │ │ │ -Definition: filters.hh:101 │ │ │ │ │ -Dune::TypeTree::SimpleFilter::validate::value │ │ │ │ │ -static const bool value │ │ │ │ │ -True if the combination of filter and node is valid. │ │ │ │ │ -Definition: filters.hh:103 │ │ │ │ │ -Dune::TypeTree::SimpleFilter::apply │ │ │ │ │ -Applies the filter to the given child node. │ │ │ │ │ -Definition: filters.hh:117 │ │ │ │ │ -Dune::TypeTree::SimpleFilter::apply::value │ │ │ │ │ -static const bool value │ │ │ │ │ -True if the child will be included in the filtered node. │ │ │ │ │ -Definition: filters.hh:119 │ │ │ │ │ -Dune::TypeTree::IndexFilter │ │ │ │ │ -Filter class for FilteredCompositeNode that selects the children with the given │ │ │ │ │ -indices. │ │ │ │ │ -Definition: filters.hh:159 │ │ │ │ │ -Dune::TypeTree::filter │ │ │ │ │ -Adapter class that takes a SimpleFilter, validated it and turns it into an │ │ │ │ │ -AdvancedFilter. │ │ │ │ │ -Definition: filters.hh:210 │ │ │ │ │ -Dune::TypeTree::filter::apply │ │ │ │ │ -Apply the filter. │ │ │ │ │ -Definition: filters.hh:215 │ │ │ │ │ -Dune::TypeTree::filter::apply::type │ │ │ │ │ -filter_helper< Filter, 0, 0, Children... >::template apply ::type type │ │ │ │ │ -Definition: filters.hh:219 │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10#endif // DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH │ │ │ │ │ +generictransformationdescriptors.hh │ │ │ │ │ +simpletransformationdescriptors.hh │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodetags.hh File Reference │ │ │ │ +dune-typetree: nodeinterface.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,42 +64,60 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
nodetags.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
nodeinterface.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ +
#include <cstddef>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <dune/common/documentation.hh>
│ │ │ │ +
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::LeafNodeTag
 Tag designating a leaf node. More...
 
struct  Dune::TypeTree::PowerNodeTag
 Tag designating a power node. More...
 
struct  Dune::TypeTree::DynamicPowerNodeTag
 Tag designating a power node with runtime degree. More...
 
struct  Dune::TypeTree::CompositeNodeTag
 Tag designating a composite node. More...
struct  Dune::TypeTree::NodeInterface
 Interface for nodes in a dune-typetree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

template<typename Node >
using Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag
 Returns the node tag of the given Node. More...
 
template<typename T >
using Dune::TypeTree::ImplementationTag = typename std::decay_t< T >::ImplementationTag
 Returns the implementation tag of the given Node. More...
 
template<typename Node >
using Dune::TypeTree::StaticDegree = decltype(Node::degree())
 Returns the statically known degree of the given Node type as a std::integral_constant. More...
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<typename Node >
std::size_t Dune::TypeTree::degree (const Node &node)
 Returns the degree of node as run time information. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,31 +4,45 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -nodetags.hh File Reference │ │ │ │ │ +Classes | Namespaces | Typedefs | Functions │ │ │ │ │ +nodeinterface.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::LeafNodeTag │ │ │ │ │ -  Tag designating a leaf node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::PowerNodeTag │ │ │ │ │ -  Tag designating a power node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ -  Tag designating a power node with runtime degree. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::CompositeNodeTag │ │ │ │ │ -  Tag designating a composite node. More... │ │ │ │ │ +struct  Dune::TypeTree::NodeInterface │ │ │ │ │ +  Interface for nodes in a dune-typetree. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ + Typedefs │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag │ │ │ │ │ +  Returns the node tag of the given Node. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::ImplementationTag = typename std::decay_t< T >:: │ │ │ │ │ + ImplementationTag │ │ │ │ │ +  Returns the implementation tag of the given Node. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::StaticDegree = decltype(Node::degree()) │ │ │ │ │ +  Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ + integral_constant. More... │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +std::size_t Dune::TypeTree::degree (const Node &node) │ │ │ │ │ +  Returns the degree of node as run time information. More... │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00020_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodetags.hh Source File │ │ │ │ +dune-typetree: nodeinterface.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,52 +62,98 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
nodetags.hh
│ │ │ │ +
nodeinterface.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │
6
│ │ │ │ -
7namespace Dune {
│ │ │ │ -
8 namespace TypeTree {
│ │ │ │ +
7#include <cstddef>
│ │ │ │ +
8#include <type_traits>
│ │ │ │
9
│ │ │ │ -
16 struct LeafNodeTag {};
│ │ │ │ -
17
│ │ │ │ -
19 struct PowerNodeTag {};
│ │ │ │ -
20
│ │ │ │ - │ │ │ │ -
23
│ │ │ │ - │ │ │ │ -
26
│ │ │ │ -
27#ifndef DOXYGEN
│ │ │ │ -
28
│ │ │ │ -
30 struct StartTag {};
│ │ │ │ -
31
│ │ │ │ -
32
│ │ │ │ -
33
│ │ │ │ -
34#endif // DOXYGEN
│ │ │ │ -
35
│ │ │ │ -
37
│ │ │ │ -
38 } // namespace TypeTree
│ │ │ │ -
39} //namespace Dune
│ │ │ │ -
40
│ │ │ │ -
41#endif // DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ +
10#include <dune/common/documentation.hh>
│ │ │ │ +
11
│ │ │ │ +
12namespace Dune {
│ │ │ │ +
13 namespace TypeTree {
│ │ │ │ +
14
│ │ │ │ + │ │ │ │ +
33 {
│ │ │ │ +
35 static const bool isLeaf = implementationDefined;
│ │ │ │ +
36
│ │ │ │ +
38 static const bool isPower = implementationDefined;
│ │ │ │ +
39
│ │ │ │ +
41 static const bool isComposite = implementationDefined;
│ │ │ │ +
42
│ │ │ │ +
44
│ │ │ │ +
49 static const std::size_t CHILDREN = implementationDefined;
│ │ │ │ +
50
│ │ │ │ +
52
│ │ │ │ +
57 static auto degree();
│ │ │ │ +
58
│ │ │ │ +
60
│ │ │ │ +
65 typedef ImplementationDefined NodeTag;
│ │ │ │ +
66
│ │ │ │ +
68
│ │ │ │ +
71 typedef ImplementationDefined NodeStorage;
│ │ │ │ +
72 };
│ │ │ │ +
73
│ │ │ │ +
75 template<typename Node>
│ │ │ │ + │ │ │ │ +
77
│ │ │ │ +
79 template<typename T>
│ │ │ │ + │ │ │ │ +
81
│ │ │ │ +
82
│ │ │ │ +
84 template<typename Node>
│ │ │ │ +
85 std::size_t degree(const Node& node)
│ │ │ │ +
86 {
│ │ │ │ +
87 return degree(&node,NodeTag<Node>());
│ │ │ │ +
88 }
│ │ │ │ +
89
│ │ │ │ +
90#ifndef DOXYGEN
│ │ │ │ +
91
│ │ │ │ +
93
│ │ │ │ +
99 template<typename Node, typename NodeTag>
│ │ │ │ +
100 std::size_t degree(const Node* node, NodeTag)
│ │ │ │ +
101 {
│ │ │ │ +
102 return node->degree();
│ │ │ │ +
103 }
│ │ │ │ +
104
│ │ │ │ +
105#endif // DOXYGEN
│ │ │ │ +
106
│ │ │ │ +
108
│ │ │ │ +
112 template<typename Node>
│ │ │ │ +
113 using StaticDegree = decltype(Node::degree());
│ │ │ │ +
114
│ │ │ │ +
116
│ │ │ │ +
117 } // namespace TypeTree
│ │ │ │ +
118} //namespace Dune
│ │ │ │ +
119
│ │ │ │ +
120#endif // DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │ +
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ +
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ +
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition: nodeinterface.hh:80
│ │ │ │ +
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:113
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ -
Tag designating a power node.
Definition: nodetags.hh:19
│ │ │ │ -
Tag designating a power node with runtime degree.
Definition: nodetags.hh:22
│ │ │ │ -
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │ +
Interface for nodes in a dune-typetree.
Definition: nodeinterface.hh:33
│ │ │ │ +
static const std::size_t CHILDREN
Number of children of this node in the dune-typetree.
Definition: nodeinterface.hh:49
│ │ │ │ +
static auto degree()
Number of children of this node in the dune-typetree.
│ │ │ │ +
static const bool isPower
Whether this is a power node in the dune-typetree.
Definition: nodeinterface.hh:38
│ │ │ │ +
static const bool isLeaf
Whether this is a leaf node in a dune-typetree.
Definition: nodeinterface.hh:35
│ │ │ │ +
ImplementationDefined NodeStorage
container type to pass around a collection of children
Definition: nodeinterface.hh:71
│ │ │ │ +
static const bool isComposite
Whether this is a composite node in the dune-typetree.
Definition: nodeinterface.hh:41
│ │ │ │ +
ImplementationDefined NodeTag
The type tag that describes what kind of node this is.
Definition: nodeinterface.hh:65
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,56 +4,129 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -nodetags.hh │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ 6 │ │ │ │ │ - 7namespace Dune { │ │ │ │ │ - 8 namespace TypeTree { │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ 9 │ │ │ │ │ -16 struct LeafNodeTag {}; │ │ │ │ │ - 17 │ │ │ │ │ -19 struct PowerNodeTag {}; │ │ │ │ │ - 20 │ │ │ │ │ -22 struct DynamicPowerNodeTag {}; │ │ │ │ │ - 23 │ │ │ │ │ -25 struct CompositeNodeTag {}; │ │ │ │ │ - 26 │ │ │ │ │ - 27#ifndef DOXYGEN │ │ │ │ │ - 28 │ │ │ │ │ - 30 struct StartTag {}; │ │ │ │ │ - 31 │ │ │ │ │ - 32 │ │ │ │ │ - 33 │ │ │ │ │ - 34#endif // DOXYGEN │ │ │ │ │ - 35 │ │ │ │ │ - 37 │ │ │ │ │ - 38 } // namespace TypeTree │ │ │ │ │ - 39} //namespace Dune │ │ │ │ │ - 40 │ │ │ │ │ - 41#endif // DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ + 10#include │ │ │ │ │ + 11 │ │ │ │ │ + 12namespace Dune { │ │ │ │ │ + 13 namespace TypeTree { │ │ │ │ │ + 14 │ │ │ │ │ +32 struct NodeInterface │ │ │ │ │ + 33 { │ │ │ │ │ +35 static const bool isLeaf = implementationDefined; │ │ │ │ │ + 36 │ │ │ │ │ +38 static const bool isPower = implementationDefined; │ │ │ │ │ + 39 │ │ │ │ │ +41 static const bool isComposite = implementationDefined; │ │ │ │ │ + 42 │ │ │ │ │ + 44 │ │ │ │ │ +49 static const std::size_t CHILDREN = implementationDefined; │ │ │ │ │ + 50 │ │ │ │ │ + 52 │ │ │ │ │ +57 static auto degree(); │ │ │ │ │ + 58 │ │ │ │ │ + 60 │ │ │ │ │ +65 typedef ImplementationDefined NodeTag; │ │ │ │ │ + 66 │ │ │ │ │ + 68 │ │ │ │ │ +71 typedef ImplementationDefined NodeStorage; │ │ │ │ │ + 72 }; │ │ │ │ │ + 73 │ │ │ │ │ + 75 template │ │ │ │ │ +76 using NodeTag = typename std::decay_t::NodeTag; │ │ │ │ │ + 77 │ │ │ │ │ + 79 template │ │ │ │ │ +80 using ImplementationTag = typename std::decay_t::ImplementationTag; │ │ │ │ │ + 81 │ │ │ │ │ + 82 │ │ │ │ │ + 84 template │ │ │ │ │ +85 std::size_t degree(const Node& node) │ │ │ │ │ + 86 { │ │ │ │ │ + 87 return degree(&node,NodeTag()); │ │ │ │ │ + 88 } │ │ │ │ │ + 89 │ │ │ │ │ + 90#ifndef DOXYGEN │ │ │ │ │ + 91 │ │ │ │ │ + 93 │ │ │ │ │ + 99 template │ │ │ │ │ + 100 std::size_t degree(const Node* node, NodeTag) │ │ │ │ │ + 101 { │ │ │ │ │ + 102 return node->degree(); │ │ │ │ │ + 103 } │ │ │ │ │ + 104 │ │ │ │ │ + 105#endif // DOXYGEN │ │ │ │ │ + 106 │ │ │ │ │ + 108 │ │ │ │ │ + 112 template │ │ │ │ │ +113 using StaticDegree = decltype(Node::degree()); │ │ │ │ │ + 114 │ │ │ │ │ + 116 │ │ │ │ │ + 117 } // namespace TypeTree │ │ │ │ │ + 118} //namespace Dune │ │ │ │ │ + 119 │ │ │ │ │ + 120#endif // DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ +Dune::TypeTree::degree │ │ │ │ │ +std::size_t degree(const Node &node) │ │ │ │ │ +Returns the degree of node as run time information. │ │ │ │ │ +Definition: nodeinterface.hh:85 │ │ │ │ │ +Dune::TypeTree::NodeTag │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +Definition: nodeinterface.hh:76 │ │ │ │ │ +Dune::TypeTree::ImplementationTag │ │ │ │ │ +typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ +Returns the implementation tag of the given Node. │ │ │ │ │ +Definition: nodeinterface.hh:80 │ │ │ │ │ +Dune::TypeTree::StaticDegree │ │ │ │ │ +decltype(Node::degree()) StaticDegree │ │ │ │ │ +Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +Definition: nodeinterface.hh:113 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::LeafNodeTag │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -Definition: nodetags.hh:16 │ │ │ │ │ -Dune::TypeTree::PowerNodeTag │ │ │ │ │ -Tag designating a power node. │ │ │ │ │ -Definition: nodetags.hh:19 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ -Tag designating a power node with runtime degree. │ │ │ │ │ -Definition: nodetags.hh:22 │ │ │ │ │ -Dune::TypeTree::CompositeNodeTag │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -Definition: nodetags.hh:25 │ │ │ │ │ +Dune::TypeTree::NodeInterface │ │ │ │ │ +Interface for nodes in a dune-typetree. │ │ │ │ │ +Definition: nodeinterface.hh:33 │ │ │ │ │ +Dune::TypeTree::NodeInterface::CHILDREN │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +Number of children of this node in the dune-typetree. │ │ │ │ │ +Definition: nodeinterface.hh:49 │ │ │ │ │ +Dune::TypeTree::NodeInterface::degree │ │ │ │ │ +static auto degree() │ │ │ │ │ +Number of children of this node in the dune-typetree. │ │ │ │ │ +Dune::TypeTree::NodeInterface::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Whether this is a power node in the dune-typetree. │ │ │ │ │ +Definition: nodeinterface.hh:38 │ │ │ │ │ +Dune::TypeTree::NodeInterface::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Whether this is a leaf node in a dune-typetree. │ │ │ │ │ +Definition: nodeinterface.hh:35 │ │ │ │ │ +Dune::TypeTree::NodeInterface::NodeStorage │ │ │ │ │ +ImplementationDefined NodeStorage │ │ │ │ │ +container type to pass around a collection of children │ │ │ │ │ +Definition: nodeinterface.hh:71 │ │ │ │ │ +Dune::TypeTree::NodeInterface::isComposite │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Whether this is a composite node in the dune-typetree. │ │ │ │ │ +Definition: nodeinterface.hh:41 │ │ │ │ │ +Dune::TypeTree::NodeInterface::NodeTag │ │ │ │ │ +ImplementationDefined NodeTag │ │ │ │ │ +The type tag that describes what kind of node this is. │ │ │ │ │ +Definition: nodeinterface.hh:65 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: simpletransformationdescriptors.hh File Reference │ │ │ │ +dune-typetree: fixedcapacitystack.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,40 +65,27 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
simpletransformationdescriptors.hh File Reference
│ │ │ │ +
fixedcapacitystack.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include <array>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ +#include <cassert>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::SimpleLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
class  Dune::TypeTree::FixedCapacityStackView< T >
 
struct  Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
 
struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
 
struct  Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
class  Dune::TypeTree::FixedCapacityStack< T, capacity >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,42 +5,22 @@ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -simpletransformationdescriptors.hh File Reference │ │ │ │ │ +fixedcapacitystack.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::SimpleLeafNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_> │ │ │ │ │ +class  Dune::TypeTree::FixedCapacityStackView<_T_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ +class  Dune::TypeTree::FixedCapacityStack<_T,_capacity_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00023_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: simpletransformationdescriptors.hh Source File │ │ │ │ +dune-typetree: fixedcapacitystack.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,177 +62,181 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
simpletransformationdescriptors.hh
│ │ │ │ +
fixedcapacitystack.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │ +
5#define DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │
6
│ │ │ │
7#include <array>
│ │ │ │ -
8#include <memory>
│ │ │ │ +
8#include <cassert>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ -
12#include <dune/common/exceptions.hh>
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11 namespace TypeTree {
│ │ │ │ +
12
│ │ │ │
13
│ │ │ │ -
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16 namespace TypeTree {
│ │ │ │
17
│ │ │ │ -
23 template<typename SourceNode, typename Transformation, typename TransformedNode>
│ │ │ │ - │ │ │ │ -
25 {
│ │ │ │ +
18 template<typename T>
│ │ │ │ + │ │ │ │ +
20 {
│ │ │ │ +
21
│ │ │ │ +
22 public:
│ │ │ │ +
23
│ │ │ │ +
24 struct Impl
│ │ │ │ +
25 {
│ │ │ │
26
│ │ │ │ -
27 static const bool recursive = false;
│ │ │ │ -
28
│ │ │ │ -
29 typedef TransformedNode transformed_type;
│ │ │ │ -
30 typedef std::shared_ptr<transformed_type> transformed_storage_type;
│ │ │ │ -
31
│ │ │ │ -
32 static transformed_type transform(const SourceNode& s, const Transformation& t)
│ │ │ │ -
33 {
│ │ │ │ -
34 return transformed_type();
│ │ │ │ -
35 }
│ │ │ │ -
36
│ │ │ │ -
37 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
│ │ │ │ -
38 {
│ │ │ │ -
39 return std::make_shared<transformed_type>();
│ │ │ │ -
40 }
│ │ │ │ +
27 Impl(T* data, std::size_t capacity)
│ │ │ │ +
28 : _data(data)
│ │ │ │ +
29 , _size(0)
│ │ │ │ +
30 , _capacity(capacity)
│ │ │ │ +
31 {}
│ │ │ │ +
32
│ │ │ │ +
33 T * const _data;
│ │ │ │ +
34 std::size_t _size;
│ │ │ │ +
35 const std::size_t _capacity;
│ │ │ │ +
36 };
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
39 : _impl(impl)
│ │ │ │ +
40 {}
│ │ │ │
41
│ │ │ │ -
42 };
│ │ │ │ +
42 public:
│ │ │ │
43
│ │ │ │ -
44
│ │ │ │ -
45 template<typename SourceNode, typename Transformation, template<typename Child, std::size_t> class TransformedNode>
│ │ │ │ - │ │ │ │ -
47 {
│ │ │ │ +
44 std::size_t size() const
│ │ │ │ +
45 {
│ │ │ │ +
46 return _impl._size;
│ │ │ │ +
47 }
│ │ │ │
48
│ │ │ │ -
49 static const bool recursive = true;
│ │ │ │ -
50
│ │ │ │ -
51 template<typename TC>
│ │ │ │ -
52 struct result
│ │ │ │ -
53 {
│ │ │ │ -
54 typedef TransformedNode<TC, StaticDegree<SourceNode>::value> type;
│ │ │ │ -
55 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
56 static const std::size_t degree = StaticDegree<type>::value;
│ │ │ │ -
57 };
│ │ │ │ +
49 std::size_t capacity() const
│ │ │ │ +
50 {
│ │ │ │ +
51 return _impl._capacity;
│ │ │ │ +
52 }
│ │ │ │ +
53
│ │ │ │ +
54 bool empty() const
│ │ │ │ +
55 {
│ │ │ │ +
56 return _impl._size == 0;
│ │ │ │ +
57 }
│ │ │ │
58
│ │ │ │ -
59 template<typename TC>
│ │ │ │ -
60 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ -
61 {
│ │ │ │ -
62 return typename result<TC>::type(children);
│ │ │ │ -
63 }
│ │ │ │ -
64
│ │ │ │ -
65 template<typename TC>
│ │ │ │ -
66 static typename result<TC>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ -
67 {
│ │ │ │ -
68 return std::make_shared<typename result<TC>::type>(children);
│ │ │ │ -
69 }
│ │ │ │ -
70
│ │ │ │ -
71 };
│ │ │ │ -
72
│ │ │ │ -
73
│ │ │ │ -
74 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNode>
│ │ │ │ - │ │ │ │ -
76 {
│ │ │ │ -
77
│ │ │ │ -
78 static const bool recursive = true;
│ │ │ │ -
79
│ │ │ │ -
80 template<typename TC>
│ │ │ │ -
81 struct result
│ │ │ │ -
82 {
│ │ │ │ -
83 typedef TransformedNode<TC> type;
│ │ │ │ -
84 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
85 };
│ │ │ │ -
86
│ │ │ │ -
87 template<typename TC>
│ │ │ │ -
88 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ +
59 bool full() const
│ │ │ │ +
60 {
│ │ │ │ +
61 return _impl._size == _impl._capacity;
│ │ │ │ +
62 }
│ │ │ │ +
63
│ │ │ │ +
64 void push_back(const T& t)
│ │ │ │ +
65 {
│ │ │ │ +
66 assert(!full());
│ │ │ │ +
67 _impl._data[_impl._size++] = t;
│ │ │ │ +
68 }
│ │ │ │ +
69
│ │ │ │ +
70 void pop_back()
│ │ │ │ +
71 {
│ │ │ │ +
72 assert(!empty());
│ │ │ │ +
73 --_impl._size;
│ │ │ │ +
74 }
│ │ │ │ +
75
│ │ │ │ +
76 T& back()
│ │ │ │ +
77 {
│ │ │ │ +
78 assert(!empty());
│ │ │ │ +
79 return _impl._data[_impl._size-1];
│ │ │ │ +
80 }
│ │ │ │ +
81
│ │ │ │ +
82 const T& back() const
│ │ │ │ +
83 {
│ │ │ │ +
84 assert(!empty());
│ │ │ │ +
85 return _impl._data[_impl._size-1];
│ │ │ │ +
86 }
│ │ │ │ +
87
│ │ │ │ +
88 T& front()
│ │ │ │
89 {
│ │ │ │ -
90 return typename result<TC>::type(children);
│ │ │ │ -
91 }
│ │ │ │ -
92
│ │ │ │ -
93 template<typename TC>
│ │ │ │ -
94 static typename result<TC>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ -
95 {
│ │ │ │ -
96 return std::make_shared<typename result<TC>::type>(children);
│ │ │ │ -
97 }
│ │ │ │ -
98
│ │ │ │ -
99 };
│ │ │ │ -
100
│ │ │ │ -
101
│ │ │ │ -
102 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNode>
│ │ │ │ - │ │ │ │ -
104 {
│ │ │ │ +
90 assert(!empty());
│ │ │ │ +
91 return _impl._data[0];
│ │ │ │ +
92 }
│ │ │ │ +
93
│ │ │ │ +
94 const T& front() const
│ │ │ │ +
95 {
│ │ │ │ +
96 assert(!empty());
│ │ │ │ +
97 return _impl._data[0];
│ │ │ │ +
98 }
│ │ │ │ +
99
│ │ │ │ +
100 T& operator[](std::size_t k)
│ │ │ │ +
101 {
│ │ │ │ +
102 assert(k < _impl._size);
│ │ │ │ +
103 return _impl._data[k];
│ │ │ │ +
104 }
│ │ │ │
105
│ │ │ │ -
106 static const bool recursive = true;
│ │ │ │ -
107
│ │ │ │ -
108 template<typename... TC>
│ │ │ │ -
109 struct result
│ │ │ │ -
110 {
│ │ │ │ -
111 typedef TransformedNode<TC...> type;
│ │ │ │ -
112 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
113 };
│ │ │ │ +
106 const T& operator[](std::size_t k) const
│ │ │ │ +
107 {
│ │ │ │ +
108 assert(k < _impl._size);
│ │ │ │ +
109 return _impl._data[k];
│ │ │ │ +
110 }
│ │ │ │ +
111
│ │ │ │ +
112 private:
│ │ │ │ +
113 Impl& _impl;
│ │ │ │
114
│ │ │ │ -
115 template<typename... TC>
│ │ │ │ -
116 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ -
117 {
│ │ │ │ -
118 return typename result<TC...>::type(children...);
│ │ │ │ -
119 }
│ │ │ │ -
120
│ │ │ │ -
121 template<typename... TC>
│ │ │ │ -
122 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ -
123 {
│ │ │ │ -
124 return std::make_shared<typename result<TC...>::type>(children...);
│ │ │ │ -
125 }
│ │ │ │ +
115 };
│ │ │ │ +
116
│ │ │ │ +
117
│ │ │ │ +
118 template<typename T, std::size_t capacity>
│ │ │ │ + │ │ │ │ +
120 : private std::array<T,capacity>
│ │ │ │ +
121 , private FixedCapacityStackView<T>::Impl
│ │ │ │ +
122 , public FixedCapacityStackView<T>
│ │ │ │ +
123 {
│ │ │ │ +
124
│ │ │ │ + │ │ │ │
126
│ │ │ │ -
127 };
│ │ │ │ +
127 public:
│ │ │ │
128
│ │ │ │ -
130
│ │ │ │ -
131 } // namespace TypeTree
│ │ │ │ -
132} //namespace Dune
│ │ │ │ +
129 using view_base::back;
│ │ │ │ +
130 using view_base::front;
│ │ │ │ +
131 using view_base::size;
│ │ │ │ +
132 using view_base::operator[];
│ │ │ │
133
│ │ │ │ -
134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:113
│ │ │ │ + │ │ │ │ +
135 : FixedCapacityStackView<T>::Impl(&(static_cast<std::array<T,capacity>&>(*this)[0]),capacity)
│ │ │ │ +
136 , FixedCapacityStackView<T>(static_cast<typename FixedCapacityStackView<T>::Impl&>(*this))
│ │ │ │ +
137 {}
│ │ │ │ +
138
│ │ │ │ +
139 private:
│ │ │ │ +
140
│ │ │ │ +
141 //FixedCapacityStack(const FixedCapacityStack&);
│ │ │ │ +
142 FixedCapacityStack& operator=(const FixedCapacityStack&);
│ │ │ │ +
143
│ │ │ │ +
144 };
│ │ │ │ +
145
│ │ │ │ +
147
│ │ │ │ +
148 } // namespace TypeTree
│ │ │ │ +
149} //namespace Dune
│ │ │ │ +
150
│ │ │ │ +
151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:25
│ │ │ │ -
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:32
│ │ │ │ -
static const bool recursive
Definition: simpletransformationdescriptors.hh:27
│ │ │ │ -
std::shared_ptr< transformed_type > transformed_storage_type
Definition: simpletransformationdescriptors.hh:30
│ │ │ │ -
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:37
│ │ │ │ -
TransformedNode transformed_type
Definition: simpletransformationdescriptors.hh:29
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:47
│ │ │ │ -
static result< TC >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: simpletransformationdescriptors.hh:66
│ │ │ │ -
static const bool recursive
Definition: simpletransformationdescriptors.hh:49
│ │ │ │ -
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: simpletransformationdescriptors.hh:60
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:53
│ │ │ │ -
TransformedNode< TC, StaticDegree< SourceNode >::value > type
Definition: simpletransformationdescriptors.hh:54
│ │ │ │ -
static const std::size_t degree
Definition: simpletransformationdescriptors.hh:56
│ │ │ │ -
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:55
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:76
│ │ │ │ -
static const bool recursive
Definition: simpletransformationdescriptors.hh:78
│ │ │ │ -
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition: simpletransformationdescriptors.hh:88
│ │ │ │ -
static result< TC >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition: simpletransformationdescriptors.hh:94
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:82
│ │ │ │ -
TransformedNode< TC > type
Definition: simpletransformationdescriptors.hh:83
│ │ │ │ -
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:84
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:104
│ │ │ │ -
static const bool recursive
Definition: simpletransformationdescriptors.hh:106
│ │ │ │ -
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: simpletransformationdescriptors.hh:122
│ │ │ │ -
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: simpletransformationdescriptors.hh:116
│ │ │ │ -
Definition: simpletransformationdescriptors.hh:110
│ │ │ │ -
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:112
│ │ │ │ -
TransformedNode< TC... > type
Definition: simpletransformationdescriptors.hh:111
│ │ │ │ +
Definition: fixedcapacitystack.hh:20
│ │ │ │ +
bool empty() const
Definition: fixedcapacitystack.hh:54
│ │ │ │ +
bool full() const
Definition: fixedcapacitystack.hh:59
│ │ │ │ +
T & operator[](std::size_t k)
Definition: fixedcapacitystack.hh:100
│ │ │ │ +
void pop_back()
Definition: fixedcapacitystack.hh:70
│ │ │ │ +
T & back()
Definition: fixedcapacitystack.hh:76
│ │ │ │ +
std::size_t capacity() const
Definition: fixedcapacitystack.hh:49
│ │ │ │ +
T & front()
Definition: fixedcapacitystack.hh:88
│ │ │ │ +
const T & front() const
Definition: fixedcapacitystack.hh:94
│ │ │ │ +
const T & operator[](std::size_t k) const
Definition: fixedcapacitystack.hh:106
│ │ │ │ +
void push_back(const T &t)
Definition: fixedcapacitystack.hh:64
│ │ │ │ +
const T & back() const
Definition: fixedcapacitystack.hh:82
│ │ │ │ +
std::size_t size() const
Definition: fixedcapacitystack.hh:44
│ │ │ │ +
FixedCapacityStackView(Impl &impl)
Definition: fixedcapacitystack.hh:38
│ │ │ │ +
Definition: fixedcapacitystack.hh:123
│ │ │ │ +
FixedCapacityStack()
Definition: fixedcapacitystack.hh:134
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,251 +4,209 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -simpletransformationdescriptors.hh │ │ │ │ │ +fixedcapacitystack.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ 6 │ │ │ │ │ 7#include │ │ │ │ │ - 8#include │ │ │ │ │ + 8#include │ │ │ │ │ 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ + 10namespace Dune { │ │ │ │ │ + 11 namespace TypeTree { │ │ │ │ │ + 12 │ │ │ │ │ 13 │ │ │ │ │ - 14 │ │ │ │ │ - 15namespace Dune { │ │ │ │ │ - 16 namespace TypeTree { │ │ │ │ │ 17 │ │ │ │ │ - 23 template │ │ │ │ │ -24 struct SimpleLeafNodeTransformation │ │ │ │ │ + 18 template │ │ │ │ │ +19 class FixedCapacityStackView │ │ │ │ │ + 20 { │ │ │ │ │ + 21 │ │ │ │ │ + 22 public: │ │ │ │ │ + 23 │ │ │ │ │ + 24 struct Impl │ │ │ │ │ 25 { │ │ │ │ │ 26 │ │ │ │ │ -27 static const bool recursive = false; │ │ │ │ │ - 28 │ │ │ │ │ -29 typedef TransformedNode transformed_type; │ │ │ │ │ -30 typedef std::shared_ptr transformed_storage_type; │ │ │ │ │ - 31 │ │ │ │ │ -32 static transformed_type transform(const SourceNode& s, const Transformation& │ │ │ │ │ -t) │ │ │ │ │ - 33 { │ │ │ │ │ - 34 return transformed_type(); │ │ │ │ │ - 35 } │ │ │ │ │ - 36 │ │ │ │ │ -37 static transformed_storage_type transform_storage(std::shared_ptr s, const Transformation& t) │ │ │ │ │ - 38 { │ │ │ │ │ - 39 return std::make_shared(); │ │ │ │ │ - 40 } │ │ │ │ │ + 27 Impl(T* data, std::size_t capacity) │ │ │ │ │ + 28 : _data(data) │ │ │ │ │ + 29 , _size(0) │ │ │ │ │ + 30 , _capacity(capacity) │ │ │ │ │ + 31 {} │ │ │ │ │ + 32 │ │ │ │ │ + 33 T * const _data; │ │ │ │ │ + 34 std::size_t _size; │ │ │ │ │ + 35 const std::size_t _capacity; │ │ │ │ │ + 36 }; │ │ │ │ │ + 37 │ │ │ │ │ +38 FixedCapacityStackView(Impl& impl) │ │ │ │ │ + 39 : _impl(impl) │ │ │ │ │ + 40 {} │ │ │ │ │ 41 │ │ │ │ │ - 42 }; │ │ │ │ │ + 42 public: │ │ │ │ │ 43 │ │ │ │ │ - 44 │ │ │ │ │ - 45 template class TransformedNode> │ │ │ │ │ -46 struct SimplePowerNodeTransformation │ │ │ │ │ - 47 { │ │ │ │ │ +44 std::size_t size() const │ │ │ │ │ + 45 { │ │ │ │ │ + 46 return _impl._size; │ │ │ │ │ + 47 } │ │ │ │ │ 48 │ │ │ │ │ -49 static const bool recursive = true; │ │ │ │ │ - 50 │ │ │ │ │ - 51 template │ │ │ │ │ -52 struct result │ │ │ │ │ - 53 { │ │ │ │ │ -54 typedef TransformedNode::value> type; │ │ │ │ │ -55 typedef std::shared_ptr storage_type; │ │ │ │ │ -56 static const std::size_t degree = StaticDegree::value; │ │ │ │ │ - 57 }; │ │ │ │ │ +49 std::size_t capacity() const │ │ │ │ │ + 50 { │ │ │ │ │ + 51 return _impl._capacity; │ │ │ │ │ + 52 } │ │ │ │ │ + 53 │ │ │ │ │ +54 bool empty() const │ │ │ │ │ + 55 { │ │ │ │ │ + 56 return _impl._size == 0; │ │ │ │ │ + 57 } │ │ │ │ │ 58 │ │ │ │ │ - 59 template │ │ │ │ │ -60 static typename result::type transform(const SourceNode& s, const │ │ │ │ │ -Transformation& t, const std::array,result::degree>& │ │ │ │ │ -children) │ │ │ │ │ - 61 { │ │ │ │ │ - 62 return typename result::type(children); │ │ │ │ │ - 63 } │ │ │ │ │ - 64 │ │ │ │ │ - 65 template │ │ │ │ │ -66 static typename result::storage_type transform_storage(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, const std::array,result::degree>& children) │ │ │ │ │ - 67 { │ │ │ │ │ - 68 return std::make_shared::type>(children); │ │ │ │ │ - 69 } │ │ │ │ │ - 70 │ │ │ │ │ - 71 }; │ │ │ │ │ - 72 │ │ │ │ │ - 73 │ │ │ │ │ - 74 template class TransformedNode> │ │ │ │ │ -75 struct SimpleDynamicPowerNodeTransformation │ │ │ │ │ - 76 { │ │ │ │ │ - 77 │ │ │ │ │ -78 static const bool recursive = true; │ │ │ │ │ - 79 │ │ │ │ │ - 80 template │ │ │ │ │ -81 struct result │ │ │ │ │ - 82 { │ │ │ │ │ -83 typedef TransformedNode type; │ │ │ │ │ -84 typedef std::shared_ptr storage_type; │ │ │ │ │ - 85 }; │ │ │ │ │ - 86 │ │ │ │ │ - 87 template │ │ │ │ │ -88 static typename result::type transform(const SourceNode& s, const │ │ │ │ │ -Transformation& t, const std::vector>& children) │ │ │ │ │ +59 bool full() const │ │ │ │ │ + 60 { │ │ │ │ │ + 61 return _impl._size == _impl._capacity; │ │ │ │ │ + 62 } │ │ │ │ │ + 63 │ │ │ │ │ +64 void push_back(const T& t) │ │ │ │ │ + 65 { │ │ │ │ │ + 66 assert(!full()); │ │ │ │ │ + 67 _impl._data[_impl._size++] = t; │ │ │ │ │ + 68 } │ │ │ │ │ + 69 │ │ │ │ │ +70 void pop_back() │ │ │ │ │ + 71 { │ │ │ │ │ + 72 assert(!empty()); │ │ │ │ │ + 73 --_impl._size; │ │ │ │ │ + 74 } │ │ │ │ │ + 75 │ │ │ │ │ +76 T& back() │ │ │ │ │ + 77 { │ │ │ │ │ + 78 assert(!empty()); │ │ │ │ │ + 79 return _impl._data[_impl._size-1]; │ │ │ │ │ + 80 } │ │ │ │ │ + 81 │ │ │ │ │ +82 const T& back() const │ │ │ │ │ + 83 { │ │ │ │ │ + 84 assert(!empty()); │ │ │ │ │ + 85 return _impl._data[_impl._size-1]; │ │ │ │ │ + 86 } │ │ │ │ │ + 87 │ │ │ │ │ +88 T& front() │ │ │ │ │ 89 { │ │ │ │ │ - 90 return typename result::type(children); │ │ │ │ │ - 91 } │ │ │ │ │ - 92 │ │ │ │ │ - 93 template │ │ │ │ │ -94 static typename result::storage_type transform_storage(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, const std:: │ │ │ │ │ -vector>& children) │ │ │ │ │ + 90 assert(!empty()); │ │ │ │ │ + 91 return _impl._data[0]; │ │ │ │ │ + 92 } │ │ │ │ │ + 93 │ │ │ │ │ +94 const T& front() const │ │ │ │ │ 95 { │ │ │ │ │ - 96 return std::make_shared::type>(children); │ │ │ │ │ - 97 } │ │ │ │ │ - 98 │ │ │ │ │ - 99 }; │ │ │ │ │ - 100 │ │ │ │ │ - 101 │ │ │ │ │ - 102 template class TransformedNode> │ │ │ │ │ -103 struct SimpleCompositeNodeTransformation │ │ │ │ │ - 104 { │ │ │ │ │ + 96 assert(!empty()); │ │ │ │ │ + 97 return _impl._data[0]; │ │ │ │ │ + 98 } │ │ │ │ │ + 99 │ │ │ │ │ +100 T& operator[](std::size_t k) │ │ │ │ │ + 101 { │ │ │ │ │ + 102 assert(k < _impl._size); │ │ │ │ │ + 103 return _impl._data[k]; │ │ │ │ │ + 104 } │ │ │ │ │ 105 │ │ │ │ │ -106 static const bool recursive = true; │ │ │ │ │ - 107 │ │ │ │ │ - 108 template │ │ │ │ │ -109 struct result │ │ │ │ │ - 110 { │ │ │ │ │ -111 typedef TransformedNode type; │ │ │ │ │ -112 typedef std::shared_ptr storage_type; │ │ │ │ │ - 113 }; │ │ │ │ │ +106 const T& operator[](std::size_t k) const │ │ │ │ │ + 107 { │ │ │ │ │ + 108 assert(k < _impl._size); │ │ │ │ │ + 109 return _impl._data[k]; │ │ │ │ │ + 110 } │ │ │ │ │ + 111 │ │ │ │ │ + 112 private: │ │ │ │ │ + 113 Impl& _impl; │ │ │ │ │ 114 │ │ │ │ │ - 115 template │ │ │ │ │ -116 static typename result::type transform(const SourceNode& s, const │ │ │ │ │ -Transformation& t, std::shared_ptr... children) │ │ │ │ │ - 117 { │ │ │ │ │ - 118 return typename result::type(children...); │ │ │ │ │ - 119 } │ │ │ │ │ - 120 │ │ │ │ │ - 121 template │ │ │ │ │ -122 static typename result::storage_type transform_storage(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, std::shared_ptr... │ │ │ │ │ -children) │ │ │ │ │ + 115 }; │ │ │ │ │ + 116 │ │ │ │ │ + 117 │ │ │ │ │ + 118 template │ │ │ │ │ +119 class FixedCapacityStack │ │ │ │ │ + 120 : private std::array │ │ │ │ │ + 121 , private FixedCapacityStackView::Impl │ │ │ │ │ + 122 , public FixedCapacityStackView │ │ │ │ │ 123 { │ │ │ │ │ - 124 return std::make_shared::type>(children...); │ │ │ │ │ - 125 } │ │ │ │ │ + 124 │ │ │ │ │ + 125 typedef FixedCapacityStackView view_base; │ │ │ │ │ 126 │ │ │ │ │ - 127 }; │ │ │ │ │ + 127 public: │ │ │ │ │ 128 │ │ │ │ │ - 130 │ │ │ │ │ - 131 } // namespace TypeTree │ │ │ │ │ - 132} //namespace Dune │ │ │ │ │ + 129 using view_base::back; │ │ │ │ │ + 130 using view_base::front; │ │ │ │ │ + 131 using view_base::size; │ │ │ │ │ + 132 using view_base::operator[]; │ │ │ │ │ 133 │ │ │ │ │ - 134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ -Dune::TypeTree::StaticDegree │ │ │ │ │ -decltype(Node::degree()) StaticDegree │ │ │ │ │ -Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -Definition: nodeinterface.hh:113 │ │ │ │ │ +134 FixedCapacityStack() │ │ │ │ │ + 135 : FixedCapacityStackView::Impl(&(static_cast&> │ │ │ │ │ +(*this)[0]),capacity) │ │ │ │ │ + 136 , FixedCapacityStackView(static_cast::Impl&>(*this)) │ │ │ │ │ + 137 {} │ │ │ │ │ + 138 │ │ │ │ │ + 139 private: │ │ │ │ │ + 140 │ │ │ │ │ + 141 //FixedCapacityStack(const FixedCapacityStack&); │ │ │ │ │ + 142 FixedCapacityStack& operator=(const FixedCapacityStack&); │ │ │ │ │ + 143 │ │ │ │ │ + 144 }; │ │ │ │ │ + 145 │ │ │ │ │ + 147 │ │ │ │ │ + 148 } // namespace TypeTree │ │ │ │ │ + 149} //namespace Dune │ │ │ │ │ + 150 │ │ │ │ │ + 151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::SimpleLeafNodeTransformation │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:25 │ │ │ │ │ -Dune::TypeTree::SimpleLeafNodeTransformation::transform │ │ │ │ │ -static transformed_type transform(const SourceNode &s, const Transformation &t) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:32 │ │ │ │ │ -Dune::TypeTree::SimpleLeafNodeTransformation::recursive │ │ │ │ │ -static const bool recursive │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:27 │ │ │ │ │ -Dune::TypeTree::SimpleLeafNodeTransformation::transformed_storage_type │ │ │ │ │ -std::shared_ptr< transformed_type > transformed_storage_type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:30 │ │ │ │ │ -Dune::TypeTree::SimpleLeafNodeTransformation::transform_storage │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:37 │ │ │ │ │ -Dune::TypeTree::SimpleLeafNodeTransformation::transformed_type │ │ │ │ │ -TransformedNode transformed_type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:29 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:47 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::transform_storage │ │ │ │ │ -static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC │ │ │ │ │ ->, result< TC >::degree > &children) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:66 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::recursive │ │ │ │ │ -static const bool recursive │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:49 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::transform │ │ │ │ │ -static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ -&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:60 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::result │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:53 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::result::type │ │ │ │ │ -TransformedNode< TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:54 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::result::degree │ │ │ │ │ -static const std::size_t degree │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:56 │ │ │ │ │ -Dune::TypeTree::SimplePowerNodeTransformation::result::storage_type │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:55 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:76 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation::recursive │ │ │ │ │ -static const bool recursive │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:78 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform │ │ │ │ │ -static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ -&t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:88 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform_storage │ │ │ │ │ -static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC │ │ │ │ │ -> > &children) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:94 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:82 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::type │ │ │ │ │ -TransformedNode< TC > type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:83 │ │ │ │ │ -Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::storage_type │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:84 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:104 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation::recursive │ │ │ │ │ -static const bool recursive │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:106 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation::transform_storage │ │ │ │ │ -static result< TC... >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:122 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation::transform │ │ │ │ │ -static result< TC... >::type transform(const SourceNode &s, const │ │ │ │ │ -Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:116 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation::result │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:110 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation::result::storage_type │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:112 │ │ │ │ │ -Dune::TypeTree::SimpleCompositeNodeTransformation::result::type │ │ │ │ │ -TransformedNode< TC... > type │ │ │ │ │ -Definition: simpletransformationdescriptors.hh:111 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView │ │ │ │ │ +Definition: fixedcapacitystack.hh:20 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::empty │ │ │ │ │ +bool empty() const │ │ │ │ │ +Definition: fixedcapacitystack.hh:54 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::full │ │ │ │ │ +bool full() const │ │ │ │ │ +Definition: fixedcapacitystack.hh:59 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::operator[] │ │ │ │ │ +T & operator[](std::size_t k) │ │ │ │ │ +Definition: fixedcapacitystack.hh:100 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::pop_back │ │ │ │ │ +void pop_back() │ │ │ │ │ +Definition: fixedcapacitystack.hh:70 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::back │ │ │ │ │ +T & back() │ │ │ │ │ +Definition: fixedcapacitystack.hh:76 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::capacity │ │ │ │ │ +std::size_t capacity() const │ │ │ │ │ +Definition: fixedcapacitystack.hh:49 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::front │ │ │ │ │ +T & front() │ │ │ │ │ +Definition: fixedcapacitystack.hh:88 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::front │ │ │ │ │ +const T & front() const │ │ │ │ │ +Definition: fixedcapacitystack.hh:94 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::operator[] │ │ │ │ │ +const T & operator[](std::size_t k) const │ │ │ │ │ +Definition: fixedcapacitystack.hh:106 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::push_back │ │ │ │ │ +void push_back(const T &t) │ │ │ │ │ +Definition: fixedcapacitystack.hh:64 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::back │ │ │ │ │ +const T & back() const │ │ │ │ │ +Definition: fixedcapacitystack.hh:82 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::size │ │ │ │ │ +std::size_t size() const │ │ │ │ │ +Definition: fixedcapacitystack.hh:44 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStackView::FixedCapacityStackView │ │ │ │ │ +FixedCapacityStackView(Impl &impl) │ │ │ │ │ +Definition: fixedcapacitystack.hh:38 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStack │ │ │ │ │ +Definition: fixedcapacitystack.hh:123 │ │ │ │ │ +Dune::TypeTree::FixedCapacityStack::FixedCapacityStack │ │ │ │ │ +FixedCapacityStack() │ │ │ │ │ +Definition: fixedcapacitystack.hh:134 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powercompositenodetransformationtemplates.hh File Reference │ │ │ │ +dune-typetree: treepath.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,44 +64,163 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
powercompositenodetransformationtemplates.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Enumerations | │ │ │ │ +Functions
│ │ │ │ +
treepath.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include <cstddef>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <iostream>
│ │ │ │ +#include <dune/common/documentation.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/typetree/fixedcapacitystack.hh>
│ │ │ │ +#include <dune/typetree/utility.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
│ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
class  Dune::TypeTree::HybridTreePath< T >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
 
struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >
struct  Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >
 
struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
struct  Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k >
 
struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >
struct  Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k >
 
struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >
 
struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >
 
struct  Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
 
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... >
 
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >
 
struct  Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
 
struct  Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::TreePathType
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

template<std::size_t... i>
using Dune::TypeTree::TreePath = HybridTreePath< Dune::index_constant< i >... >
 
template<std::size_t... i>
using Dune::TypeTree::StaticTreePath = HybridTreePath< Dune::index_constant< i >... >
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Enumerations

enum  Dune::TypeTree::TreePathType::Type { Dune::TypeTree::TreePathType::fullyStatic │ │ │ │ +, Dune::TypeTree::TreePathType::dynamic │ │ │ │ + }
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<std::size_t... i>
void Dune::TypeTree::print_tree_path (std::ostream &os)
 
template<std::size_t k, std::size_t... i>
void Dune::TypeTree::print_tree_path (std::ostream &os)
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::hybridTreePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize (const HybridTreePath< T... > &)
 Returns the size (number of components) of the given HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr auto Dune::TypeTree::treePathEntry (const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
 Returns a copy of the i-th element of the HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr std::size_t Dune::TypeTree::treePathIndex (const HybridTreePath< T... > &tp, index_constant< i >={})
 Returns the index value of the i-th element of the HybridTreePath. More...
 
template<typename... T, typename std::enable_if<(sizeof...(T) > 0), bool >::type = true>
constexpr auto Dune::TypeTree::back (const HybridTreePath< T... > &tp) -> decltype(treePathEntry< sizeof...(T) -1 >(tp))
 Returns a copy of the last element of the HybridTreePath. More...
 
template<typename... T>
constexpr auto Dune::TypeTree::front (const HybridTreePath< T... > &tp) -> decltype(treePathEntry< 0 >(tp))
 Returns a copy of the first element of the HybridTreePath. More...
 
template<typename... T>
constexpr HybridTreePath< T..., std::size_t > Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, std::size_t i)
 Appends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr HybridTreePath< T..., index_constant< i > > Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, index_constant< i > i_={})
 Appends a compile time index to a HybridTreePath. More...
 
template<typename... T>
constexpr HybridTreePath< std::size_t, T... > Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, std::size_t element)
 Prepends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr HybridTreePath< index_constant< i >, T... > Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, index_constant< i > _i={})
 Prepends a compile time index to a HybridTreePath. More...
 
template<class... T>
constexpr auto Dune::TypeTree::pop_front (const HybridTreePath< T... > &tp)
 Removes first index on a HybridTreePath. More...
 
template<class... T>
constexpr auto Dune::TypeTree::pop_back (const HybridTreePath< T... > &tp)
 Removes last index on a HybridTreePath. More...
 
template<class... S, class... T>
constexpr bool Dune::TypeTree::operator== (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for value equality. More...
 
template<class S , S... lhs, class T , T... rhs>
constexpr auto Dune::TypeTree::operator== (const HybridTreePath< std::integral_constant< S, lhs >... > &, const HybridTreePath< std::integral_constant< T, rhs >... > &)
 Overload for purely static HybridTreePaths. More...
 
template<class... S, class... T>
constexpr auto Dune::TypeTree::operator!= (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for unequality. More...
 
template<class S , S... lhs, class T , T... rhs>
constexpr auto Dune::TypeTree::operator!= (const HybridTreePath< std::integral_constant< S, lhs >... > &, const HybridTreePath< std::integral_constant< T, rhs >... > &)
 Compare two static HybridTreePaths for unequality. More...
 
template<typename... T>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T... > &tp)
 Dumps a HybridTreePath to a stream. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,39 +4,209 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -powercompositenodetransformationtemplates.hh File Reference │ │ │ │ │ +Classes | Namespaces | Typedefs | Enumerations | Functions │ │ │ │ │ +treepath.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_> │ │ │ │ │ + class  Dune::TypeTree::HybridTreePath<_T_> │ │ │ │ │ +  A hybrid version of TreePath that supports both compile time and run │ │ │ │ │ + time indices. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate<_SourceNode, │ │ │ │ │ - Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ +struct  Dune::TypeTree::TreePathSize<_HybridTreePath<_index_constant<_i_>..._> │ │ │ │ │ + > │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< │ │ │ │ │ - SourceNode,_Transformation,_TransformedNode_> │ │ │ │ │ +struct  Dune::TypeTree::TreePathPushBack<_HybridTreePath<_index_constant<_i │ │ │ │ │ + >..._>,_k_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< │ │ │ │ │ - SourceNode,_Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ +struct  Dune::TypeTree::TreePathPushFront<_HybridTreePath<_index_constant<_i │ │ │ │ │ + >..._>,_k_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< │ │ │ │ │ - SourceNode,_Transformation,_TransformedNode_> │ │ │ │ │ +struct  Dune::TypeTree::TreePathBack<_HybridTreePath<_index_constant<_k_>_>_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< │ │ │ │ │ - SourceNode,_Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ +struct  Dune::TypeTree::TreePathBack<_HybridTreePath<_index_constant<_j_>, │ │ │ │ │ + index_constant<_k_>,_index_constant<_l_>..._>_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreePathFront<_HybridTreePath<_index_constant<_k_>, │ │ │ │ │ + index_constant<_i_>..._>_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreePathPopBack<_HybridTreePath<_index_constant<_k_> │ │ │ │ │ + >,_i..._> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreePathPopBack<_HybridTreePath<_index_constant<_j_>, │ │ │ │ │ + index_constant<_k_>,_index_constant<_l_>..._>,_i..._> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreePathPopFront<_HybridTreePath<_index_constant<_k_>, │ │ │ │ │ + index_constant<_i_>..._>_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreePathConcat<_HybridTreePath<_index_constant<_i_>... │ │ │ │ │ + >,_HybridTreePath<_index_constant<_k_>..._>_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ +namespace  Dune::TypeTree::TreePathType │ │ │ │ │ +  │ │ │ │ │ + Typedefs │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::TreePath = HybridTreePath< Dune::index_constant< i >... │ │ │ │ │ + > │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::StaticTreePath = HybridTreePath< Dune::index_constant< i │ │ │ │ │ + >... > │ │ │ │ │ +  │ │ │ │ │ + Enumerations │ │ │ │ │ +enum  Dune::TypeTree::TreePathType::Type { Dune::TypeTree::TreePathType:: │ │ │ │ │ + fullyStatic , Dune::TypeTree::TreePathType::dynamic } │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::print_tree_path (std:: │ │ │ │ │ + ostream &os) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::print_tree_path (std:: │ │ │ │ │ + ostream &os) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr HybridTreePath< T... > Dune::TypeTree::hybridTreePath (const T │ │ │ │ │ + &... t) │ │ │ │ │ +  Constructs a new HybridTreePath from the │ │ │ │ │ + given indices. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... │ │ │ │ │ + t) │ │ │ │ │ +  Constructs a new HybridTreePath from the │ │ │ │ │ + given indices. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr std::size_t Dune::TypeTree::treePathSize (const │ │ │ │ │ + HybridTreePath< T... > &) │ │ │ │ │ +  Returns the size (number of components) │ │ │ │ │ + of the given HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::treePathEntry (const │ │ │ │ │ + HybridTreePath< T... > &tp, │ │ │ │ │ + index_constant< i >={}) -> typename │ │ │ │ │ + std::decay< decltype(std::get< i > │ │ │ │ │ + (tp._data))>::type │ │ │ │ │ +  Returns a copy of the i-th element of │ │ │ │ │ + the HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr std::size_t Dune::TypeTree::treePathIndex (const │ │ │ │ │ + HybridTreePath< T... > &tp, │ │ │ │ │ + index_constant< i >={}) │ │ │ │ │ +  Returns the index value of the i-th │ │ │ │ │ + element of the HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template 0), bool >:: │ │ │ │ │ +type = true> │ │ │ │ │ + constexpr auto Dune::TypeTree::back (const │ │ │ │ │ + HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ + (treePathEntry< sizeof...(T) -1 >(tp)) │ │ │ │ │ +  Returns a copy of the last element of │ │ │ │ │ + the HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::front (const │ │ │ │ │ + HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ + (treePathEntry< 0 >(tp)) │ │ │ │ │ +  Returns a copy of the first element of │ │ │ │ │ + the HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr HybridTreePath< T..., std:: Dune::TypeTree::push_back (const │ │ │ │ │ + size_t > HybridTreePath< T... > &tp, std::size_t │ │ │ │ │ + i) │ │ │ │ │ +  Appends a run time index to a │ │ │ │ │ + HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr HybridTreePath< T..., Dune::TypeTree::push_back (const │ │ │ │ │ + index_constant< i > > HybridTreePath< T... > &tp, │ │ │ │ │ + index_constant< i > i_={}) │ │ │ │ │ +  Appends a compile time index to a │ │ │ │ │ + HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr HybridTreePath< std::size_t, Dune::TypeTree::push_front (const │ │ │ │ │ + T... > HybridTreePath< T... > &tp, std::size_t │ │ │ │ │ + element) │ │ │ │ │ +  Prepends a run time index to a │ │ │ │ │ + HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr HybridTreePath< Dune::TypeTree::push_front (const │ │ │ │ │ + index_constant< i >, T... > HybridTreePath< T... > &tp, │ │ │ │ │ + index_constant< i > _i={}) │ │ │ │ │ +  Prepends a compile time index to a │ │ │ │ │ + HybridTreePath. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::pop_front (const │ │ │ │ │ + HybridTreePath< T... > &tp) │ │ │ │ │ +  Removes first index on a HybridTreePath. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::pop_back (const │ │ │ │ │ + HybridTreePath< T... > &tp) │ │ │ │ │ +  Removes last index on a HybridTreePath. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr bool Dune::TypeTree::operator== (const │ │ │ │ │ + HybridTreePath< S... > &lhs, const │ │ │ │ │ + HybridTreePath< T... > &rhs) │ │ │ │ │ +  Compare two HybridTreePaths for value │ │ │ │ │ + equality. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::operator== (const │ │ │ │ │ + HybridTreePath< std::integral_constant< │ │ │ │ │ + S, lhs >... > &, const HybridTreePath< │ │ │ │ │ + std::integral_constant< T, rhs >... > &) │ │ │ │ │ +  Overload for purely static │ │ │ │ │ + HybridTreePaths. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::operator!= (const │ │ │ │ │ + HybridTreePath< S... > &lhs, const │ │ │ │ │ + HybridTreePath< T... > &rhs) │ │ │ │ │ +  Compare two HybridTreePaths for │ │ │ │ │ + unequality. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto Dune::TypeTree::operator!= (const │ │ │ │ │ + HybridTreePath< std::integral_constant< │ │ │ │ │ + S, lhs >... > &, const HybridTreePath< │ │ │ │ │ + std::integral_constant< T, rhs >... > &) │ │ │ │ │ +  Compare two static HybridTreePaths for │ │ │ │ │ + unequality. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + std::ostream & Dune::TypeTree::operator<< (std::ostream │ │ │ │ │ + &os, const HybridTreePath< T... > &tp) │ │ │ │ │ +  Dumps a HybridTreePath to a stream. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00026_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powercompositenodetransformationtemplates.hh Source File │ │ │ │ +dune-typetree: treepath.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,77 +62,469 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
powercompositenodetransformationtemplates.hh
│ │ │ │ +
treepath.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ -
5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TREEPATH_HH
│ │ │ │
6
│ │ │ │
7#include <cstddef>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12 namespace TypeTree {
│ │ │ │ -
13
│ │ │ │ -
19 template<typename SourceNode, typename Transformation, template<typename,typename,std::size_t> class TransformedNode>
│ │ │ │ - │ │ │ │ -
21 {
│ │ │ │ -
22 template<typename TC>
│ │ │ │ -
23 struct result
│ │ │ │ -
24 {
│ │ │ │ -
25 typedef TransformedNode<SourceNode,TC,StaticDegree<SourceNode>::value> type;
│ │ │ │ -
26 };
│ │ │ │ -
27 };
│ │ │ │ +
8#include <iostream>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/documentation.hh>
│ │ │ │ +
11#include <dune/common/typetraits.hh>
│ │ │ │ +
12#include <dune/common/indices.hh>
│ │ │ │ +
13#include <dune/common/hybridutilities.hh>
│ │ │ │ +
14
│ │ │ │ + │ │ │ │ + │ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20 namespace TypeTree {
│ │ │ │ +
21
│ │ │ │ +
22 template<typename... T>
│ │ │ │ +
23 class HybridTreePath;
│ │ │ │ +
24
│ │ │ │
28
│ │ │ │ -
29
│ │ │ │ -
30 template<typename SourceNode, typename Transformation, template<typename,typename> class TransformedNode>
│ │ │ │ - │ │ │ │ -
32 {
│ │ │ │ -
33 template<typename TC>
│ │ │ │ -
34 struct result
│ │ │ │ -
35 {
│ │ │ │ -
36 typedef TransformedNode<SourceNode,TC> type;
│ │ │ │ -
37 };
│ │ │ │ -
38 };
│ │ │ │ -
39
│ │ │ │ -
40 template<typename SourceNode, typename Transformation, template<typename,typename...> class TransformedNode>
│ │ │ │ - │ │ │ │ -
42 {
│ │ │ │ -
43 template<typename... TC>
│ │ │ │ -
44 struct result
│ │ │ │ -
45 {
│ │ │ │ -
46 typedef TransformedNode<SourceNode,TC...> type;
│ │ │ │ -
47 };
│ │ │ │ -
48 };
│ │ │ │ -
49
│ │ │ │ -
51
│ │ │ │ -
52 } // namespace TypeTree
│ │ │ │ -
53} //namespace Dune
│ │ │ │ -
54
│ │ │ │ -
55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ - │ │ │ │ +
29 namespace TreePathType {
│ │ │ │ + │ │ │ │ +
31 }
│ │ │ │ +
32
│ │ │ │ +
33 template<typename>
│ │ │ │ + │ │ │ │ +
35
│ │ │ │ +
36 template<typename,std::size_t>
│ │ │ │ + │ │ │ │ +
38
│ │ │ │ +
39 template<typename,std::size_t>
│ │ │ │ + │ │ │ │ +
41
│ │ │ │ +
42 template<typename>
│ │ │ │ + │ │ │ │ +
44
│ │ │ │ +
45 template<typename>
│ │ │ │ + │ │ │ │ +
47
│ │ │ │ +
48 template<typename, std::size_t...>
│ │ │ │ + │ │ │ │ +
50
│ │ │ │ +
51 template<typename>
│ │ │ │ + │ │ │ │ +
53
│ │ │ │ +
54 template<typename, typename>
│ │ │ │ + │ │ │ │ +
56
│ │ │ │ +
57 template<std::size_t... i>
│ │ │ │ +
58 void print_tree_path(std::ostream& os)
│ │ │ │ +
59 {}
│ │ │ │ +
60
│ │ │ │ +
61 template<std::size_t k, std::size_t... i>
│ │ │ │ +
62 void print_tree_path(std::ostream& os)
│ │ │ │ +
63 {
│ │ │ │ +
64 os << k << " ";
│ │ │ │ +
65 print_tree_path<i...>(os);
│ │ │ │ +
66 }
│ │ │ │ +
67
│ │ │ │ +
69
│ │ │ │ +
77 template<typename... T>
│ │ │ │ + │ │ │ │ +
79 {
│ │ │ │ +
80
│ │ │ │ +
81 public:
│ │ │ │ +
82
│ │ │ │ +
84 using index_sequence = std::index_sequence_for<T...>;
│ │ │ │ +
85
│ │ │ │ +
87 constexpr HybridTreePath()
│ │ │ │ +
88 {}
│ │ │ │ +
89
│ │ │ │ +
90 constexpr HybridTreePath(const HybridTreePath& tp) = default;
│ │ │ │ +
91 constexpr HybridTreePath(HybridTreePath&& tp) = default;
│ │ │ │ +
92
│ │ │ │ +
93 constexpr HybridTreePath& operator=(const HybridTreePath& tp) = default;
│ │ │ │ +
94 constexpr HybridTreePath& operator=(HybridTreePath&& tp) = default;
│ │ │ │ +
95
│ │ │ │ +
97 explicit constexpr HybridTreePath(std::tuple<T...> t)
│ │ │ │ +
98 : _data(t)
│ │ │ │ +
99 {}
│ │ │ │ +
100
│ │ │ │ +
102 template<typename... U, typename std::enable_if<(sizeof...(T) > 0 && sizeof...(U) == sizeof...(T)),bool>::type = true>
│ │ │ │ +
103 explicit constexpr HybridTreePath(U... t)
│ │ │ │ +
104 : _data(t...)
│ │ │ │ +
105 {}
│ │ │ │ +
106
│ │ │ │ +
108 constexpr static index_sequence enumerate()
│ │ │ │ +
109 {
│ │ │ │ +
110 return {};
│ │ │ │ +
111 }
│ │ │ │ +
112
│ │ │ │ +
114 constexpr static std::size_t size()
│ │ │ │ +
115 {
│ │ │ │ +
116 return sizeof...(T);
│ │ │ │ +
117 }
│ │ │ │ +
118
│ │ │ │ +
120 template<std::size_t i>
│ │ │ │ +
121 constexpr auto operator[](Dune::index_constant<i>) const
│ │ │ │ +
122 {
│ │ │ │ +
123 return std::get<i>(_data);
│ │ │ │ +
124 }
│ │ │ │ +
125
│ │ │ │ +
127 constexpr std::size_t operator[](std::size_t pos) const
│ │ │ │ +
128 {
│ │ │ │ +
129 std::size_t entry = 0;
│ │ │ │ +
130 Dune::Hybrid::forEach(enumerate(), [&] (auto i) {
│ │ │ │ +
131 if (i==pos)
│ │ │ │ +
132 entry = this->element(i);
│ │ │ │ +
133 });
│ │ │ │ +
134 return entry;
│ │ │ │ +
135 }
│ │ │ │ +
136
│ │ │ │ +
138 template<std::size_t i>
│ │ │ │ +
139 constexpr auto element(Dune::index_constant<i> pos = {}) const
│ │ │ │ +
140 {
│ │ │ │ +
141 return std::get<i>(_data);
│ │ │ │ +
142 }
│ │ │ │ +
143
│ │ │ │ +
145 constexpr std::size_t element(std::size_t pos) const
│ │ │ │ +
146 {
│ │ │ │ +
147 std::size_t entry = 0;
│ │ │ │ +
148 Dune::Hybrid::forEach(enumerate(), [&] (auto i) {
│ │ │ │ +
149 if (i==pos)
│ │ │ │ +
150 entry = this->element(i);
│ │ │ │ +
151 });
│ │ │ │ +
152 return entry;
│ │ │ │ +
153 }
│ │ │ │ +
154
│ │ │ │ +
156 auto back() const
│ │ │ │ +
157 {
│ │ │ │ +
158 return std::get<sizeof...(T)-1>(_data);
│ │ │ │ +
159 }
│ │ │ │ +
160
│ │ │ │ +
161#ifndef DOXYGEN
│ │ │ │ +
162
│ │ │ │ +
163 // I can't be bothered to make all the external accessors friends of HybridTreePath,
│ │ │ │ +
164 // so we'll only hide the data tuple from the user in Doxygen.
│ │ │ │ +
165
│ │ │ │ +
166 using Data = std::tuple<T...>;
│ │ │ │ +
167 Data _data;
│ │ │ │ +
168
│ │ │ │ +
169#endif // DOXYGEN
│ │ │ │ +
170
│ │ │ │ +
171 };
│ │ │ │ +
172
│ │ │ │ +
173
│ │ │ │ +
175
│ │ │ │ +
179 template<typename... T>
│ │ │ │ +
180 constexpr HybridTreePath<T...> hybridTreePath(const T&... t)
│ │ │ │ +
181 {
│ │ │ │ +
182 return HybridTreePath<T...>(t...);
│ │ │ │ +
183 }
│ │ │ │ +
184
│ │ │ │ +
186
│ │ │ │ +
190 template<typename... T>
│ │ │ │ +
191 constexpr HybridTreePath<T...> treePath(const T&... t)
│ │ │ │ +
192 {
│ │ │ │ +
193 return HybridTreePath<T...>(t...);
│ │ │ │ +
194 }
│ │ │ │ +
195
│ │ │ │ +
196
│ │ │ │ +
198 template<typename... T>
│ │ │ │ +
199 constexpr std::size_t treePathSize(const HybridTreePath<T...>&)
│ │ │ │ +
200 {
│ │ │ │ +
201 return sizeof...(T);
│ │ │ │ +
202 }
│ │ │ │ +
203
│ │ │ │ +
205
│ │ │ │ +
221 template<std::size_t i, typename... T>
│ │ │ │ +
222 constexpr auto treePathEntry(const HybridTreePath<T...>& tp, index_constant<i> = {})
│ │ │ │ +
223 -> typename std::decay<decltype(std::get<i>(tp._data))>::type
│ │ │ │ +
224 {
│ │ │ │ +
225 return std::get<i>(tp._data);
│ │ │ │ +
226 }
│ │ │ │ +
227
│ │ │ │ +
229
│ │ │ │ +
244 template<std::size_t i,typename... T>
│ │ │ │ +
245 constexpr std::size_t treePathIndex(const HybridTreePath<T...>& tp, index_constant<i> = {})
│ │ │ │ +
246 {
│ │ │ │ +
247 return std::get<i>(tp._data);
│ │ │ │ +
248 }
│ │ │ │ +
249
│ │ │ │ +
251
│ │ │ │ +
256 template<typename... T, typename std::enable_if<(sizeof...(T) > 0),bool>::type = true>
│ │ │ │ +
257 constexpr auto back(const HybridTreePath<T...>& tp)
│ │ │ │ +
258 -> decltype(treePathEntry<sizeof...(T)-1>(tp))
│ │ │ │ +
259 {
│ │ │ │ +
260 return treePathEntry<sizeof...(T)-1>(tp);
│ │ │ │ +
261 }
│ │ │ │ +
262
│ │ │ │ +
264
│ │ │ │ +
269 template<typename... T>
│ │ │ │ +
270 constexpr auto front(const HybridTreePath<T...>& tp)
│ │ │ │ +
271 -> decltype(treePathEntry<0>(tp))
│ │ │ │ +
272 {
│ │ │ │ +
273 return treePathEntry<0>(tp);
│ │ │ │ +
274 }
│ │ │ │ +
275
│ │ │ │ +
277
│ │ │ │ +
280 template<typename... T>
│ │ │ │ +
281 constexpr HybridTreePath<T...,std::size_t> push_back(const HybridTreePath<T...>& tp, std::size_t i)
│ │ │ │ +
282 {
│ │ │ │ +
283 return HybridTreePath<T...,std::size_t>(std::tuple_cat(tp._data,std::make_tuple(i)));
│ │ │ │ +
284 }
│ │ │ │ +
285
│ │ │ │ +
287
│ │ │ │ +
301 template<std::size_t i, typename... T>
│ │ │ │ +
302 constexpr HybridTreePath<T...,index_constant<i>> push_back(const HybridTreePath<T...>& tp, index_constant<i> i_ = {})
│ │ │ │ +
303 {
│ │ │ │ +
304 return HybridTreePath<T...,index_constant<i> >(std::tuple_cat(tp._data,std::make_tuple(i_)));
│ │ │ │ +
305 }
│ │ │ │ +
306
│ │ │ │ +
308
│ │ │ │ +
311 template<typename... T>
│ │ │ │ +
312 constexpr HybridTreePath<std::size_t,T...> push_front(const HybridTreePath<T...>& tp, std::size_t element)
│ │ │ │ +
313 {
│ │ │ │ +
314 return HybridTreePath<std::size_t,T...>(std::tuple_cat(std::make_tuple(element),tp._data));
│ │ │ │ +
315 }
│ │ │ │ +
316
│ │ │ │ +
318
│ │ │ │ +
332 template<std::size_t i, typename... T>
│ │ │ │ +
333 constexpr HybridTreePath<index_constant<i>,T...> push_front(const HybridTreePath<T...>& tp, index_constant<i> _i = {})
│ │ │ │ +
334 {
│ │ │ │ +
335 return HybridTreePath<index_constant<i>,T...>(std::tuple_cat(std::make_tuple(_i),tp._data));
│ │ │ │ +
336 }
│ │ │ │ +
337
│ │ │ │ +
339
│ │ │ │ +
342 template <class... T>
│ │ │ │ +
343 constexpr auto pop_front(const HybridTreePath<T...>& tp)
│ │ │ │ +
344 {
│ │ │ │ +
345 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty");
│ │ │ │ +
346 return unpackIntegerSequence([&](auto... i){
│ │ │ │ +
347 return HybridTreePath{std::make_tuple(std::get<i+1>(tp._data)...)};
│ │ │ │ +
348 }, std::make_index_sequence<(sizeof...(T) - 1)>{});
│ │ │ │ +
349 }
│ │ │ │ +
350
│ │ │ │ +
352
│ │ │ │ +
355 template <class... T>
│ │ │ │ +
356 constexpr auto pop_back(const HybridTreePath<T...>& tp)
│ │ │ │ +
357 {
│ │ │ │ +
358 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty");
│ │ │ │ +
359 return unpackIntegerSequence([&](auto... i){
│ │ │ │ +
360 return HybridTreePath{std::make_tuple(std::get<i>(tp._data)...)};
│ │ │ │ +
361 }, std::make_index_sequence<(sizeof...(T) - 1)>{});
│ │ │ │ +
362 }
│ │ │ │ +
363
│ │ │ │ +
365
│ │ │ │ +
373 template <class... S, class... T>
│ │ │ │ +
374 constexpr bool operator==(
│ │ │ │ +
375 const HybridTreePath<S...>& lhs,
│ │ │ │ +
376 const HybridTreePath<T...>& rhs)
│ │ │ │ +
377 {
│ │ │ │ +
378 if constexpr (sizeof...(S) == sizeof...(T)) {
│ │ │ │ +
379 if constexpr ((Dune::IsInteroperable<S,T>::value &&...)) {
│ │ │ │ +
380 return unpackIntegerSequence([&](auto... i){
│ │ │ │ +
381 return ((std::get<i>(lhs._data) == std::get<i>(rhs._data)) &&...);
│ │ │ │ +
382 }, std::make_index_sequence<(sizeof...(S))>{});
│ │ │ │ +
383 } else {
│ │ │ │ +
384 return false;
│ │ │ │ +
385 }
│ │ │ │ +
386 } else {
│ │ │ │ +
387 return false;
│ │ │ │ +
388 }
│ │ │ │ +
389 }
│ │ │ │ +
390
│ │ │ │ +
392
│ │ │ │ +
397 template <class S, S... lhs, class T, T... rhs>
│ │ │ │ +
398 constexpr auto operator==(
│ │ │ │ +
399 const HybridTreePath<std::integral_constant<S,lhs>...>&,
│ │ │ │ +
400 const HybridTreePath<std::integral_constant<T,rhs>...>&)
│ │ │ │ +
401 {
│ │ │ │ +
402 return std::bool_constant<hybridTreePath(lhs...) == hybridTreePath(rhs...)>{};
│ │ │ │ +
403 }
│ │ │ │ +
404
│ │ │ │ +
405
│ │ │ │ +
407 template <class... S, class... T>
│ │ │ │ +
408 constexpr auto operator!=(
│ │ │ │ +
409 const HybridTreePath<S...>& lhs,
│ │ │ │ +
410 const HybridTreePath<T...>& rhs)
│ │ │ │ +
411 {
│ │ │ │ +
412 return !(lhs == rhs);
│ │ │ │ +
413 }
│ │ │ │ +
414
│ │ │ │ +
416 template <class S, S... lhs, class T, T... rhs>
│ │ │ │ +
417 constexpr auto operator!=(
│ │ │ │ +
418 const HybridTreePath<std::integral_constant<S,lhs>...>&,
│ │ │ │ +
419 const HybridTreePath<std::integral_constant<T,rhs>...>&)
│ │ │ │ +
420 {
│ │ │ │ +
421 return std::bool_constant<hybridTreePath(lhs...) != hybridTreePath(rhs...)>{};
│ │ │ │ +
422 }
│ │ │ │ +
423
│ │ │ │ +
424 template<std::size_t... i>
│ │ │ │ +
425 struct TreePathSize<HybridTreePath<index_constant<i>...> >
│ │ │ │ +
426 : public index_constant<sizeof...(i)>
│ │ │ │ +
427 {};
│ │ │ │ +
428
│ │ │ │ +
429
│ │ │ │ +
430 template<std::size_t k, std::size_t... i>
│ │ │ │ +
431 struct TreePathPushBack<HybridTreePath<index_constant<i>...>,k>
│ │ │ │ +
432 {
│ │ │ │ +
433 typedef HybridTreePath<index_constant<i>...,index_constant<k>> type;
│ │ │ │ +
434 };
│ │ │ │ +
435
│ │ │ │ +
436 template<std::size_t k, std::size_t... i>
│ │ │ │ +
437 struct TreePathPushFront<HybridTreePath<index_constant<i>...>,k>
│ │ │ │ +
438 {
│ │ │ │ +
439 typedef HybridTreePath<index_constant<k>,index_constant<i>...> type;
│ │ │ │ +
440 };
│ │ │ │ +
441
│ │ │ │ +
442 template<std::size_t k>
│ │ │ │ +
443 struct TreePathBack<HybridTreePath<index_constant<k>>>
│ │ │ │ +
444 : public index_constant<k>
│ │ │ │ +
445 {};
│ │ │ │ +
446
│ │ │ │ +
447 template<std::size_t j, std::size_t k, std::size_t... l>
│ │ │ │ +
448 struct TreePathBack<HybridTreePath<index_constant<j>,index_constant<k>,index_constant<l>...>>
│ │ │ │ +
449 : public TreePathBack<HybridTreePath<index_constant<k>,index_constant<l>...>>
│ │ │ │ +
450 {};
│ │ │ │ +
451
│ │ │ │ +
452 template<std::size_t k, std::size_t... i>
│ │ │ │ +
453 struct TreePathFront<HybridTreePath<index_constant<k>,index_constant<i>...>>
│ │ │ │ +
454 : public index_constant<k>
│ │ │ │ +
455 {};
│ │ │ │ +
456
│ │ │ │ +
457 template<std::size_t k, std::size_t... i>
│ │ │ │ +
458 struct TreePathPopBack<HybridTreePath<index_constant<k>>,i...>
│ │ │ │ +
459 {
│ │ │ │ + │ │ │ │ +
461 };
│ │ │ │ +
462
│ │ │ │ +
463 template<std::size_t j,
│ │ │ │ +
464 std::size_t k,
│ │ │ │ +
465 std::size_t... l,
│ │ │ │ +
466 std::size_t... i>
│ │ │ │ +
467 struct TreePathPopBack<HybridTreePath<index_constant<j>,index_constant<k>,index_constant<l>...>,i...>
│ │ │ │ +
468 : public TreePathPopBack<HybridTreePath<index_constant<k>,index_constant<l>...>,i...,j>
│ │ │ │ +
469 {};
│ │ │ │ +
470
│ │ │ │ +
471 template<std::size_t k, std::size_t... i>
│ │ │ │ +
472 struct TreePathPopFront<HybridTreePath<index_constant<k>,index_constant<i>...> >
│ │ │ │ +
473 {
│ │ │ │ + │ │ │ │ +
475 };
│ │ │ │ +
476
│ │ │ │ +
477 template<std::size_t... i, std::size_t... k>
│ │ │ │ +
478 struct TreePathConcat<HybridTreePath<index_constant<i>...>,HybridTreePath<index_constant<k>...> >
│ │ │ │ +
479 {
│ │ │ │ +
480 typedef HybridTreePath<index_constant<i>...,index_constant<k>...> type;
│ │ │ │ +
481 };
│ │ │ │ +
482
│ │ │ │ +
483#ifndef DOXYGEN
│ │ │ │ +
484
│ │ │ │ +
485 namespace impl {
│ │ │ │ +
486
│ │ │ │ +
487 // end of recursion
│ │ │ │ +
488 template<std::size_t i, typename... T>
│ │ │ │ +
489 typename std::enable_if<
│ │ │ │ +
490 (i == sizeof...(T))
│ │ │ │ +
491 >::type
│ │ │ │ +
492 print_hybrid_tree_path(std::ostream& os, const HybridTreePath<T...>& tp, index_constant<i> _i)
│ │ │ │ +
493 {}
│ │ │ │ +
494
│ │ │ │ +
495 // print current entry and recurse
│ │ │ │ +
496 template<std::size_t i, typename... T>
│ │ │ │ +
497 typename std::enable_if<
│ │ │ │ +
498 (i < sizeof...(T))
│ │ │ │ +
499 >::type
│ │ │ │ +
500 print_hybrid_tree_path(std::ostream& os, const HybridTreePath<T...>& tp, index_constant<i> _i)
│ │ │ │ +
501 {
│ │ │ │ +
502 os << treePathIndex(tp,_i) << " ";
│ │ │ │ +
503 print_hybrid_tree_path(os,tp,index_constant<i+1>{});
│ │ │ │ +
504 }
│ │ │ │ +
505
│ │ │ │ +
506 } // namespace impl
│ │ │ │ +
507
│ │ │ │ +
508#endif // DOXYGEN
│ │ │ │ +
509
│ │ │ │ +
511 template<typename... T>
│ │ │ │ +
512 std::ostream& operator<<(std::ostream& os, const HybridTreePath<T...>& tp)
│ │ │ │ +
513 {
│ │ │ │ +
514 os << "HybridTreePath< ";
│ │ │ │ +
515 impl::print_hybrid_tree_path(os, tp, index_constant<0>{});
│ │ │ │ +
516 os << ">";
│ │ │ │ +
517 return os;
│ │ │ │ +
518 }
│ │ │ │ +
519
│ │ │ │ +
520 template<std::size_t... i>
│ │ │ │ +
521 using TreePath [[deprecated("use StaticTreePath, this type will be removed after DUNE 2.7")]] = HybridTreePath<Dune::index_constant<i>...>;
│ │ │ │ +
522
│ │ │ │ +
523 template<std::size_t... i>
│ │ │ │ + │ │ │ │ +
525
│ │ │ │ +
527
│ │ │ │ +
528 } // namespace TypeTree
│ │ │ │ +
529} //namespace Dune
│ │ │ │ +
530
│ │ │ │ +
531#endif // DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ +
constexpr auto pop_front(const HybridTreePath< T... > &tp)
Removes first index on a HybridTreePath.
Definition: treepath.hh:343
│ │ │ │ +
std::ostream & operator<<(std::ostream &os, const HybridTreePath< T... > &tp)
Dumps a HybridTreePath to a stream.
Definition: treepath.hh:512
│ │ │ │ +
constexpr auto back(const HybridTreePath< T... > &tp) -> decltype(treePathEntry< sizeof...(T) -1 >(tp))
Returns a copy of the last element of the HybridTreePath.
Definition: treepath.hh:257
│ │ │ │ +
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition: treepath.hh:199
│ │ │ │ +
constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< T... > &tp, std::size_t element)
Prepends a run time index to a HybridTreePath.
Definition: treepath.hh:312
│ │ │ │ +
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ +
constexpr auto front(const HybridTreePath< T... > &tp) -> decltype(treePathEntry< 0 >(tp))
Returns a copy of the first element of the HybridTreePath.
Definition: treepath.hh:270
│ │ │ │ +
constexpr auto treePathEntry(const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
Returns a copy of the i-th element of the HybridTreePath.
Definition: treepath.hh:222
│ │ │ │ +
constexpr auto operator!=(const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
Compare two HybridTreePaths for unequality.
Definition: treepath.hh:408
│ │ │ │ +
constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, index_constant< i >={})
Returns the index value of the i-th element of the HybridTreePath.
Definition: treepath.hh:245
│ │ │ │ +
constexpr auto pop_back(const HybridTreePath< T... > &tp)
Removes last index on a HybridTreePath.
Definition: treepath.hh:356
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ +
constexpr bool operator==(const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
Compare two HybridTreePaths for value equality.
Definition: treepath.hh:374
│ │ │ │ +
void print_tree_path(std::ostream &os)
Definition: treepath.hh:58
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Definition: powercompositenodetransformationtemplates.hh:21
│ │ │ │ -
Definition: powercompositenodetransformationtemplates.hh:24
│ │ │ │ -
TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type
Definition: powercompositenodetransformationtemplates.hh:25
│ │ │ │ -
Definition: powercompositenodetransformationtemplates.hh:32
│ │ │ │ -
Definition: powercompositenodetransformationtemplates.hh:35
│ │ │ │ -
TransformedNode< SourceNode, TC > type
Definition: powercompositenodetransformationtemplates.hh:36
│ │ │ │ -
Definition: powercompositenodetransformationtemplates.hh:42
│ │ │ │ -
Definition: powercompositenodetransformationtemplates.hh:45
│ │ │ │ -
TransformedNode< SourceNode, TC... > type
Definition: powercompositenodetransformationtemplates.hh:46
│ │ │ │ +
Type
Definition: treepath.hh:30
│ │ │ │ +
@ fullyStatic
Definition: treepath.hh:30
│ │ │ │ +
@ dynamic
Definition: treepath.hh:30
│ │ │ │ +
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ +
constexpr HybridTreePath(HybridTreePath &&tp)=default
│ │ │ │ +
constexpr HybridTreePath & operator=(const HybridTreePath &tp)=default
│ │ │ │ +
constexpr std::size_t element(std::size_t pos) const
Get the index value at position pos.
Definition: treepath.hh:145
│ │ │ │ +
constexpr HybridTreePath(std::tuple< T... > t)
Constructor from a std::tuple
Definition: treepath.hh:97
│ │ │ │ +
constexpr HybridTreePath & operator=(HybridTreePath &&tp)=default
│ │ │ │ +
constexpr HybridTreePath(U... t)
Constructor from arguments.
Definition: treepath.hh:103
│ │ │ │ +
constexpr HybridTreePath()
Default constructor.
Definition: treepath.hh:87
│ │ │ │ +
static constexpr std::size_t size()
Get the size (length) of this path.
Definition: treepath.hh:114
│ │ │ │ +
constexpr auto operator[](Dune::index_constant< i >) const
Get the index value at position pos.
Definition: treepath.hh:121
│ │ │ │ +
constexpr auto element(Dune::index_constant< i > pos={}) const
Get the last index value.
Definition: treepath.hh:139
│ │ │ │ +
static constexpr index_sequence enumerate()
Returns an index_sequence for enumerating the components of this HybridTreePath.
Definition: treepath.hh:108
│ │ │ │ +
constexpr HybridTreePath(const HybridTreePath &tp)=default
│ │ │ │ +
constexpr std::size_t operator[](std::size_t pos) const
Get the index value at position pos.
Definition: treepath.hh:127
│ │ │ │ +
auto back() const
Get the last index value.
Definition: treepath.hh:156
│ │ │ │ +
std::index_sequence_for< T... > index_sequence
An index_sequence for the entries in this HybridTreePath.
Definition: treepath.hh:84
│ │ │ │ +
Definition: treepath.hh:34
│ │ │ │ +
Definition: treepath.hh:37
│ │ │ │ +
Definition: treepath.hh:40
│ │ │ │ +
Definition: treepath.hh:43
│ │ │ │ +
Definition: treepath.hh:46
│ │ │ │ +
Definition: treepath.hh:49
│ │ │ │ +
Definition: treepath.hh:52
│ │ │ │ +
Definition: treepath.hh:55
│ │ │ │ +
HybridTreePath< index_constant< i >..., index_constant< k > > type
Definition: treepath.hh:433
│ │ │ │ +
HybridTreePath< index_constant< k >, index_constant< i >... > type
Definition: treepath.hh:439
│ │ │ │ +
HybridTreePath< index_constant< i >... > type
Definition: treepath.hh:460
│ │ │ │ +
HybridTreePath< index_constant< i >... > type
Definition: treepath.hh:474
│ │ │ │ +
HybridTreePath< index_constant< i >..., index_constant< k >... > type
Definition: treepath.hh:480
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,88 +4,613 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -powercompositenodetransformationtemplates.hh │ │ │ │ │ +treepath.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ 6 │ │ │ │ │ 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11namespace Dune { │ │ │ │ │ - 12 namespace TypeTree { │ │ │ │ │ - 13 │ │ │ │ │ - 19 template class TransformedNode> │ │ │ │ │ -20 struct GenericPowerNodeTransformationTemplate │ │ │ │ │ - 21 { │ │ │ │ │ - 22 template │ │ │ │ │ -23 struct result │ │ │ │ │ - 24 { │ │ │ │ │ -25 typedef TransformedNode::value> type; │ │ │ │ │ - 26 }; │ │ │ │ │ - 27 }; │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17 │ │ │ │ │ + 18 │ │ │ │ │ + 19namespace Dune { │ │ │ │ │ + 20 namespace TypeTree { │ │ │ │ │ + 21 │ │ │ │ │ + 22 template │ │ │ │ │ + 23 class HybridTreePath; │ │ │ │ │ + 24 │ │ │ │ │ 28 │ │ │ │ │ - 29 │ │ │ │ │ - 30 template class TransformedNode> │ │ │ │ │ -31 struct GenericDynamicPowerNodeTransformationTemplate │ │ │ │ │ - 32 { │ │ │ │ │ - 33 template │ │ │ │ │ -34 struct result │ │ │ │ │ - 35 { │ │ │ │ │ -36 typedef TransformedNode type; │ │ │ │ │ - 37 }; │ │ │ │ │ - 38 }; │ │ │ │ │ - 39 │ │ │ │ │ - 40 template class TransformedNode> │ │ │ │ │ -41 struct GenericCompositeNodeTransformationTemplate │ │ │ │ │ - 42 { │ │ │ │ │ - 43 template │ │ │ │ │ -44 struct result │ │ │ │ │ - 45 { │ │ │ │ │ -46 typedef TransformedNode type; │ │ │ │ │ - 47 }; │ │ │ │ │ - 48 }; │ │ │ │ │ - 49 │ │ │ │ │ - 51 │ │ │ │ │ - 52 } // namespace TypeTree │ │ │ │ │ - 53} //namespace Dune │ │ │ │ │ - 54 │ │ │ │ │ - 55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ +29 namespace TreePathType { │ │ │ │ │ +30 enum Type { fullyStatic, dynamic }; │ │ │ │ │ + 31 } │ │ │ │ │ + 32 │ │ │ │ │ + 33 template │ │ │ │ │ +34 struct TreePathSize; │ │ │ │ │ + 35 │ │ │ │ │ + 36 template │ │ │ │ │ +37 struct TreePathPushBack; │ │ │ │ │ + 38 │ │ │ │ │ + 39 template │ │ │ │ │ +40 struct TreePathPushFront; │ │ │ │ │ + 41 │ │ │ │ │ + 42 template │ │ │ │ │ +43 struct TreePathBack; │ │ │ │ │ + 44 │ │ │ │ │ + 45 template │ │ │ │ │ +46 struct TreePathFront; │ │ │ │ │ + 47 │ │ │ │ │ + 48 template │ │ │ │ │ +49 struct TreePathPopBack; │ │ │ │ │ + 50 │ │ │ │ │ + 51 template │ │ │ │ │ +52 struct TreePathPopFront; │ │ │ │ │ + 53 │ │ │ │ │ + 54 template │ │ │ │ │ +55 struct TreePathConcat; │ │ │ │ │ + 56 │ │ │ │ │ + 57 template │ │ │ │ │ +58 void print_tree_path(std::ostream& os) │ │ │ │ │ + 59 {} │ │ │ │ │ + 60 │ │ │ │ │ + 61 template │ │ │ │ │ +62 void print_tree_path(std::ostream& os) │ │ │ │ │ + 63 { │ │ │ │ │ + 64 os << k << " "; │ │ │ │ │ + 65 print_tree_path(os); │ │ │ │ │ + 66 } │ │ │ │ │ + 67 │ │ │ │ │ + 69 │ │ │ │ │ + 77 template │ │ │ │ │ +78 class HybridTreePath │ │ │ │ │ + 79 { │ │ │ │ │ + 80 │ │ │ │ │ + 81 public: │ │ │ │ │ + 82 │ │ │ │ │ +84 using index_sequence = std::index_sequence_for; │ │ │ │ │ + 85 │ │ │ │ │ +87 constexpr HybridTreePath() │ │ │ │ │ + 88 {} │ │ │ │ │ + 89 │ │ │ │ │ +90 constexpr HybridTreePath(const HybridTreePath& tp) = default; │ │ │ │ │ +91 constexpr HybridTreePath(HybridTreePath&& tp) = default; │ │ │ │ │ + 92 │ │ │ │ │ +93 constexpr HybridTreePath& operator=(const HybridTreePath& tp) = default; │ │ │ │ │ +94 constexpr HybridTreePath& operator=(HybridTreePath&& tp) = default; │ │ │ │ │ + 95 │ │ │ │ │ +97 explicit constexpr HybridTreePath(std::tuple t) │ │ │ │ │ + 98 : _data(t) │ │ │ │ │ + 99 {} │ │ │ │ │ + 100 │ │ │ │ │ + 102 template 0 && │ │ │ │ │ +sizeof...(U) == sizeof...(T)),bool>::type = true> │ │ │ │ │ +103 explicit constexpr HybridTreePath(U... t) │ │ │ │ │ + 104 : _data(t...) │ │ │ │ │ + 105 {} │ │ │ │ │ + 106 │ │ │ │ │ +108 constexpr static index_sequence enumerate() │ │ │ │ │ + 109 { │ │ │ │ │ + 110 return {}; │ │ │ │ │ + 111 } │ │ │ │ │ + 112 │ │ │ │ │ +114 constexpr static std::size_t size() │ │ │ │ │ + 115 { │ │ │ │ │ + 116 return sizeof...(T); │ │ │ │ │ + 117 } │ │ │ │ │ + 118 │ │ │ │ │ + 120 template │ │ │ │ │ +121 constexpr auto operator[](Dune::index_constant) const │ │ │ │ │ + 122 { │ │ │ │ │ + 123 return std::get(_data); │ │ │ │ │ + 124 } │ │ │ │ │ + 125 │ │ │ │ │ +127 constexpr std::size_t operator[](std::size_t pos) const │ │ │ │ │ + 128 { │ │ │ │ │ + 129 std::size_t entry = 0; │ │ │ │ │ + 130 Dune::Hybrid::forEach(enumerate(), [&] (auto i) { │ │ │ │ │ + 131 if (i==pos) │ │ │ │ │ + 132 entry = this->element(i); │ │ │ │ │ + 133 }); │ │ │ │ │ + 134 return entry; │ │ │ │ │ + 135 } │ │ │ │ │ + 136 │ │ │ │ │ + 138 template │ │ │ │ │ +139 constexpr auto element(Dune::index_constant pos = {}) const │ │ │ │ │ + 140 { │ │ │ │ │ + 141 return std::get(_data); │ │ │ │ │ + 142 } │ │ │ │ │ + 143 │ │ │ │ │ +145 constexpr std::size_t element(std::size_t pos) const │ │ │ │ │ + 146 { │ │ │ │ │ + 147 std::size_t entry = 0; │ │ │ │ │ + 148 Dune::Hybrid::forEach(enumerate(), [&] (auto i) { │ │ │ │ │ + 149 if (i==pos) │ │ │ │ │ + 150 entry = this->element(i); │ │ │ │ │ + 151 }); │ │ │ │ │ + 152 return entry; │ │ │ │ │ + 153 } │ │ │ │ │ + 154 │ │ │ │ │ +156 auto back() const │ │ │ │ │ + 157 { │ │ │ │ │ + 158 return std::get(_data); │ │ │ │ │ + 159 } │ │ │ │ │ + 160 │ │ │ │ │ + 161#ifndef DOXYGEN │ │ │ │ │ + 162 │ │ │ │ │ + 163 // I can't be bothered to make all the external accessors friends of │ │ │ │ │ +HybridTreePath, │ │ │ │ │ + 164 // so we'll only hide the data tuple from the user in Doxygen. │ │ │ │ │ + 165 │ │ │ │ │ + 166 using Data = std::tuple; │ │ │ │ │ + 167 Data _data; │ │ │ │ │ + 168 │ │ │ │ │ + 169#endif // DOXYGEN │ │ │ │ │ + 170 │ │ │ │ │ + 171 }; │ │ │ │ │ + 172 │ │ │ │ │ + 173 │ │ │ │ │ + 175 │ │ │ │ │ + 179 template │ │ │ │ │ +180 constexpr HybridTreePath hybridTreePath(const T&... t) │ │ │ │ │ + 181 { │ │ │ │ │ + 182 return HybridTreePath(t...); │ │ │ │ │ + 183 } │ │ │ │ │ + 184 │ │ │ │ │ + 186 │ │ │ │ │ + 190 template │ │ │ │ │ +191 constexpr HybridTreePath treePath(const T&... t) │ │ │ │ │ + 192 { │ │ │ │ │ + 193 return HybridTreePath(t...); │ │ │ │ │ + 194 } │ │ │ │ │ + 195 │ │ │ │ │ + 196 │ │ │ │ │ + 198 template │ │ │ │ │ +199 constexpr std::size_t treePathSize(const HybridTreePath&) │ │ │ │ │ + 200 { │ │ │ │ │ + 201 return sizeof...(T); │ │ │ │ │ + 202 } │ │ │ │ │ + 203 │ │ │ │ │ + 205 │ │ │ │ │ + 221 template │ │ │ │ │ +222 constexpr auto treePathEntry(const HybridTreePath& tp, │ │ │ │ │ +index_constant = {}) │ │ │ │ │ + 223 -> typename std::decay(tp._data))>::type │ │ │ │ │ + 224 { │ │ │ │ │ + 225 return std::get(tp._data); │ │ │ │ │ + 226 } │ │ │ │ │ + 227 │ │ │ │ │ + 229 │ │ │ │ │ + 244 template │ │ │ │ │ +245 constexpr std::size_t treePathIndex(const HybridTreePath& tp, │ │ │ │ │ +index_constant = {}) │ │ │ │ │ + 246 { │ │ │ │ │ + 247 return std::get(tp._data); │ │ │ │ │ + 248 } │ │ │ │ │ + 249 │ │ │ │ │ + 251 │ │ │ │ │ + 256 template 0),bool>:: │ │ │ │ │ +type = true> │ │ │ │ │ +257 constexpr auto back(const HybridTreePath& tp) │ │ │ │ │ + 258 -> decltype(treePathEntry(tp)) │ │ │ │ │ + 259 { │ │ │ │ │ + 260 return treePathEntry(tp); │ │ │ │ │ + 261 } │ │ │ │ │ + 262 │ │ │ │ │ + 264 │ │ │ │ │ + 269 template │ │ │ │ │ +270 constexpr auto front(const HybridTreePath& tp) │ │ │ │ │ + 271 -> decltype(treePathEntry<0>(tp)) │ │ │ │ │ + 272 { │ │ │ │ │ + 273 return treePathEntry<0>(tp); │ │ │ │ │ + 274 } │ │ │ │ │ + 275 │ │ │ │ │ + 277 │ │ │ │ │ + 280 template │ │ │ │ │ +281 constexpr HybridTreePath push_back(const │ │ │ │ │ +HybridTreePath& tp, std::size_t i) │ │ │ │ │ + 282 { │ │ │ │ │ + 283 return HybridTreePath(std::tuple_cat(tp._data,std:: │ │ │ │ │ +make_tuple(i))); │ │ │ │ │ + 284 } │ │ │ │ │ + 285 │ │ │ │ │ + 287 │ │ │ │ │ + 301 template │ │ │ │ │ +302 constexpr HybridTreePath> push_back(const │ │ │ │ │ +HybridTreePath& tp, index_constant i_ = {}) │ │ │ │ │ + 303 { │ │ │ │ │ + 304 return HybridTreePath >(std::tuple_cat │ │ │ │ │ +(tp._data,std::make_tuple(i_))); │ │ │ │ │ + 305 } │ │ │ │ │ + 306 │ │ │ │ │ + 308 │ │ │ │ │ + 311 template │ │ │ │ │ +312 constexpr HybridTreePath push_front(const │ │ │ │ │ +HybridTreePath& tp, std::size_t element) │ │ │ │ │ + 313 { │ │ │ │ │ + 314 return HybridTreePath(std::tuple_cat(std::make_tuple │ │ │ │ │ +(element),tp._data)); │ │ │ │ │ + 315 } │ │ │ │ │ + 316 │ │ │ │ │ + 318 │ │ │ │ │ + 332 template │ │ │ │ │ +333 constexpr HybridTreePath,T...> push_front(const │ │ │ │ │ +HybridTreePath& tp, index_constant _i = {}) │ │ │ │ │ + 334 { │ │ │ │ │ + 335 return HybridTreePath,T...>(std::tuple_cat(std:: │ │ │ │ │ +make_tuple(_i),tp._data)); │ │ │ │ │ + 336 } │ │ │ │ │ + 337 │ │ │ │ │ + 339 │ │ │ │ │ + 342 template │ │ │ │ │ +343 constexpr auto pop_front(const HybridTreePath& tp) │ │ │ │ │ + 344 { │ │ │ │ │ + 345 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ + 346 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ + 347 return HybridTreePath{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ + 348 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ + 349 } │ │ │ │ │ + 350 │ │ │ │ │ + 352 │ │ │ │ │ + 355 template │ │ │ │ │ +356 constexpr auto pop_back(const HybridTreePath& tp) │ │ │ │ │ + 357 { │ │ │ │ │ + 358 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ + 359 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ + 360 return HybridTreePath{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ + 361 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ + 362 } │ │ │ │ │ + 363 │ │ │ │ │ + 365 │ │ │ │ │ + 373 template │ │ │ │ │ +374 constexpr bool operator==( │ │ │ │ │ + 375 const HybridTreePath& lhs, │ │ │ │ │ + 376 const HybridTreePath& rhs) │ │ │ │ │ + 377 { │ │ │ │ │ + 378 if constexpr (sizeof...(S) == sizeof...(T)) { │ │ │ │ │ + 379 if constexpr ((Dune::IsInteroperable::value &&...)) { │ │ │ │ │ + 380 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ + 381 return ((std::get(lhs._data) == std::get(rhs._data)) &&...); │ │ │ │ │ + 382 }, std::make_index_sequence<(sizeof...(S))>{}); │ │ │ │ │ + 383 } else { │ │ │ │ │ + 384 return false; │ │ │ │ │ + 385 } │ │ │ │ │ + 386 } else { │ │ │ │ │ + 387 return false; │ │ │ │ │ + 388 } │ │ │ │ │ + 389 } │ │ │ │ │ + 390 │ │ │ │ │ + 392 │ │ │ │ │ + 397 template │ │ │ │ │ +398 constexpr auto operator==( │ │ │ │ │ + 399 const HybridTreePath...>&, │ │ │ │ │ + 400 const HybridTreePath...>&) │ │ │ │ │ + 401 { │ │ │ │ │ + 402 return std::bool_constant{}; │ │ │ │ │ + 403 } │ │ │ │ │ + 404 │ │ │ │ │ + 405 │ │ │ │ │ + 407 template │ │ │ │ │ +408 constexpr auto operator!=( │ │ │ │ │ + 409 const HybridTreePath& lhs, │ │ │ │ │ + 410 const HybridTreePath& rhs) │ │ │ │ │ + 411 { │ │ │ │ │ + 412 return !(lhs == rhs); │ │ │ │ │ + 413 } │ │ │ │ │ + 414 │ │ │ │ │ + 416 template │ │ │ │ │ +417 constexpr auto operator!=( │ │ │ │ │ + 418 const HybridTreePath...>&, │ │ │ │ │ + 419 const HybridTreePath...>&) │ │ │ │ │ + 420 { │ │ │ │ │ + 421 return std::bool_constant{}; │ │ │ │ │ + 422 } │ │ │ │ │ + 423 │ │ │ │ │ + 424 template │ │ │ │ │ +425 struct TreePathSize...> > │ │ │ │ │ + 426 : public index_constant │ │ │ │ │ + 427 {}; │ │ │ │ │ + 428 │ │ │ │ │ + 429 │ │ │ │ │ + 430 template │ │ │ │ │ +431 struct TreePathPushBack...>,k> │ │ │ │ │ + 432 { │ │ │ │ │ +433 typedef HybridTreePath...,index_constant> type; │ │ │ │ │ + 434 }; │ │ │ │ │ + 435 │ │ │ │ │ + 436 template │ │ │ │ │ +437 struct TreePathPushFront...>,k> │ │ │ │ │ + 438 { │ │ │ │ │ +439 typedef HybridTreePath,index_constant...> type; │ │ │ │ │ + 440 }; │ │ │ │ │ + 441 │ │ │ │ │ + 442 template │ │ │ │ │ +443 struct TreePathBack>> │ │ │ │ │ + 444 : public index_constant │ │ │ │ │ + 445 {}; │ │ │ │ │ + 446 │ │ │ │ │ + 447 template │ │ │ │ │ +448 struct │ │ │ │ │ +TreePathBack,index_constant,index_constant...>> │ │ │ │ │ + 449 : public │ │ │ │ │ +TreePathBack,index_constant...>> │ │ │ │ │ + 450 {}; │ │ │ │ │ + 451 │ │ │ │ │ + 452 template │ │ │ │ │ +453 struct │ │ │ │ │ +TreePathFront,index_constant...>> │ │ │ │ │ + 454 : public index_constant │ │ │ │ │ + 455 {}; │ │ │ │ │ + 456 │ │ │ │ │ + 457 template │ │ │ │ │ +458 struct TreePathPopBack>,i...> │ │ │ │ │ + 459 { │ │ │ │ │ +460 typedef HybridTreePath...> type; │ │ │ │ │ + 461 }; │ │ │ │ │ + 462 │ │ │ │ │ + 463 template │ │ │ │ │ +467 struct │ │ │ │ │ +TreePathPopBack,index_constant,index_constant...>,i...> │ │ │ │ │ + 468 : public │ │ │ │ │ +TreePathPopBack,index_constant...>,i...,j> │ │ │ │ │ + 469 {}; │ │ │ │ │ + 470 │ │ │ │ │ + 471 template │ │ │ │ │ +472 struct │ │ │ │ │ +TreePathPopFront,index_constant...> > │ │ │ │ │ + 473 { │ │ │ │ │ +474 typedef HybridTreePath...> type; │ │ │ │ │ + 475 }; │ │ │ │ │ + 476 │ │ │ │ │ + 477 template │ │ │ │ │ +478 struct │ │ │ │ │ +TreePathConcat...>,HybridTreePath...> │ │ │ │ │ +> │ │ │ │ │ + 479 { │ │ │ │ │ +480 typedef HybridTreePath...,index_constant...> type; │ │ │ │ │ + 481 }; │ │ │ │ │ + 482 │ │ │ │ │ + 483#ifndef DOXYGEN │ │ │ │ │ + 484 │ │ │ │ │ + 485 namespace impl { │ │ │ │ │ + 486 │ │ │ │ │ + 487 // end of recursion │ │ │ │ │ + 488 template │ │ │ │ │ + 489 typename std::enable_if< │ │ │ │ │ + 490 (i == sizeof...(T)) │ │ │ │ │ + 491 >::type │ │ │ │ │ + 492 print_hybrid_tree_path(std::ostream& os, const HybridTreePath& tp, │ │ │ │ │ +index_constant _i) │ │ │ │ │ + 493 {} │ │ │ │ │ + 494 │ │ │ │ │ + 495 // print current entry and recurse │ │ │ │ │ + 496 template │ │ │ │ │ + 497 typename std::enable_if< │ │ │ │ │ + 498 (i < sizeof...(T)) │ │ │ │ │ + 499 >::type │ │ │ │ │ + 500 print_hybrid_tree_path(std::ostream& os, const HybridTreePath& tp, │ │ │ │ │ +index_constant _i) │ │ │ │ │ + 501 { │ │ │ │ │ + 502 os << treePathIndex(tp,_i) << " "; │ │ │ │ │ + 503 print_hybrid_tree_path(os,tp,index_constant{}); │ │ │ │ │ + 504 } │ │ │ │ │ + 505 │ │ │ │ │ + 506 } // namespace impl │ │ │ │ │ + 507 │ │ │ │ │ + 508#endif // DOXYGEN │ │ │ │ │ + 509 │ │ │ │ │ + 511 template │ │ │ │ │ +512 std::ostream& operator<<(std::ostream& os, const HybridTreePath& tp) │ │ │ │ │ + 513 { │ │ │ │ │ + 514 os << "HybridTreePath< "; │ │ │ │ │ + 515 impl::print_hybrid_tree_path(os, tp, index_constant<0>{}); │ │ │ │ │ + 516 os << ">"; │ │ │ │ │ + 517 return os; │ │ │ │ │ + 518 } │ │ │ │ │ + 519 │ │ │ │ │ + 520 template │ │ │ │ │ +521 using TreePath [[deprecated("use StaticTreePath, this type will be removed │ │ │ │ │ +after DUNE 2.7")]] = HybridTreePath...>; │ │ │ │ │ + 522 │ │ │ │ │ + 523 template │ │ │ │ │ +524 using StaticTreePath = HybridTreePath...>; │ │ │ │ │ + 525 │ │ │ │ │ + 527 │ │ │ │ │ + 528 } // namespace TypeTree │ │ │ │ │ + 529} //namespace Dune │ │ │ │ │ + 530 │ │ │ │ │ + 531#endif // DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ +fixedcapacitystack.hh │ │ │ │ │ +utility.hh │ │ │ │ │ +Dune::TypeTree::push_back │ │ │ │ │ +constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t i) │ │ │ │ │ +Appends a run time index to a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:281 │ │ │ │ │ +Dune::TypeTree::pop_front │ │ │ │ │ +constexpr auto pop_front(const HybridTreePath< T... > &tp) │ │ │ │ │ +Removes first index on a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:343 │ │ │ │ │ +Dune::TypeTree::operator<< │ │ │ │ │ +std::ostream & operator<<(std::ostream &os, const HybridTreePath< T... > &tp) │ │ │ │ │ +Dumps a HybridTreePath to a stream. │ │ │ │ │ +Definition: treepath.hh:512 │ │ │ │ │ +Dune::TypeTree::back │ │ │ │ │ +constexpr auto back(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ +(treePathEntry< sizeof...(T) -1 >(tp)) │ │ │ │ │ +Returns a copy of the last element of the HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:257 │ │ │ │ │ +Dune::TypeTree::treePathSize │ │ │ │ │ +constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ +Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:199 │ │ │ │ │ +Dune::TypeTree::push_front │ │ │ │ │ +constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t element) │ │ │ │ │ +Prepends a run time index to a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:312 │ │ │ │ │ +Dune::TypeTree::hybridTreePath │ │ │ │ │ +constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:180 │ │ │ │ │ +Dune::TypeTree::front │ │ │ │ │ +constexpr auto front(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ +(treePathEntry< 0 >(tp)) │ │ │ │ │ +Returns a copy of the first element of the HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:270 │ │ │ │ │ +Dune::TypeTree::treePathEntry │ │ │ │ │ +constexpr auto treePathEntry(const HybridTreePath< T... > &tp, index_constant< │ │ │ │ │ +i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type │ │ │ │ │ +Returns a copy of the i-th element of the HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:222 │ │ │ │ │ +Dune::TypeTree::operator!= │ │ │ │ │ +constexpr auto operator!=(const HybridTreePath< S... > &lhs, const │ │ │ │ │ +HybridTreePath< T... > &rhs) │ │ │ │ │ +Compare two HybridTreePaths for unequality. │ │ │ │ │ +Definition: treepath.hh:408 │ │ │ │ │ +Dune::TypeTree::treePathIndex │ │ │ │ │ +constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, │ │ │ │ │ +index_constant< i >={}) │ │ │ │ │ +Returns the index value of the i-th element of the HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:245 │ │ │ │ │ +Dune::TypeTree::pop_back │ │ │ │ │ +constexpr auto pop_back(const HybridTreePath< T... > &tp) │ │ │ │ │ +Removes last index on a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:356 │ │ │ │ │ +Dune::TypeTree::treePath │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:191 │ │ │ │ │ +Dune::TypeTree::operator== │ │ │ │ │ +constexpr bool operator==(const HybridTreePath< S... > &lhs, const │ │ │ │ │ +HybridTreePath< T... > &rhs) │ │ │ │ │ +Compare two HybridTreePaths for value equality. │ │ │ │ │ +Definition: treepath.hh:374 │ │ │ │ │ +Dune::TypeTree::print_tree_path │ │ │ │ │ +void print_tree_path(std::ostream &os) │ │ │ │ │ +Definition: treepath.hh:58 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::GenericPowerNodeTransformationTemplate │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:21 │ │ │ │ │ -Dune::TypeTree::GenericPowerNodeTransformationTemplate::result │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:24 │ │ │ │ │ -Dune::TypeTree::GenericPowerNodeTransformationTemplate::result::type │ │ │ │ │ -TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:25 │ │ │ │ │ -Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:32 │ │ │ │ │ -Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:35 │ │ │ │ │ -Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result::type │ │ │ │ │ -TransformedNode< SourceNode, TC > type │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:36 │ │ │ │ │ -Dune::TypeTree::GenericCompositeNodeTransformationTemplate │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:42 │ │ │ │ │ -Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:45 │ │ │ │ │ -Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result::type │ │ │ │ │ -TransformedNode< SourceNode, TC... > type │ │ │ │ │ -Definition: powercompositenodetransformationtemplates.hh:46 │ │ │ │ │ +Dune::TypeTree::TreePathType::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::TreePathType::fullyStatic │ │ │ │ │ +@ fullyStatic │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ +@ dynamic │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::HybridTreePath │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: treepath.hh:79 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ +constexpr HybridTreePath(HybridTreePath &&tp)=default │ │ │ │ │ +Dune::TypeTree::HybridTreePath::operator= │ │ │ │ │ +constexpr HybridTreePath & operator=(const HybridTreePath &tp)=default │ │ │ │ │ +Dune::TypeTree::HybridTreePath::element │ │ │ │ │ +constexpr std::size_t element(std::size_t pos) const │ │ │ │ │ +Get the index value at position pos. │ │ │ │ │ +Definition: treepath.hh:145 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ +constexpr HybridTreePath(std::tuple< T... > t) │ │ │ │ │ +Constructor from a std::tuple │ │ │ │ │ +Definition: treepath.hh:97 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::operator= │ │ │ │ │ +constexpr HybridTreePath & operator=(HybridTreePath &&tp)=default │ │ │ │ │ +Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ +constexpr HybridTreePath(U... t) │ │ │ │ │ +Constructor from arguments. │ │ │ │ │ +Definition: treepath.hh:103 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ +constexpr HybridTreePath() │ │ │ │ │ +Default constructor. │ │ │ │ │ +Definition: treepath.hh:87 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::size │ │ │ │ │ +static constexpr std::size_t size() │ │ │ │ │ +Get the size (length) of this path. │ │ │ │ │ +Definition: treepath.hh:114 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::operator[] │ │ │ │ │ +constexpr auto operator[](Dune::index_constant< i >) const │ │ │ │ │ +Get the index value at position pos. │ │ │ │ │ +Definition: treepath.hh:121 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::element │ │ │ │ │ +constexpr auto element(Dune::index_constant< i > pos={}) const │ │ │ │ │ +Get the last index value. │ │ │ │ │ +Definition: treepath.hh:139 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::enumerate │ │ │ │ │ +static constexpr index_sequence enumerate() │ │ │ │ │ +Returns an index_sequence for enumerating the components of this │ │ │ │ │ +HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:108 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ +constexpr HybridTreePath(const HybridTreePath &tp)=default │ │ │ │ │ +Dune::TypeTree::HybridTreePath::operator[] │ │ │ │ │ +constexpr std::size_t operator[](std::size_t pos) const │ │ │ │ │ +Get the index value at position pos. │ │ │ │ │ +Definition: treepath.hh:127 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::back │ │ │ │ │ +auto back() const │ │ │ │ │ +Get the last index value. │ │ │ │ │ +Definition: treepath.hh:156 │ │ │ │ │ +Dune::TypeTree::HybridTreePath::index_sequence │ │ │ │ │ +std::index_sequence_for< T... > index_sequence │ │ │ │ │ +An index_sequence for the entries in this HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:84 │ │ │ │ │ +Dune::TypeTree::TreePathSize │ │ │ │ │ +Definition: treepath.hh:34 │ │ │ │ │ +Dune::TypeTree::TreePathPushBack │ │ │ │ │ +Definition: treepath.hh:37 │ │ │ │ │ +Dune::TypeTree::TreePathPushFront │ │ │ │ │ +Definition: treepath.hh:40 │ │ │ │ │ +Dune::TypeTree::TreePathBack │ │ │ │ │ +Definition: treepath.hh:43 │ │ │ │ │ +Dune::TypeTree::TreePathFront │ │ │ │ │ +Definition: treepath.hh:46 │ │ │ │ │ +Dune::TypeTree::TreePathPopBack │ │ │ │ │ +Definition: treepath.hh:49 │ │ │ │ │ +Dune::TypeTree::TreePathPopFront │ │ │ │ │ +Definition: treepath.hh:52 │ │ │ │ │ +Dune::TypeTree::TreePathConcat │ │ │ │ │ +Definition: treepath.hh:55 │ │ │ │ │ +Dune::TypeTree::TreePathPushBack<_HybridTreePath<_index_constant<_i_>..._>,_k │ │ │ │ │ +>::type │ │ │ │ │ +HybridTreePath< index_constant< i >..., index_constant< k > > type │ │ │ │ │ +Definition: treepath.hh:433 │ │ │ │ │ +Dune::TypeTree::TreePathPushFront<_HybridTreePath<_index_constant<_i_>..._>,_k │ │ │ │ │ +>::type │ │ │ │ │ +HybridTreePath< index_constant< k >, index_constant< i >... > type │ │ │ │ │ +Definition: treepath.hh:439 │ │ │ │ │ +Dune::TypeTree::TreePathPopBack<_HybridTreePath<_index_constant<_k_>_>,_i... │ │ │ │ │ +>::type │ │ │ │ │ +HybridTreePath< index_constant< i >... > type │ │ │ │ │ +Definition: treepath.hh:460 │ │ │ │ │ +Dune::TypeTree::TreePathPopFront<_HybridTreePath<_index_constant<_k_>, │ │ │ │ │ +index_constant<_i_>..._>_>::type │ │ │ │ │ +HybridTreePath< index_constant< i >... > type │ │ │ │ │ +Definition: treepath.hh:474 │ │ │ │ │ +Dune::TypeTree::TreePathConcat<_HybridTreePath<_index_constant<_i_>..._>, │ │ │ │ │ +HybridTreePath<_index_constant<_k_>..._>_>::type │ │ │ │ │ +HybridTreePath< index_constant< i >..., index_constant< k >... > type │ │ │ │ │ +Definition: treepath.hh:480 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treecontainer.hh File Reference │ │ │ │ +dune-typetree: transformation.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,73 +65,51 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ Functions
│ │ │ │ -
treecontainer.hh File Reference
│ │ │ │ +
transformation.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ +
#include <array>
│ │ │ │ +#include <tuple>
│ │ │ │ +#include <memory>
│ │ │ │ #include <utility>
│ │ │ │ -#include <functional>
│ │ │ │ -#include <array>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ #include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/common/rangeutilities.hh>
│ │ │ │ -#include <dune/common/tuplevector.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/typetree/typetraits.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/utility.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::TypeTree::Detail::ContainerFactory< LeafToValue >
 
class  Dune::TypeTree::Detail::TreeContainerVectorBackend< Container >
 
struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue >
struct  Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive >
 Transform a TypeTree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Detail
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Typedefs

template<class Value , class Tree >
using Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >()))>
 Alias to container type generated by makeTreeContainer for given tree type and uniform value type. More...
 
template<template< class Node > class LeafToValue, class Tree >
using Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))>
 Alias to container type generated by makeTreeContainer for give tree type and when using LeafToValue to create values. More...
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<class Container >
auto Dune::TypeTree::Detail::makeTreeContainerVectorBackend (Container &&container)
 
template<class Tree , class LeafToValue >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue &&leafToValue)
 Create container havin the same structure as the given tree. More...
 
template<class Value , class Tree >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree)
 Create container havin the same structure as the given tree. More...
 
template<typename SourceNode , typename Transformation , typename Tag >
void Dune::TypeTree::registerNodeTransformation (SourceNode *, Transformation *, Tag *)
 Register transformation descriptor to transform SourceNode with Transformation. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,64 +4,41 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Typedefs | Functions │ │ │ │ │ -treecontainer.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +transformation.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::TypeTree::Detail::ContainerFactory<_LeafToValue_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::TypeTree::Detail::TreeContainerVectorBackend<_Container_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue<_LeafToValue_> │ │ │ │ │ +struct  Dune::TypeTree::TransformTree<_SourceTree,_Transformation,_Tag, │ │ │ │ │ + recursive_> │ │ │ │ │ +  Transform a TypeTree. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::Detail │ │ │ │ │ -  │ │ │ │ │ - Typedefs │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype │ │ │ │ │ - (makeTreeContainer< Value >(std::declval< const Tree & >()))> │ │ │ │ │ -  Alias to container type generated by makeTreeContainer for given tree │ │ │ │ │ - type and uniform value type. More... │ │ │ │ │ -  │ │ │ │ │ -template class LeafToValue, class Tree > │ │ │ │ │ -using Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer │ │ │ │ │ - (std::declval< const Tree & >(), std::declval< Detail:: │ │ │ │ │ - LeafToDefaultConstructibleValue< LeafToValue > >()))> │ │ │ │ │ -  Alias to container type generated by makeTreeContainer for give tree │ │ │ │ │ - type and when using LeafToValue to create values. More... │ │ │ │ │ -  │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -auto Dune::TypeTree::Detail::makeTreeContainerVectorBackend (Container │ │ │ │ │ - &&container) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -auto Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue │ │ │ │ │ - &&leafToValue) │ │ │ │ │ -  Create container havin the same structure as the given tree. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -auto Dune::TypeTree::makeTreeContainer (const Tree &tree) │ │ │ │ │ -  Create container havin the same structure as the given tree. More... │ │ │ │ │ +template │ │ │ │ │ +void Dune::TypeTree::registerNodeTransformation (SourceNode *, Transformation │ │ │ │ │ + *, Tag *) │ │ │ │ │ +  Register transformation descriptor to transform SourceNode with │ │ │ │ │ + Transformation. More... │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treecontainer.hh Source File │ │ │ │ +dune-typetree: transformation.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,297 +62,497 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
treecontainer.hh
│ │ │ │ +
transformation.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │
6
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <utility>
│ │ │ │ -
9#include <functional>
│ │ │ │ -
10#include <array>
│ │ │ │ +
7#include <array>
│ │ │ │ +
8#include <tuple>
│ │ │ │ +
9#include <memory>
│ │ │ │ +
10#include <utility>
│ │ │ │
11
│ │ │ │ -
12#include <dune/common/indices.hh>
│ │ │ │ -
13#include <dune/common/hybridutilities.hh>
│ │ │ │ -
14#include <dune/common/rangeutilities.hh>
│ │ │ │ -
15#include <dune/common/tuplevector.hh>
│ │ │ │ -
16
│ │ │ │ - │ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20 namespace TypeTree {
│ │ │ │ -
21
│ │ │ │ -
22 namespace Detail {
│ │ │ │ +
12#include <dune/common/hybridutilities.hh>
│ │ │ │ +
13#include <dune/common/exceptions.hh>
│ │ │ │ +
14#include <dune/common/typetraits.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21namespace Dune {
│ │ │ │ +
22 namespace TypeTree {
│ │ │ │
23
│ │ │ │ -
24 /*
│ │ │ │ -
25 * \brief A factory class creating a hybrid container compatible with a type tree
│ │ │ │ -
26 *
│ │ │ │ -
27 * This class allows to create a nested hybrid container having the same structure
│ │ │ │ -
28 * as a given type tree. Power nodes are represented as std::array's while composite
│ │ │ │ -
29 * nodes are represented as Dune::TupleVector's. The stored values for the leaf nodes
│ │ │ │ -
30 * are creating using a given predicate. Once created, the factory provides an
│ │ │ │ -
31 * operator() creating the container for the tree given as argument.
│ │ │ │ -
32 *
│ │ │ │ -
33 * \tparam LeafToValue Type of a predicate that determines the stored values at the leafs
│ │ │ │ -
34 */
│ │ │ │ -
35 template<class LeafToValue>
│ │ │ │ - │ │ │ │ -
37 {
│ │ │ │ -
38 template<class N>
│ │ │ │ -
39 using DynamicDegreeConcept = decltype((std::size_t(std::declval<N>().degree()), true));
│ │ │ │ -
40
│ │ │ │ -
41 template<class N>
│ │ │ │ -
42 using StaticDegreeConcept = decltype((std::integral_constant<std::size_t, N::degree()>{}, true));
│ │ │ │ -
43
│ │ │ │ -
44 template<class N>
│ │ │ │ -
45 using DynamicChildAccessConcept = decltype((std::declval<N>().child(0u), true));
│ │ │ │ -
46
│ │ │ │ -
47 public:
│ │ │ │ -
48
│ │ │ │ -
56 ContainerFactory(LeafToValue leafToValue) :
│ │ │ │ -
57 leafToValue_(leafToValue)
│ │ │ │ -
58 {}
│ │ │ │ -
59
│ │ │ │ -
60 template<class Node>
│ │ │ │ -
61 auto operator()(const Node& node)
│ │ │ │ -
62 {
│ │ │ │ -
63 return (*this)(node, Dune::PriorityTag<5>{});
│ │ │ │ -
64 }
│ │ │ │ -
65
│ │ │ │ -
66 private:
│ │ │ │ -
67
│ │ │ │ -
68 template<class Node,
│ │ │ │ -
69 std::enable_if_t<Node::isLeaf, bool> = true>
│ │ │ │ -
70 auto operator()(const Node& node, Dune::PriorityTag<4>)
│ │ │ │ -
71 {
│ │ │ │ -
72 return leafToValue_(node);
│ │ │ │ -
73 }
│ │ │ │ -
74
│ │ │ │ -
75 template<class Node,
│ │ │ │ -
76 StaticDegreeConcept<Node> = true,
│ │ │ │ -
77 DynamicChildAccessConcept<Node> = true>
│ │ │ │ -
78 auto operator()(const Node& node, Dune::PriorityTag<3>)
│ │ │ │ -
79 {
│ │ │ │ -
80 return Dune::unpackIntegerSequence([&](auto... indices) {
│ │ │ │ -
81 return std::array{(*this)(node.child(indices))...};
│ │ │ │ -
82 }, std::make_index_sequence<std::size_t(Node::degree())>());
│ │ │ │ -
83 }
│ │ │ │ -
84
│ │ │ │ -
85 template<class Node,
│ │ │ │ -
86 DynamicDegreeConcept<Node> = true,
│ │ │ │ -
87 DynamicChildAccessConcept<Node> = true>
│ │ │ │ -
88 auto operator()(const Node& node, Dune::PriorityTag<2>)
│ │ │ │ -
89 {
│ │ │ │ -
90 using TransformedChild = decltype((*this)(node.child(0)));
│ │ │ │ -
91 std::vector<TransformedChild> container;
│ │ │ │ -
92 container.reserve(node.degree());
│ │ │ │ -
93 for (std::size_t i = 0; i < node.degree(); ++i)
│ │ │ │ -
94 container.emplace_back((*this)(node.child(i)));
│ │ │ │ -
95 return container;
│ │ │ │ -
96 }
│ │ │ │ +
29#ifdef DOXYGEN
│ │ │ │ +
30
│ │ │ │ +
32
│ │ │ │ +
51 template<typename SourceNode, typename Transformation, typename Tag>
│ │ │ │ +
52 void registerNodeTransformation(SourceNode*, Transformation*, Tag*);
│ │ │ │ +
53
│ │ │ │ +
54#else // DOXYGEN
│ │ │ │ +
55
│ │ │ │ +
66 template<typename S, typename T, typename Tag>
│ │ │ │ +
67 struct LookupNodeTransformation
│ │ │ │ +
68 {
│ │ │ │ +
69
│ │ │ │ +
70 typedef decltype(registerNodeTransformation(declptr<S>(),declptr<T>(),declptr<Tag>())) lookup_type;
│ │ │ │ +
71
│ │ │ │ +
72 typedef typename evaluate_if_meta_function<
│ │ │ │ +
73 lookup_type
│ │ │ │ +
74 >::type type;
│ │ │ │ +
75
│ │ │ │ +
76 static_assert((!std::is_same<type,void>::value), "Unable to find valid transformation descriptor");
│ │ │ │ +
77 };
│ │ │ │ +
78
│ │ │ │ +
79#endif // DOXYGEN
│ │ │ │ +
80
│ │ │ │ +
81
│ │ │ │ +
83
│ │ │ │ +
92 template<typename SourceTree, typename Transformation, typename Tag = StartTag, bool recursive = true>
│ │ │ │ + │ │ │ │ +
94 {
│ │ │ │ +
95
│ │ │ │ +
96#ifndef DOXYGEN
│ │ │ │
97
│ │ │ │ -
98 template<class Node,
│ │ │ │ -
99 StaticDegreeConcept<Node> = true>
│ │ │ │ -
100 auto operator()(const Node& node, Dune::PriorityTag<1>)
│ │ │ │ -
101 {
│ │ │ │ -
102 return Dune::unpackIntegerSequence([&](auto... indices) {
│ │ │ │ -
103 return Dune::makeTupleVector((*this)(node.child(indices))...);
│ │ │ │ -
104 }, std::make_index_sequence<std::size_t(Node::degree())>());
│ │ │ │ -
105 }
│ │ │ │ -
106
│ │ │ │ -
107 private:
│ │ │ │ -
108 LeafToValue leafToValue_;
│ │ │ │ -
109 };
│ │ │ │ +
98 typedef typename LookupNodeTransformation<SourceTree,Transformation,typename SourceTree::ImplementationTag>::type NodeTransformation;
│ │ │ │ +
99
│ │ │ │ +
100 // the type of the new tree that will result from this transformation
│ │ │ │ +
101 typedef typename TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transformed_type transformed_type;
│ │ │ │ +
102
│ │ │ │ +
103 // the storage type of the new tree that will result from this transformation
│ │ │ │ +
104 typedef typename TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transformed_storage_type transformed_storage_type;
│ │ │ │ +
105
│ │ │ │ +
106#endif // DOXYGEN
│ │ │ │ +
107
│ │ │ │ +
109 typedef transformed_type type;
│ │ │ │
110
│ │ │ │ -
111
│ │ │ │ -
112 /*
│ │ │ │ -
113 * \brief Wrap nested container to provide a VectorBackend
│ │ │ │ -
114 */
│ │ │ │ -
115 template<class Container>
│ │ │ │ - │ │ │ │ -
117 {
│ │ │ │ -
118 template<class C>
│ │ │ │ -
119 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<>& path)
│ │ │ │ -
120 {
│ │ │ │ -
121 return container;
│ │ │ │ -
122 }
│ │ │ │ -
123
│ │ │ │ -
124 template<class C, class... T>
│ │ │ │ -
125 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<T...>& path)
│ │ │ │ -
126 {
│ │ │ │ -
127 auto head = path[Dune::Indices::_0];
│ │ │ │ -
128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){
│ │ │ │ -
129 return treePath(path[Dune::index_constant<i+1>{}]...);
│ │ │ │ -
130 }, std::make_index_sequence<sizeof...(T)-1>());
│ │ │ │ -
131 return accessByTreePath(container[head], tailPath);
│ │ │ │ -
132 }
│ │ │ │ -
133
│ │ │ │ -
134 template<class C, class Tree,
│ │ │ │ -
135 std::enable_if_t<Tree::isLeaf, bool> = true>
│ │ │ │ -
136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune::PriorityTag<2>)
│ │ │ │ -
137 {
│ │ │ │ -
138 /* do nothing */
│ │ │ │ -
139 }
│ │ │ │ -
140
│ │ │ │ -
141 template<class C, class Tree,
│ │ │ │ -
142 class = decltype(std::declval<C>().resize(0u))>
│ │ │ │ -
143 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<1>)
│ │ │ │ -
144 {
│ │ │ │ -
145 container.resize(tree.degree());
│ │ │ │ -
146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
│ │ │ │ -
147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
│ │ │ │ -
148 });
│ │ │ │ -
149 }
│ │ │ │ +
111 typedef type Type;
│ │ │ │ +
112
│ │ │ │ +
114 static transformed_type transform(const SourceTree& s, const Transformation& t = Transformation())
│ │ │ │ +
115 {
│ │ │ │ +
116 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(s,t);
│ │ │ │ +
117 }
│ │ │ │ +
118
│ │ │ │ +
120 static transformed_type transform(const SourceTree& s, Transformation& t)
│ │ │ │ +
121 {
│ │ │ │ +
122 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(s,t);
│ │ │ │ +
123 }
│ │ │ │ +
124
│ │ │ │ +
126 static transformed_type transform(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
│ │ │ │ +
127 {
│ │ │ │ +
128 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(sp,t);
│ │ │ │ +
129 }
│ │ │ │ +
130
│ │ │ │ +
132 static transformed_type transform(std::shared_ptr<const SourceTree> sp, Transformation& t)
│ │ │ │ +
133 {
│ │ │ │ +
134 return TransformTree<SourceTree,Transformation,NodeTag<SourceTree>,NodeTransformation::recursive>::transform(sp,t);
│ │ │ │ +
135 }
│ │ │ │ +
136
│ │ │ │ +
139 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
│ │ │ │ +
140 {
│ │ │ │ + │ │ │ │ +
142 }
│ │ │ │ +
143
│ │ │ │ +
146 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, Transformation& t)
│ │ │ │ +
147 {
│ │ │ │ + │ │ │ │ +
149 }
│ │ │ │
150
│ │ │ │ -
151 template<class C, class Tree>
│ │ │ │ -
152 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<0>)
│ │ │ │ -
153 {
│ │ │ │ -
154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
│ │ │ │ -
155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
│ │ │ │ -
156 });
│ │ │ │ -
157 }
│ │ │ │ -
158
│ │ │ │ -
159 template<class T>
│ │ │ │ -
160 using TypeTreeConcept = decltype((
│ │ │ │ -
161 std::declval<T>().degree(),
│ │ │ │ -
162 T::isLeaf,
│ │ │ │ -
163 T::isPower,
│ │ │ │ -
164 T::isComposite,
│ │ │ │ -
165 true));
│ │ │ │ -
166
│ │ │ │ -
167 public:
│ │ │ │ -
169 TreeContainerVectorBackend(Container&& container) :
│ │ │ │ -
170 container_(std::move(container))
│ │ │ │ -
171 {}
│ │ │ │ -
172
│ │ │ │ -
174 template <class Tree, TypeTreeConcept<Tree> = true>
│ │ │ │ -
175 TreeContainerVectorBackend(const Tree& tree) :
│ │ │ │ - │ │ │ │ -
177 {
│ │ │ │ -
178 this->resize(tree);
│ │ │ │ -
179 }
│ │ │ │ -
180
│ │ │ │ -
182 template <class C = Container,
│ │ │ │ -
183 std::enable_if_t<std::is_default_constructible_v<C>, bool> = true>
│ │ │ │ - │ │ │ │ -
185 container_()
│ │ │ │ -
186 {}
│ │ │ │ -
187
│ │ │ │ -
188 template<class... T>
│ │ │ │ -
189 decltype(auto) operator[](const HybridTreePath<T...>& path) const
│ │ │ │ -
190 {
│ │ │ │ -
191 return accessByTreePath(container_, path);
│ │ │ │ -
192 }
│ │ │ │ -
193
│ │ │ │ -
194 template<class... T>
│ │ │ │ -
195 decltype(auto) operator[](const HybridTreePath<T...>& path)
│ │ │ │ -
196 {
│ │ │ │ -
197 return accessByTreePath(container_, path);
│ │ │ │ -
198 }
│ │ │ │ +
151
│ │ │ │ +
152 };
│ │ │ │ +
153
│ │ │ │ +
154#ifndef DOXYGEN // internal per-node implementations of the transformation algorithm
│ │ │ │ +
155
│ │ │ │ +
156 // handle a leaf node - this is easy
│ │ │ │ +
157 template<typename S, typename T, bool recursive>
│ │ │ │ +
158 struct TransformTree<S,T,LeafNodeTag,recursive>
│ │ │ │ +
159 {
│ │ │ │ +
160 // get transformed type from specification
│ │ │ │ +
161 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>::type NodeTransformation;
│ │ │ │ +
162
│ │ │ │ +
163 typedef typename NodeTransformation::transformed_type transformed_type;
│ │ │ │ +
164 typedef typename NodeTransformation::transformed_storage_type transformed_storage_type;
│ │ │ │ +
165
│ │ │ │ +
166 // delegate instance transformation to per-node specification
│ │ │ │ +
167 static transformed_type transform(const S& s, T& t)
│ │ │ │ +
168 {
│ │ │ │ +
169 return NodeTransformation::transform(s,t);
│ │ │ │ +
170 }
│ │ │ │ +
171
│ │ │ │ +
172 // delegate instance transformation to per-node specification
│ │ │ │ +
173 static transformed_type transform(const S& s, const T& t)
│ │ │ │ +
174 {
│ │ │ │ +
175 return NodeTransformation::transform(s,t);
│ │ │ │ +
176 }
│ │ │ │ +
177
│ │ │ │ +
178 // delegate instance transformation to per-node specification
│ │ │ │ +
179 static transformed_type transform(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
180 {
│ │ │ │ +
181 return NodeTransformation::transform(sp,t);
│ │ │ │ +
182 }
│ │ │ │ +
183
│ │ │ │ +
184 // delegate instance transformation to per-node specification
│ │ │ │ +
185 static transformed_type transform(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ +
186 {
│ │ │ │ +
187 return NodeTransformation::transform(sp,t);
│ │ │ │ +
188 }
│ │ │ │ +
189
│ │ │ │ +
190 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
191 {
│ │ │ │ +
192 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
193 }
│ │ │ │ +
194
│ │ │ │ +
195 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ +
196 {
│ │ │ │ +
197 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
198 }
│ │ │ │
199
│ │ │ │ -
201 template<class Tree, TypeTreeConcept<Tree> = true>
│ │ │ │ -
202 void resize(const Tree& tree)
│ │ │ │ -
203 {
│ │ │ │ -
204 resizeImpl(container_, tree, Dune::PriorityTag<5>{});
│ │ │ │ -
205 }
│ │ │ │ -
206
│ │ │ │ -
207 const Container& data() const
│ │ │ │ -
208 {
│ │ │ │ -
209 return container_;
│ │ │ │ -
210 }
│ │ │ │ -
211
│ │ │ │ -
212 Container& data()
│ │ │ │ -
213 {
│ │ │ │ -
214 return container_;
│ │ │ │ -
215 }
│ │ │ │ -
216
│ │ │ │ -
217 private:
│ │ │ │ -
218 Container container_;
│ │ │ │ -
219 };
│ │ │ │ -
220
│ │ │ │ -
221 template<class Container>
│ │ │ │ -
222 auto makeTreeContainerVectorBackend(Container&& container)
│ │ │ │ -
223 {
│ │ │ │ -
224 return TreeContainerVectorBackend<std::decay_t<Container>>(std::forward<Container>(container));
│ │ │ │ -
225 }
│ │ │ │ -
226
│ │ │ │ -
227 /*
│ │ │ │ -
228 * \brief A simple lambda for creating default constructible values from a node
│ │ │ │ -
229 *
│ │ │ │ -
230 * This simply returns LeafToValue<Node>{} for a given Node. It's needed
│ │ │ │ -
231 * because using a lambda expression in a using declaration is not allowed
│ │ │ │ -
232 * because it's an unevaluated context.
│ │ │ │ -
233 */
│ │ │ │ -
234 template<template<class Node> class LeafToValue>
│ │ │ │ - │ │ │ │ -
236 {
│ │ │ │ -
237 template<class Node>
│ │ │ │ -
238 auto operator()(const Node& node) const
│ │ │ │ -
239 {
│ │ │ │ -
240 return LeafToValue<Node>{};
│ │ │ │ -
241 }
│ │ │ │ -
242 };
│ │ │ │ -
243
│ │ │ │ -
244 } // namespace Detail
│ │ │ │ -
245
│ │ │ │ -
265 template<class Tree, class LeafToValue>
│ │ │ │ -
266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue)
│ │ │ │ -
267 {
│ │ │ │ -
268 auto f = std::ref(leafToValue);
│ │ │ │ - │ │ │ │ -
270 return Detail::makeTreeContainerVectorBackend(factory(tree));
│ │ │ │ -
271 }
│ │ │ │ -
272
│ │ │ │ -
288 template<class Value, class Tree>
│ │ │ │ -
289 auto makeTreeContainer(const Tree& tree)
│ │ │ │ -
290 {
│ │ │ │ -
291 return makeTreeContainer(tree, [](const auto&) {return Value{};});
│ │ │ │ -
292 }
│ │ │ │ -
293
│ │ │ │ -
297 template<class Value, class Tree>
│ │ │ │ -
298 using UniformTreeContainer = std::decay_t<decltype(makeTreeContainer<Value>(std::declval<const Tree&>()))>;
│ │ │ │ -
299
│ │ │ │ -
303 template<template<class Node> class LeafToValue, class Tree>
│ │ │ │ -
304 using TreeContainer = std::decay_t<decltype(makeTreeContainer(std::declval<const Tree&>(), std::declval<Detail::LeafToDefaultConstructibleValue<LeafToValue>>()))>;
│ │ │ │ -
305
│ │ │ │ -
307
│ │ │ │ -
308 } // namespace TypeTree
│ │ │ │ -
309} //namespace Dune
│ │ │ │ +
200 };
│ │ │ │ +
201
│ │ │ │ +
202
│ │ │ │ +
203 // common implementation for non-recursive transformation of non-leaf nodes
│ │ │ │ +
204 template<typename S, typename T>
│ │ │ │ +
205 struct TransformTreeNonRecursive
│ │ │ │ +
206 {
│ │ │ │ +
207 // get transformed type from specification
│ │ │ │ +
208 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>::type NodeTransformation;
│ │ │ │ +
209
│ │ │ │ +
210 typedef typename NodeTransformation::transformed_type transformed_type;
│ │ │ │ +
211 typedef typename NodeTransformation::transformed_storage_type transformed_storage_type;
│ │ │ │ +
212
│ │ │ │ +
213 // delegate instance transformation to per-node specification
│ │ │ │ +
214 static transformed_type transform(const S& s, T& t)
│ │ │ │ +
215 {
│ │ │ │ +
216 return NodeTransformation::transform(s,t);
│ │ │ │ +
217 }
│ │ │ │ +
218
│ │ │ │ +
219 // delegate instance transformation to per-node specification
│ │ │ │ +
220 static transformed_type transform(const S& s, const T& t)
│ │ │ │ +
221 {
│ │ │ │ +
222 return NodeTransformation::transform(s,t);
│ │ │ │ +
223 }
│ │ │ │ +
224
│ │ │ │ +
225 // delegate instance transformation to per-node specification
│ │ │ │ +
226 static transformed_type transform(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
227 {
│ │ │ │ +
228 return NodeTransformation::transform(sp,t);
│ │ │ │ +
229 }
│ │ │ │ +
230
│ │ │ │ +
231 // delegate instance transformation to per-node specification
│ │ │ │ +
232 static transformed_type transform(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ +
233 {
│ │ │ │ +
234 return NodeTransformation::transform(sp,t);
│ │ │ │ +
235 }
│ │ │ │ +
236
│ │ │ │ +
237 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
238 {
│ │ │ │ +
239 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
240 }
│ │ │ │ +
241
│ │ │ │ +
242 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ +
243 {
│ │ │ │ +
244 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
245 }
│ │ │ │ +
246
│ │ │ │ +
247 };
│ │ │ │ +
248
│ │ │ │ +
249
│ │ │ │ +
250 namespace Impl {
│ │ │ │ +
251
│ │ │ │ +
252 // Helper class to handle recursive power nodes
│ │ │ │ +
253 template<class Source, class Transformation, class Tag>
│ │ │ │ +
254 class RecursivePowerTransformTree
│ │ │ │ +
255 {
│ │ │ │ +
256 // We only know two types of tags!
│ │ │ │ +
257 static_assert(std::is_same_v<Tag,PowerNodeTag> or std::is_same_v<Tag,DynamicPowerNodeTag>);
│ │ │ │ +
258
│ │ │ │ +
259 using ChildType = typename Source::ChildType;
│ │ │ │ +
260
│ │ │ │ +
261 // in case degree is dynamic, provid a vector correctly initialized
│ │ │ │ +
262 template<class NodeStorage>
│ │ │ │ +
263 static auto node_storage_provider(const std::size_t& degree)
│ │ │ │ +
264 {
│ │ │ │ +
265 return std::vector<NodeStorage>(degree);
│ │ │ │ +
266 }
│ │ │ │ +
267
│ │ │ │ +
268 // in case degree is static, provid an array
│ │ │ │ +
269 template<class NodeStorage, class StaticIndex>
│ │ │ │ +
270 static auto node_storage_provider(StaticIndex)
│ │ │ │ +
271 {
│ │ │ │ +
272 return std::array<NodeStorage,std::size_t(StaticIndex{})>();
│ │ │ │ +
273 }
│ │ │ │ +
274
│ │ │ │ +
275 public:
│ │ │ │ +
276 // get transformed type from specification
│ │ │ │ +
277 // Handling this transformation in a way that makes the per-node specification easy to write
│ │ │ │ +
278 // is a little involved:
│ │ │ │ +
279 // The problem is that the transformed power node must be parameterized on the transformed child
│ │ │ │ +
280 // type. So we need to transform the child type and pass the transformed child type to an inner
│ │ │ │ +
281 // template of the node transformation struct called result (see example of such a specification
│ │ │ │ +
282 // further down).
│ │ │ │ +
283 using NodeTransformation = typename LookupNodeTransformation<Source,Transformation,ImplementationTag<Source>>::type;
│ │ │ │ +
284 using ChildNodeTransformation = typename LookupNodeTransformation<ChildType,Transformation,ImplementationTag<ChildType>>::type;
│ │ │ │ +
285
│ │ │ │ +
286 private:
│ │ │ │ +
287 // Since every child is same type, is enough to get transformation once
│ │ │ │ +
288 using ChildTreeTransformation = TransformTree<ChildType,
│ │ │ │ +
289 Transformation,
│ │ │ │ +
290 NodeTag<ChildType>,
│ │ │ │ +
291 ChildNodeTransformation::recursive>;
│ │ │ │ +
292
│ │ │ │ +
293 // Get transformed type of children
│ │ │ │ +
294 using transformed_child_type = typename ChildTreeTransformation::transformed_type;
│ │ │ │ +
295 using transformed_child_storage_type = typename ChildTreeTransformation::transformed_storage_type;
│ │ │ │ +
296 public:
│ │ │ │ +
297 // Apply transformation from children to current node
│ │ │ │ +
298 using transformed_type = typename NodeTransformation::template result<transformed_child_type>::type;
│ │ │ │ +
299 using transformed_storage_type = typename NodeTransformation::template result<transformed_child_type>::storage_type;
│ │ │ │ +
300
│ │ │ │ +
301 // Transform an instance of source tree.
│ │ │ │ +
302 static transformed_type transform(const Source& source, Transformation& transformation)
│ │ │ │ +
303 {
│ │ │ │ +
304 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source.degree());
│ │ │ │ +
305 for (std::size_t k = 0; k < source.degree(); ++k) {
│ │ │ │ +
306 children_storage[k] = ChildTreeTransformation::transform_storage(source.childStorage(k),transformation);
│ │ │ │ +
307 }
│ │ │ │ +
308 return NodeTransformation::transform(source,transformation,children_storage);
│ │ │ │ +
309 }
│ │ │ │
310
│ │ │ │ -
311#endif // DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ - │ │ │ │ -
std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >()))> UniformTreeContainer
Alias to container type generated by makeTreeContainer for given tree type and uniform value type.
Definition: treecontainer.hh:298
│ │ │ │ -
std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))> TreeContainer
Alias to container type generated by makeTreeContainer for give tree type and when using LeafToValue ...
Definition: treecontainer.hh:304
│ │ │ │ -
auto makeTreeContainer(const Tree &tree)
Create container havin the same structure as the given tree.
Definition: treecontainer.hh:289
│ │ │ │ +
311 // Transform an instance of source tree.
│ │ │ │ +
312 static transformed_type transform(const Source& source, const Transformation& transformation)
│ │ │ │ +
313 {
│ │ │ │ +
314 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source.degree());
│ │ │ │ +
315 for (std::size_t k = 0; k < source.degree(); ++k) {
│ │ │ │ +
316 children_storage[k] = ChildTreeTransformation::transform_storage(source.childStorage(k),transformation);
│ │ │ │ +
317 }
│ │ │ │ +
318 return NodeTransformation::transform(source,transformation,children_storage);
│ │ │ │ +
319 }
│ │ │ │ +
320
│ │ │ │ +
321 // Transform an instance of source tree.
│ │ │ │ +
322 static transformed_type transform(std::shared_ptr<const Source> source_ptr, Transformation& transformation)
│ │ │ │ +
323 {
│ │ │ │ +
324 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source_ptr->degree());
│ │ │ │ +
325 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
326 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
327 }
│ │ │ │ +
328 return NodeTransformation::transform(source_ptr,transformation,children_storage);
│ │ │ │ +
329 }
│ │ │ │ +
330
│ │ │ │ +
331 // Transform an instance of source tree.
│ │ │ │ +
332 static transformed_type transform(std::shared_ptr<const Source> source_ptr, const Transformation& transformation)
│ │ │ │ +
333 {
│ │ │ │ +
334 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source_ptr->degree());
│ │ │ │ +
335 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
336 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
337 }
│ │ │ │ +
338 return NodeTransformation::transform(source_ptr,transformation,children_storage);
│ │ │ │ +
339 }
│ │ │ │ +
340
│ │ │ │ +
341 // Transform an instance of source tree ptr.
│ │ │ │ +
342 static transformed_storage_type transform_storage(std::shared_ptr<const Source> source_ptr, Transformation& transformation)
│ │ │ │ +
343 {
│ │ │ │ +
344 auto children_storage = node_storage_provider<transformed_child_storage_type>(source_ptr->degree());
│ │ │ │ +
345 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
346 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
347 }
│ │ │ │ +
348 return NodeTransformation::transform_storage(source_ptr,transformation,children_storage);
│ │ │ │ +
349 }
│ │ │ │ +
350
│ │ │ │ +
351 // Transform an instance of source tree ptr.
│ │ │ │ +
352 static transformed_storage_type transform_storage(std::shared_ptr<const Source> source_ptr, const Transformation& transformation)
│ │ │ │ +
353 {
│ │ │ │ +
354 auto children_storage = node_storage_provider<transformed_child_storage_type>(source_ptr->degree());
│ │ │ │ +
355 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
356 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
357 }
│ │ │ │ +
358 return NodeTransformation::transform_storage(source_ptr,transformation,children_storage);
│ │ │ │ +
359 }
│ │ │ │ +
360
│ │ │ │ +
361 };
│ │ │ │ +
362 } // namespace Impl
│ │ │ │ +
363
│ │ │ │ +
364 // Recursive version of the PowerNode transformation for static nodes.
│ │ │ │ +
365 template<typename Source, typename Transformation>
│ │ │ │ +
366 struct TransformTree<Source,Transformation,PowerNodeTag,true>
│ │ │ │ +
367 : public Impl::RecursivePowerTransformTree<Source,Transformation,PowerNodeTag>
│ │ │ │ +
368 {};
│ │ │ │ +
369
│ │ │ │ +
370 // Recursive version of the DynamicPowerNode transformation for static nodes.
│ │ │ │ +
371 template<typename Source, typename Transformation>
│ │ │ │ +
372 struct TransformTree<Source,Transformation,DynamicPowerNodeTag,true>
│ │ │ │ +
373 : public Impl::RecursivePowerTransformTree<Source,Transformation,DynamicPowerNodeTag>
│ │ │ │ +
374 {};
│ │ │ │ +
375
│ │ │ │ +
376 // non-recursive version of the PowerNode transformation.
│ │ │ │ +
377 template<typename S, typename T>
│ │ │ │ +
378 struct TransformTree<S,T,PowerNodeTag,false>
│ │ │ │ +
379 : public TransformTreeNonRecursive<S,T>
│ │ │ │ +
380 {};
│ │ │ │ +
381
│ │ │ │ +
382 // non-recursive version of the DynamicPowerNodeTag transformation.
│ │ │ │ +
383 template<typename S, typename T>
│ │ │ │ +
384 struct TransformTree<S,T,DynamicPowerNodeTag,false>
│ │ │ │ +
385 : public TransformTreeNonRecursive<S,T>
│ │ │ │ +
386 {};
│ │ │ │ +
387
│ │ │ │ +
388 // helper struct that does the actual transformation for a composite node. We need this additional struct
│ │ │ │ +
389 // to extract the template argument list with the types of all children from the node, which we cannot do
│ │ │ │ +
390 // directly in the transformation<> template, as the type passed to transformation<> will usually be a
│ │ │ │ +
391 // derived type and will normally have more template arguments than just the children. This declaration
│ │ │ │ +
392 // just introduces the type of the helper struct, we always instantiate the specialization defined below;
│ │ │ │ +
393 template<typename S, typename Children, typename T>
│ │ │ │ +
394 struct transform_composite_node;
│ │ │ │ +
395
│ │ │ │ +
396 // specialized version of the helper struct which extracts the template argument list with the children from
│ │ │ │ +
397 // its second template parameter, which has to be CompositeNode::ChildTypes. Apart from that, the struct is
│ │ │ │ +
398 // similar to the one for a PowerNode, but it obviously delegates transformation of the children to the TMP.
│ │ │ │ +
399 template<typename S, typename T, typename... C>
│ │ │ │ +
400 struct transform_composite_node<S,std::tuple<C...>,T>
│ │ │ │ +
401 {
│ │ │ │ +
402
│ │ │ │ +
403 // transformed type, using the same nested struct trick as the PowerNode
│ │ │ │ +
404 typedef ImplementationTag<S> Tag;
│ │ │ │ +
405 typedef typename LookupNodeTransformation<S,T,Tag>::type NodeTransformation;
│ │ │ │ +
406 typedef typename NodeTransformation::template result<typename TransformTree<C,
│ │ │ │ +
407 T,
│ │ │ │ +
408 NodeTag<C>,
│ │ │ │ +
409 LookupNodeTransformation<C,T,ImplementationTag<C>>::type::recursive
│ │ │ │ +
410 >::transformed_type...
│ │ │ │ +
411 >::type transformed_type;
│ │ │ │ +
412
│ │ │ │ +
413 typedef typename NodeTransformation::template result<typename TransformTree<C,
│ │ │ │ +
414 T,
│ │ │ │ +
415 NodeTag<C>,
│ │ │ │ +
416 LookupNodeTransformation<C,T,ImplementationTag<C>>::type::recursive
│ │ │ │ +
417 >::transformed_type...
│ │ │ │ +
418 >::storage_type transformed_storage_type;
│ │ │ │ +
419
│ │ │ │ +
420 // Retrieve the transformation descriptor for the child with index i.
│ │ │ │ +
421 // This little helper improves really improves the readability of the
│ │ │ │ +
422 // transformation functions.
│ │ │ │ +
423 template<std::size_t i>
│ │ │ │ +
424 struct ChildTransformation
│ │ │ │ +
425 : public TransformTree<typename S::template Child<i>::Type,
│ │ │ │ +
426 T,
│ │ │ │ +
427 NodeTag<typename S::template Child<i>::Type>,
│ │ │ │ +
428 LookupNodeTransformation<
│ │ │ │ +
429 typename S::template Child<i>::Type,
│ │ │ │ +
430 T,
│ │ │ │ +
431 ImplementationTag<typename S::template Child<i>::Type>
│ │ │ │ +
432 >::type::recursive
│ │ │ │ +
433 >
│ │ │ │ +
434 {};
│ │ │ │ +
435
│ │ │ │ +
436 template<std::size_t i, typename Tuple, typename Value>
│ │ │ │ +
437 static void setElement(Tuple& tuple, Value&& value)
│ │ │ │ +
438 {
│ │ │ │ +
439 std::get<i>(tuple) = std::forward<Value>(value);
│ │ │ │ +
440 }
│ │ │ │ +
441
│ │ │ │ +
442 template<typename Trafo, std::size_t... i>
│ │ │ │ +
443 static transformed_type transform(const S& s, Trafo&& t, std::index_sequence<i...> indices)
│ │ │ │ +
444 {
│ │ │ │ +
445 std::tuple<typename ChildTransformation<i>::transformed_storage_type...> storage;
│ │ │ │ +
446 Dune::Hybrid::Impl::evaluateFoldExpression<int>({(setElement<i>(storage, ChildTransformation<i>::transform_storage(s.template childStorage<i>(), std::forward<Trafo>(t))),0)...});
│ │ │ │ +
447 return NodeTransformation::transform(s, std::forward<Trafo>(t), std::get<i>(storage)...);
│ │ │ │ +
448 }
│ │ │ │ +
449
│ │ │ │ +
450 template<typename Trafo, std::size_t... i>
│ │ │ │ +
451 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, Trafo&& t, std::index_sequence<i...> indices)
│ │ │ │ +
452 {
│ │ │ │ +
453 std::tuple<typename ChildTransformation<i>::transformed_storage_type...> storage;
│ │ │ │ +
454 Dune::Hybrid::Impl::evaluateFoldExpression<int>({(setElement<i>(storage, ChildTransformation<i>::transform_storage(sp->template childStorage<i>(), std::forward<Trafo>(t))),0)...});
│ │ │ │ +
455 return NodeTransformation::transform_storage(sp, std::forward<Trafo>(t), std::get<i>(storage)...);
│ │ │ │ +
456 }
│ │ │ │ +
457 };
│ │ │ │ +
458
│ │ │ │ +
459
│ │ │ │ +
460 // the specialization of transformation<> for the CompositeNode. This just extracts the
│ │ │ │ +
461 // CompositeNode::ChildTypes member and forwards to the helper struct
│ │ │ │ +
462 template<typename S, typename T>
│ │ │ │ +
463 struct TransformTree<S,T,CompositeNodeTag,true>
│ │ │ │ +
464 {
│ │ │ │ +
465
│ │ │ │ +
466 private:
│ │ │ │ +
467
│ │ │ │ +
468 typedef typename S::ChildTypes ChildTypes;
│ │ │ │ +
469
│ │ │ │ +
470 static auto child_indices()
│ │ │ │ +
471 {
│ │ │ │ +
472 return std::make_index_sequence<S::degree()>();
│ │ │ │ +
473 }
│ │ │ │ +
474
│ │ │ │ +
475 public:
│ │ │ │ +
476
│ │ │ │ +
477 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_type transformed_type;
│ │ │ │ +
478 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_storage_type transformed_storage_type;
│ │ │ │ +
479
│ │ │ │ +
480 static transformed_type transform(const S& s, T& t)
│ │ │ │ +
481 {
│ │ │ │ +
482 return transform_composite_node<S,ChildTypes,T>::transform(s,t,child_indices());
│ │ │ │ +
483 }
│ │ │ │ +
484
│ │ │ │ +
485 static transformed_type transform(const S& s, const T& t)
│ │ │ │ +
486 {
│ │ │ │ +
487 return transform_composite_node<S,ChildTypes,T>::transform(s,t,child_indices());
│ │ │ │ +
488 }
│ │ │ │ +
489
│ │ │ │ +
490 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
491 {
│ │ │ │ +
492 return transform_composite_node<S,ChildTypes,T>::transform_storage(sp,t,child_indices());
│ │ │ │ +
493 }
│ │ │ │ +
494
│ │ │ │ +
495 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, const T& t)
│ │ │ │ +
496 {
│ │ │ │ +
497 return transform_composite_node<S,ChildTypes,T>::transform_storage(sp,t,child_indices());
│ │ │ │ +
498 }
│ │ │ │ +
499
│ │ │ │ +
500 };
│ │ │ │ +
501
│ │ │ │ +
502 // non-recursive version of the CompositeNode transformation.
│ │ │ │ +
503 template<typename S, typename T>
│ │ │ │ +
504 struct TransformTree<S,T,CompositeNodeTag,false>
│ │ │ │ +
505 : public TransformTreeNonRecursive<S,T>
│ │ │ │ +
506 {};
│ │ │ │ +
507
│ │ │ │ +
508#endif // DOXYGEN
│ │ │ │ +
509
│ │ │ │ +
511
│ │ │ │ +
512 } // namespace TypeTree
│ │ │ │ +
513} //namespace Dune
│ │ │ │ +
514
│ │ │ │ +
515#endif // DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ +
void registerNodeTransformation(SourceNode *, Transformation *, Tag *)
Register transformation descriptor to transform SourceNode with Transformation.
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
auto makeTreeContainerVectorBackend(Container &&container)
Definition: treecontainer.hh:222
│ │ │ │ -
Definition: treecontainer.hh:37
│ │ │ │ -
auto operator()(const Node &node)
Definition: treecontainer.hh:61
│ │ │ │ -
ContainerFactory(LeafToValue leafToValue)
Create ContainerFactory.
Definition: treecontainer.hh:56
│ │ │ │ - │ │ │ │ -
void resize(const Tree &tree)
Resize the (nested) container depending on the degree of the tree nodes.
Definition: treecontainer.hh:202
│ │ │ │ -
Container & data()
Definition: treecontainer.hh:212
│ │ │ │ -
const Container & data() const
Definition: treecontainer.hh:207
│ │ │ │ -
TreeContainerVectorBackend(Container &&container)
Move the passed container into the internal storage.
Definition: treecontainer.hh:169
│ │ │ │ -
TreeContainerVectorBackend()
Default constructor. The stored container might need to be resized before usage.
Definition: treecontainer.hh:184
│ │ │ │ -
TreeContainerVectorBackend(const Tree &tree)
Default construct the container and perform a resize depending on the tree-node degrees.
Definition: treecontainer.hh:175
│ │ │ │ - │ │ │ │ -
auto operator()(const Node &node) const
Definition: treecontainer.hh:238
│ │ │ │ -
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ +
Transform a TypeTree.
Definition: transformation.hh:94
│ │ │ │ +
type Type
Definition: transformation.hh:111
│ │ │ │ +
static transformed_type transform(std::shared_ptr< const SourceTree > sp, Transformation &t)
Apply transformation to an existing tree s.
Definition: transformation.hh:132
│ │ │ │ +
static transformed_type transform(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition: transformation.hh:126
│ │ │ │ +
static transformed_type transform(const SourceTree &s, Transformation &t)
Apply transformation to an existing tree s.
Definition: transformation.hh:120
│ │ │ │ +
transformed_type type
The type of the transformed tree.
Definition: transformation.hh:109
│ │ │ │ +
static transformed_type transform(const SourceTree &s, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition: transformation.hh:114
│ │ │ │ +
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Definition: transformation.hh:139
│ │ │ │ +
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, Transformation &t)
Definition: transformation.hh:146
│ │ │ │ +
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:140
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,365 +4,637 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -treecontainer.hh │ │ │ │ │ +transformation.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ 11 │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16 │ │ │ │ │ - 17#include │ │ │ │ │ - 18 │ │ │ │ │ - 19namespace Dune { │ │ │ │ │ - 20 namespace TypeTree { │ │ │ │ │ - 21 │ │ │ │ │ - 22 namespace Detail { │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19 │ │ │ │ │ + 20 │ │ │ │ │ + 21namespace Dune { │ │ │ │ │ + 22 namespace TypeTree { │ │ │ │ │ 23 │ │ │ │ │ - 24 /* │ │ │ │ │ - 25 * \brief A factory class creating a hybrid container compatible with a type │ │ │ │ │ -tree │ │ │ │ │ - 26 * │ │ │ │ │ - 27 * This class allows to create a nested hybrid container having the same │ │ │ │ │ -structure │ │ │ │ │ - 28 * as a given type tree. Power nodes are represented as std::array's while │ │ │ │ │ -composite │ │ │ │ │ - 29 * nodes are represented as Dune::TupleVector's. The stored values for the │ │ │ │ │ -leaf nodes │ │ │ │ │ - 30 * are creating using a given predicate. Once created, the factory provides │ │ │ │ │ -an │ │ │ │ │ - 31 * operator() creating the container for the tree given as argument. │ │ │ │ │ - 32 * │ │ │ │ │ - 33 * \tparam LeafToValue Type of a predicate that determines the stored values │ │ │ │ │ -at the leafs │ │ │ │ │ - 34 */ │ │ │ │ │ - 35 template │ │ │ │ │ -36 class ContainerFactory │ │ │ │ │ - 37 { │ │ │ │ │ - 38 template │ │ │ │ │ - 39 using DynamicDegreeConcept = decltype((std::size_t(std::declval().degree │ │ │ │ │ -()), true)); │ │ │ │ │ - 40 │ │ │ │ │ - 41 template │ │ │ │ │ - 42 using StaticDegreeConcept = decltype((std::integral_constant{}, true)); │ │ │ │ │ - 43 │ │ │ │ │ - 44 template │ │ │ │ │ - 45 using DynamicChildAccessConcept = decltype((std::declval().child(0u), │ │ │ │ │ -true)); │ │ │ │ │ - 46 │ │ │ │ │ - 47 public: │ │ │ │ │ - 48 │ │ │ │ │ -56 ContainerFactory(LeafToValue leafToValue) : │ │ │ │ │ - 57 leafToValue_(leafToValue) │ │ │ │ │ - 58 {} │ │ │ │ │ - 59 │ │ │ │ │ - 60 template │ │ │ │ │ -61 auto operator()(const Node& node) │ │ │ │ │ - 62 { │ │ │ │ │ - 63 return (*this)(node, Dune::PriorityTag<5>{}); │ │ │ │ │ - 64 } │ │ │ │ │ - 65 │ │ │ │ │ - 66 private: │ │ │ │ │ - 67 │ │ │ │ │ - 68 template = true> │ │ │ │ │ - 70 auto operator()(const Node& node, Dune::PriorityTag<4>) │ │ │ │ │ - 71 { │ │ │ │ │ - 72 return leafToValue_(node); │ │ │ │ │ - 73 } │ │ │ │ │ - 74 │ │ │ │ │ - 75 template = true, │ │ │ │ │ - 77 DynamicChildAccessConcept = true> │ │ │ │ │ - 78 auto operator()(const Node& node, Dune::PriorityTag<3>) │ │ │ │ │ - 79 { │ │ │ │ │ - 80 return Dune::unpackIntegerSequence([&](auto... indices) { │ │ │ │ │ - 81 return std::array{(*this)(node.child(indices))...}; │ │ │ │ │ - 82 }, std::make_index_sequence()); │ │ │ │ │ - 83 } │ │ │ │ │ - 84 │ │ │ │ │ - 85 template = true, │ │ │ │ │ - 87 DynamicChildAccessConcept = true> │ │ │ │ │ - 88 auto operator()(const Node& node, Dune::PriorityTag<2>) │ │ │ │ │ - 89 { │ │ │ │ │ - 90 using TransformedChild = decltype((*this)(node.child(0))); │ │ │ │ │ - 91 std::vector container; │ │ │ │ │ - 92 container.reserve(node.degree()); │ │ │ │ │ - 93 for (std::size_t i = 0; i < node.degree(); ++i) │ │ │ │ │ - 94 container.emplace_back((*this)(node.child(i))); │ │ │ │ │ - 95 return container; │ │ │ │ │ - 96 } │ │ │ │ │ + 29#ifdef DOXYGEN │ │ │ │ │ + 30 │ │ │ │ │ + 32 │ │ │ │ │ + 51 template │ │ │ │ │ +52 void registerNodeTransformation(SourceNode*, Transformation*, Tag*); │ │ │ │ │ + 53 │ │ │ │ │ + 54#else // DOXYGEN │ │ │ │ │ + 55 │ │ │ │ │ + 66 template │ │ │ │ │ + 67 struct LookupNodeTransformation │ │ │ │ │ + 68 { │ │ │ │ │ + 69 │ │ │ │ │ + 70 typedef decltype(registerNodeTransformation(declptr(),declptr │ │ │ │ │ +(),declptr())) lookup_type; │ │ │ │ │ + 71 │ │ │ │ │ + 72 typedef typename evaluate_if_meta_function< │ │ │ │ │ + 73 lookup_type │ │ │ │ │ + 74 >::type type; │ │ │ │ │ + 75 │ │ │ │ │ + 76 static_assert((!std::is_same::value), "Unable to find valid │ │ │ │ │ +transformation descriptor"); │ │ │ │ │ + 77 }; │ │ │ │ │ + 78 │ │ │ │ │ + 79#endif // DOXYGEN │ │ │ │ │ + 80 │ │ │ │ │ + 81 │ │ │ │ │ + 83 │ │ │ │ │ + 92 template │ │ │ │ │ +93 struct TransformTree │ │ │ │ │ + 94 { │ │ │ │ │ + 95 │ │ │ │ │ + 96#ifndef DOXYGEN │ │ │ │ │ 97 │ │ │ │ │ - 98 template = true> │ │ │ │ │ - 100 auto operator()(const Node& node, Dune::PriorityTag<1>) │ │ │ │ │ - 101 { │ │ │ │ │ - 102 return Dune::unpackIntegerSequence([&](auto... indices) { │ │ │ │ │ - 103 return Dune::makeTupleVector((*this)(node.child(indices))...); │ │ │ │ │ - 104 }, std::make_index_sequence()); │ │ │ │ │ - 105 } │ │ │ │ │ - 106 │ │ │ │ │ - 107 private: │ │ │ │ │ - 108 LeafToValue leafToValue_; │ │ │ │ │ - 109 }; │ │ │ │ │ + 98 typedef typename │ │ │ │ │ +LookupNodeTransformation::type NodeTransformation; │ │ │ │ │ + 99 │ │ │ │ │ + 100 // the type of the new tree that will result from this transformation │ │ │ │ │ + 101 typedef typename │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transformed_type transformed_type; │ │ │ │ │ + 102 │ │ │ │ │ + 103 // the storage type of the new tree that will result from this │ │ │ │ │ +transformation │ │ │ │ │ + 104 typedef typename │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transformed_storage_type transformed_storage_type; │ │ │ │ │ + 105 │ │ │ │ │ + 106#endif // DOXYGEN │ │ │ │ │ + 107 │ │ │ │ │ +109 typedef transformed_type type; │ │ │ │ │ 110 │ │ │ │ │ - 111 │ │ │ │ │ - 112 /* │ │ │ │ │ - 113 * \brief Wrap nested container to provide a VectorBackend │ │ │ │ │ - 114 */ │ │ │ │ │ - 115 template │ │ │ │ │ -116 class TreeContainerVectorBackend │ │ │ │ │ - 117 { │ │ │ │ │ - 118 template │ │ │ │ │ - 119 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ -HybridTreePath<>& path) │ │ │ │ │ - 120 { │ │ │ │ │ - 121 return container; │ │ │ │ │ - 122 } │ │ │ │ │ - 123 │ │ │ │ │ - 124 template │ │ │ │ │ - 125 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ -HybridTreePath& path) │ │ │ │ │ - 126 { │ │ │ │ │ - 127 auto head = path[Dune::Indices::_0]; │ │ │ │ │ - 128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){ │ │ │ │ │ - 129 return treePath(path[Dune::index_constant{}]...); │ │ │ │ │ - 130 }, std::make_index_sequence()); │ │ │ │ │ - 131 return accessByTreePath(container[head], tailPath); │ │ │ │ │ - 132 } │ │ │ │ │ - 133 │ │ │ │ │ - 134 template = true> │ │ │ │ │ - 136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune:: │ │ │ │ │ -PriorityTag<2>) │ │ │ │ │ - 137 { │ │ │ │ │ - 138 /* do nothing */ │ │ │ │ │ - 139 } │ │ │ │ │ - 140 │ │ │ │ │ - 141 template().resize(0u))> │ │ │ │ │ - 143 static void resizeImpl(C& container, const Tree& tree, Dune:: │ │ │ │ │ -PriorityTag<1>) │ │ │ │ │ - 144 { │ │ │ │ │ - 145 container.resize(tree.degree()); │ │ │ │ │ - 146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) { │ │ │ │ │ - 147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{}); │ │ │ │ │ - 148 }); │ │ │ │ │ +111 typedef type Type; │ │ │ │ │ + 112 │ │ │ │ │ +114 static transformed_type transform(const SourceTree& s, const │ │ │ │ │ +Transformation& t = Transformation()) │ │ │ │ │ + 115 { │ │ │ │ │ + 116 return │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transform(s,t); │ │ │ │ │ + 117 } │ │ │ │ │ + 118 │ │ │ │ │ +120 static transformed_type transform(const SourceTree& s, Transformation& t) │ │ │ │ │ + 121 { │ │ │ │ │ + 122 return │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transform(s,t); │ │ │ │ │ + 123 } │ │ │ │ │ + 124 │ │ │ │ │ +126 static transformed_type transform(std::shared_ptr sp, │ │ │ │ │ +const Transformation& t = Transformation()) │ │ │ │ │ + 127 { │ │ │ │ │ + 128 return │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transform(sp,t); │ │ │ │ │ + 129 } │ │ │ │ │ + 130 │ │ │ │ │ +132 static transformed_type transform(std::shared_ptr sp, │ │ │ │ │ +Transformation& t) │ │ │ │ │ + 133 { │ │ │ │ │ + 134 return │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transform(sp,t); │ │ │ │ │ + 135 } │ │ │ │ │ + 136 │ │ │ │ │ +139 static transformed_storage_type transform_storage(std::shared_ptr sp, const Transformation& t = Transformation()) │ │ │ │ │ + 140 { │ │ │ │ │ + 141 return │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transform_storage(sp,t); │ │ │ │ │ + 142 } │ │ │ │ │ + 143 │ │ │ │ │ +146 static transformed_storage_type transform_storage(std::shared_ptr sp, Transformation& t) │ │ │ │ │ + 147 { │ │ │ │ │ + 148 return │ │ │ │ │ +TransformTree,NodeTransformation:: │ │ │ │ │ +recursive>::transform_storage(sp,t); │ │ │ │ │ 149 } │ │ │ │ │ 150 │ │ │ │ │ - 151 template │ │ │ │ │ - 152 static void resizeImpl(C& container, const Tree& tree, Dune:: │ │ │ │ │ -PriorityTag<0>) │ │ │ │ │ - 153 { │ │ │ │ │ - 154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) { │ │ │ │ │ - 155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{}); │ │ │ │ │ - 156 }); │ │ │ │ │ - 157 } │ │ │ │ │ - 158 │ │ │ │ │ - 159 template │ │ │ │ │ - 160 using TypeTreeConcept = decltype(( │ │ │ │ │ - 161 std::declval().degree(), │ │ │ │ │ - 162 T::isLeaf, │ │ │ │ │ - 163 T::isPower, │ │ │ │ │ - 164 T::isComposite, │ │ │ │ │ - 165 true)); │ │ │ │ │ - 166 │ │ │ │ │ - 167 public: │ │ │ │ │ -169 TreeContainerVectorBackend(Container&& container) : │ │ │ │ │ - 170 container_(std::move(container)) │ │ │ │ │ - 171 {} │ │ │ │ │ - 172 │ │ │ │ │ - 174 template = true> │ │ │ │ │ -175 TreeContainerVectorBackend(const Tree& tree) : │ │ │ │ │ - 176 TreeContainerVectorBackend() │ │ │ │ │ - 177 { │ │ │ │ │ - 178 this->resize(tree); │ │ │ │ │ - 179 } │ │ │ │ │ - 180 │ │ │ │ │ - 182 template , bool> = true> │ │ │ │ │ -184 TreeContainerVectorBackend() : │ │ │ │ │ - 185 container_() │ │ │ │ │ - 186 {} │ │ │ │ │ - 187 │ │ │ │ │ - 188 template │ │ │ │ │ -189 decltype(auto) operator[](const HybridTreePath& path) const │ │ │ │ │ - 190 { │ │ │ │ │ - 191 return accessByTreePath(container_, path); │ │ │ │ │ - 192 } │ │ │ │ │ - 193 │ │ │ │ │ - 194 template │ │ │ │ │ -195 decltype(auto) operator[](const HybridTreePath& path) │ │ │ │ │ + 151 │ │ │ │ │ + 152 }; │ │ │ │ │ + 153 │ │ │ │ │ + 154#ifndef DOXYGEN // internal per-node implementations of the transformation │ │ │ │ │ +algorithm │ │ │ │ │ + 155 │ │ │ │ │ + 156 // handle a leaf node - this is easy │ │ │ │ │ + 157 template │ │ │ │ │ + 158 struct TransformTree │ │ │ │ │ + 159 { │ │ │ │ │ + 160 // get transformed type from specification │ │ │ │ │ + 161 typedef typename LookupNodeTransformation>::type │ │ │ │ │ +NodeTransformation; │ │ │ │ │ + 162 │ │ │ │ │ + 163 typedef typename NodeTransformation::transformed_type transformed_type; │ │ │ │ │ + 164 typedef typename NodeTransformation::transformed_storage_type │ │ │ │ │ +transformed_storage_type; │ │ │ │ │ + 165 │ │ │ │ │ + 166 // delegate instance transformation to per-node specification │ │ │ │ │ + 167 static transformed_type transform(const S& s, T& t) │ │ │ │ │ + 168 { │ │ │ │ │ + 169 return NodeTransformation::transform(s,t); │ │ │ │ │ + 170 } │ │ │ │ │ + 171 │ │ │ │ │ + 172 // delegate instance transformation to per-node specification │ │ │ │ │ + 173 static transformed_type transform(const S& s, const T& t) │ │ │ │ │ + 174 { │ │ │ │ │ + 175 return NodeTransformation::transform(s,t); │ │ │ │ │ + 176 } │ │ │ │ │ + 177 │ │ │ │ │ + 178 // delegate instance transformation to per-node specification │ │ │ │ │ + 179 static transformed_type transform(std::shared_ptr sp, T& t) │ │ │ │ │ + 180 { │ │ │ │ │ + 181 return NodeTransformation::transform(sp,t); │ │ │ │ │ + 182 } │ │ │ │ │ + 183 │ │ │ │ │ + 184 // delegate instance transformation to per-node specification │ │ │ │ │ + 185 static transformed_type transform(std::shared_ptr sp, const T& t) │ │ │ │ │ + 186 { │ │ │ │ │ + 187 return NodeTransformation::transform(sp,t); │ │ │ │ │ + 188 } │ │ │ │ │ + 189 │ │ │ │ │ + 190 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, T& t) │ │ │ │ │ + 191 { │ │ │ │ │ + 192 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ + 193 } │ │ │ │ │ + 194 │ │ │ │ │ + 195 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, const T& t) │ │ │ │ │ 196 { │ │ │ │ │ - 197 return accessByTreePath(container_, path); │ │ │ │ │ + 197 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ 198 } │ │ │ │ │ 199 │ │ │ │ │ - 201 template = true> │ │ │ │ │ -202 void resize(const Tree& tree) │ │ │ │ │ - 203 { │ │ │ │ │ - 204 resizeImpl(container_, tree, Dune::PriorityTag<5>{}); │ │ │ │ │ - 205 } │ │ │ │ │ - 206 │ │ │ │ │ -207 const Container& data() const │ │ │ │ │ - 208 { │ │ │ │ │ - 209 return container_; │ │ │ │ │ - 210 } │ │ │ │ │ - 211 │ │ │ │ │ -212 Container& data() │ │ │ │ │ - 213 { │ │ │ │ │ - 214 return container_; │ │ │ │ │ - 215 } │ │ │ │ │ - 216 │ │ │ │ │ - 217 private: │ │ │ │ │ - 218 Container container_; │ │ │ │ │ - 219 }; │ │ │ │ │ - 220 │ │ │ │ │ - 221 template │ │ │ │ │ -222 auto makeTreeContainerVectorBackend(Container&& container) │ │ │ │ │ - 223 { │ │ │ │ │ - 224 return TreeContainerVectorBackend>(std:: │ │ │ │ │ -forward(container)); │ │ │ │ │ - 225 } │ │ │ │ │ - 226 │ │ │ │ │ - 227 /* │ │ │ │ │ - 228 * \brief A simple lambda for creating default constructible values from a │ │ │ │ │ -node │ │ │ │ │ - 229 * │ │ │ │ │ - 230 * This simply returns LeafToValue{} for a given Node. It's needed │ │ │ │ │ - 231 * because using a lambda expression in a using declaration is not allowed │ │ │ │ │ - 232 * because it's an unevaluated context. │ │ │ │ │ - 233 */ │ │ │ │ │ - 234 template class LeafToValue> │ │ │ │ │ -235 struct LeafToDefaultConstructibleValue │ │ │ │ │ - 236 { │ │ │ │ │ - 237 template │ │ │ │ │ -238 auto operator()(const Node& node) const │ │ │ │ │ - 239 { │ │ │ │ │ - 240 return LeafToValue{}; │ │ │ │ │ - 241 } │ │ │ │ │ - 242 }; │ │ │ │ │ - 243 │ │ │ │ │ - 244 } // namespace Detail │ │ │ │ │ - 245 │ │ │ │ │ - 265 template │ │ │ │ │ -266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue) │ │ │ │ │ - 267 { │ │ │ │ │ - 268 auto f = std::ref(leafToValue); │ │ │ │ │ - 269 auto factory = Detail::ContainerFactory(f); │ │ │ │ │ - 270 return Detail::makeTreeContainerVectorBackend(factory(tree)); │ │ │ │ │ - 271 } │ │ │ │ │ - 272 │ │ │ │ │ - 288 template │ │ │ │ │ -289 auto makeTreeContainer(const Tree& tree) │ │ │ │ │ - 290 { │ │ │ │ │ - 291 return makeTreeContainer(tree, [](const auto&) {return Value{};}); │ │ │ │ │ - 292 } │ │ │ │ │ - 293 │ │ │ │ │ - 297 template │ │ │ │ │ -298 using UniformTreeContainer = std::decay_t │ │ │ │ │ -(std::declval()))>; │ │ │ │ │ - 299 │ │ │ │ │ - 303 template class LeafToValue, class Tree> │ │ │ │ │ -304 using TreeContainer = std::decay_t(), std::declval>()))>; │ │ │ │ │ - 305 │ │ │ │ │ - 307 │ │ │ │ │ - 308 } // namespace TypeTree │ │ │ │ │ - 309} //namespace Dune │ │ │ │ │ + 200 }; │ │ │ │ │ + 201 │ │ │ │ │ + 202 │ │ │ │ │ + 203 // common implementation for non-recursive transformation of non-leaf │ │ │ │ │ +nodes │ │ │ │ │ + 204 template │ │ │ │ │ + 205 struct TransformTreeNonRecursive │ │ │ │ │ + 206 { │ │ │ │ │ + 207 // get transformed type from specification │ │ │ │ │ + 208 typedef typename LookupNodeTransformation>::type │ │ │ │ │ +NodeTransformation; │ │ │ │ │ + 209 │ │ │ │ │ + 210 typedef typename NodeTransformation::transformed_type transformed_type; │ │ │ │ │ + 211 typedef typename NodeTransformation::transformed_storage_type │ │ │ │ │ +transformed_storage_type; │ │ │ │ │ + 212 │ │ │ │ │ + 213 // delegate instance transformation to per-node specification │ │ │ │ │ + 214 static transformed_type transform(const S& s, T& t) │ │ │ │ │ + 215 { │ │ │ │ │ + 216 return NodeTransformation::transform(s,t); │ │ │ │ │ + 217 } │ │ │ │ │ + 218 │ │ │ │ │ + 219 // delegate instance transformation to per-node specification │ │ │ │ │ + 220 static transformed_type transform(const S& s, const T& t) │ │ │ │ │ + 221 { │ │ │ │ │ + 222 return NodeTransformation::transform(s,t); │ │ │ │ │ + 223 } │ │ │ │ │ + 224 │ │ │ │ │ + 225 // delegate instance transformation to per-node specification │ │ │ │ │ + 226 static transformed_type transform(std::shared_ptr sp, T& t) │ │ │ │ │ + 227 { │ │ │ │ │ + 228 return NodeTransformation::transform(sp,t); │ │ │ │ │ + 229 } │ │ │ │ │ + 230 │ │ │ │ │ + 231 // delegate instance transformation to per-node specification │ │ │ │ │ + 232 static transformed_type transform(std::shared_ptr sp, const T& t) │ │ │ │ │ + 233 { │ │ │ │ │ + 234 return NodeTransformation::transform(sp,t); │ │ │ │ │ + 235 } │ │ │ │ │ + 236 │ │ │ │ │ + 237 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, T& t) │ │ │ │ │ + 238 { │ │ │ │ │ + 239 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ + 240 } │ │ │ │ │ + 241 │ │ │ │ │ + 242 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, const T& t) │ │ │ │ │ + 243 { │ │ │ │ │ + 244 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ + 245 } │ │ │ │ │ + 246 │ │ │ │ │ + 247 }; │ │ │ │ │ + 248 │ │ │ │ │ + 249 │ │ │ │ │ + 250 namespace Impl { │ │ │ │ │ + 251 │ │ │ │ │ + 252 // Helper class to handle recursive power nodes │ │ │ │ │ + 253 template │ │ │ │ │ + 254 class RecursivePowerTransformTree │ │ │ │ │ + 255 { │ │ │ │ │ + 256 // We only know two types of tags! │ │ │ │ │ + 257 static_assert(std::is_same_v or std:: │ │ │ │ │ +is_same_v); │ │ │ │ │ + 258 │ │ │ │ │ + 259 using ChildType = typename Source::ChildType; │ │ │ │ │ + 260 │ │ │ │ │ + 261 // in case degree is dynamic, provid a vector correctly initialized │ │ │ │ │ + 262 template │ │ │ │ │ + 263 static auto node_storage_provider(const std::size_t& degree) │ │ │ │ │ + 264 { │ │ │ │ │ + 265 return std::vector(degree); │ │ │ │ │ + 266 } │ │ │ │ │ + 267 │ │ │ │ │ + 268 // in case degree is static, provid an array │ │ │ │ │ + 269 template │ │ │ │ │ + 270 static auto node_storage_provider(StaticIndex) │ │ │ │ │ + 271 { │ │ │ │ │ + 272 return std::array(); │ │ │ │ │ + 273 } │ │ │ │ │ + 274 │ │ │ │ │ + 275 public: │ │ │ │ │ + 276 // get transformed type from specification │ │ │ │ │ + 277 // Handling this transformation in a way that makes the per-node │ │ │ │ │ +specification easy to write │ │ │ │ │ + 278 // is a little involved: │ │ │ │ │ + 279 // The problem is that the transformed power node must be parameterized on │ │ │ │ │ +the transformed child │ │ │ │ │ + 280 // type. So we need to transform the child type and pass the transformed │ │ │ │ │ +child type to an inner │ │ │ │ │ + 281 // template of the node transformation struct called result (see example │ │ │ │ │ +of such a specification │ │ │ │ │ + 282 // further down). │ │ │ │ │ + 283 using NodeTransformation = typename │ │ │ │ │ +LookupNodeTransformation>:: │ │ │ │ │ +type; │ │ │ │ │ + 284 using ChildNodeTransformation = typename │ │ │ │ │ +LookupNodeTransformation>:: │ │ │ │ │ +type; │ │ │ │ │ + 285 │ │ │ │ │ + 286 private: │ │ │ │ │ + 287 // Since every child is same type, is enough to get transformation once │ │ │ │ │ + 288 using ChildTreeTransformation = TransformTree, │ │ │ │ │ + 291 ChildNodeTransformation::recursive>; │ │ │ │ │ + 292 │ │ │ │ │ + 293 // Get transformed type of children │ │ │ │ │ + 294 using transformed_child_type = typename ChildTreeTransformation:: │ │ │ │ │ +transformed_type; │ │ │ │ │ + 295 using transformed_child_storage_type = typename ChildTreeTransformation:: │ │ │ │ │ +transformed_storage_type; │ │ │ │ │ + 296 public: │ │ │ │ │ + 297 // Apply transformation from children to current node │ │ │ │ │ + 298 using transformed_type = typename NodeTransformation::template │ │ │ │ │ +result::type; │ │ │ │ │ + 299 using transformed_storage_type = typename NodeTransformation::template │ │ │ │ │ +result::storage_type; │ │ │ │ │ + 300 │ │ │ │ │ + 301 // Transform an instance of source tree. │ │ │ │ │ + 302 static transformed_type transform(const Source& source, Transformation& │ │ │ │ │ +transformation) │ │ │ │ │ + 303 { │ │ │ │ │ + 304 auto children_storage = node_storage_provider>(source.degree()); │ │ │ │ │ + 305 for (std::size_t k = 0; k < source.degree(); ++k) { │ │ │ │ │ + 306 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ +(source.childStorage(k),transformation); │ │ │ │ │ + 307 } │ │ │ │ │ + 308 return NodeTransformation::transform │ │ │ │ │ +(source,transformation,children_storage); │ │ │ │ │ + 309 } │ │ │ │ │ 310 │ │ │ │ │ - 311#endif // DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ -treepath.hh │ │ │ │ │ -Dune::TypeTree::UniformTreeContainer │ │ │ │ │ -std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & > │ │ │ │ │ -()))> UniformTreeContainer │ │ │ │ │ -Alias to container type generated by makeTreeContainer for given tree type and │ │ │ │ │ -uniform value type. │ │ │ │ │ -Definition: treecontainer.hh:298 │ │ │ │ │ -Dune::TypeTree::TreeContainer │ │ │ │ │ -std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std:: │ │ │ │ │ -declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))> │ │ │ │ │ -TreeContainer │ │ │ │ │ -Alias to container type generated by makeTreeContainer for give tree type and │ │ │ │ │ -when using LeafToValue ... │ │ │ │ │ -Definition: treecontainer.hh:304 │ │ │ │ │ -Dune::TypeTree::makeTreeContainer │ │ │ │ │ -auto makeTreeContainer(const Tree &tree) │ │ │ │ │ -Create container havin the same structure as the given tree. │ │ │ │ │ -Definition: treecontainer.hh:289 │ │ │ │ │ + 311 // Transform an instance of source tree. │ │ │ │ │ + 312 static transformed_type transform(const Source& source, const │ │ │ │ │ +Transformation& transformation) │ │ │ │ │ + 313 { │ │ │ │ │ + 314 auto children_storage = node_storage_provider>(source.degree()); │ │ │ │ │ + 315 for (std::size_t k = 0; k < source.degree(); ++k) { │ │ │ │ │ + 316 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ +(source.childStorage(k),transformation); │ │ │ │ │ + 317 } │ │ │ │ │ + 318 return NodeTransformation::transform │ │ │ │ │ +(source,transformation,children_storage); │ │ │ │ │ + 319 } │ │ │ │ │ + 320 │ │ │ │ │ + 321 // Transform an instance of source tree. │ │ │ │ │ + 322 static transformed_type transform(std::shared_ptr │ │ │ │ │ +source_ptr, Transformation& transformation) │ │ │ │ │ + 323 { │ │ │ │ │ + 324 auto children_storage = node_storage_provider>(source_ptr->degree()); │ │ │ │ │ + 325 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ + 326 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ +(source_ptr->childStorage(k),transformation); │ │ │ │ │ + 327 } │ │ │ │ │ + 328 return NodeTransformation::transform │ │ │ │ │ +(source_ptr,transformation,children_storage); │ │ │ │ │ + 329 } │ │ │ │ │ + 330 │ │ │ │ │ + 331 // Transform an instance of source tree. │ │ │ │ │ + 332 static transformed_type transform(std::shared_ptr │ │ │ │ │ +source_ptr, const Transformation& transformation) │ │ │ │ │ + 333 { │ │ │ │ │ + 334 auto children_storage = node_storage_provider>(source_ptr->degree()); │ │ │ │ │ + 335 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ + 336 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ +(source_ptr->childStorage(k),transformation); │ │ │ │ │ + 337 } │ │ │ │ │ + 338 return NodeTransformation::transform │ │ │ │ │ +(source_ptr,transformation,children_storage); │ │ │ │ │ + 339 } │ │ │ │ │ + 340 │ │ │ │ │ + 341 // Transform an instance of source tree ptr. │ │ │ │ │ + 342 static transformed_storage_type transform_storage(std::shared_ptr source_ptr, Transformation& transformation) │ │ │ │ │ + 343 { │ │ │ │ │ + 344 auto children_storage = │ │ │ │ │ +node_storage_provider(source_ptr->degree()); │ │ │ │ │ + 345 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ + 346 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ +(source_ptr->childStorage(k),transformation); │ │ │ │ │ + 347 } │ │ │ │ │ + 348 return NodeTransformation::transform_storage │ │ │ │ │ +(source_ptr,transformation,children_storage); │ │ │ │ │ + 349 } │ │ │ │ │ + 350 │ │ │ │ │ + 351 // Transform an instance of source tree ptr. │ │ │ │ │ + 352 static transformed_storage_type transform_storage(std::shared_ptr source_ptr, const Transformation& transformation) │ │ │ │ │ + 353 { │ │ │ │ │ + 354 auto children_storage = │ │ │ │ │ +node_storage_provider(source_ptr->degree()); │ │ │ │ │ + 355 for (std::size_t k = 0; k < source_ptr->degree(); ++k) { │ │ │ │ │ + 356 children_storage[k] = ChildTreeTransformation::transform_storage │ │ │ │ │ +(source_ptr->childStorage(k),transformation); │ │ │ │ │ + 357 } │ │ │ │ │ + 358 return NodeTransformation::transform_storage │ │ │ │ │ +(source_ptr,transformation,children_storage); │ │ │ │ │ + 359 } │ │ │ │ │ + 360 │ │ │ │ │ + 361 }; │ │ │ │ │ + 362 } // namespace Impl │ │ │ │ │ + 363 │ │ │ │ │ + 364 // Recursive version of the PowerNode transformation for static nodes. │ │ │ │ │ + 365 template │ │ │ │ │ + 366 struct TransformTree │ │ │ │ │ + 367 : public Impl:: │ │ │ │ │ +RecursivePowerTransformTree │ │ │ │ │ + 368 {}; │ │ │ │ │ + 369 │ │ │ │ │ + 370 // Recursive version of the DynamicPowerNode transformation for static │ │ │ │ │ +nodes. │ │ │ │ │ + 371 template │ │ │ │ │ + 372 struct TransformTree │ │ │ │ │ + 373 : public Impl:: │ │ │ │ │ +RecursivePowerTransformTree │ │ │ │ │ + 374 {}; │ │ │ │ │ + 375 │ │ │ │ │ + 376 // non-recursive version of the PowerNode transformation. │ │ │ │ │ + 377 template │ │ │ │ │ + 378 struct TransformTree │ │ │ │ │ + 379 : public TransformTreeNonRecursive │ │ │ │ │ + 380 {}; │ │ │ │ │ + 381 │ │ │ │ │ + 382 // non-recursive version of the DynamicPowerNodeTag transformation. │ │ │ │ │ + 383 template │ │ │ │ │ + 384 struct TransformTree │ │ │ │ │ + 385 : public TransformTreeNonRecursive │ │ │ │ │ + 386 {}; │ │ │ │ │ + 387 │ │ │ │ │ + 388 // helper struct that does the actual transformation for a composite node. │ │ │ │ │ +We need this additional struct │ │ │ │ │ + 389 // to extract the template argument list with the types of all children │ │ │ │ │ +from the node, which we cannot do │ │ │ │ │ + 390 // directly in the transformation<> template, as the type passed to │ │ │ │ │ +transformation<> will usually be a │ │ │ │ │ + 391 // derived type and will normally have more template arguments than just │ │ │ │ │ +the children. This declaration │ │ │ │ │ + 392 // just introduces the type of the helper struct, we always instantiate │ │ │ │ │ +the specialization defined below; │ │ │ │ │ + 393 template │ │ │ │ │ + 394 struct transform_composite_node; │ │ │ │ │ + 395 │ │ │ │ │ + 396 // specialized version of the helper struct which extracts the template │ │ │ │ │ +argument list with the children from │ │ │ │ │ + 397 // its second template parameter, which has to be CompositeNode:: │ │ │ │ │ +ChildTypes. Apart from that, the struct is │ │ │ │ │ + 398 // similar to the one for a PowerNode, but it obviously delegates │ │ │ │ │ +transformation of the children to the TMP. │ │ │ │ │ + 399 template │ │ │ │ │ + 400 struct transform_composite_node,T> │ │ │ │ │ + 401 { │ │ │ │ │ + 402 │ │ │ │ │ + 403 // transformed type, using the same nested struct trick as the PowerNode │ │ │ │ │ + 404 typedef ImplementationTag Tag; │ │ │ │ │ + 405 typedef typename LookupNodeTransformation::type │ │ │ │ │ +NodeTransformation; │ │ │ │ │ + 406 typedef typename NodeTransformation::template result, │ │ │ │ │ + 409 LookupNodeTransformation>::type::recursive │ │ │ │ │ + 410 >::transformed_type... │ │ │ │ │ + 411 >::type transformed_type; │ │ │ │ │ + 412 │ │ │ │ │ + 413 typedef typename NodeTransformation::template result, │ │ │ │ │ + 416 LookupNodeTransformation>::type::recursive │ │ │ │ │ + 417 >::transformed_type... │ │ │ │ │ + 418 >::storage_type transformed_storage_type; │ │ │ │ │ + 419 │ │ │ │ │ + 420 // Retrieve the transformation descriptor for the child with index i. │ │ │ │ │ + 421 // This little helper improves really improves the readability of the │ │ │ │ │ + 422 // transformation functions. │ │ │ │ │ + 423 template │ │ │ │ │ + 424 struct ChildTransformation │ │ │ │ │ + 425 : public TransformTree::Type, │ │ │ │ │ + 426 T, │ │ │ │ │ + 427 NodeTag::Type>, │ │ │ │ │ + 428 LookupNodeTransformation< │ │ │ │ │ + 429 typename S::template Child::Type, │ │ │ │ │ + 430 T, │ │ │ │ │ + 431 ImplementationTag::Type> │ │ │ │ │ + 432 >::type::recursive │ │ │ │ │ + 433 > │ │ │ │ │ + 434 {}; │ │ │ │ │ + 435 │ │ │ │ │ + 436 template │ │ │ │ │ + 437 static void setElement(Tuple& tuple, Value&& value) │ │ │ │ │ + 438 { │ │ │ │ │ + 439 std::get(tuple) = std::forward(value); │ │ │ │ │ + 440 } │ │ │ │ │ + 441 │ │ │ │ │ + 442 template │ │ │ │ │ + 443 static transformed_type transform(const S& s, Trafo&& t, std:: │ │ │ │ │ +index_sequence indices) │ │ │ │ │ + 444 { │ │ │ │ │ + 445 std::tuple::transformed_storage_type...> │ │ │ │ │ +storage; │ │ │ │ │ + 446 Dune::Hybrid::Impl::evaluateFoldExpression({(setElement(storage, │ │ │ │ │ +ChildTransformation::transform_storage(s.template childStorage(), std:: │ │ │ │ │ +forward(t))),0)...}); │ │ │ │ │ + 447 return NodeTransformation::transform(s, std::forward(t), std:: │ │ │ │ │ +get(storage)...); │ │ │ │ │ + 448 } │ │ │ │ │ + 449 │ │ │ │ │ + 450 template │ │ │ │ │ + 451 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, Trafo&& t, std::index_sequence indices) │ │ │ │ │ + 452 { │ │ │ │ │ + 453 std::tuple::transformed_storage_type...> │ │ │ │ │ +storage; │ │ │ │ │ + 454 Dune::Hybrid::Impl::evaluateFoldExpression({(setElement(storage, │ │ │ │ │ +ChildTransformation::transform_storage(sp->template childStorage(), std:: │ │ │ │ │ +forward(t))),0)...}); │ │ │ │ │ + 455 return NodeTransformation::transform_storage(sp, std::forward(t), │ │ │ │ │ +std::get(storage)...); │ │ │ │ │ + 456 } │ │ │ │ │ + 457 }; │ │ │ │ │ + 458 │ │ │ │ │ + 459 │ │ │ │ │ + 460 // the specialization of transformation<> for the CompositeNode. This just │ │ │ │ │ +extracts the │ │ │ │ │ + 461 // CompositeNode::ChildTypes member and forwards to the helper struct │ │ │ │ │ + 462 template │ │ │ │ │ + 463 struct TransformTree │ │ │ │ │ + 464 { │ │ │ │ │ + 465 │ │ │ │ │ + 466 private: │ │ │ │ │ + 467 │ │ │ │ │ + 468 typedef typename S::ChildTypes ChildTypes; │ │ │ │ │ + 469 │ │ │ │ │ + 470 static auto child_indices() │ │ │ │ │ + 471 { │ │ │ │ │ + 472 return std::make_index_sequence(); │ │ │ │ │ + 473 } │ │ │ │ │ + 474 │ │ │ │ │ + 475 public: │ │ │ │ │ + 476 │ │ │ │ │ + 477 typedef typename transform_composite_node:: │ │ │ │ │ +transformed_type transformed_type; │ │ │ │ │ + 478 typedef typename transform_composite_node:: │ │ │ │ │ +transformed_storage_type transformed_storage_type; │ │ │ │ │ + 479 │ │ │ │ │ + 480 static transformed_type transform(const S& s, T& t) │ │ │ │ │ + 481 { │ │ │ │ │ + 482 return transform_composite_node::transform │ │ │ │ │ +(s,t,child_indices()); │ │ │ │ │ + 483 } │ │ │ │ │ + 484 │ │ │ │ │ + 485 static transformed_type transform(const S& s, const T& t) │ │ │ │ │ + 486 { │ │ │ │ │ + 487 return transform_composite_node::transform │ │ │ │ │ +(s,t,child_indices()); │ │ │ │ │ + 488 } │ │ │ │ │ + 489 │ │ │ │ │ + 490 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, T& t) │ │ │ │ │ + 491 { │ │ │ │ │ + 492 return transform_composite_node::transform_storage │ │ │ │ │ +(sp,t,child_indices()); │ │ │ │ │ + 493 } │ │ │ │ │ + 494 │ │ │ │ │ + 495 static transformed_storage_type transform_storage(std::shared_ptr │ │ │ │ │ +sp, const T& t) │ │ │ │ │ + 496 { │ │ │ │ │ + 497 return transform_composite_node::transform_storage │ │ │ │ │ +(sp,t,child_indices()); │ │ │ │ │ + 498 } │ │ │ │ │ + 499 │ │ │ │ │ + 500 }; │ │ │ │ │ + 501 │ │ │ │ │ + 502 // non-recursive version of the CompositeNode transformation. │ │ │ │ │ + 503 template │ │ │ │ │ + 504 struct TransformTree │ │ │ │ │ + 505 : public TransformTreeNonRecursive │ │ │ │ │ + 506 {}; │ │ │ │ │ + 507 │ │ │ │ │ + 508#endif // DOXYGEN │ │ │ │ │ + 509 │ │ │ │ │ + 511 │ │ │ │ │ + 512 } // namespace TypeTree │ │ │ │ │ + 513} //namespace Dune │ │ │ │ │ + 514 │ │ │ │ │ + 515#endif // DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ +utility.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ +typetraits.hh │ │ │ │ │ +result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:110 │ │ │ │ │ Dune::TypeTree::degree │ │ │ │ │ std::size_t degree(const Node &node) │ │ │ │ │ Returns the degree of node as run time information. │ │ │ │ │ Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::treePath │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:191 │ │ │ │ │ +Dune::TypeTree::registerNodeTransformation │ │ │ │ │ +void registerNodeTransformation(SourceNode *, Transformation *, Tag *) │ │ │ │ │ +Register transformation descriptor to transform SourceNode with Transformation. │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::Detail::makeTreeContainerVectorBackend │ │ │ │ │ -auto makeTreeContainerVectorBackend(Container &&container) │ │ │ │ │ -Definition: treecontainer.hh:222 │ │ │ │ │ -Dune::TypeTree::Detail::ContainerFactory │ │ │ │ │ -Definition: treecontainer.hh:37 │ │ │ │ │ -Dune::TypeTree::Detail::ContainerFactory::operator() │ │ │ │ │ -auto operator()(const Node &node) │ │ │ │ │ -Definition: treecontainer.hh:61 │ │ │ │ │ -Dune::TypeTree::Detail::ContainerFactory::ContainerFactory │ │ │ │ │ -ContainerFactory(LeafToValue leafToValue) │ │ │ │ │ -Create ContainerFactory. │ │ │ │ │ -Definition: treecontainer.hh:56 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend │ │ │ │ │ -Definition: treecontainer.hh:117 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend::resize │ │ │ │ │ -void resize(const Tree &tree) │ │ │ │ │ -Resize the (nested) container depending on the degree of the tree nodes. │ │ │ │ │ -Definition: treecontainer.hh:202 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend::data │ │ │ │ │ -Container & data() │ │ │ │ │ -Definition: treecontainer.hh:212 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend::data │ │ │ │ │ -const Container & data() const │ │ │ │ │ -Definition: treecontainer.hh:207 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend │ │ │ │ │ -TreeContainerVectorBackend(Container &&container) │ │ │ │ │ -Move the passed container into the internal storage. │ │ │ │ │ -Definition: treecontainer.hh:169 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend │ │ │ │ │ -TreeContainerVectorBackend() │ │ │ │ │ -Default constructor. The stored container might need to be resized before │ │ │ │ │ -usage. │ │ │ │ │ -Definition: treecontainer.hh:184 │ │ │ │ │ -Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend │ │ │ │ │ -TreeContainerVectorBackend(const Tree &tree) │ │ │ │ │ -Default construct the container and perform a resize depending on the tree-node │ │ │ │ │ -degrees. │ │ │ │ │ -Definition: treecontainer.hh:175 │ │ │ │ │ -Dune::TypeTree::Detail::LeafToDefaultConstructibleValue │ │ │ │ │ -Definition: treecontainer.hh:236 │ │ │ │ │ -Dune::TypeTree::Detail::LeafToDefaultConstructibleValue::operator() │ │ │ │ │ -auto operator()(const Node &node) const │ │ │ │ │ -Definition: treecontainer.hh:238 │ │ │ │ │ -Dune::TypeTree::HybridTreePath │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: treepath.hh:79 │ │ │ │ │ +Dune::TypeTree::TransformTree │ │ │ │ │ +Transform a TypeTree. │ │ │ │ │ +Definition: transformation.hh:94 │ │ │ │ │ +Dune::TypeTree::TransformTree::Type │ │ │ │ │ +type Type │ │ │ │ │ +Definition: transformation.hh:111 │ │ │ │ │ +Dune::TypeTree::TransformTree::transform │ │ │ │ │ +static transformed_type transform(std::shared_ptr< const SourceTree > sp, │ │ │ │ │ +Transformation &t) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +Definition: transformation.hh:132 │ │ │ │ │ +Dune::TypeTree::TransformTree::transform │ │ │ │ │ +static transformed_type transform(std::shared_ptr< const SourceTree > sp, const │ │ │ │ │ +Transformation &t=Transformation()) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +Definition: transformation.hh:126 │ │ │ │ │ +Dune::TypeTree::TransformTree::transform │ │ │ │ │ +static transformed_type transform(const SourceTree &s, Transformation &t) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +Definition: transformation.hh:120 │ │ │ │ │ +Dune::TypeTree::TransformTree::type │ │ │ │ │ +transformed_type type │ │ │ │ │ +The type of the transformed tree. │ │ │ │ │ +Definition: transformation.hh:109 │ │ │ │ │ +Dune::TypeTree::TransformTree::transform │ │ │ │ │ +static transformed_type transform(const SourceTree &s, const Transformation │ │ │ │ │ +&t=Transformation()) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +Definition: transformation.hh:114 │ │ │ │ │ +Dune::TypeTree::TransformTree::transform_storage │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceTree > sp, const Transformation &t=Transformation()) │ │ │ │ │ +Definition: transformation.hh:139 │ │ │ │ │ +Dune::TypeTree::TransformTree::transform_storage │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceTree > sp, Transformation &t) │ │ │ │ │ +Definition: transformation.hh:146 │ │ │ │ │ +Dune::TypeTree::evaluate_if_meta_function │ │ │ │ │ +Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ +Definition: typetraits.hh:140 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: compositenode.hh File Reference │ │ │ │ +dune-typetree: traversalutilities.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,44 +63,102 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
compositenode.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
traversalutilities.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <tuple>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/childextraction.hh>
│ │ │ │ -#include <dune/typetree/typetraits.hh>
│ │ │ │ +
#include <dune/typetree/traversal.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  Dune::TypeTree::CompositeNode< Children >
 Base class for composite nodes based on variadic templates. More...
 
struct  Dune::TypeTree::CompositeNode< Children >::Child< k >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Functions

template<typename ResultType , typename Tree , typename F , typename R >
ResultType Dune::TypeTree::reduceOverLeafs (const Tree &tree, F functor, R reduction, ResultType startValue)
 Calculate a quantity as a reduction over the leaf nodes of a TypeTree. More...
 
│ │ │ │ +

Variable Documentation

│ │ │ │ + │ │ │ │ +

◆ _functor

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
F _functor
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ +

◆ _reduction

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
R _reduction
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ +

◆ _value

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
ResultType _value
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ +

◆ treePathType

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
const TreePathType::Type treePathType = TreePathType::dynamic
│ │ │ │ +
│ │ │ │ +static
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,31 +4,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -compositenode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +traversalutilities.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ - class  Dune::TypeTree::CompositeNode<_Children_> │ │ │ │ │ -  Base class for composite nodes based on variadic templates. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::CompositeNode<_Children_>::Child<_k_> │ │ │ │ │ -  Access to the type and storage type of the i-th child. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +ResultType Dune::TypeTree::reduceOverLeafs (const Tree &tree, F functor, R │ │ │ │ │ + reduction, ResultType startValue) │ │ │ │ │ +  Calculate a quantity as a reduction over the leaf nodes of a │ │ │ │ │ + TypeTree. More... │ │ │ │ │ +  │ │ │ │ │ +***** Variable Documentation ***** │ │ │ │ │ +***** ◆ _functor ***** │ │ │ │ │ +F _functor │ │ │ │ │ +***** ◆ _reduction ***** │ │ │ │ │ +R _reduction │ │ │ │ │ +***** ◆ _value ***** │ │ │ │ │ +ResultType _value │ │ │ │ │ +***** ◆ treePathType ***** │ │ │ │ │ +const TreePathType::Type treePathType = TreePathType::dynamic static │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: compositenode.hh Source File │ │ │ │ +dune-typetree: traversalutilities.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,237 +62,87 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
compositenode.hh
│ │ │ │ +
traversalutilities.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │
6
│ │ │ │ -
7#include <tuple>
│ │ │ │ -
8#include <memory>
│ │ │ │ -
9#include <type_traits>
│ │ │ │ -
10
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16 namespace TypeTree {
│ │ │ │ -
17
│ │ │ │ -
24 template<typename... Children>
│ │ │ │ - │ │ │ │ -
26 {
│ │ │ │ -
27
│ │ │ │ -
28 public:
│ │ │ │ + │ │ │ │ +
8
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10 namespace TypeTree {
│ │ │ │ +
11
│ │ │ │ +
17 namespace {
│ │ │ │ +
18
│ │ │ │ +
20
│ │ │ │ +
25 template<typename F, typename R, typename ResultType>
│ │ │ │ +
26 struct LeafReductionVisitor
│ │ │ │ +
27 : public TypeTree::TreeVisitor
│ │ │ │ +
28 {
│ │ │ │
29
│ │ │ │ - │ │ │ │ -
32
│ │ │ │ -
34 typedef std::tuple<std::shared_ptr<Children>... > NodeStorage;
│ │ │ │ -
35
│ │ │ │ -
37 typedef std::tuple<Children...> ChildTypes;
│ │ │ │ -
38
│ │ │ │ -
40 static const bool isLeaf = false;
│ │ │ │ -
41
│ │ │ │ -
43 static const bool isPower = false;
│ │ │ │ -
44
│ │ │ │ -
46 static const bool isComposite = true;
│ │ │ │ -
47
│ │ │ │ -
49 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ -
50 static const std::size_t CHILDREN = sizeof...(Children);
│ │ │ │ + │ │ │ │ +
31
│ │ │ │ +
32 template<typename Node, typename TreePath>
│ │ │ │ +
33 void leaf(const Node& node, TreePath treePath)
│ │ │ │ +
34 {
│ │ │ │ + │ │ │ │ +
36 }
│ │ │ │ +
37
│ │ │ │ +
38 LeafReductionVisitor(F functor, R reduction, ResultType startValue)
│ │ │ │ +
39 : _functor(functor)
│ │ │ │ +
40 , _reduction(reduction)
│ │ │ │ +
41 , _value(startValue)
│ │ │ │ +
42 {}
│ │ │ │ +
43
│ │ │ │ +
44 ResultType result() { return _value; }
│ │ │ │ +
45
│ │ │ │ + │ │ │ │ + │ │ │ │ +
48 ResultType _value;
│ │ │ │ +
49
│ │ │ │ +
50 };
│ │ │ │
51
│ │ │ │ -
52 static constexpr auto degree ()
│ │ │ │ -
53 {
│ │ │ │ -
54 return std::integral_constant<std::size_t,sizeof...(Children)>{};
│ │ │ │ -
55 }
│ │ │ │ -
56
│ │ │ │ -
58 template<std::size_t k>
│ │ │ │ -
59 struct Child {
│ │ │ │ -
60
│ │ │ │ -
61 static_assert((k < degree()), "child index out of range");
│ │ │ │ -
62
│ │ │ │ -
64 typedef typename std::tuple_element<k,ChildTypes>::type Type;
│ │ │ │ -
65
│ │ │ │ -
67 typedef typename std::tuple_element<k,ChildTypes>::type type;
│ │ │ │ -
68 };
│ │ │ │ -
69
│ │ │ │ -
72
│ │ │ │ -
74
│ │ │ │ -
77 template<std::size_t k>
│ │ │ │ -
78 typename Child<k>::Type& child (index_constant<k> = {})
│ │ │ │ -
79 {
│ │ │ │ -
80 return *std::get<k>(_children);
│ │ │ │ -
81 }
│ │ │ │ -
82
│ │ │ │ -
84
│ │ │ │ -
87 template<std::size_t k>
│ │ │ │ -
88 const typename Child<k>::Type& child (index_constant<k> = {}) const
│ │ │ │ -
89 {
│ │ │ │ -
90 return *std::get<k>(_children);
│ │ │ │ -
91 }
│ │ │ │ +
52 } // anonymous namespace
│ │ │ │ +
53
│ │ │ │ +
55
│ │ │ │ +
80 template<typename ResultType, typename Tree, typename F, typename R>
│ │ │ │ +
81 ResultType reduceOverLeafs(const Tree& tree, F functor, R reduction, ResultType startValue)
│ │ │ │ +
82 {
│ │ │ │ +
83 LeafReductionVisitor<F,R,ResultType> visitor(functor,reduction,startValue);
│ │ │ │ +
84 TypeTree::applyToTree(tree,visitor);
│ │ │ │ +
85 return visitor.result();
│ │ │ │ +
86 }
│ │ │ │ +
87
│ │ │ │ +
89
│ │ │ │ +
90 } // namespace TypeTree
│ │ │ │ +
91} //namespace Dune
│ │ │ │
92
│ │ │ │ -
94
│ │ │ │ -
97 template<std::size_t k>
│ │ │ │ - │ │ │ │ -
99 {
│ │ │ │ -
100 return std::get<k>(_children);
│ │ │ │ -
101 }
│ │ │ │ -
102
│ │ │ │ -
104
│ │ │ │ -
107 template<std::size_t k>
│ │ │ │ - │ │ │ │ -
109 {
│ │ │ │ -
110 return std::get<k>(_children);
│ │ │ │ -
111 }
│ │ │ │ -
112
│ │ │ │ -
114 template<std::size_t k>
│ │ │ │ -
115 void setChild (typename Child<k>::Type& child, index_constant<k> = {})
│ │ │ │ -
116 {
│ │ │ │ -
117 std::get<k>(_children) = stackobject_to_shared_ptr(child);
│ │ │ │ -
118 }
│ │ │ │ -
119
│ │ │ │ -
121 template<std::size_t k>
│ │ │ │ -
122 void setChild (typename Child<k>::Type&& child, index_constant<k> = {})
│ │ │ │ -
123 {
│ │ │ │ -
124 std::get<k>(_children) = convert_arg(std::move(child));
│ │ │ │ -
125 }
│ │ │ │ -
126
│ │ │ │ -
128 template<std::size_t k>
│ │ │ │ -
129 void setChild (std::shared_ptr<typename Child<k>::Type> child, index_constant<k> = {})
│ │ │ │ -
130 {
│ │ │ │ -
131 std::get<k>(_children) = std::move(child);
│ │ │ │ -
132 }
│ │ │ │ -
133
│ │ │ │ -
134 const NodeStorage& nodeStorage () const
│ │ │ │ -
135 {
│ │ │ │ -
136 return _children;
│ │ │ │ -
137 }
│ │ │ │ -
138
│ │ │ │ -
140
│ │ │ │ -
143
│ │ │ │ -
144 // The following two methods require a little bit of SFINAE trickery to work correctly:
│ │ │ │ -
145 // We have to make sure that they don't shadow the methods for direct child access because
│ │ │ │ -
146 // those get called by the generic child() machinery. If that machinery picks up the methods
│ │ │ │ -
147 // defined below, we have an infinite recursion.
│ │ │ │ -
148 // So the methods make sure that either
│ │ │ │ -
149 //
│ │ │ │ -
150 // * there are more than one argument. In that case, we got multiple indices and can forward
│ │ │ │ -
151 // to the general machine.
│ │ │ │ -
152 //
│ │ │ │ -
153 // * the first argument is not a valid flat index, i.e. either a std::size_t or an index_constant.
│ │ │ │ -
154 // The argument thus has to be some kind of TreePath instance that we can also pass to the
│ │ │ │ -
155 // generic machine.
│ │ │ │ -
156 //
│ │ │ │ -
157 // The above SFINAE logic works, but there is still a problem with the return type deduction.
│ │ │ │ -
158 // We have to do a lazy lookup of the return type after SFINAE has succeeded, otherwise the return
│ │ │ │ -
159 // type deduction will trigger the infinite recursion.
│ │ │ │ -
160
│ │ │ │ -
162
│ │ │ │ -
166#ifdef DOXYGEN
│ │ │ │ -
167 template<typename... Indices>
│ │ │ │ -
168 ImplementationDefined& child (Indices... indices)
│ │ │ │ -
169#else
│ │ │ │ -
170 template<typename I0, typename... I,
│ │ │ │ -
171 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ -
172 decltype(auto) child (I0 i0, I... i)
│ │ │ │ -
173#endif
│ │ │ │ -
174 {
│ │ │ │ -
175 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ -
176 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ -
177 );
│ │ │ │ -
178 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ -
179 }
│ │ │ │ -
180
│ │ │ │ -
182
│ │ │ │ -
186#ifdef DOXYGEN
│ │ │ │ -
187 template<typename... Indices>
│ │ │ │ -
188 const ImplementationDefined& child (Indices... indices)
│ │ │ │ -
189#else
│ │ │ │ -
190 template<typename I0, typename... I,
│ │ │ │ -
191 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ -
192 decltype(auto) child (I0 i0, I... i) const
│ │ │ │ -
193#endif
│ │ │ │ -
194 {
│ │ │ │ -
195 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ -
196 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ -
197 );
│ │ │ │ -
198 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ -
199 }
│ │ │ │ -
200
│ │ │ │ -
202
│ │ │ │ -
203 protected:
│ │ │ │ -
204
│ │ │ │ -
207
│ │ │ │ -
209
│ │ │ │ - │ │ │ │ -
217 {}
│ │ │ │ -
218
│ │ │ │ -
220 template<typename... Args, typename = typename std::enable_if<(sizeof...(Args) == degree())>::type>
│ │ │ │ -
221 CompositeNode (Args&&... args)
│ │ │ │ -
222 : _children(convert_arg(std::forward<Args>(args))...)
│ │ │ │ -
223 {}
│ │ │ │ -
224
│ │ │ │ -
226 CompositeNode (std::shared_ptr<Children>... children)
│ │ │ │ -
227 : _children(std::move(children)...)
│ │ │ │ -
228 {}
│ │ │ │ -
229
│ │ │ │ -
231 CompositeNode (const NodeStorage& children)
│ │ │ │ -
232 : _children(children)
│ │ │ │ -
233 {}
│ │ │ │ -
234
│ │ │ │ -
236
│ │ │ │ -
237 private:
│ │ │ │ -
238 NodeStorage _children;
│ │ │ │ -
239 };
│ │ │ │ -
240
│ │ │ │ -
242
│ │ │ │ -
243 } // namespace TypeTree
│ │ │ │ -
244} //namespace Dune
│ │ │ │ -
245
│ │ │ │ -
246#endif // DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ +
93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ +
R _reduction
Definition: traversalutilities.hh:47
│ │ │ │ +
F _functor
Definition: traversalutilities.hh:46
│ │ │ │ +
static const TreePathType::Type treePathType
Definition: traversalutilities.hh:30
│ │ │ │ +
ResultType _value
Definition: traversalutilities.hh:48
│ │ │ │ + │ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │ +
ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType startValue)
Calculate a quantity as a reduction over the leaf nodes of a TypeTree.
Definition: traversalutilities.hh:81
│ │ │ │ +
void applyToTree(Tree &&tree, Visitor &&visitor)
Apply visitor to TypeTree.
Definition: traversal.hh:237
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ +
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │
Type
Definition: treepath.hh:30
│ │ │ │ -
Base class for composite nodes based on variadic templates.
Definition: compositenode.hh:26
│ │ │ │ -
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: compositenode.hh:40
│ │ │ │ -
ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: compositenode.hh:168
│ │ │ │ -
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: compositenode.hh:46
│ │ │ │ -
static const std::size_t CHILDREN
The number of children.
Definition: compositenode.hh:50
│ │ │ │ -
CompositeNode()
Default constructor.
Definition: compositenode.hh:216
│ │ │ │ -
CompositeNodeTag NodeTag
The type tag that describes a CompositeNode.
Definition: compositenode.hh:31
│ │ │ │ -
void setChild(typename Child< k >::Type &child, index_constant< k >={})
Sets the k-th child to the passed-in value.
Definition: compositenode.hh:115
│ │ │ │ -
void setChild(typename Child< k >::Type &&child, index_constant< k >={})
Store the passed value in k-th child.
Definition: compositenode.hh:122
│ │ │ │ -
static constexpr auto degree()
Definition: compositenode.hh:52
│ │ │ │ -
const NodeStorage & nodeStorage() const
Definition: compositenode.hh:134
│ │ │ │ -
CompositeNode(std::shared_ptr< Children >... children)
Initialize the CompositeNode with copies of the passed in Storage objects.
Definition: compositenode.hh:226
│ │ │ │ -
std::shared_ptr< typename Child< k >::Type > childStorage(index_constant< k >={})
Returns the storage of the k-th child.
Definition: compositenode.hh:98
│ │ │ │ -
std::tuple< Children... > ChildTypes
A tuple storing the types of all children.
Definition: compositenode.hh:37
│ │ │ │ -
void setChild(std::shared_ptr< typename Child< k >::Type > child, index_constant< k >={})
Sets the storage of the k-th child to the passed-in value.
Definition: compositenode.hh:129
│ │ │ │ -
const ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: compositenode.hh:188
│ │ │ │ -
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: compositenode.hh:43
│ │ │ │ -
std::shared_ptr< const typename Child< k >::Type > childStorage(index_constant< k >={}) const
Returns the storage of the k-th child (const version).
Definition: compositenode.hh:108
│ │ │ │ -
Child< k >::Type & child(index_constant< k >={})
Returns the k-th child.
Definition: compositenode.hh:78
│ │ │ │ -
CompositeNode(const NodeStorage &children)
Initialize the CompositeNode with a copy of the passed-in storage type.
Definition: compositenode.hh:231
│ │ │ │ -
std::tuple< std::shared_ptr< Children >... > NodeStorage
The type used for storing the children.
Definition: compositenode.hh:34
│ │ │ │ -
const Child< k >::Type & child(index_constant< k >={}) const
Returns the k-th child (const version).
Definition: compositenode.hh:88
│ │ │ │ -
Access to the type and storage type of the i-th child.
Definition: compositenode.hh:59
│ │ │ │ -
std::tuple_element< k, ChildTypes >::type Type
The type of the child.
Definition: compositenode.hh:64
│ │ │ │ -
std::tuple_element< k, ChildTypes >::type type
The type of the child.
Definition: compositenode.hh:67
│ │ │ │ -
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │ -
Check if type represents a tree path.
Definition: typetraits.hh:182
│ │ │ │ +
@ dynamic
Definition: treepath.hh:30
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,331 +4,110 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -compositenode.hh │ │ │ │ │ +traversalutilities.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15namespace Dune { │ │ │ │ │ - 16 namespace TypeTree { │ │ │ │ │ - 17 │ │ │ │ │ - 24 template │ │ │ │ │ -25 class CompositeNode │ │ │ │ │ - 26 { │ │ │ │ │ - 27 │ │ │ │ │ - 28 public: │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9namespace Dune { │ │ │ │ │ + 10 namespace TypeTree { │ │ │ │ │ + 11 │ │ │ │ │ + 17 namespace { │ │ │ │ │ + 18 │ │ │ │ │ + 20 │ │ │ │ │ + 25 template │ │ │ │ │ + 26 struct LeafReductionVisitor │ │ │ │ │ + 27 : public TypeTree::TreeVisitor │ │ │ │ │ + 28 { │ │ │ │ │ 29 │ │ │ │ │ -31 typedef CompositeNodeTag NodeTag; │ │ │ │ │ - 32 │ │ │ │ │ -34 typedef std::tuple... > NodeStorage; │ │ │ │ │ - 35 │ │ │ │ │ -37 typedef std::tuple ChildTypes; │ │ │ │ │ - 38 │ │ │ │ │ -40 static const bool isLeaf = false; │ │ │ │ │ - 41 │ │ │ │ │ -43 static const bool isPower = false; │ │ │ │ │ - 44 │ │ │ │ │ -46 static const bool isComposite = true; │ │ │ │ │ - 47 │ │ │ │ │ - 49 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -50 static const std::size_t CHILDREN = sizeof...(Children); │ │ │ │ │ +30 static const TreePathType::Type treePathType = TreePathType::dynamic; │ │ │ │ │ + 31 │ │ │ │ │ + 32 template │ │ │ │ │ + 33 void leaf(const Node& node, TreePath treePath) │ │ │ │ │ + 34 { │ │ │ │ │ + 35 _value = _reduction(_value,_functor(node,treePath)); │ │ │ │ │ + 36 } │ │ │ │ │ + 37 │ │ │ │ │ + 38 LeafReductionVisitor(F functor, R reduction, ResultType startValue) │ │ │ │ │ + 39 : _functor(functor) │ │ │ │ │ + 40 , _reduction(reduction) │ │ │ │ │ + 41 , _value(startValue) │ │ │ │ │ + 42 {} │ │ │ │ │ + 43 │ │ │ │ │ + 44 ResultType result() { return _value; } │ │ │ │ │ + 45 │ │ │ │ │ +46 F _functor; │ │ │ │ │ +47 R _reduction; │ │ │ │ │ +48 ResultType _value; │ │ │ │ │ + 49 │ │ │ │ │ + 50 }; │ │ │ │ │ 51 │ │ │ │ │ -52 static constexpr auto degree () │ │ │ │ │ - 53 { │ │ │ │ │ - 54 return std::integral_constant{}; │ │ │ │ │ - 55 } │ │ │ │ │ - 56 │ │ │ │ │ - 58 template │ │ │ │ │ -59 struct Child { │ │ │ │ │ - 60 │ │ │ │ │ - 61 static_assert((k < degree()), "child index out of range"); │ │ │ │ │ - 62 │ │ │ │ │ -64 typedef typename std::tuple_element::type Type; │ │ │ │ │ - 65 │ │ │ │ │ -67 typedef typename std::tuple_element::type type; │ │ │ │ │ - 68 }; │ │ │ │ │ - 69 │ │ │ │ │ - 72 │ │ │ │ │ - 74 │ │ │ │ │ - 77 template │ │ │ │ │ -78 typename Child::Type& child (index_constant = {}) │ │ │ │ │ - 79 { │ │ │ │ │ - 80 return *std::get(_children); │ │ │ │ │ - 81 } │ │ │ │ │ - 82 │ │ │ │ │ - 84 │ │ │ │ │ - 87 template │ │ │ │ │ -88 const typename Child::Type& child (index_constant = {}) const │ │ │ │ │ - 89 { │ │ │ │ │ - 90 return *std::get(_children); │ │ │ │ │ - 91 } │ │ │ │ │ + 52 } // anonymous namespace │ │ │ │ │ + 53 │ │ │ │ │ + 55 │ │ │ │ │ + 80 template │ │ │ │ │ +81 ResultType reduceOverLeafs(const Tree& tree, F functor, R reduction, │ │ │ │ │ +ResultType startValue) │ │ │ │ │ + 82 { │ │ │ │ │ + 83 LeafReductionVisitor visitor(functor,reduction,startValue); │ │ │ │ │ + 84 TypeTree::applyToTree(tree,visitor); │ │ │ │ │ + 85 return visitor.result(); │ │ │ │ │ + 86 } │ │ │ │ │ + 87 │ │ │ │ │ + 89 │ │ │ │ │ + 90 } // namespace TypeTree │ │ │ │ │ + 91} //namespace Dune │ │ │ │ │ 92 │ │ │ │ │ - 94 │ │ │ │ │ - 97 template │ │ │ │ │ -98 std::shared_ptr::Type> childStorage (index_constant = │ │ │ │ │ -{}) │ │ │ │ │ - 99 { │ │ │ │ │ - 100 return std::get(_children); │ │ │ │ │ - 101 } │ │ │ │ │ - 102 │ │ │ │ │ - 104 │ │ │ │ │ - 107 template │ │ │ │ │ -108 std::shared_ptr::Type> childStorage │ │ │ │ │ -(index_constant = {}) const │ │ │ │ │ - 109 { │ │ │ │ │ - 110 return std::get(_children); │ │ │ │ │ - 111 } │ │ │ │ │ - 112 │ │ │ │ │ - 114 template │ │ │ │ │ -115 void setChild (typename Child::Type& child, index_constant = {}) │ │ │ │ │ - 116 { │ │ │ │ │ - 117 std::get(_children) = stackobject_to_shared_ptr(child); │ │ │ │ │ - 118 } │ │ │ │ │ - 119 │ │ │ │ │ - 121 template │ │ │ │ │ -122 void setChild (typename Child::Type&& child, index_constant = {}) │ │ │ │ │ - 123 { │ │ │ │ │ - 124 std::get(_children) = convert_arg(std::move(child)); │ │ │ │ │ - 125 } │ │ │ │ │ - 126 │ │ │ │ │ - 128 template │ │ │ │ │ -129 void setChild (std::shared_ptr::Type> child, │ │ │ │ │ -index_constant = {}) │ │ │ │ │ - 130 { │ │ │ │ │ - 131 std::get(_children) = std::move(child); │ │ │ │ │ - 132 } │ │ │ │ │ - 133 │ │ │ │ │ -134 const NodeStorage& nodeStorage () const │ │ │ │ │ - 135 { │ │ │ │ │ - 136 return _children; │ │ │ │ │ - 137 } │ │ │ │ │ - 138 │ │ │ │ │ - 140 │ │ │ │ │ - 143 │ │ │ │ │ - 144 // The following two methods require a little bit of SFINAE trickery to │ │ │ │ │ -work correctly: │ │ │ │ │ - 145 // We have to make sure that they don't shadow the methods for direct │ │ │ │ │ -child access because │ │ │ │ │ - 146 // those get called by the generic child() machinery. If that machinery │ │ │ │ │ -picks up the methods │ │ │ │ │ - 147 // defined below, we have an infinite recursion. │ │ │ │ │ - 148 // So the methods make sure that either │ │ │ │ │ - 149 // │ │ │ │ │ - 150 // * there are more than one argument. In that case, we got multiple │ │ │ │ │ -indices and can forward │ │ │ │ │ - 151 // to the general machine. │ │ │ │ │ - 152 // │ │ │ │ │ - 153 // * the first argument is not a valid flat index, i.e. either a std:: │ │ │ │ │ -size_t or an index_constant. │ │ │ │ │ - 154 // The argument thus has to be some kind of TreePath instance that we can │ │ │ │ │ -also pass to the │ │ │ │ │ - 155 // generic machine. │ │ │ │ │ - 156 // │ │ │ │ │ - 157 // The above SFINAE logic works, but there is still a problem with the │ │ │ │ │ -return type deduction. │ │ │ │ │ - 158 // We have to do a lazy lookup of the return type after SFINAE has │ │ │ │ │ -succeeded, otherwise the return │ │ │ │ │ - 159 // type deduction will trigger the infinite recursion. │ │ │ │ │ - 160 │ │ │ │ │ - 162 │ │ │ │ │ - 166#ifdef DOXYGEN │ │ │ │ │ - 167 template │ │ │ │ │ -168 ImplementationDefined& child (Indices... indices) │ │ │ │ │ - 169#else │ │ │ │ │ - 170 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ - 172 decltype(auto) child (I0 i0, I... i) │ │ │ │ │ - 173#endif │ │ │ │ │ - 174 { │ │ │ │ │ - 175 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ - 176 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ -the freestanding version child(node,treePath) instead." │ │ │ │ │ - 177 ); │ │ │ │ │ - 178 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ - 179 } │ │ │ │ │ - 180 │ │ │ │ │ - 182 │ │ │ │ │ - 186#ifdef DOXYGEN │ │ │ │ │ - 187 template │ │ │ │ │ -188 const ImplementationDefined& child (Indices... indices) │ │ │ │ │ - 189#else │ │ │ │ │ - 190 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ - 192 decltype(auto) child (I0 i0, I... i) const │ │ │ │ │ - 193#endif │ │ │ │ │ - 194 { │ │ │ │ │ - 195 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ - 196 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ -the freestanding version child(node,treePath) instead." │ │ │ │ │ - 197 ); │ │ │ │ │ - 198 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ - 199 } │ │ │ │ │ - 200 │ │ │ │ │ - 202 │ │ │ │ │ - 203 protected: │ │ │ │ │ - 204 │ │ │ │ │ - 207 │ │ │ │ │ - 209 │ │ │ │ │ -216 CompositeNode () │ │ │ │ │ - 217 {} │ │ │ │ │ - 218 │ │ │ │ │ - 220 template::type> │ │ │ │ │ -221 CompositeNode (Args&&... args) │ │ │ │ │ - 222 : _children(convert_arg(std::forward(args))...) │ │ │ │ │ - 223 {} │ │ │ │ │ - 224 │ │ │ │ │ -226 CompositeNode (std::shared_ptr... children) │ │ │ │ │ - 227 : _children(std::move(children)...) │ │ │ │ │ - 228 {} │ │ │ │ │ - 229 │ │ │ │ │ -231 CompositeNode (const NodeStorage& children) │ │ │ │ │ - 232 : _children(children) │ │ │ │ │ - 233 {} │ │ │ │ │ - 234 │ │ │ │ │ - 236 │ │ │ │ │ - 237 private: │ │ │ │ │ - 238 NodeStorage _children; │ │ │ │ │ - 239 }; │ │ │ │ │ - 240 │ │ │ │ │ - 242 │ │ │ │ │ - 243 } // namespace TypeTree │ │ │ │ │ - 244} //namespace Dune │ │ │ │ │ - 245 │ │ │ │ │ - 246#endif // DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ -typetraits.hh │ │ │ │ │ -childextraction.hh │ │ │ │ │ -Dune::TypeTree::child │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: childextraction.hh:126 │ │ │ │ │ + 93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ +_reduction │ │ │ │ │ +R _reduction │ │ │ │ │ +Definition: traversalutilities.hh:47 │ │ │ │ │ +_functor │ │ │ │ │ +F _functor │ │ │ │ │ +Definition: traversalutilities.hh:46 │ │ │ │ │ +treePathType │ │ │ │ │ +static const TreePathType::Type treePathType │ │ │ │ │ +Definition: traversalutilities.hh:30 │ │ │ │ │ +_value │ │ │ │ │ +ResultType _value │ │ │ │ │ +Definition: traversalutilities.hh:48 │ │ │ │ │ +traversal.hh │ │ │ │ │ +result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:110 │ │ │ │ │ +Dune::TypeTree::reduceOverLeafs │ │ │ │ │ +ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType │ │ │ │ │ +startValue) │ │ │ │ │ +Calculate a quantity as a reduction over the leaf nodes of a TypeTree. │ │ │ │ │ +Definition: traversalutilities.hh:81 │ │ │ │ │ +Dune::TypeTree::applyToTree │ │ │ │ │ +void applyToTree(Tree &&tree, Visitor &&visitor) │ │ │ │ │ +Apply visitor to TypeTree. │ │ │ │ │ +Definition: traversal.hh:237 │ │ │ │ │ +Dune::TypeTree::treePath │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:191 │ │ │ │ │ +Dune::TypeTree::TreePath │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +Definition: treepath.hh:521 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ Dune::TypeTree::TreePathType::Type │ │ │ │ │ Type │ │ │ │ │ Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::CompositeNode │ │ │ │ │ -Base class for composite nodes based on variadic templates. │ │ │ │ │ -Definition: compositenode.hh:26 │ │ │ │ │ -Dune::TypeTree::CompositeNode::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -Definition: compositenode.hh:40 │ │ │ │ │ -Dune::TypeTree::CompositeNode::child │ │ │ │ │ -ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -Definition: compositenode.hh:168 │ │ │ │ │ -Dune::TypeTree::CompositeNode::isComposite │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a composite in the dune-typetree. │ │ │ │ │ -Definition: compositenode.hh:46 │ │ │ │ │ -Dune::TypeTree::CompositeNode::CHILDREN │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -Definition: compositenode.hh:50 │ │ │ │ │ -Dune::TypeTree::CompositeNode::CompositeNode │ │ │ │ │ -CompositeNode() │ │ │ │ │ -Default constructor. │ │ │ │ │ -Definition: compositenode.hh:216 │ │ │ │ │ -Dune::TypeTree::CompositeNode::NodeTag │ │ │ │ │ -CompositeNodeTag NodeTag │ │ │ │ │ -The type tag that describes a CompositeNode. │ │ │ │ │ -Definition: compositenode.hh:31 │ │ │ │ │ -Dune::TypeTree::CompositeNode::setChild │ │ │ │ │ -void setChild(typename Child< k >::Type &child, index_constant< k >={}) │ │ │ │ │ -Sets the k-th child to the passed-in value. │ │ │ │ │ -Definition: compositenode.hh:115 │ │ │ │ │ -Dune::TypeTree::CompositeNode::setChild │ │ │ │ │ -void setChild(typename Child< k >::Type &&child, index_constant< k >={}) │ │ │ │ │ -Store the passed value in k-th child. │ │ │ │ │ -Definition: compositenode.hh:122 │ │ │ │ │ -Dune::TypeTree::CompositeNode::degree │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -Definition: compositenode.hh:52 │ │ │ │ │ -Dune::TypeTree::CompositeNode::nodeStorage │ │ │ │ │ -const NodeStorage & nodeStorage() const │ │ │ │ │ -Definition: compositenode.hh:134 │ │ │ │ │ -Dune::TypeTree::CompositeNode::CompositeNode │ │ │ │ │ -CompositeNode(std::shared_ptr< Children >... children) │ │ │ │ │ -Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ -Definition: compositenode.hh:226 │ │ │ │ │ -Dune::TypeTree::CompositeNode::childStorage │ │ │ │ │ -std::shared_ptr< typename Child< k >::Type > childStorage(index_constant< k >= │ │ │ │ │ -{}) │ │ │ │ │ -Returns the storage of the k-th child. │ │ │ │ │ -Definition: compositenode.hh:98 │ │ │ │ │ -Dune::TypeTree::CompositeNode::ChildTypes │ │ │ │ │ -std::tuple< Children... > ChildTypes │ │ │ │ │ -A tuple storing the types of all children. │ │ │ │ │ -Definition: compositenode.hh:37 │ │ │ │ │ -Dune::TypeTree::CompositeNode::setChild │ │ │ │ │ -void setChild(std::shared_ptr< typename Child< k >::Type > child, │ │ │ │ │ -index_constant< k >={}) │ │ │ │ │ -Sets the storage of the k-th child to the passed-in value. │ │ │ │ │ -Definition: compositenode.hh:129 │ │ │ │ │ -Dune::TypeTree::CompositeNode::child │ │ │ │ │ -const ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -Definition: compositenode.hh:188 │ │ │ │ │ -Dune::TypeTree::CompositeNode::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -Definition: compositenode.hh:43 │ │ │ │ │ -Dune::TypeTree::CompositeNode::childStorage │ │ │ │ │ -std::shared_ptr< const typename Child< k >::Type > childStorage(index_constant< │ │ │ │ │ -k >={}) const │ │ │ │ │ -Returns the storage of the k-th child (const version). │ │ │ │ │ -Definition: compositenode.hh:108 │ │ │ │ │ -Dune::TypeTree::CompositeNode::child │ │ │ │ │ -Child< k >::Type & child(index_constant< k >={}) │ │ │ │ │ -Returns the k-th child. │ │ │ │ │ -Definition: compositenode.hh:78 │ │ │ │ │ -Dune::TypeTree::CompositeNode::CompositeNode │ │ │ │ │ -CompositeNode(const NodeStorage &children) │ │ │ │ │ -Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ -Definition: compositenode.hh:231 │ │ │ │ │ -Dune::TypeTree::CompositeNode::NodeStorage │ │ │ │ │ -std::tuple< std::shared_ptr< Children >... > NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -Definition: compositenode.hh:34 │ │ │ │ │ -Dune::TypeTree::CompositeNode::child │ │ │ │ │ -const Child< k >::Type & child(index_constant< k >={}) const │ │ │ │ │ -Returns the k-th child (const version). │ │ │ │ │ -Definition: compositenode.hh:88 │ │ │ │ │ -Dune::TypeTree::CompositeNode::Child │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -Definition: compositenode.hh:59 │ │ │ │ │ -Dune::TypeTree::CompositeNode::Child::Type │ │ │ │ │ -std::tuple_element< k, ChildTypes >::type Type │ │ │ │ │ -The type of the child. │ │ │ │ │ -Definition: compositenode.hh:64 │ │ │ │ │ -Dune::TypeTree::CompositeNode::Child::type │ │ │ │ │ -std::tuple_element< k, ChildTypes >::type type │ │ │ │ │ -The type of the child. │ │ │ │ │ -Definition: compositenode.hh:67 │ │ │ │ │ -Dune::TypeTree::CompositeNodeTag │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -Definition: nodetags.hh:25 │ │ │ │ │ -Dune::TypeTree::IsTreePath │ │ │ │ │ -Check if type represents a tree path. │ │ │ │ │ -Definition: typetraits.hh:182 │ │ │ │ │ +Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ +@ dynamic │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html │ │ │ │ @@ -70,17 +70,17 @@ │ │ │ │ Classes | │ │ │ │ Namespaces │ │ │ │
generictransformationdescriptors.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │
#include <array>
│ │ │ │ #include <memory>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/powercompositenodetransformationtemplates.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/powercompositenodetransformationtemplates.hh>
│ │ │ │ #include <dune/common/exceptions.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html │ │ │ │ @@ -74,17 +74,17 @@ │ │ │ │
3
│ │ │ │
4#ifndef DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
│ │ │ │
5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
│ │ │ │
6
│ │ │ │
7#include <array>
│ │ │ │
8#include <memory>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
13#include <dune/common/exceptions.hh>
│ │ │ │
14
│ │ │ │
15
│ │ │ │
16namespace Dune {
│ │ │ │
17 namespace TypeTree {
│ │ │ │
18
│ │ │ │
24 template<typename SourceNode, typename Transformation, typename TransformedNode>
│ │ │ │ @@ -250,17 +250,17 @@ │ │ │ │
184 {};
│ │ │ │
185
│ │ │ │
187
│ │ │ │
188 } // namespace TypeTree
│ │ │ │
189} //namespace Dune
│ │ │ │
190
│ │ │ │
191#endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:113
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │
Definition: generictransformationdescriptors.hh:26
│ │ │ │
TransformedNode transformed_type
Definition: generictransformationdescriptors.hh:30
│ │ │ │
std::shared_ptr< transformed_type > transformed_storage_type
Definition: generictransformationdescriptors.hh:31
│ │ │ │
static transformed_type transform(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: generictransformationdescriptors.hh:38
│ │ │ │
static const bool recursive
Definition: generictransformationdescriptors.hh:28
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -216,17 +216,17 @@ │ │ │ │ │ 184 {}; │ │ │ │ │ 185 │ │ │ │ │ 187 │ │ │ │ │ 188 } // namespace TypeTree │ │ │ │ │ 189} //namespace Dune │ │ │ │ │ 190 │ │ │ │ │ 191#endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ nodetags.hh │ │ │ │ │ powercompositenodetransformationtemplates.hh │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ Dune::TypeTree::StaticDegree │ │ │ │ │ decltype(Node::degree()) StaticDegree │ │ │ │ │ Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ integral_constant. │ │ │ │ │ Definition: nodeinterface.hh:113 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: accumulate_static.hh File Reference │ │ │ │ +dune-typetree: filters.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,133 +64,71 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
accumulate_static.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
filters.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ +
#include <tuple>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::GenericLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::or_< result_type >
 Statically combine two values of type result_type using ||. More...
struct  Dune::TypeTree::FilterEntry< new_k, old_k >
 A filter entry describing the mapping of one child in the filtered node. More...
 
struct  Dune::TypeTree::or_< result_type >::reduce< r1, r2 >
struct  Dune::TypeTree::FilterResult< FilterEntries >
 The result of a filter. More...
 
struct  Dune::TypeTree::and_< result_type >
 Statically combine two values of type result_type using &&. More...
struct  Dune::TypeTree::FilterResult< FilterEntries >::apply< Node >
 
struct  Dune::TypeTree::and_< result_type >::reduce< r1, r2 >
struct  Dune::TypeTree::SimpleFilterTag
 Tag describing a simple filter that can only decide whether or not to include a single given child. More...
 
struct  Dune::TypeTree::plus< result_type >
 Statically combine two values of type result_type using +. More...
struct  Dune::TypeTree::AdvancedFilterTag
 Tag describing an advanced filter that has full control over the construction of the list of FilterEntries. More...
 
struct  Dune::TypeTree::plus< result_type >::reduce< r1, r2 >
struct  Dune::TypeTree::AdvancedFilter
 Base class for advanced filters. More...
 
struct  Dune::TypeTree::minus< result_type >
 Statically combine two values of type result_type using -. More...
struct  Dune::TypeTree::AdvancedFilter::apply< Node, Children >
 Apply this filter to the given node and children. More...
 
struct  Dune::TypeTree::minus< result_type >::reduce< r1, r2 >
struct  Dune::TypeTree::SimpleFilter
 Default simple filter that accepts any node and leaves its child structure unchanged. More...
 
struct  Dune::TypeTree::multiply< result_type >
 Statically combine two values of type result_type using *. More...
struct  Dune::TypeTree::SimpleFilter::validate< Node >
 Validates the combination of filter and node. More...
 
struct  Dune::TypeTree::multiply< result_type >::reduce< r1, r2 >
struct  Dune::TypeTree::SimpleFilter::apply< Child, new_index, old_index >
 Applies the filter to the given child node. More...
 
struct  Dune::TypeTree::min< result_type >
 Statically combine two values of type result_type by returning their minimum. More...
struct  Dune::TypeTree::IndexFilter< indices >
 Filter class for FilteredCompositeNode that selects the children with the given indices. More...
 
struct  Dune::TypeTree::min< result_type >::reduce< r1, r2 >
struct  Dune::TypeTree::filter< Filter >
 Adapter class that takes a SimpleFilter, validated it and turns it into an AdvancedFilter. More...
 
struct  Dune::TypeTree::max< result_type >
 Statically combine two values of type result_type by returning their maximum. More...
 
struct  Dune::TypeTree::max< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction >
 Statically accumulate a value over the nodes of a TypeTree. More...
 
struct  Dune::TypeTree::TypeAccumulationPolicy< Functor, Reduction, StartType, ParentChildReduction, ReductionAlgorithm >
 
struct  Dune::TypeTree::AccumulateType< Tree, Policy >
 Statically accumulate a type over the nodes of a TypeTree. More...
struct  Dune::TypeTree::filter< Filter >::apply< Node, Children >
 Apply the filter. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Experimental
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Functions

template<typename Tree , typename Visitor , typename Init >
auto Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor &&visitor, Init &&init)
 Apply hybrid visitor to TypeTree. More...
 
│ │ │ │ -

Variable Documentation

│ │ │ │ - │ │ │ │ -

◆ child_result

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result
│ │ │ │ -
│ │ │ │ -static
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -

◆ result

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
const result_type result = current_value
│ │ │ │ -
│ │ │ │ -static
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,85 +4,65 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -accumulate_static.hh File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +filters.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::or_<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type using ||. More... │ │ │ │ │ +struct  Dune::TypeTree::FilterEntry<_new_k,_old_k_> │ │ │ │ │ +  A filter entry describing the mapping of one child in the filtered │ │ │ │ │ + node. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::or_<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +struct  Dune::TypeTree::FilterResult<_FilterEntries_> │ │ │ │ │ +  The result of a filter. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::and_<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type using &&. More... │ │ │ │ │ +struct  Dune::TypeTree::FilterResult<_FilterEntries_>::apply<_Node_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::and_<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +struct  Dune::TypeTree::SimpleFilterTag │ │ │ │ │ +  Tag describing a simple filter that can only decide whether or not to │ │ │ │ │ + include a single given child. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::plus<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type using +. More... │ │ │ │ │ +struct  Dune::TypeTree::AdvancedFilterTag │ │ │ │ │ +  Tag describing an advanced filter that has full control over the │ │ │ │ │ + construction of the list of FilterEntries. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::plus<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +struct  Dune::TypeTree::AdvancedFilter │ │ │ │ │ +  Base class for advanced filters. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::minus<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type using -. More... │ │ │ │ │ +struct  Dune::TypeTree::AdvancedFilter::apply<_Node,_Children_> │ │ │ │ │ +  Apply this filter to the given node and children. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::minus<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +struct  Dune::TypeTree::SimpleFilter │ │ │ │ │ +  Default simple filter that accepts any node and leaves its child │ │ │ │ │ + structure unchanged. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::multiply<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type using *. More... │ │ │ │ │ +struct  Dune::TypeTree::SimpleFilter::validate<_Node_> │ │ │ │ │ +  Validates the combination of filter and node. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::multiply<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +struct  Dune::TypeTree::SimpleFilter::apply<_Child,_new_index,_old_index_> │ │ │ │ │ +  Applies the filter to the given child node. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::min<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type by returning their │ │ │ │ │ - minimum. More... │ │ │ │ │ +struct  Dune::TypeTree::IndexFilter<_indices_> │ │ │ │ │ +  Filter class for FilteredCompositeNode that selects the children with │ │ │ │ │ + the given indices. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::min<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +struct  Dune::TypeTree::filter<_Filter_> │ │ │ │ │ +  Adapter class that takes a SimpleFilter, validated it and turns it │ │ │ │ │ + into an AdvancedFilter. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::max<_result_type_> │ │ │ │ │ -  Statically combine two values of type result_type by returning their │ │ │ │ │ - maximum. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::max<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::AccumulateValue<_Tree,_Functor,_Reduction,_startValue, │ │ │ │ │ - ParentChildReduction_> │ │ │ │ │ -  Statically accumulate a value over the nodes of a TypeTree. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TypeAccumulationPolicy<_Functor,_Reduction,_StartType, │ │ │ │ │ - ParentChildReduction,_ReductionAlgorithm_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::AccumulateType<_Tree,_Policy_> │ │ │ │ │ -  Statically accumulate a type over the nodes of a TypeTree. More... │ │ │ │ │ +struct  Dune::TypeTree::filter<_Filter_>::apply<_Node,_Children_> │ │ │ │ │ +  Apply the filter. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::Experimental │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -auto Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor │ │ │ │ │ - &&visitor, Init &&init) │ │ │ │ │ -  Apply hybrid visitor to TypeTree. More... │ │ │ │ │ -  │ │ │ │ │ -***** Variable Documentation ***** │ │ │ │ │ -***** ◆ child_result ***** │ │ │ │ │ -const result_type child_result = │ │ │ │ │ -accumulate_value>:: static │ │ │ │ │ -result │ │ │ │ │ -***** ◆ result ***** │ │ │ │ │ -const result_type result = current_value static │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00038_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: accumulate_static.hh Source File │ │ │ │ +dune-typetree: filters.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,553 +62,238 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
accumulate_static.hh
│ │ │ │ +
filters.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ -
5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_FILTERS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_FILTERS_HH
│ │ │ │
6
│ │ │ │ -
7#include <dune/common/typetraits.hh>
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
11
│ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14 namespace TypeTree {
│ │ │ │ -
15
│ │ │ │ -
22 template<typename result_type>
│ │ │ │ -
23 struct or_
│ │ │ │ -
24 {
│ │ │ │ -
25 template<result_type r1, result_type r2>
│ │ │ │ -
26 struct reduce
│ │ │ │ -
27 {
│ │ │ │ -
28 static const result_type result = r1 || r2;
│ │ │ │ -
29 };
│ │ │ │ -
30 };
│ │ │ │ -
31
│ │ │ │ -
33 template<typename result_type>
│ │ │ │ -
34 struct and_
│ │ │ │ -
35 {
│ │ │ │ -
36 template<result_type r1, result_type r2>
│ │ │ │ -
37 struct reduce
│ │ │ │ -
38 {
│ │ │ │ -
39 static const result_type result = r1 && r2;
│ │ │ │ -
40 };
│ │ │ │ -
41 };
│ │ │ │ -
42
│ │ │ │ -
44 template<typename result_type>
│ │ │ │ -
45 struct plus
│ │ │ │ -
46 {
│ │ │ │ -
47 template<result_type r1, result_type r2>
│ │ │ │ -
48 struct reduce
│ │ │ │ -
49 {
│ │ │ │ -
50 static const result_type result = r1 + r2;
│ │ │ │ -
51 };
│ │ │ │ +
7#include <tuple>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/typetraits.hh>
│ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12 namespace TypeTree {
│ │ │ │ +
13
│ │ │ │ +
20 template<std::size_t new_k, std::size_t old_k>
│ │ │ │ + │ │ │ │ +
22 {
│ │ │ │ +
23
│ │ │ │ +
24#ifndef DOXYGEN
│ │ │ │ +
25
│ │ │ │ +
26 // The precise contents of this class is an implementation detail.
│ │ │ │ +
27
│ │ │ │ +
28 static const std::size_t filtered_index = new_k;
│ │ │ │ +
29 static const std::size_t original_index = old_k;
│ │ │ │ +
30
│ │ │ │ +
31#endif // DOXYGEN
│ │ │ │ +
32
│ │ │ │ +
33 };
│ │ │ │ +
34
│ │ │ │ +
36 template<typename... FilterEntries>
│ │ │ │ + │ │ │ │ +
38 {
│ │ │ │ +
39
│ │ │ │ +
40 static const std::size_t size = sizeof...(FilterEntries);
│ │ │ │ +
41
│ │ │ │ +
42 typedef std::tuple<FilterEntries...> IndexMap;
│ │ │ │ +
43
│ │ │ │ +
44 template<typename Node>
│ │ │ │ +
45 struct apply
│ │ │ │ +
46 {
│ │ │ │ +
47 typedef std::tuple<typename Node::template Child<FilterEntries::original_index>...> Children;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
50 };
│ │ │ │ +
51
│ │ │ │
52 };
│ │ │ │
53
│ │ │ │ -
55 template<typename result_type>
│ │ │ │ -
56 struct minus
│ │ │ │ -
57 {
│ │ │ │ -
58 template<result_type r1, result_type r2>
│ │ │ │ -
59 struct reduce
│ │ │ │ -
60 {
│ │ │ │ -
61 static const result_type result = r1 - r2;
│ │ │ │ -
62 };
│ │ │ │ -
63 };
│ │ │ │ +
55 struct SimpleFilterTag {};
│ │ │ │ +
56
│ │ │ │ + │ │ │ │ +
59
│ │ │ │ +
60
│ │ │ │ + │ │ │ │ +
63 {
│ │ │ │
64
│ │ │ │ -
66 template<typename result_type>
│ │ │ │ -
67 struct multiply
│ │ │ │ -
68 {
│ │ │ │ -
69 template<result_type r1, result_type r2>
│ │ │ │ -
70 struct reduce
│ │ │ │ -
71 {
│ │ │ │ -
72 static const result_type result = r1 * r2;
│ │ │ │ -
73 };
│ │ │ │ -
74 };
│ │ │ │ + │ │ │ │ +
67
│ │ │ │ +
68#ifdef DOXYGEN
│ │ │ │ +
69
│ │ │ │ +
71 template<typename Node, typename... Children>
│ │ │ │ +
72 struct apply
│ │ │ │ +
73 {
│ │ │ │
75
│ │ │ │ -
77 template<typename result_type>
│ │ │ │ -
78 struct min
│ │ │ │ -
79 {
│ │ │ │ -
80 template<result_type r1, result_type r2>
│ │ │ │ -
81 struct reduce
│ │ │ │ -
82 {
│ │ │ │ -
83 static const result_type result = r1 < r2 ? r1 : r2;
│ │ │ │ -
84 };
│ │ │ │ -
85 };
│ │ │ │ +
78 typedef implementation-defined type;
│ │ │ │ +
79 };
│ │ │ │ +
80
│ │ │ │ +
81#endif // DOXYGEN
│ │ │ │ +
82
│ │ │ │ +
83 };
│ │ │ │ +
84
│ │ │ │
86
│ │ │ │ -
88 template<typename result_type>
│ │ │ │ -
89 struct max
│ │ │ │ -
90 {
│ │ │ │ -
91 template<result_type r1, result_type r2>
│ │ │ │ -
92 struct reduce
│ │ │ │ -
93 {
│ │ │ │ -
94 static const result_type result = r1 > r2 ? r1 : r2;
│ │ │ │ -
95 };
│ │ │ │ -
96 };
│ │ │ │ + │ │ │ │ +
92 {
│ │ │ │ +
93
│ │ │ │ + │ │ │ │ +
96
│ │ │ │
97
│ │ │ │ -
98
│ │ │ │ -
99 namespace {
│ │ │ │ -
100
│ │ │ │ -
101 // implementation of the traversal algorithm
│ │ │ │ -
102
│ │ │ │ -
104 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath, bool doVisit>
│ │ │ │ -
105 struct accumulate_node_helper
│ │ │ │ -
106 {
│ │ │ │ +
99 template<typename Node>
│ │ │ │ +
100 struct validate
│ │ │ │ +
101 {
│ │ │ │ +
103 static const bool value = true;
│ │ │ │ +
104 };
│ │ │ │ +
105
│ │ │ │
107
│ │ │ │ -
108 typedef typename Functor::result_type result_type;
│ │ │ │ -
109
│ │ │ │ -
110 static const result_type result = current_value;
│ │ │ │ -
111
│ │ │ │ -
112 };
│ │ │ │ -
113
│ │ │ │ -
115 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ -
116 struct accumulate_node_helper<Node,Functor,Reduction,current_value,TreePath,true>
│ │ │ │ +
115 template<typename Child, std::size_t new_index, std::size_t old_index>
│ │ │ │ +
116 struct apply
│ │ │ │
117 {
│ │ │ │ -
118
│ │ │ │ -
119 typedef typename Functor::result_type result_type;
│ │ │ │ -
120
│ │ │ │ -
121 static const result_type result = Reduction::template reduce<current_value,Functor::template visit<Node,TreePath>::result>::result;
│ │ │ │ -
122
│ │ │ │ -
123 };
│ │ │ │ -
124
│ │ │ │ -
126 template<typename Tree, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, typename Tag>
│ │ │ │ -
127 struct accumulate_value;
│ │ │ │ -
128
│ │ │ │ -
130 template<typename LeafNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ -
131 struct accumulate_value<LeafNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,LeafNodeTag>
│ │ │ │ +
119 static const bool value = true;
│ │ │ │ +
120 };
│ │ │ │ +
121
│ │ │ │ +
122 };
│ │ │ │ +
123
│ │ │ │ +
124 namespace {
│ │ │ │ +
125
│ │ │ │ +
126 // ********************************************************************************
│ │ │ │ +
127 // IndexFilter helpers
│ │ │ │ +
128 // ********************************************************************************
│ │ │ │ +
129
│ │ │ │ +
130 template<typename Node, std::size_t new_index, std::size_t... indices>
│ │ │ │ +
131 struct index_filter_helper
│ │ │ │
132 {
│ │ │ │ -
133
│ │ │ │ -
134 typedef typename Functor::result_type result_type;
│ │ │ │ -
135
│ │ │ │ -
136 static const result_type result =
│ │ │ │ -
137
│ │ │ │ -
138 accumulate_node_helper<LeafNode,Functor,Reduction,current_value,TreePath,Functor::template doVisit<LeafNode,TreePath>::value>::result;
│ │ │ │ +
133 template<typename... FilterEntries>
│ │ │ │ +
134 struct apply
│ │ │ │ +
135 {
│ │ │ │ +
136 typedef FilterResult<FilterEntries...> type;
│ │ │ │ +
137 };
│ │ │ │ +
138 };
│ │ │ │
139
│ │ │ │ -
140 };
│ │ │ │ -
141
│ │ │ │ -
143 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t i, std::size_t n>
│ │ │ │ -
144 struct accumulate_over_children
│ │ │ │ -
145 {
│ │ │ │ -
146
│ │ │ │ -
147 typedef typename Functor::result_type result_type;
│ │ │ │ -
148
│ │ │ │ -
149 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
│ │ │ │ -
150
│ │ │ │ -
151 typedef typename Node::template Child<i>::Type child;
│ │ │ │ -
152
│ │ │ │ -
153 static const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result;
│ │ │ │ +
140 template<typename Node, std::size_t new_index, std::size_t old_index, std::size_t... indices>
│ │ │ │ +
141 struct index_filter_helper<Node,new_index,old_index,indices...>
│ │ │ │ +
142 {
│ │ │ │ +
143 template<typename... FilterEntries>
│ │ │ │ +
144 struct apply
│ │ │ │ +
145 : public index_filter_helper<Node,new_index+1,indices...>::template apply<FilterEntries...,
│ │ │ │ +
146 FilterEntry<new_index,
│ │ │ │ +
147 old_index>
│ │ │ │ +
148 >
│ │ │ │ +
149 {};
│ │ │ │ +
150 };
│ │ │ │ +
151
│ │ │ │ +
152 } // anonymous namespace
│ │ │ │ +
153
│ │ │ │
154
│ │ │ │ -
155 static const result_type result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,child_result,TreePath,i+1,n>::result;
│ │ │ │ -
156
│ │ │ │ -
157 };
│ │ │ │ -
158
│ │ │ │ -
160 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t n>
│ │ │ │ -
161 struct accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,n,n>
│ │ │ │ -
162 {
│ │ │ │ -
163
│ │ │ │ -
164 typedef typename Functor::result_type result_type;
│ │ │ │ -
165
│ │ │ │ -
166 static const result_type result = current_value;
│ │ │ │ -
167
│ │ │ │ -
168 };
│ │ │ │ -
169
│ │ │ │ -
172 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ -
173 struct accumulate_value_generic_composite_node
│ │ │ │ -
174 {
│ │ │ │ -
175
│ │ │ │ -
176 typedef typename Functor::result_type result_type;
│ │ │ │ -
177
│ │ │ │ -
178 static const result_type child_result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,0,StaticDegree<Node>::value>::result;
│ │ │ │ -
179
│ │ │ │ -
180 static const result_type result =
│ │ │ │ -
181 accumulate_node_helper<Node,Functor,ParentChildReduction,child_result,TreePath,Functor::template doVisit<Node,TreePath>::value>::result;
│ │ │ │ -
182
│ │ │ │ -
183
│ │ │ │ -
184 };
│ │ │ │ -
185
│ │ │ │ -
187 template<typename PowerNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ -
188 struct accumulate_value<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,PowerNodeTag>
│ │ │ │ -
189 : public accumulate_value_generic_composite_node<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
│ │ │ │ -
190 {};
│ │ │ │ -
191
│ │ │ │ -
193 template<typename CompositeNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ -
194 struct accumulate_value<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,CompositeNodeTag>
│ │ │ │ -
195 : public accumulate_value_generic_composite_node<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
│ │ │ │ -
196 {};
│ │ │ │ -
197
│ │ │ │ -
198 } // anonymous namespace
│ │ │ │ -
199
│ │ │ │ -
201
│ │ │ │ -
257 template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>
│ │ │ │ - │ │ │ │ -
259 {
│ │ │ │ -
260
│ │ │ │ -
262 typedef typename Functor::result_type result_type;
│ │ │ │ -
263
│ │ │ │ -
265 static const result_type result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result;
│ │ │ │ -
266
│ │ │ │ -
267 };
│ │ │ │ -
268
│ │ │ │ -
271 struct flattened_reduction;
│ │ │ │ -
272
│ │ │ │ -
275 struct bottom_up_reduction;
│ │ │ │ -
276
│ │ │ │ -
277 namespace {
│ │ │ │ -
278
│ │ │ │ -
279 // implementation of the traversal algorithm
│ │ │ │ -
280
│ │ │ │ -
283 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath, bool doVisit>
│ │ │ │ -
284 struct accumulate_type_node_helper
│ │ │ │ -
285 {
│ │ │ │ -
286
│ │ │ │ -
287 typedef current_type type;
│ │ │ │ -
288
│ │ │ │ -
289 };
│ │ │ │ -
290
│ │ │ │ -
292 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath>
│ │ │ │ -
293 struct accumulate_type_node_helper<Node,Functor,Reduction,current_type,TreePath,true>
│ │ │ │ -
294 {
│ │ │ │ -
295
│ │ │ │ -
296 typedef typename Reduction::template reduce<
│ │ │ │ -
297 current_type,
│ │ │ │ -
298 typename Functor::template visit<
│ │ │ │ -
299 Node,
│ │ │ │ - │ │ │ │ -
301 >::type
│ │ │ │ -
302 >::type type;
│ │ │ │ -
303
│ │ │ │ -
304 };
│ │ │ │ -
305
│ │ │ │ -
307 template<typename Tree, typename Policy, typename current_type, typename TreePath, typename Tag>
│ │ │ │ -
308 struct accumulate_type;
│ │ │ │ -
309
│ │ │ │ -
311 template<typename LeafNode, typename Policy, typename current_type, typename TreePath>
│ │ │ │ -
312 struct accumulate_type<LeafNode,Policy,current_type,TreePath,LeafNodeTag>
│ │ │ │ -
313 {
│ │ │ │ -
314
│ │ │ │ -
315 typedef typename accumulate_type_node_helper<
│ │ │ │ -
316 LeafNode,
│ │ │ │ -
317 typename Policy::functor,
│ │ │ │ -
318 typename Policy::sibling_reduction,
│ │ │ │ -
319 current_type,
│ │ │ │ -
320 TreePath,
│ │ │ │ -
321 Policy::functor::template doVisit<
│ │ │ │ -
322 LeafNode,
│ │ │ │ -
323 TreePath>::value
│ │ │ │ -
324 >::type type;
│ │ │ │ -
325
│ │ │ │ -
326 };
│ │ │ │ -
327
│ │ │ │ -
328
│ │ │ │ -
331 template<typename current_type, typename tree_path, typename start_type, typename reduction_strategy>
│ │ │ │ -
332 struct propagate_type_down_tree;
│ │ │ │ -
333
│ │ │ │ -
335 template<typename current_type, typename tree_path, typename start_type>
│ │ │ │ -
336 struct propagate_type_down_tree<
│ │ │ │ -
337 current_type,
│ │ │ │ -
338 tree_path,
│ │ │ │ -
339 start_type,
│ │ │ │ -
340 bottom_up_reduction
│ │ │ │ -
341 >
│ │ │ │ -
342 {
│ │ │ │ -
343 typedef current_type type;
│ │ │ │ -
344 };
│ │ │ │ -
345
│ │ │ │ -
347 template<typename current_type, typename tree_path, typename start_type>
│ │ │ │ -
348 struct propagate_type_down_tree<
│ │ │ │ -
349 current_type,
│ │ │ │ -
350 tree_path,
│ │ │ │ -
351 start_type,
│ │ │ │ -
352 flattened_reduction
│ │ │ │ -
353 >
│ │ │ │ -
354 {
│ │ │ │ -
355 typedef typename std::conditional<
│ │ │ │ -
356 TreePathBack<tree_path>::value == 0,
│ │ │ │ -
357 start_type,
│ │ │ │ -
358 current_type
│ │ │ │ -
359 >::type type;
│ │ │ │ -
360 };
│ │ │ │ -
361
│ │ │ │ -
362
│ │ │ │ -
364 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t i, std::size_t n>
│ │ │ │ -
365 struct accumulate_type_over_children
│ │ │ │ -
366 {
│ │ │ │ -
367
│ │ │ │ -
368 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
│ │ │ │ -
369
│ │ │ │ -
370 typedef typename Node::template Child<i>::Type child;
│ │ │ │ -
371
│ │ │ │ -
372 typedef typename accumulate_type<
│ │ │ │ -
373 child,
│ │ │ │ -
374 Policy,
│ │ │ │ -
375 // apply reduction choice (flat / hierarchic)
│ │ │ │ -
376 typename propagate_type_down_tree<
│ │ │ │ -
377 current_type,
│ │ │ │ -
378 child_tree_path,
│ │ │ │ -
379 typename Policy::start_type,
│ │ │ │ -
380 typename Policy::reduction_strategy
│ │ │ │ -
381 >::type,
│ │ │ │ -
382 child_tree_path,
│ │ │ │ - │ │ │ │ -
384 >::type child_result_type;
│ │ │ │ -
385
│ │ │ │ -
386 typedef typename accumulate_type_over_children<
│ │ │ │ -
387 Node,
│ │ │ │ -
388 Policy,
│ │ │ │ -
389 child_result_type,
│ │ │ │ -
390 TreePath,
│ │ │ │ -
391 i+1,
│ │ │ │ -
392 n
│ │ │ │ -
393 >::type type;
│ │ │ │ -
394
│ │ │ │ -
395 };
│ │ │ │ -
396
│ │ │ │ -
398 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t n>
│ │ │ │ -
399 struct accumulate_type_over_children<Node,Policy,current_type,TreePath,n,n>
│ │ │ │ -
400 {
│ │ │ │ -
401
│ │ │ │ -
402 typedef current_type type;
│ │ │ │ -
403
│ │ │ │ -
404 };
│ │ │ │ -
405
│ │ │ │ -
406
│ │ │ │ -
409 template<typename Node, typename Policy, typename current_type, typename TreePath>
│ │ │ │ -
410 struct accumulate_type_generic_composite_node
│ │ │ │ -
411 {
│ │ │ │ -
412
│ │ │ │ -
413 typedef typename accumulate_type_over_children<
│ │ │ │ -
414 Node,
│ │ │ │ -
415 Policy,
│ │ │ │ -
416 current_type,
│ │ │ │ -
417 TreePath,
│ │ │ │ -
418 0,
│ │ │ │ -
419 StaticDegree<Node>::value
│ │ │ │ -
420 >::type children_result_type;
│ │ │ │ -
421
│ │ │ │ -
422 typedef typename accumulate_type_node_helper<
│ │ │ │ -
423 Node,
│ │ │ │ -
424 typename Policy::functor,
│ │ │ │ -
425 typename Policy::parent_child_reduction,
│ │ │ │ -
426 children_result_type,
│ │ │ │ -
427 TreePath,
│ │ │ │ -
428 Policy::functor::template doVisit<
│ │ │ │ -
429 Node,
│ │ │ │ - │ │ │ │ -
431 >::value
│ │ │ │ -
432 >::type type;
│ │ │ │ -
433
│ │ │ │ -
434 };
│ │ │ │ -
435
│ │ │ │ -
437 template<typename PowerNode, typename Policy, typename current_type, typename TreePath>
│ │ │ │ -
438 struct accumulate_type<PowerNode,Policy,current_type,TreePath,PowerNodeTag>
│ │ │ │ -
439 : public accumulate_type_generic_composite_node<PowerNode,Policy,current_type,TreePath>
│ │ │ │ -
440 {};
│ │ │ │ -
441
│ │ │ │ -
443 template<typename CompositeNode, typename Policy, typename current_type, typename TreePath>
│ │ │ │ -
444 struct accumulate_type<CompositeNode,Policy,current_type,TreePath,CompositeNodeTag>
│ │ │ │ -
445 : public accumulate_type_generic_composite_node<CompositeNode,Policy,current_type,TreePath>
│ │ │ │ -
446 {};
│ │ │ │ -
447
│ │ │ │ -
448 } // anonymous namespace
│ │ │ │ -
449
│ │ │ │ -
450
│ │ │ │ -
458 template<
│ │ │ │ -
459 typename Functor,
│ │ │ │ -
460 typename Reduction,
│ │ │ │ -
461 typename StartType,
│ │ │ │ -
462 typename ParentChildReduction = Reduction,
│ │ │ │ -
463 typename ReductionAlgorithm = flattened_reduction
│ │ │ │ -
464 >
│ │ │ │ - │ │ │ │ -
466 {
│ │ │ │ -
467
│ │ │ │ -
495 typedef Functor functor;
│ │ │ │ -
496
│ │ │ │ -
516 typedef Reduction sibling_reduction;
│ │ │ │ -
517
│ │ │ │ -
524 typedef ParentChildReduction parent_child_reduction;
│ │ │ │ -
525
│ │ │ │ -
532 typedef StartType start_type;
│ │ │ │ -
533
│ │ │ │ -
538 typedef ReductionAlgorithm reduction_strategy;
│ │ │ │ -
539 };
│ │ │ │ -
540
│ │ │ │ -
541
│ │ │ │ -
543
│ │ │ │ -
551 template<typename Tree, typename Policy>
│ │ │ │ - │ │ │ │ -
553 {
│ │ │ │ -
554
│ │ │ │ -
556 typedef typename accumulate_type<
│ │ │ │ -
557 Tree,
│ │ │ │ -
558 Policy,
│ │ │ │ -
559 typename Policy::start_type,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
562 >::type type;
│ │ │ │ -
563
│ │ │ │ -
564 };
│ │ │ │ -
565
│ │ │ │ -
566
│ │ │ │ -
567
│ │ │ │ -
568
│ │ │ │ -
569
│ │ │ │ -
570 /***************************************************/
│ │ │ │ -
571
│ │ │ │ -
572 namespace Experimental {
│ │ │ │ -
573 namespace Impl {
│ │ │ │ -
574
│ │ │ │ -
576 template<class T, class TreePath, class V, class U,
│ │ │ │ -
577 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ -
578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
│ │ │ │ -
579 {
│ │ │ │ -
580 return visitor.leaf(tree, treePath, std::forward<U>(current_val));
│ │ │ │ -
581 }
│ │ │ │ -
582
│ │ │ │ -
584 template<class T, class TreePath, class V, class U,
│ │ │ │ -
585 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ -
586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
│ │ │ │ -
587 {
│ │ │ │ -
588 using Tree = std::remove_reference_t<T>;
│ │ │ │ -
589 using Visitor = std::remove_reference_t<V>;
│ │ │ │ -
590 auto pre_val = visitor.pre(tree, treePath, std::forward<U>(current_val));
│ │ │ │ -
591
│ │ │ │ -
592 // check which type of traversal is supported by the tree
│ │ │ │ -
593 using allowDynamicTraversal = Dune::Std::is_detected<Detail::DynamicTraversalConcept,Tree>;
│ │ │ │ -
594 using allowStaticTraversal = Dune::Std::is_detected<Detail::StaticTraversalConcept,Tree>;
│ │ │ │ -
595
│ │ │ │ -
596 // the tree must support either dynamic or static traversal
│ │ │ │ -
597 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ -
598
│ │ │ │ -
599 // the visitor may specify preferred dynamic traversal
│ │ │ │ -
600 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
│ │ │ │ -
601
│ │ │ │ -
602 // declare rule that applies visitor and current value to a child i. Returns next value
│ │ │ │ -
603 auto apply_i = [&](auto&& value, const auto& i){
│ │ │ │ -
604 auto&& child = tree.child(i);
│ │ │ │ -
605 using Child = std::decay_t<decltype(child)>;
│ │ │ │ -
606
│ │ │ │ -
607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move(value));
│ │ │ │ -
608
│ │ │ │ -
609 // visits between children
│ │ │ │ -
610 auto val_in = Hybrid::ifElse(
│ │ │ │ -
611 Hybrid::equals(i,Indices::_0),
│ │ │ │ -
612 [&](auto id){return std::move(val_before);},
│ │ │ │ -
613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));}
│ │ │ │ -
614 );
│ │ │ │ -
615
│ │ │ │ -
616 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
│ │ │ │ -
617 auto val_visit = [&](){
│ │ │ │ -
618 if constexpr (visitChild) {
│ │ │ │ -
619 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ -
620 return hybridApplyToTree(child, childTreePath, visitor, std::move(val_in));
│ │ │ │ -
621 }
│ │ │ │ -
622 else
│ │ │ │ -
623 return std::move(val_in);
│ │ │ │ -
624 }();
│ │ │ │ -
625
│ │ │ │ -
626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit));
│ │ │ │ -
627 };
│ │ │ │ -
628
│ │ │ │ -
629 // apply visitor to children
│ │ │ │ -
630 auto in_val = [&](){
│ │ │ │ -
631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal::value) {
│ │ │ │ -
632 // get list of static indices
│ │ │ │ -
633 auto indices = std::make_index_sequence<Tree::degree()>{};
│ │ │ │ -
634
│ │ │ │ -
635 // unfold apply_i left to right
│ │ │ │ -
636 return unpackIntegerSequence([&](auto... i) {
│ │ │ │ -
656 return left_fold(std::move(apply_i),std::move(pre_val), i...);
│ │ │ │ -
657 }, indices);
│ │ │ │ -
658
│ │ │ │ -
659 } else {
│ │ │ │ -
660 // unfold first child to get type
│ │ │ │ -
661 auto i_val = apply_i(std::move(pre_val),std::size_t{0});
│ │ │ │ -
662 // dynamically loop rest of the children to accumulate remindng values
│ │ │ │ -
663 for(std::size_t i = 1; i < tree.degree(); i++)
│ │ │ │ -
664 i_val = apply_i(i_val,i);
│ │ │ │ -
665 return i_val;
│ │ │ │ -
666 }
│ │ │ │ -
667 }();
│ │ │ │ -
668
│ │ │ │ -
669 return visitor.post(tree, treePath, in_val);
│ │ │ │ -
670 }
│ │ │ │ -
671
│ │ │ │ -
672 }
│ │ │ │ -
673
│ │ │ │ -
697 template<typename Tree, typename Visitor, typename Init>
│ │ │ │ -
698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init)
│ │ │ │ -
699 {
│ │ │ │ -
700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init);
│ │ │ │ -
701 }
│ │ │ │ -
702
│ │ │ │ -
703 } // namespace Experimental
│ │ │ │ -
704
│ │ │ │ -
706 } // namespace TypeTree
│ │ │ │ -
707} //namespace Dune
│ │ │ │ -
708
│ │ │ │ -
709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ - │ │ │ │ -
static const result_type child_result
Definition: accumulate_static.hh:153
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │ - │ │ │ │ - │ │ │ │ -
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │ +
156 template<std::size_t... indices>
│ │ │ │ + │ │ │ │ +
158 : public AdvancedFilter
│ │ │ │ +
159 {
│ │ │ │ +
160
│ │ │ │ +
161#ifndef DOXYGEN
│ │ │ │ +
162
│ │ │ │ +
163 template<typename Node, typename... Children>
│ │ │ │ +
164 struct apply
│ │ │ │ +
165 {
│ │ │ │ +
166 typedef typename index_filter_helper<Node,0,indices...>::template apply<>::type type;
│ │ │ │ +
167 };
│ │ │ │ +
168
│ │ │ │ +
169#endif // DOXYGEN
│ │ │ │ +
170
│ │ │ │ +
171 };
│ │ │ │ +
172
│ │ │ │ +
173
│ │ │ │ +
174 // ********************************************************************************
│ │ │ │ +
175 // filter: Wrapper class for turning a simple filter into an advanced filter
│ │ │ │ +
176 // usable by FilteredCompositeNode
│ │ │ │ +
177 // ********************************************************************************
│ │ │ │ +
178
│ │ │ │ +
179 namespace {
│ │ │ │ +
180
│ │ │ │ +
181 template<typename Filter, std::size_t new_k, std::size_t old_k, typename... tail>
│ │ │ │ +
182 struct filter_helper
│ │ │ │ +
183 {
│ │ │ │ +
184 template<typename... FilterDescriptors>
│ │ │ │ +
185 struct apply
│ │ │ │ +
186 {
│ │ │ │ +
187 typedef FilterResult<FilterDescriptors...> type;
│ │ │ │ +
188 };
│ │ │ │ +
189 };
│ │ │ │ +
190
│ │ │ │ +
191 template<typename Filter, std::size_t new_k, std::size_t old_k, typename child, typename... tail>
│ │ │ │ +
192 struct filter_helper<Filter,new_k,old_k,child,tail...>
│ │ │ │ +
193 {
│ │ │ │ +
194
│ │ │ │ +
195 template<typename... FilterDescriptors>
│ │ │ │ +
196 struct apply
│ │ │ │ +
197 : public std::conditional<Filter::template apply<child,new_k,old_k>::value,
│ │ │ │ +
198 typename filter_helper<Filter,new_k+1,old_k+1,tail...>::template apply<FilterDescriptors...,FilterEntry<new_k,old_k> >,
│ │ │ │ +
199 typename filter_helper<Filter,new_k,old_k+1,tail...>::template apply<FilterDescriptors...>
│ │ │ │ +
200 >::type
│ │ │ │ +
201 {};
│ │ │ │ +
202
│ │ │ │ +
203 };
│ │ │ │ +
204
│ │ │ │ +
205 } // anonymous namespace
│ │ │ │ +
206
│ │ │ │ +
208 template<typename Filter>
│ │ │ │ +
209 struct filter
│ │ │ │ +
210 {
│ │ │ │ +
211
│ │ │ │ +
213 template<typename Node, typename... Children>
│ │ │ │ +
214 struct apply
│ │ │ │ +
215 {
│ │ │ │ +
216
│ │ │ │ +
217 static_assert((Filter::template validate<Node>::value),"Invalid simple filter");
│ │ │ │ +
218
│ │ │ │ +
219 typedef typename filter_helper<Filter,0,0,Children...>::template apply<>::type type;
│ │ │ │ +
220
│ │ │ │ +
221 };
│ │ │ │ +
222
│ │ │ │ +
223 };
│ │ │ │ +
224
│ │ │ │ +
226
│ │ │ │ +
227 } // namespace TypeTree
│ │ │ │ +
228} //namespace Dune
│ │ │ │ +
229
│ │ │ │ +
230#endif // DUNE_TYPETREE_FILTERS_HH
│ │ │ │
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ -
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ -
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ -
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ -
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ -
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
Apply hybrid visitor to TypeTree.
Definition: accumulate_static.hh:698
│ │ │ │
Type
Definition: treepath.hh:30
│ │ │ │ -
Statically combine two values of type result_type using ||.
Definition: accumulate_static.hh:24
│ │ │ │ -
Definition: accumulate_static.hh:27
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:28
│ │ │ │ -
Statically combine two values of type result_type using &&.
Definition: accumulate_static.hh:35
│ │ │ │ -
Definition: accumulate_static.hh:38
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:39
│ │ │ │ -
Statically combine two values of type result_type using +.
Definition: accumulate_static.hh:46
│ │ │ │ -
Definition: accumulate_static.hh:49
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:50
│ │ │ │ -
Statically combine two values of type result_type using -.
Definition: accumulate_static.hh:57
│ │ │ │ -
Definition: accumulate_static.hh:60
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:61
│ │ │ │ -
Statically combine two values of type result_type using *.
Definition: accumulate_static.hh:68
│ │ │ │ -
Definition: accumulate_static.hh:71
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:72
│ │ │ │ -
Statically combine two values of type result_type by returning their minimum.
Definition: accumulate_static.hh:79
│ │ │ │ -
Definition: accumulate_static.hh:82
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:83
│ │ │ │ -
Statically combine two values of type result_type by returning their maximum.
Definition: accumulate_static.hh:90
│ │ │ │ -
Definition: accumulate_static.hh:93
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:94
│ │ │ │ -
Statically accumulate a value over the nodes of a TypeTree.
Definition: accumulate_static.hh:259
│ │ │ │ -
Functor::result_type result_type
The result type of the computation.
Definition: accumulate_static.hh:262
│ │ │ │ -
static const result_type result
The accumulated result of the computation.
Definition: accumulate_static.hh:265
│ │ │ │ -
Definition: accumulate_static.hh:466
│ │ │ │ -
ParentChildReduction parent_child_reduction
Definition: accumulate_static.hh:524
│ │ │ │ -
Functor functor
Definition: accumulate_static.hh:495
│ │ │ │ -
StartType start_type
Definition: accumulate_static.hh:532
│ │ │ │ -
ReductionAlgorithm reduction_strategy
Definition: accumulate_static.hh:538
│ │ │ │ -
Reduction sibling_reduction
Definition: accumulate_static.hh:516
│ │ │ │ -
Statically accumulate a type over the nodes of a TypeTree.
Definition: accumulate_static.hh:553
│ │ │ │ -
accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, NodeTag< Tree > >::type type
The accumulated result of the computation.
Definition: accumulate_static.hh:562
│ │ │ │ -
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ +
A filter entry describing the mapping of one child in the filtered node.
Definition: filters.hh:22
│ │ │ │ +
The result of a filter.
Definition: filters.hh:38
│ │ │ │ +
std::tuple< FilterEntries... > IndexMap
Definition: filters.hh:42
│ │ │ │ +
static const std::size_t size
Definition: filters.hh:40
│ │ │ │ +
Definition: filters.hh:46
│ │ │ │ +
std::tuple< typename Node::template Child< FilterEntries::original_index >... > Children
Definition: filters.hh:47
│ │ │ │ +
std::tuple< typename Node::template Child< FilterEntries::original_index >::Type... > ChildTypes
Definition: filters.hh:48
│ │ │ │ +
std::tuple< std::shared_ptr< typename Node::template Child< FilterEntries::original_index >::Type >... > NodeStorage
Definition: filters.hh:49
│ │ │ │ +
Tag describing a simple filter that can only decide whether or not to include a single given child.
Definition: filters.hh:55
│ │ │ │ +
Tag describing an advanced filter that has full control over the construction of the list of FilterEn...
Definition: filters.hh:58
│ │ │ │ +
Base class for advanced filters.
Definition: filters.hh:63
│ │ │ │ +
AdvancedFilterTag FilterTag
Filter tag for deciding on filter application mechanism.
Definition: filters.hh:66
│ │ │ │ +
Apply this filter to the given node and children.
Definition: filters.hh:73
│ │ │ │ +
implementation defined type
The result of the filtering process.
Definition: filters.hh:78
│ │ │ │ +
Default simple filter that accepts any node and leaves its child structure unchanged.
Definition: filters.hh:92
│ │ │ │ +
SimpleFilterTag FilterTag
Filter tag for deciding on filter application mechanism.
Definition: filters.hh:95
│ │ │ │ +
Validates the combination of filter and node.
Definition: filters.hh:101
│ │ │ │ +
static const bool value
True if the combination of filter and node is valid.
Definition: filters.hh:103
│ │ │ │ +
Applies the filter to the given child node.
Definition: filters.hh:117
│ │ │ │ +
static const bool value
True if the child will be included in the filtered node.
Definition: filters.hh:119
│ │ │ │ +
Filter class for FilteredCompositeNode that selects the children with the given indices.
Definition: filters.hh:159
│ │ │ │ +
Adapter class that takes a SimpleFilter, validated it and turns it into an AdvancedFilter.
Definition: filters.hh:210
│ │ │ │ +
Apply the filter.
Definition: filters.hh:215
│ │ │ │ +
filter_helper< Filter, 0, 0, Children... >::template apply ::type type
Definition: filters.hh:219
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,712 +4,322 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -accumulate_static.hh │ │ │ │ │ +filters.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11 │ │ │ │ │ - 12 │ │ │ │ │ -13namespace Dune { │ │ │ │ │ -14 namespace TypeTree { │ │ │ │ │ - 15 │ │ │ │ │ - 22 template │ │ │ │ │ -23 struct or_ │ │ │ │ │ - 24 { │ │ │ │ │ - 25 template │ │ │ │ │ -26 struct reduce │ │ │ │ │ - 27 { │ │ │ │ │ -28 static const result_type result = r1 || r2; │ │ │ │ │ - 29 }; │ │ │ │ │ - 30 }; │ │ │ │ │ - 31 │ │ │ │ │ - 33 template │ │ │ │ │ -34 struct and_ │ │ │ │ │ - 35 { │ │ │ │ │ - 36 template │ │ │ │ │ -37 struct reduce │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11namespace Dune { │ │ │ │ │ + 12 namespace TypeTree { │ │ │ │ │ + 13 │ │ │ │ │ + 20 template │ │ │ │ │ +21 struct FilterEntry │ │ │ │ │ + 22 { │ │ │ │ │ + 23 │ │ │ │ │ + 24#ifndef DOXYGEN │ │ │ │ │ + 25 │ │ │ │ │ + 26 // The precise contents of this class is an implementation detail. │ │ │ │ │ + 27 │ │ │ │ │ + 28 static const std::size_t filtered_index = new_k; │ │ │ │ │ + 29 static const std::size_t original_index = old_k; │ │ │ │ │ + 30 │ │ │ │ │ + 31#endif // DOXYGEN │ │ │ │ │ + 32 │ │ │ │ │ + 33 }; │ │ │ │ │ + 34 │ │ │ │ │ + 36 template │ │ │ │ │ +37 struct FilterResult │ │ │ │ │ 38 { │ │ │ │ │ -39 static const result_type result = r1 && r2; │ │ │ │ │ - 40 }; │ │ │ │ │ - 41 }; │ │ │ │ │ - 42 │ │ │ │ │ - 44 template │ │ │ │ │ -45 struct plus │ │ │ │ │ + 39 │ │ │ │ │ +40 static const std::size_t size = sizeof...(FilterEntries); │ │ │ │ │ + 41 │ │ │ │ │ +42 typedef std::tuple IndexMap; │ │ │ │ │ + 43 │ │ │ │ │ + 44 template │ │ │ │ │ +45 struct apply │ │ │ │ │ 46 { │ │ │ │ │ - 47 template │ │ │ │ │ -48 struct reduce │ │ │ │ │ - 49 { │ │ │ │ │ -50 static const result_type result = r1 + r2; │ │ │ │ │ - 51 }; │ │ │ │ │ +47 typedef std::tuple...> Children; │ │ │ │ │ +48 typedef std::tuple::Type...> ChildTypes; │ │ │ │ │ +49 typedef std::tuple::Type>...> NodeStorage; │ │ │ │ │ + 50 }; │ │ │ │ │ + 51 │ │ │ │ │ 52 }; │ │ │ │ │ 53 │ │ │ │ │ - 55 template │ │ │ │ │ -56 struct minus │ │ │ │ │ - 57 { │ │ │ │ │ - 58 template │ │ │ │ │ -59 struct reduce │ │ │ │ │ - 60 { │ │ │ │ │ -61 static const result_type result = r1 - r2; │ │ │ │ │ - 62 }; │ │ │ │ │ - 63 }; │ │ │ │ │ +55 struct SimpleFilterTag {}; │ │ │ │ │ + 56 │ │ │ │ │ +58 struct AdvancedFilterTag {}; │ │ │ │ │ + 59 │ │ │ │ │ + 60 │ │ │ │ │ +62 struct AdvancedFilter │ │ │ │ │ + 63 { │ │ │ │ │ 64 │ │ │ │ │ - 66 template │ │ │ │ │ -67 struct multiply │ │ │ │ │ - 68 { │ │ │ │ │ - 69 template │ │ │ │ │ -70 struct reduce │ │ │ │ │ - 71 { │ │ │ │ │ -72 static const result_type result = r1 * r2; │ │ │ │ │ - 73 }; │ │ │ │ │ - 74 }; │ │ │ │ │ +66 typedef AdvancedFilterTag FilterTag; │ │ │ │ │ + 67 │ │ │ │ │ + 68#ifdef DOXYGEN │ │ │ │ │ + 69 │ │ │ │ │ + 71 template │ │ │ │ │ +72 struct apply │ │ │ │ │ + 73 { │ │ │ │ │ 75 │ │ │ │ │ - 77 template │ │ │ │ │ -78 struct min │ │ │ │ │ - 79 { │ │ │ │ │ - 80 template │ │ │ │ │ -81 struct reduce │ │ │ │ │ - 82 { │ │ │ │ │ -83 static const result_type result = r1 < r2 ? r1 : r2; │ │ │ │ │ - 84 }; │ │ │ │ │ - 85 }; │ │ │ │ │ +78 typedef implementation-defined type; │ │ │ │ │ + 79 }; │ │ │ │ │ + 80 │ │ │ │ │ + 81#endif // DOXYGEN │ │ │ │ │ + 82 │ │ │ │ │ + 83 }; │ │ │ │ │ + 84 │ │ │ │ │ 86 │ │ │ │ │ - 88 template │ │ │ │ │ -89 struct max │ │ │ │ │ - 90 { │ │ │ │ │ - 91 template │ │ │ │ │ -92 struct reduce │ │ │ │ │ - 93 { │ │ │ │ │ -94 static const result_type result = r1 > r2 ? r1 : r2; │ │ │ │ │ - 95 }; │ │ │ │ │ - 96 }; │ │ │ │ │ +91 struct SimpleFilter │ │ │ │ │ + 92 { │ │ │ │ │ + 93 │ │ │ │ │ +95 typedef SimpleFilterTag FilterTag; │ │ │ │ │ + 96 │ │ │ │ │ 97 │ │ │ │ │ - 98 │ │ │ │ │ - 99 namespace { │ │ │ │ │ - 100 │ │ │ │ │ - 101 // implementation of the traversal algorithm │ │ │ │ │ - 102 │ │ │ │ │ - 104 template │ │ │ │ │ - 105 struct accumulate_node_helper │ │ │ │ │ - 106 { │ │ │ │ │ + 99 template │ │ │ │ │ +100 struct validate │ │ │ │ │ + 101 { │ │ │ │ │ +103 static const bool value = true; │ │ │ │ │ + 104 }; │ │ │ │ │ + 105 │ │ │ │ │ 107 │ │ │ │ │ - 108 typedef typename Functor::result_type result_type; │ │ │ │ │ - 109 │ │ │ │ │ -110 static const result_type result = current_value; │ │ │ │ │ - 111 │ │ │ │ │ - 112 }; │ │ │ │ │ - 113 │ │ │ │ │ - 115 template │ │ │ │ │ - 116 struct │ │ │ │ │ -accumulate_node_helper │ │ │ │ │ + 115 template │ │ │ │ │ +116 struct apply │ │ │ │ │ 117 { │ │ │ │ │ - 118 │ │ │ │ │ - 119 typedef typename Functor::result_type result_type; │ │ │ │ │ - 120 │ │ │ │ │ - 121 static const result_type result = Reduction::template │ │ │ │ │ -reduce::result>::result; │ │ │ │ │ - 122 │ │ │ │ │ - 123 }; │ │ │ │ │ - 124 │ │ │ │ │ - 126 template │ │ │ │ │ - 127 struct accumulate_value; │ │ │ │ │ - 128 │ │ │ │ │ - 130 template │ │ │ │ │ - 131 struct │ │ │ │ │ -accumulate_value │ │ │ │ │ +119 static const bool value = true; │ │ │ │ │ + 120 }; │ │ │ │ │ + 121 │ │ │ │ │ + 122 }; │ │ │ │ │ + 123 │ │ │ │ │ + 124 namespace { │ │ │ │ │ + 125 │ │ │ │ │ + 126 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 127 // IndexFilter helpers │ │ │ │ │ + 128 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 129 │ │ │ │ │ + 130 template │ │ │ │ │ + 131 struct index_filter_helper │ │ │ │ │ 132 { │ │ │ │ │ - 133 │ │ │ │ │ - 134 typedef typename Functor::result_type result_type; │ │ │ │ │ - 135 │ │ │ │ │ - 136 static const result_type result = │ │ │ │ │ - 137 │ │ │ │ │ - 138 │ │ │ │ │ -accumulate_node_helper::value>::result; │ │ │ │ │ + 133 template │ │ │ │ │ + 134 struct apply │ │ │ │ │ + 135 { │ │ │ │ │ + 136 typedef FilterResult type; │ │ │ │ │ + 137 }; │ │ │ │ │ + 138 }; │ │ │ │ │ 139 │ │ │ │ │ - 140 }; │ │ │ │ │ - 141 │ │ │ │ │ - 143 template │ │ │ │ │ - 144 struct accumulate_over_children │ │ │ │ │ - 145 { │ │ │ │ │ - 146 │ │ │ │ │ - 147 typedef typename Functor::result_type result_type; │ │ │ │ │ - 148 │ │ │ │ │ - 149 typedef decltype(push_back(TreePath{},index_constant{})) │ │ │ │ │ -child_tree_path; │ │ │ │ │ - 150 │ │ │ │ │ - 151 typedef typename Node::template Child::Type child; │ │ │ │ │ - 152 │ │ │ │ │ -153 static const result_type child_result = │ │ │ │ │ -accumulate_value>:: │ │ │ │ │ -result; │ │ │ │ │ + 140 template │ │ │ │ │ + 141 struct index_filter_helper │ │ │ │ │ + 142 { │ │ │ │ │ + 143 template │ │ │ │ │ + 144 struct apply │ │ │ │ │ + 145 : public index_filter_helper::template │ │ │ │ │ +apply │ │ │ │ │ + 148 > │ │ │ │ │ + 149 {}; │ │ │ │ │ + 150 }; │ │ │ │ │ + 151 │ │ │ │ │ + 152 } // anonymous namespace │ │ │ │ │ + 153 │ │ │ │ │ 154 │ │ │ │ │ - 155 static const result_type result = │ │ │ │ │ -accumulate_over_children:: │ │ │ │ │ -result; │ │ │ │ │ - 156 │ │ │ │ │ - 157 }; │ │ │ │ │ - 158 │ │ │ │ │ - 160 template │ │ │ │ │ - 161 struct │ │ │ │ │ -accumulate_over_children │ │ │ │ │ - 162 { │ │ │ │ │ - 163 │ │ │ │ │ - 164 typedef typename Functor::result_type result_type; │ │ │ │ │ - 165 │ │ │ │ │ - 166 static const result_type result = current_value; │ │ │ │ │ - 167 │ │ │ │ │ - 168 }; │ │ │ │ │ - 169 │ │ │ │ │ - 172 template │ │ │ │ │ - 173 struct accumulate_value_generic_composite_node │ │ │ │ │ - 174 { │ │ │ │ │ - 175 │ │ │ │ │ - 176 typedef typename Functor::result_type result_type; │ │ │ │ │ - 177 │ │ │ │ │ - 178 static const result_type child_result = │ │ │ │ │ -accumulate_over_children:: │ │ │ │ │ -value>::result; │ │ │ │ │ - 179 │ │ │ │ │ - 180 static const result_type result = │ │ │ │ │ - 181 │ │ │ │ │ -accumulate_node_helper::value>::result; │ │ │ │ │ - 182 │ │ │ │ │ - 183 │ │ │ │ │ - 184 }; │ │ │ │ │ - 185 │ │ │ │ │ - 187 template │ │ │ │ │ - 188 struct │ │ │ │ │ -accumulate_value │ │ │ │ │ - 189 : public │ │ │ │ │ -accumulate_value_generic_composite_node │ │ │ │ │ - 190 {}; │ │ │ │ │ - 191 │ │ │ │ │ - 193 template │ │ │ │ │ - 194 struct │ │ │ │ │ -accumulate_value │ │ │ │ │ - 195 : public │ │ │ │ │ -accumulate_value_generic_composite_node │ │ │ │ │ - 196 {}; │ │ │ │ │ - 197 │ │ │ │ │ - 198 } // anonymous namespace │ │ │ │ │ - 199 │ │ │ │ │ - 201 │ │ │ │ │ - 257 template │ │ │ │ │ -258 struct AccumulateValue │ │ │ │ │ - 259 { │ │ │ │ │ - 260 │ │ │ │ │ -262 typedef typename Functor::result_type result_type; │ │ │ │ │ - 263 │ │ │ │ │ -265 static const result_type result = │ │ │ │ │ -accumulate_value,NodeTag>:: │ │ │ │ │ -result; │ │ │ │ │ - 266 │ │ │ │ │ - 267 }; │ │ │ │ │ - 268 │ │ │ │ │ - 271 struct flattened_reduction; │ │ │ │ │ - 272 │ │ │ │ │ - 275 struct bottom_up_reduction; │ │ │ │ │ - 276 │ │ │ │ │ - 277 namespace { │ │ │ │ │ - 278 │ │ │ │ │ - 279 // implementation of the traversal algorithm │ │ │ │ │ - 280 │ │ │ │ │ - 283 template │ │ │ │ │ - 284 struct accumulate_type_node_helper │ │ │ │ │ - 285 { │ │ │ │ │ - 286 │ │ │ │ │ - 287 typedef current_type type; │ │ │ │ │ - 288 │ │ │ │ │ - 289 }; │ │ │ │ │ - 290 │ │ │ │ │ - 292 template │ │ │ │ │ - 293 struct │ │ │ │ │ -accumulate_type_node_helper │ │ │ │ │ - 294 { │ │ │ │ │ - 295 │ │ │ │ │ - 296 typedef typename Reduction::template reduce< │ │ │ │ │ - 297 current_type, │ │ │ │ │ - 298 typename Functor::template visit< │ │ │ │ │ - 299 Node, │ │ │ │ │ - 300 TreePath │ │ │ │ │ - 301 >::type │ │ │ │ │ - 302 >::type type; │ │ │ │ │ - 303 │ │ │ │ │ - 304 }; │ │ │ │ │ - 305 │ │ │ │ │ - 307 template │ │ │ │ │ - 308 struct accumulate_type; │ │ │ │ │ - 309 │ │ │ │ │ - 311 template │ │ │ │ │ - 312 struct accumulate_type │ │ │ │ │ - 313 { │ │ │ │ │ - 314 │ │ │ │ │ - 315 typedef typename accumulate_type_node_helper< │ │ │ │ │ - 316 LeafNode, │ │ │ │ │ - 317 typename Policy::functor, │ │ │ │ │ - 318 typename Policy::sibling_reduction, │ │ │ │ │ - 319 current_type, │ │ │ │ │ - 320 TreePath, │ │ │ │ │ - 321 Policy::functor::template doVisit< │ │ │ │ │ - 322 LeafNode, │ │ │ │ │ - 323 TreePath>::value │ │ │ │ │ - 324 >::type type; │ │ │ │ │ - 325 │ │ │ │ │ - 326 }; │ │ │ │ │ - 327 │ │ │ │ │ - 328 │ │ │ │ │ - 331 template │ │ │ │ │ - 332 struct propagate_type_down_tree; │ │ │ │ │ - 333 │ │ │ │ │ - 335 template │ │ │ │ │ - 336 struct propagate_type_down_tree< │ │ │ │ │ - 337 current_type, │ │ │ │ │ - 338 tree_path, │ │ │ │ │ - 339 start_type, │ │ │ │ │ - 340 bottom_up_reduction │ │ │ │ │ - 341 > │ │ │ │ │ - 342 { │ │ │ │ │ - 343 typedef current_type type; │ │ │ │ │ - 344 }; │ │ │ │ │ - 345 │ │ │ │ │ - 347 template │ │ │ │ │ - 348 struct propagate_type_down_tree< │ │ │ │ │ - 349 current_type, │ │ │ │ │ - 350 tree_path, │ │ │ │ │ - 351 start_type, │ │ │ │ │ - 352 flattened_reduction │ │ │ │ │ - 353 > │ │ │ │ │ - 354 { │ │ │ │ │ - 355 typedef typename std::conditional< │ │ │ │ │ - 356 TreePathBack::value == 0, │ │ │ │ │ - 357 start_type, │ │ │ │ │ - 358 current_type │ │ │ │ │ - 359 >::type type; │ │ │ │ │ - 360 }; │ │ │ │ │ - 361 │ │ │ │ │ - 362 │ │ │ │ │ - 364 template │ │ │ │ │ - 365 struct accumulate_type_over_children │ │ │ │ │ - 366 { │ │ │ │ │ - 367 │ │ │ │ │ - 368 typedef decltype(push_back(TreePath{},index_constant{})) │ │ │ │ │ -child_tree_path; │ │ │ │ │ - 369 │ │ │ │ │ - 370 typedef typename Node::template Child::Type child; │ │ │ │ │ - 371 │ │ │ │ │ - 372 typedef typename accumulate_type< │ │ │ │ │ - 373 child, │ │ │ │ │ - 374 Policy, │ │ │ │ │ - 375 // apply reduction choice (flat / hierarchic) │ │ │ │ │ - 376 typename propagate_type_down_tree< │ │ │ │ │ - 377 current_type, │ │ │ │ │ - 378 child_tree_path, │ │ │ │ │ - 379 typename Policy::start_type, │ │ │ │ │ - 380 typename Policy::reduction_strategy │ │ │ │ │ - 381 >::type, │ │ │ │ │ - 382 child_tree_path, │ │ │ │ │ - 383 NodeTag │ │ │ │ │ - 384 >::type child_result_type; │ │ │ │ │ - 385 │ │ │ │ │ - 386 typedef typename accumulate_type_over_children< │ │ │ │ │ - 387 Node, │ │ │ │ │ - 388 Policy, │ │ │ │ │ - 389 child_result_type, │ │ │ │ │ - 390 TreePath, │ │ │ │ │ - 391 i+1, │ │ │ │ │ - 392 n │ │ │ │ │ - 393 >::type type; │ │ │ │ │ - 394 │ │ │ │ │ - 395 }; │ │ │ │ │ - 396 │ │ │ │ │ - 398 template │ │ │ │ │ - 399 struct │ │ │ │ │ -accumulate_type_over_children │ │ │ │ │ - 400 { │ │ │ │ │ - 401 │ │ │ │ │ - 402 typedef current_type type; │ │ │ │ │ - 403 │ │ │ │ │ - 404 }; │ │ │ │ │ - 405 │ │ │ │ │ - 406 │ │ │ │ │ - 409 template │ │ │ │ │ - 410 struct accumulate_type_generic_composite_node │ │ │ │ │ - 411 { │ │ │ │ │ - 412 │ │ │ │ │ - 413 typedef typename accumulate_type_over_children< │ │ │ │ │ - 414 Node, │ │ │ │ │ - 415 Policy, │ │ │ │ │ - 416 current_type, │ │ │ │ │ - 417 TreePath, │ │ │ │ │ - 418 0, │ │ │ │ │ - 419 StaticDegree::value │ │ │ │ │ - 420 >::type children_result_type; │ │ │ │ │ - 421 │ │ │ │ │ - 422 typedef typename accumulate_type_node_helper< │ │ │ │ │ - 423 Node, │ │ │ │ │ - 424 typename Policy::functor, │ │ │ │ │ - 425 typename Policy::parent_child_reduction, │ │ │ │ │ - 426 children_result_type, │ │ │ │ │ - 427 TreePath, │ │ │ │ │ - 428 Policy::functor::template doVisit< │ │ │ │ │ - 429 Node, │ │ │ │ │ - 430 TreePath │ │ │ │ │ - 431 >::value │ │ │ │ │ - 432 >::type type; │ │ │ │ │ - 433 │ │ │ │ │ - 434 }; │ │ │ │ │ - 435 │ │ │ │ │ - 437 template │ │ │ │ │ - 438 struct │ │ │ │ │ -accumulate_type │ │ │ │ │ - 439 : public │ │ │ │ │ -accumulate_type_generic_composite_node │ │ │ │ │ - 440 {}; │ │ │ │ │ - 441 │ │ │ │ │ - 443 template │ │ │ │ │ - 444 struct │ │ │ │ │ -accumulate_type │ │ │ │ │ - 445 : public │ │ │ │ │ -accumulate_type_generic_composite_node │ │ │ │ │ - 446 {}; │ │ │ │ │ - 447 │ │ │ │ │ - 448 } // anonymous namespace │ │ │ │ │ - 449 │ │ │ │ │ - 450 │ │ │ │ │ - 458 template< │ │ │ │ │ - 459 typename Functor, │ │ │ │ │ - 460 typename Reduction, │ │ │ │ │ - 461 typename StartType, │ │ │ │ │ - 462 typename ParentChildReduction = Reduction, │ │ │ │ │ - 463 typename ReductionAlgorithm = flattened_reduction │ │ │ │ │ - 464 > │ │ │ │ │ -465 struct TypeAccumulationPolicy │ │ │ │ │ - 466 { │ │ │ │ │ - 467 │ │ │ │ │ -495 typedef Functor functor; │ │ │ │ │ - 496 │ │ │ │ │ -516 typedef Reduction sibling_reduction; │ │ │ │ │ - 517 │ │ │ │ │ -524 typedef ParentChildReduction parent_child_reduction; │ │ │ │ │ - 525 │ │ │ │ │ -532 typedef StartType start_type; │ │ │ │ │ - 533 │ │ │ │ │ -538 typedef ReductionAlgorithm reduction_strategy; │ │ │ │ │ - 539 }; │ │ │ │ │ - 540 │ │ │ │ │ - 541 │ │ │ │ │ - 543 │ │ │ │ │ - 551 template │ │ │ │ │ -552 struct AccumulateType │ │ │ │ │ - 553 { │ │ │ │ │ - 554 │ │ │ │ │ - 556 typedef typename accumulate_type< │ │ │ │ │ - 557 Tree, │ │ │ │ │ - 558 Policy, │ │ │ │ │ - 559 typename Policy::start_type, │ │ │ │ │ - 560 HybridTreePath<>, │ │ │ │ │ - 561 NodeTag │ │ │ │ │ -562 >::type type; │ │ │ │ │ - 563 │ │ │ │ │ - 564 }; │ │ │ │ │ - 565 │ │ │ │ │ - 566 │ │ │ │ │ - 567 │ │ │ │ │ - 568 │ │ │ │ │ - 569 │ │ │ │ │ - 570 /***************************************************/ │ │ │ │ │ - 571 │ │ │ │ │ -572 namespace Experimental { │ │ │ │ │ - 573 namespace Impl { │ │ │ │ │ - 574 │ │ │ │ │ - 576 template::isLeaf, int> = 0> │ │ │ │ │ - 578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& │ │ │ │ │ -current_val) │ │ │ │ │ - 579 { │ │ │ │ │ - 580 return visitor.leaf(tree, treePath, std::forward(current_val)); │ │ │ │ │ - 581 } │ │ │ │ │ - 582 │ │ │ │ │ - 584 template::isLeaf, int> = 0> │ │ │ │ │ - 586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& │ │ │ │ │ -current_val) │ │ │ │ │ - 587 { │ │ │ │ │ - 588 using Tree = std::remove_reference_t; │ │ │ │ │ - 589 using Visitor = std::remove_reference_t; │ │ │ │ │ - 590 auto pre_val = visitor.pre(tree, treePath, std::forward(current_val)); │ │ │ │ │ - 591 │ │ │ │ │ - 592 // check which type of traversal is supported by the tree │ │ │ │ │ - 593 using allowDynamicTraversal = Dune::Std::is_detected; │ │ │ │ │ - 594 using allowStaticTraversal = Dune::Std::is_detected; │ │ │ │ │ - 595 │ │ │ │ │ - 596 // the tree must support either dynamic or static traversal │ │ │ │ │ - 597 static_assert(allowDynamicTraversal::value || allowStaticTraversal:: │ │ │ │ │ -value); │ │ │ │ │ - 598 │ │ │ │ │ - 599 // the visitor may specify preferred dynamic traversal │ │ │ │ │ - 600 using preferDynamicTraversal = std::bool_constant; │ │ │ │ │ - 601 │ │ │ │ │ - 602 // declare rule that applies visitor and current value to a child i. │ │ │ │ │ -Returns next value │ │ │ │ │ - 603 auto apply_i = [&](auto&& value, const auto& i){ │ │ │ │ │ - 604 auto&& child = tree.child(i); │ │ │ │ │ - 605 using Child = std::decay_t; │ │ │ │ │ - 606 │ │ │ │ │ - 607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move │ │ │ │ │ -(value)); │ │ │ │ │ - 608 │ │ │ │ │ - 609 // visits between children │ │ │ │ │ - 610 auto val_in = Hybrid::ifElse( │ │ │ │ │ - 611 Hybrid::equals(i,Indices::_0), │ │ │ │ │ - 612 [&](auto id){return std::move(val_before);}, │ │ │ │ │ - 613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));} │ │ │ │ │ - 614 ); │ │ │ │ │ - 615 │ │ │ │ │ - 616 constexpr bool visitChild = Visitor::template │ │ │ │ │ -VisitChild::value; │ │ │ │ │ - 617 auto val_visit = [&](){ │ │ │ │ │ - 618 if constexpr (visitChild) { │ │ │ │ │ - 619 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ - 620 return hybridApplyToTree(child, childTreePath, visitor, std::move │ │ │ │ │ -(val_in)); │ │ │ │ │ - 621 } │ │ │ │ │ - 622 else │ │ │ │ │ - 623 return std::move(val_in); │ │ │ │ │ - 624 }(); │ │ │ │ │ - 625 │ │ │ │ │ - 626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit)); │ │ │ │ │ - 627 }; │ │ │ │ │ - 628 │ │ │ │ │ - 629 // apply visitor to children │ │ │ │ │ - 630 auto in_val = [&](){ │ │ │ │ │ - 631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal:: │ │ │ │ │ -value) { │ │ │ │ │ - 632 // get list of static indices │ │ │ │ │ - 633 auto indices = std::make_index_sequence{}; │ │ │ │ │ - 634 │ │ │ │ │ - 635 // unfold apply_i left to right │ │ │ │ │ - 636 return unpackIntegerSequence([&](auto... i) { │ │ │ │ │ - 656 return left_fold(std::move(apply_i),std::move(pre_val), i...); │ │ │ │ │ - 657 }, indices); │ │ │ │ │ - 658 │ │ │ │ │ - 659 } else { │ │ │ │ │ - 660 // unfold first child to get type │ │ │ │ │ - 661 auto i_val = apply_i(std::move(pre_val),std::size_t{0}); │ │ │ │ │ - 662 // dynamically loop rest of the children to accumulate remindng values │ │ │ │ │ - 663 for(std::size_t i = 1; i < tree.degree(); i++) │ │ │ │ │ - 664 i_val = apply_i(i_val,i); │ │ │ │ │ - 665 return i_val; │ │ │ │ │ - 666 } │ │ │ │ │ - 667 }(); │ │ │ │ │ - 668 │ │ │ │ │ - 669 return visitor.post(tree, treePath, in_val); │ │ │ │ │ - 670 } │ │ │ │ │ - 671 │ │ │ │ │ - 672 } │ │ │ │ │ - 673 │ │ │ │ │ - 697 template │ │ │ │ │ -698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init) │ │ │ │ │ - 699 { │ │ │ │ │ - 700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init); │ │ │ │ │ - 701 } │ │ │ │ │ - 702 │ │ │ │ │ - 703 } // namespace Experimental │ │ │ │ │ - 704 │ │ │ │ │ - 706 } // namespace TypeTree │ │ │ │ │ - 707} //namespace Dune │ │ │ │ │ - 708 │ │ │ │ │ - 709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ -child_result │ │ │ │ │ -static const result_type child_result │ │ │ │ │ -Definition: accumulate_static.hh:153 │ │ │ │ │ -result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:110 │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ -treepath.hh │ │ │ │ │ -Dune::TypeTree::Child │ │ │ │ │ -typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ -Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ -Definition: childextraction.hh:223 │ │ │ │ │ + 156 template │ │ │ │ │ +157 struct IndexFilter │ │ │ │ │ + 158 : public AdvancedFilter │ │ │ │ │ + 159 { │ │ │ │ │ + 160 │ │ │ │ │ + 161#ifndef DOXYGEN │ │ │ │ │ + 162 │ │ │ │ │ + 163 template │ │ │ │ │ + 164 struct apply │ │ │ │ │ + 165 { │ │ │ │ │ + 166 typedef typename index_filter_helper::template │ │ │ │ │ +apply<>::type type; │ │ │ │ │ + 167 }; │ │ │ │ │ + 168 │ │ │ │ │ + 169#endif // DOXYGEN │ │ │ │ │ + 170 │ │ │ │ │ + 171 }; │ │ │ │ │ + 172 │ │ │ │ │ + 173 │ │ │ │ │ + 174 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 175 // filter: Wrapper class for turning a simple filter into an advanced │ │ │ │ │ +filter │ │ │ │ │ + 176 // usable by FilteredCompositeNode │ │ │ │ │ + 177 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 178 │ │ │ │ │ + 179 namespace { │ │ │ │ │ + 180 │ │ │ │ │ + 181 template │ │ │ │ │ + 182 struct filter_helper │ │ │ │ │ + 183 { │ │ │ │ │ + 184 template │ │ │ │ │ + 185 struct apply │ │ │ │ │ + 186 { │ │ │ │ │ + 187 typedef FilterResult type; │ │ │ │ │ + 188 }; │ │ │ │ │ + 189 }; │ │ │ │ │ + 190 │ │ │ │ │ + 191 template │ │ │ │ │ + 192 struct filter_helper │ │ │ │ │ + 193 { │ │ │ │ │ + 194 │ │ │ │ │ + 195 template │ │ │ │ │ + 196 struct apply │ │ │ │ │ + 197 : public std::conditional:: │ │ │ │ │ +value, │ │ │ │ │ + 198 typename filter_helper::template │ │ │ │ │ +apply >, │ │ │ │ │ + 199 typename filter_helper::template │ │ │ │ │ +apply │ │ │ │ │ + 200 >::type │ │ │ │ │ + 201 {}; │ │ │ │ │ + 202 │ │ │ │ │ + 203 }; │ │ │ │ │ + 204 │ │ │ │ │ + 205 } // anonymous namespace │ │ │ │ │ + 206 │ │ │ │ │ + 208 template │ │ │ │ │ +209 struct filter │ │ │ │ │ + 210 { │ │ │ │ │ + 211 │ │ │ │ │ + 213 template │ │ │ │ │ +214 struct apply │ │ │ │ │ + 215 { │ │ │ │ │ + 216 │ │ │ │ │ + 217 static_assert((Filter::template validate::value),"Invalid simple │ │ │ │ │ +filter"); │ │ │ │ │ + 218 │ │ │ │ │ +219 typedef typename filter_helper::template apply<>:: │ │ │ │ │ +type type; │ │ │ │ │ + 220 │ │ │ │ │ + 221 }; │ │ │ │ │ + 222 │ │ │ │ │ + 223 }; │ │ │ │ │ + 224 │ │ │ │ │ + 226 │ │ │ │ │ + 227 } // namespace TypeTree │ │ │ │ │ + 228} //namespace Dune │ │ │ │ │ + 229 │ │ │ │ │ + 230#endif // DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ Dune::TypeTree::child │ │ │ │ │ ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ indices. │ │ │ │ │ Definition: childextraction.hh:126 │ │ │ │ │ -Dune::TypeTree::degree │ │ │ │ │ -std::size_t degree(const Node &node) │ │ │ │ │ -Returns the degree of node as run time information. │ │ │ │ │ -Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::NodeTag │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -Definition: nodeinterface.hh:76 │ │ │ │ │ -Dune::TypeTree::push_back │ │ │ │ │ -constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t i) │ │ │ │ │ -Appends a run time index to a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:281 │ │ │ │ │ -Dune::TypeTree::hybridTreePath │ │ │ │ │ -constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:180 │ │ │ │ │ -Dune::TypeTree::treePath │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:191 │ │ │ │ │ -Dune::TypeTree::TreePath │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -Definition: treepath.hh:521 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::Experimental::hybridApplyToTree │ │ │ │ │ -auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ -Apply hybrid visitor to TypeTree. │ │ │ │ │ -Definition: accumulate_static.hh:698 │ │ │ │ │ Dune::TypeTree::TreePathType::Type │ │ │ │ │ Type │ │ │ │ │ Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::or_ │ │ │ │ │ -Statically combine two values of type result_type using ||. │ │ │ │ │ -Definition: accumulate_static.hh:24 │ │ │ │ │ -Dune::TypeTree::or_::reduce │ │ │ │ │ -Definition: accumulate_static.hh:27 │ │ │ │ │ -Dune::TypeTree::or_::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:28 │ │ │ │ │ -Dune::TypeTree::and_ │ │ │ │ │ -Statically combine two values of type result_type using &&. │ │ │ │ │ -Definition: accumulate_static.hh:35 │ │ │ │ │ -Dune::TypeTree::and_::reduce │ │ │ │ │ -Definition: accumulate_static.hh:38 │ │ │ │ │ -Dune::TypeTree::and_::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:39 │ │ │ │ │ -Dune::TypeTree::plus │ │ │ │ │ -Statically combine two values of type result_type using +. │ │ │ │ │ -Definition: accumulate_static.hh:46 │ │ │ │ │ -Dune::TypeTree::plus::reduce │ │ │ │ │ -Definition: accumulate_static.hh:49 │ │ │ │ │ -Dune::TypeTree::plus::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:50 │ │ │ │ │ -Dune::TypeTree::minus │ │ │ │ │ -Statically combine two values of type result_type using -. │ │ │ │ │ -Definition: accumulate_static.hh:57 │ │ │ │ │ -Dune::TypeTree::minus::reduce │ │ │ │ │ -Definition: accumulate_static.hh:60 │ │ │ │ │ -Dune::TypeTree::minus::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:61 │ │ │ │ │ -Dune::TypeTree::multiply │ │ │ │ │ -Statically combine two values of type result_type using *. │ │ │ │ │ -Definition: accumulate_static.hh:68 │ │ │ │ │ -Dune::TypeTree::multiply::reduce │ │ │ │ │ -Definition: accumulate_static.hh:71 │ │ │ │ │ -Dune::TypeTree::multiply::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:72 │ │ │ │ │ -Dune::TypeTree::min │ │ │ │ │ -Statically combine two values of type result_type by returning their minimum. │ │ │ │ │ -Definition: accumulate_static.hh:79 │ │ │ │ │ -Dune::TypeTree::min::reduce │ │ │ │ │ -Definition: accumulate_static.hh:82 │ │ │ │ │ -Dune::TypeTree::min::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:83 │ │ │ │ │ -Dune::TypeTree::max │ │ │ │ │ -Statically combine two values of type result_type by returning their maximum. │ │ │ │ │ -Definition: accumulate_static.hh:90 │ │ │ │ │ -Dune::TypeTree::max::reduce │ │ │ │ │ -Definition: accumulate_static.hh:93 │ │ │ │ │ -Dune::TypeTree::max::reduce::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:94 │ │ │ │ │ -Dune::TypeTree::AccumulateValue │ │ │ │ │ -Statically accumulate a value over the nodes of a TypeTree. │ │ │ │ │ -Definition: accumulate_static.hh:259 │ │ │ │ │ -Dune::TypeTree::AccumulateValue::result_type │ │ │ │ │ -Functor::result_type result_type │ │ │ │ │ -The result type of the computation. │ │ │ │ │ -Definition: accumulate_static.hh:262 │ │ │ │ │ -Dune::TypeTree::AccumulateValue::result │ │ │ │ │ -static const result_type result │ │ │ │ │ -The accumulated result of the computation. │ │ │ │ │ -Definition: accumulate_static.hh:265 │ │ │ │ │ -Dune::TypeTree::TypeAccumulationPolicy │ │ │ │ │ -Definition: accumulate_static.hh:466 │ │ │ │ │ -Dune::TypeTree::TypeAccumulationPolicy::parent_child_reduction │ │ │ │ │ -ParentChildReduction parent_child_reduction │ │ │ │ │ -Definition: accumulate_static.hh:524 │ │ │ │ │ -Dune::TypeTree::TypeAccumulationPolicy::functor │ │ │ │ │ -Functor functor │ │ │ │ │ -Definition: accumulate_static.hh:495 │ │ │ │ │ -Dune::TypeTree::TypeAccumulationPolicy::start_type │ │ │ │ │ -StartType start_type │ │ │ │ │ -Definition: accumulate_static.hh:532 │ │ │ │ │ -Dune::TypeTree::TypeAccumulationPolicy::reduction_strategy │ │ │ │ │ -ReductionAlgorithm reduction_strategy │ │ │ │ │ -Definition: accumulate_static.hh:538 │ │ │ │ │ -Dune::TypeTree::TypeAccumulationPolicy::sibling_reduction │ │ │ │ │ -Reduction sibling_reduction │ │ │ │ │ -Definition: accumulate_static.hh:516 │ │ │ │ │ -Dune::TypeTree::AccumulateType │ │ │ │ │ -Statically accumulate a type over the nodes of a TypeTree. │ │ │ │ │ -Definition: accumulate_static.hh:553 │ │ │ │ │ -Dune::TypeTree::AccumulateType::type │ │ │ │ │ -accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, │ │ │ │ │ -NodeTag< Tree > >::type type │ │ │ │ │ -The accumulated result of the computation. │ │ │ │ │ -Definition: accumulate_static.hh:562 │ │ │ │ │ -Dune::TypeTree::HybridTreePath │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +Dune::TypeTree::FilterEntry │ │ │ │ │ +A filter entry describing the mapping of one child in the filtered node. │ │ │ │ │ +Definition: filters.hh:22 │ │ │ │ │ +Dune::TypeTree::FilterResult │ │ │ │ │ +The result of a filter. │ │ │ │ │ +Definition: filters.hh:38 │ │ │ │ │ +Dune::TypeTree::FilterResult::IndexMap │ │ │ │ │ +std::tuple< FilterEntries... > IndexMap │ │ │ │ │ +Definition: filters.hh:42 │ │ │ │ │ +Dune::TypeTree::FilterResult::size │ │ │ │ │ +static const std::size_t size │ │ │ │ │ +Definition: filters.hh:40 │ │ │ │ │ +Dune::TypeTree::FilterResult::apply │ │ │ │ │ +Definition: filters.hh:46 │ │ │ │ │ +Dune::TypeTree::FilterResult::apply::Children │ │ │ │ │ +std::tuple< typename Node::template Child< FilterEntries::original_index >... > │ │ │ │ │ +Children │ │ │ │ │ +Definition: filters.hh:47 │ │ │ │ │ +Dune::TypeTree::FilterResult::apply::ChildTypes │ │ │ │ │ +std::tuple< typename Node::template Child< FilterEntries::original_index >:: │ │ │ │ │ +Type... > ChildTypes │ │ │ │ │ +Definition: filters.hh:48 │ │ │ │ │ +Dune::TypeTree::FilterResult::apply::NodeStorage │ │ │ │ │ +std::tuple< std::shared_ptr< typename Node::template Child< FilterEntries:: │ │ │ │ │ +original_index >::Type >... > NodeStorage │ │ │ │ │ +Definition: filters.hh:49 │ │ │ │ │ +Dune::TypeTree::SimpleFilterTag │ │ │ │ │ +Tag describing a simple filter that can only decide whether or not to include a │ │ │ │ │ +single given child. │ │ │ │ │ +Definition: filters.hh:55 │ │ │ │ │ +Dune::TypeTree::AdvancedFilterTag │ │ │ │ │ +Tag describing an advanced filter that has full control over the construction │ │ │ │ │ +of the list of FilterEn... │ │ │ │ │ +Definition: filters.hh:58 │ │ │ │ │ +Dune::TypeTree::AdvancedFilter │ │ │ │ │ +Base class for advanced filters. │ │ │ │ │ +Definition: filters.hh:63 │ │ │ │ │ +Dune::TypeTree::AdvancedFilter::FilterTag │ │ │ │ │ +AdvancedFilterTag FilterTag │ │ │ │ │ +Filter tag for deciding on filter application mechanism. │ │ │ │ │ +Definition: filters.hh:66 │ │ │ │ │ +Dune::TypeTree::AdvancedFilter::apply │ │ │ │ │ +Apply this filter to the given node and children. │ │ │ │ │ +Definition: filters.hh:73 │ │ │ │ │ +Dune::TypeTree::AdvancedFilter::apply::type │ │ │ │ │ +implementation defined type │ │ │ │ │ +The result of the filtering process. │ │ │ │ │ +Definition: filters.hh:78 │ │ │ │ │ +Dune::TypeTree::SimpleFilter │ │ │ │ │ +Default simple filter that accepts any node and leaves its child structure │ │ │ │ │ +unchanged. │ │ │ │ │ +Definition: filters.hh:92 │ │ │ │ │ +Dune::TypeTree::SimpleFilter::FilterTag │ │ │ │ │ +SimpleFilterTag FilterTag │ │ │ │ │ +Filter tag for deciding on filter application mechanism. │ │ │ │ │ +Definition: filters.hh:95 │ │ │ │ │ +Dune::TypeTree::SimpleFilter::validate │ │ │ │ │ +Validates the combination of filter and node. │ │ │ │ │ +Definition: filters.hh:101 │ │ │ │ │ +Dune::TypeTree::SimpleFilter::validate::value │ │ │ │ │ +static const bool value │ │ │ │ │ +True if the combination of filter and node is valid. │ │ │ │ │ +Definition: filters.hh:103 │ │ │ │ │ +Dune::TypeTree::SimpleFilter::apply │ │ │ │ │ +Applies the filter to the given child node. │ │ │ │ │ +Definition: filters.hh:117 │ │ │ │ │ +Dune::TypeTree::SimpleFilter::apply::value │ │ │ │ │ +static const bool value │ │ │ │ │ +True if the child will be included in the filtered node. │ │ │ │ │ +Definition: filters.hh:119 │ │ │ │ │ +Dune::TypeTree::IndexFilter │ │ │ │ │ +Filter class for FilteredCompositeNode that selects the children with the given │ │ │ │ │ indices. │ │ │ │ │ -Definition: treepath.hh:79 │ │ │ │ │ +Definition: filters.hh:159 │ │ │ │ │ +Dune::TypeTree::filter │ │ │ │ │ +Adapter class that takes a SimpleFilter, validated it and turns it into an │ │ │ │ │ +AdvancedFilter. │ │ │ │ │ +Definition: filters.hh:210 │ │ │ │ │ +Dune::TypeTree::filter::apply │ │ │ │ │ +Apply the filter. │ │ │ │ │ +Definition: filters.hh:215 │ │ │ │ │ +Dune::TypeTree::filter::apply::type │ │ │ │ │ +filter_helper< Filter, 0, 0, Children... >::template apply ::type type │ │ │ │ │ +Definition: filters.hh:219 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filteredcompositenode.hh File Reference │ │ │ │ +dune-typetree: childextraction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,45 +63,66 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
filteredcompositenode.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
childextraction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/filters.hh>
│ │ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <dune/common/concept.hh>
│ │ │ │ +#include <dune/common/documentation.hh>
│ │ │ │ #include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/treepath.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  Dune::TypeTree::FilteredCompositeNode< Node, Filter >
 Base class for composite nodes representing a filtered view on an underlying composite node. More...
 
struct  Dune::TypeTree::FilteredCompositeNode< Node, Filter >::Child< k >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

template<typename Node , std::size_t... indices>
using Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type
 Template alias for the type of a child node given by a list of child indices. More...
 
template<typename Node , typename TreePath >
using Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath< Node, TreePath >::type
 Template alias for the type of a child node given by a TreePath or a HybridTreePath type. More...
 
template<typename T >
using Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std::decay_t< T > >::type
 Type trait that determines whether T is a flat index in the context of child extraction. More...
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child (Node &&node, Indices... indices)
 Extracts the child of a node given by a sequence of compile-time and run-time indices. More...
 
template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::childStorage (Node &&node, Indices... indices)
 
template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child (Node &&node, HybridTreePath< Indices... > treePath)
 Extracts the child of a node given by a HybridTreePath object. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,34 +4,60 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -filteredcompositenode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Typedefs | Functions │ │ │ │ │ +childextraction.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ - class  Dune::TypeTree::FilteredCompositeNode<_Node,_Filter_> │ │ │ │ │ -  Base class for composite nodes representing a filtered view on an │ │ │ │ │ - underlying composite node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::FilteredCompositeNode<_Node,_Filter_>::Child<_k_> │ │ │ │ │ -  Access to the type and storage type of the i-th child. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ + Typedefs │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type │ │ │ │ │ +  Template alias for the type of a child node given by a list of child │ │ │ │ │ + indices. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath< │ │ │ │ │ + Node, TreePath >::type │ │ │ │ │ +  Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ + HybridTreePath type. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std:: │ │ │ │ │ + decay_t< T > >::type │ │ │ │ │ +  Type trait that determines whether T is a flat index in the context of │ │ │ │ │ + child extraction. More... │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +ImplementationDefined Dune::TypeTree::child (Node &&node, Indices... indices) │ │ │ │ │ +  Extracts the child of a node given by a sequence of │ │ │ │ │ + compile-time and run-time indices. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +ImplementationDefined Dune::TypeTree::childStorage (Node &&node, Indices... │ │ │ │ │ + indices) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +ImplementationDefined Dune::TypeTree::child (Node &&node, HybridTreePath< │ │ │ │ │ + Indices... > treePath) │ │ │ │ │ +  Extracts the child of a node given by a HybridTreePath │ │ │ │ │ + object. More... │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00041_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filteredcompositenode.hh Source File │ │ │ │ +dune-typetree: childextraction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,262 +62,284 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
filteredcompositenode.hh
│ │ │ │ +
childextraction.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ +
5#define DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │
6
│ │ │ │ -
7#include <memory>
│ │ │ │ -
8#include <tuple>
│ │ │ │ -
9#include <type_traits>
│ │ │ │ -
10
│ │ │ │ - │ │ │ │ - │ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <utility>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/concept.hh>
│ │ │ │ +
11#include <dune/common/documentation.hh>
│ │ │ │ +
12#include <dune/common/typetraits.hh>
│ │ │ │
13#include <dune/common/shared_ptr.hh>
│ │ │ │ -
14#include <dune/common/typetraits.hh>
│ │ │ │ -
15#include <dune/common/indices.hh>
│ │ │ │ -
16
│ │ │ │ - │ │ │ │ - │ │ │ │ -
19
│ │ │ │ -
20namespace Dune {
│ │ │ │ -
21 namespace TypeTree {
│ │ │ │ -
22
│ │ │ │ -
28#ifndef DOXYGEN
│ │ │ │ -
29 namespace {
│ │ │ │ +
14
│ │ │ │ + │ │ │ │ + │ │ │ │ +
17
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20 namespace TypeTree {
│ │ │ │ +
21
│ │ │ │ +
26
│ │ │ │ +
27#ifndef DOXYGEN
│ │ │ │ +
28
│ │ │ │ +
29 namespace Impl {
│ │ │ │
30
│ │ │ │ -
31 // ********************************************************************************
│ │ │ │ -
32 // Utility structs for filter construction and application
│ │ │ │ -
33 // ********************************************************************************
│ │ │ │ -
34
│ │ │ │ -
35 // Gets the filter and wraps it in case of a SimpleFilter.
│ │ │ │ -
36 template<typename Filter, typename Tag>
│ │ │ │ -
37 struct get_filter;
│ │ │ │ +
31 // check at run time whether index is a valid child index
│ │ │ │ +
32 template <class Node, class Index>
│ │ │ │ +
33 std::true_type checkChildIndex (Node const& node, Index i)
│ │ │ │ +
34 {
│ │ │ │ +
35 assert(std::size_t(i) < node.degree() && "Child index out of range");
│ │ │ │ +
36 return {};
│ │ │ │ +
37 }
│ │ │ │
38
│ │ │ │ -
39 // Helper struct to extract the child template parameter pack from the ChildTypes tuple.
│ │ │ │ -
40 template<typename Filter, typename Node, typename ChildTypes>
│ │ │ │ -
41 struct apply_filter_wrapper;
│ │ │ │ -
42
│ │ │ │ -
43 template<typename Filter, typename Node, typename... Children>
│ │ │ │ -
44 struct apply_filter_wrapper<Filter,Node,std::tuple<Children...> >
│ │ │ │ -
45 : public Filter::template apply<Node,Children...>
│ │ │ │ -
46 {};
│ │ │ │ -
47
│ │ │ │ -
48 // specialization for SimpleFilter
│ │ │ │ -
49 template<typename Filter>
│ │ │ │ -
50 struct get_filter<Filter,SimpleFilterTag>
│ │ │ │ +
39 // check at compile time whether index is a valid index
│ │ │ │ +
40 template <class Node, std::size_t i>
│ │ │ │ +
41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node, index_constant<i>)
│ │ │ │ +
42 {
│ │ │ │ +
43 static_assert(i < Node::degree(), "Child index out of range");
│ │ │ │ +
44 return {};
│ │ │ │ +
45 }
│ │ │ │ +
46
│ │ │ │ +
47 // finally return the node itself if no further indices are provided. Break condition
│ │ │ │ +
48 // for the recursion over the node childs.
│ │ │ │ +
49 template<class Node>
│ │ │ │ +
50 decltype(auto) childImpl (Node&& node)
│ │ │ │
51 {
│ │ │ │ -
52 struct type
│ │ │ │ -
53 {
│ │ │ │ -
54 template<typename Node, typename ChildTypes>
│ │ │ │ -
55 struct apply
│ │ │ │ -
56 : public apply_filter_wrapper<filter<Filter>,Node,ChildTypes>
│ │ │ │ -
57 {};
│ │ │ │ -
58 };
│ │ │ │ -
59 };
│ │ │ │ +
52 return std::forward<Node>(node);
│ │ │ │ +
53 }
│ │ │ │ +
54
│ │ │ │ +
55 template<class NodePtr>
│ │ │ │ +
56 auto childStorageImpl (NodePtr&& nodePtr)
│ │ │ │ +
57 {
│ │ │ │ +
58 return std::forward<NodePtr>(nodePtr);
│ │ │ │ +
59 }
│ │ │ │
60
│ │ │ │ -
61 // specialization for AdvancedFilter
│ │ │ │ -
62 template<typename Filter>
│ │ │ │ -
63 struct get_filter<Filter,AdvancedFilterTag>
│ │ │ │ +
61 // recursively call `node.child(...)` with the given indices
│ │ │ │ +
62 template<class Node, class I0, class... I>
│ │ │ │ +
63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i)
│ │ │ │
64 {
│ │ │ │ -
65 struct type
│ │ │ │ -
66 {
│ │ │ │ -
67 template<typename Node, typename ChildTypes>
│ │ │ │ -
68 struct apply
│ │ │ │ -
69 : public apply_filter_wrapper<Filter,Node,ChildTypes>
│ │ │ │ -
70 {};
│ │ │ │ -
71 };
│ │ │ │ -
72 };
│ │ │ │ -
73
│ │ │ │ -
74 } // anonymous namespace
│ │ │ │ -
75#endif // DOXYGEN
│ │ │ │ -
76
│ │ │ │ -
77
│ │ │ │ -
79 template<typename Node, typename Filter>
│ │ │ │ - │ │ │ │ -
81 {
│ │ │ │ +
65 auto valid = checkChildIndex(node,i0);
│ │ │ │ +
66 if constexpr (valid)
│ │ │ │ +
67 return childImpl(node.child(i0),i...);
│ │ │ │ +
68 else
│ │ │ │ +
69 return;
│ │ │ │ +
70 }
│ │ │ │ +
71
│ │ │ │ +
72 // recursively call `node.childStorage(...)` with the given indices
│ │ │ │ +
73 template<class NodePtr, class I0, class... I>
│ │ │ │ +
74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]] I... i)
│ │ │ │ +
75 {
│ │ │ │ +
76 auto valid = checkChildIndex(*nodePtr,i0);
│ │ │ │ +
77 if constexpr (valid)
│ │ │ │ +
78 return childStorageImpl(nodePtr->childStorage(i0),i...);
│ │ │ │ +
79 else
│ │ │ │ +
80 return;
│ │ │ │ +
81 }
│ │ │ │
82
│ │ │ │ -
83 typedef typename get_filter<Filter,typename Filter::FilterTag>::type filter;
│ │ │ │ -
84 typedef typename filter::template apply<Node,typename Node::ChildTypes>::type filter_result;
│ │ │ │ -
85 typedef typename filter_result::template apply<Node> mapped_children;
│ │ │ │ -
86
│ │ │ │ -
87 static const bool nodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
│ │ │ │ -
88
│ │ │ │ -
89 template<std::size_t k>
│ │ │ │ -
90 struct lazy_enable
│ │ │ │ -
91 {
│ │ │ │ -
92 static const bool value = !nodeIsConst;
│ │ │ │ -
93 };
│ │ │ │ -
94
│ │ │ │ -
95 public:
│ │ │ │ +
83 // forward to the impl methods by extracting the indices from the treepath
│ │ │ │ +
84 template<class Node, class... Indices, std::size_t... i>
│ │ │ │ +
85 decltype(auto) child (Node&& node, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
│ │ │ │ +
86 {
│ │ │ │ +
87 return childImpl(std::forward<Node>(node),treePathEntry<i>(tp)...);
│ │ │ │ +
88 }
│ │ │ │ +
89
│ │ │ │ +
90 // forward to the impl methods by extracting the indices from the treepath
│ │ │ │ +
91 template<class NodePtr, class... Indices, std::size_t... i>
│ │ │ │ +
92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
│ │ │ │ +
93 {
│ │ │ │ +
94 return childStorageImpl(std::forward<NodePtr>(nodePtr),treePathEntry<i>(tp)...);
│ │ │ │ +
95 }
│ │ │ │
96
│ │ │ │ - │ │ │ │ -
99
│ │ │ │ -
101 typedef typename mapped_children::NodeStorage NodeStorage;
│ │ │ │ +
97 } // end namespace Impl
│ │ │ │ +
98
│ │ │ │ +
99#endif // DOXYGEN
│ │ │ │ +
100
│ │ │ │
102
│ │ │ │ -
104 typedef typename mapped_children::ChildTypes ChildTypes;
│ │ │ │ -
105
│ │ │ │ -
107 static const bool isLeaf = false;
│ │ │ │ -
108
│ │ │ │ -
110 static const bool isPower = false;
│ │ │ │ -
111
│ │ │ │ -
113 static const bool isComposite = true;
│ │ │ │ -
114
│ │ │ │ -
116 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ -
117 static const std::size_t CHILDREN = filter_result::size;
│ │ │ │ -
118
│ │ │ │ -
119 static constexpr auto degree ()
│ │ │ │ -
120 {
│ │ │ │ -
121 return std::integral_constant<std::size_t,filter_result::size>{};
│ │ │ │ -
122 }
│ │ │ │ -
123
│ │ │ │ -
125 template<std::size_t k>
│ │ │ │ -
126 struct Child {
│ │ │ │ -
127
│ │ │ │ -
128#ifndef DOXYGEN
│ │ │ │ -
129
│ │ │ │ -
130 typedef typename std::tuple_element<k,typename mapped_children::Children>::type OriginalChild;
│ │ │ │ -
131
│ │ │ │ -
132 static const std::size_t mapped_index = std::tuple_element<k,typename filter_result::IndexMap>::type::original_index;
│ │ │ │ +
124 template<typename Node, typename... Indices>
│ │ │ │ +
125#ifdef DOXYGEN
│ │ │ │ +
126 ImplementationDefined child (Node&& node, Indices... indices)
│ │ │ │ +
127#else
│ │ │ │ +
128 decltype(auto) child (Node&& node, Indices... indices)
│ │ │ │ +
129#endif
│ │ │ │ +
130 {
│ │ │ │ +
131 return Impl::childImpl(std::forward<Node>(node),indices...);
│ │ │ │ +
132 }
│ │ │ │
133
│ │ │ │ -
134#endif // DOXYGEN
│ │ │ │ -
135
│ │ │ │ -
137 typedef typename OriginalChild::Type Type;
│ │ │ │ -
138
│ │ │ │ -
140 typedef typename OriginalChild::type type;
│ │ │ │ -
141 };
│ │ │ │ -
142
│ │ │ │ -
145
│ │ │ │ -
147
│ │ │ │ -
150 template<std::size_t k,
│ │ │ │ -
151 typename std::enable_if<lazy_enable<k>::value, int>::type = 0>
│ │ │ │ -
152 auto& child (index_constant<k> = {})
│ │ │ │ -
153 {
│ │ │ │ -
154 return _node->template child<Child<k>::mapped_index>();
│ │ │ │ -
155 }
│ │ │ │ -
156
│ │ │ │ -
158
│ │ │ │ -
161 template<std::size_t k>
│ │ │ │ -
162 const auto& child (index_constant<k> = {}) const
│ │ │ │ -
163 {
│ │ │ │ -
164 return _node->template child<Child<k>::mapped_index>();
│ │ │ │ -
165 }
│ │ │ │ -
166
│ │ │ │ -
168
│ │ │ │ -
171 template<std::size_t k,
│ │ │ │ -
172 typename std::enable_if<lazy_enable<k>::value, int>::type = 0>
│ │ │ │ -
173 auto childStorage (index_constant<k> = {})
│ │ │ │ -
174 {
│ │ │ │ -
175 return _node->template childStorage<Child<k>::mapped_index>();
│ │ │ │ -
176 }
│ │ │ │ -
177
│ │ │ │ -
179
│ │ │ │ -
182 template<std::size_t k>
│ │ │ │ -
183 auto childStorage (index_constant<k> = {}) const
│ │ │ │ -
184 {
│ │ │ │ -
185 return _node->template childStorage<Child<k>::mapped_index>();
│ │ │ │ -
186 }
│ │ │ │ -
187
│ │ │ │ -
189 template<std::size_t k, class ChildType>
│ │ │ │ -
190 void setChild (ChildType&& child, typename std::enable_if<lazy_enable<k>::value,void*>::type = 0)
│ │ │ │ -
191 {
│ │ │ │ -
192 _node->template setChild<Child<k>::mapped_index>(std::forward<ChildType>(child));
│ │ │ │ -
193 }
│ │ │ │ +
134 template<typename Node, typename... Indices>
│ │ │ │ +
135#ifdef DOXYGEN
│ │ │ │ +
136 ImplementationDefined childStorage (Node&& node, Indices... indices)
│ │ │ │ +
137#else
│ │ │ │ +
138 auto childStorage (Node&& node, Indices... indices)
│ │ │ │ +
139#endif
│ │ │ │ +
140 {
│ │ │ │ +
141 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty list of child indices");
│ │ │ │ +
142 return Impl::childStorageImpl(&node,indices...);
│ │ │ │ +
143 }
│ │ │ │ +
144
│ │ │ │ +
146
│ │ │ │ +
169 template<typename Node, typename... Indices>
│ │ │ │ +
170#ifdef DOXYGEN
│ │ │ │ +
171 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
│ │ │ │ +
172#else
│ │ │ │ +
173 decltype(auto) child (Node&& node, HybridTreePath<Indices...> tp)
│ │ │ │ +
174#endif
│ │ │ │ +
175 {
│ │ │ │ +
176 return Impl::child(std::forward<Node>(node),tp,std::index_sequence_for<Indices...>{});
│ │ │ │ +
177 }
│ │ │ │ +
178
│ │ │ │ +
179 template<typename Node, typename... Indices>
│ │ │ │ +
180#ifdef DOXYGEN
│ │ │ │ +
181 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
│ │ │ │ +
182#else
│ │ │ │ +
183 auto childStorage (Node&& node, HybridTreePath<Indices...> tp)
│ │ │ │ +
184#endif
│ │ │ │ +
185 {
│ │ │ │ +
186 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty TreePath");
│ │ │ │ +
187 return Impl::childStorage(&node,tp,std::index_sequence_for<Indices...>{});
│ │ │ │ +
188 }
│ │ │ │ +
189
│ │ │ │ +
190
│ │ │ │ +
191#ifndef DOXYGEN
│ │ │ │ +
192
│ │ │ │ +
193 namespace impl {
│ │ │ │
194
│ │ │ │ -
196
│ │ │ │ -
199
│ │ │ │ -
200 protected:
│ │ │ │ -
201
│ │ │ │ -
203
│ │ │ │ -
206 template<bool enabled = !nodeIsConst>
│ │ │ │ -
207 typename std::enable_if<enabled,Node&>::type
│ │ │ │ - │ │ │ │ -
209 {
│ │ │ │ -
210 return *_node;
│ │ │ │ -
211 }
│ │ │ │ -
212
│ │ │ │ -
214
│ │ │ │ -
217 const Node& unfiltered () const
│ │ │ │ -
218 {
│ │ │ │ -
219 return *_node;
│ │ │ │ -
220 }
│ │ │ │ -
221
│ │ │ │ -
223
│ │ │ │ -
226 template<bool enabled = !nodeIsConst>
│ │ │ │ -
227 typename std::enable_if<enabled,std::shared_ptr<Node> >::type
│ │ │ │ - │ │ │ │ -
229 {
│ │ │ │ -
230 return _node;
│ │ │ │ -
231 }
│ │ │ │ -
232
│ │ │ │ -
234
│ │ │ │ -
237 std::shared_ptr<const Node> unfilteredStorage () const
│ │ │ │ -
238 {
│ │ │ │ -
239 return _node;
│ │ │ │ -
240 }
│ │ │ │ +
195 template<typename T>
│ │ │ │ +
196 struct filter_void
│ │ │ │ +
197 {
│ │ │ │ +
198 using type = T;
│ │ │ │ +
199 };
│ │ │ │ +
200
│ │ │ │ +
201 template<>
│ │ │ │ +
202 struct filter_void<void>
│ │ │ │ +
203 {};
│ │ │ │ +
204
│ │ │ │ +
205 template<typename Node, std::size_t... indices>
│ │ │ │ +
206 struct _Child
│ │ │ │ +
207 : public filter_void<std::decay_t<decltype(child(std::declval<Node>(),index_constant<indices>{}...))>>
│ │ │ │ +
208 {};
│ │ │ │ +
209
│ │ │ │ +
210 }
│ │ │ │ +
211
│ │ │ │ +
212#endif // DOXYGEN
│ │ │ │ +
213
│ │ │ │ +
215
│ │ │ │ +
222 template<typename Node, std::size_t... indices>
│ │ │ │ +
223 using Child = typename impl::_Child<Node,indices...>::type;
│ │ │ │ +
224
│ │ │ │ +
225
│ │ │ │ +
226#ifndef DOXYGEN
│ │ │ │ +
227
│ │ │ │ +
228 namespace impl {
│ │ │ │ +
229
│ │ │ │ +
230 template<typename Node, typename TreePath>
│ │ │ │ +
231 struct _ChildForTreePath
│ │ │ │ +
232 {
│ │ │ │ +
233 using type = typename std::decay<decltype(child(std::declval<Node>(),std::declval<TreePath>()))>::type;
│ │ │ │ +
234 };
│ │ │ │ +
235
│ │ │ │ +
236 }
│ │ │ │ +
237
│ │ │ │ +
238#endif // DOXYGEN
│ │ │ │ +
239
│ │ │ │
241
│ │ │ │ -
243
│ │ │ │ -
244 public:
│ │ │ │ -
245
│ │ │ │ -
248
│ │ │ │ -
250 FilteredCompositeNode (std::shared_ptr<Node> node)
│ │ │ │ -
251 : _node(std::move(node))
│ │ │ │ -
252 {}
│ │ │ │ -
253
│ │ │ │ - │ │ │ │ -
256 : _node(stackobject_to_shared_ptr(node))
│ │ │ │ -
257 {}
│ │ │ │ -
258
│ │ │ │ -
260
│ │ │ │ -
261 private:
│ │ │ │ -
262 std::shared_ptr<Node> _node;
│ │ │ │ -
263 };
│ │ │ │ -
264
│ │ │ │ -
266
│ │ │ │ -
267 } // namespace TypeTree
│ │ │ │ -
268} //namespace Dune
│ │ │ │ -
269
│ │ │ │ -
270#endif // DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ +
249 template<typename Node, typename TreePath>
│ │ │ │ +
250 using ChildForTreePath = typename impl::_ChildForTreePath<Node,TreePath>::type;
│ │ │ │ +
251
│ │ │ │ +
252
│ │ │ │ +
253#ifndef DOXYGEN
│ │ │ │ +
254
│ │ │ │ +
255 namespace impl {
│ │ │ │ +
256
│ │ │ │ +
257 // By default, types are flat indices if they are integral
│ │ │ │ +
258 template<typename T>
│ │ │ │ +
259 struct _is_flat_index
│ │ │ │ +
260 {
│ │ │ │ +
261 using type = std::is_integral<T>;
│ │ │ │ +
262 };
│ │ │ │ +
263
│ │ │ │ +
264 // And so is any index_constant
│ │ │ │ +
265 template<std::size_t i>
│ │ │ │ +
266 struct _is_flat_index<index_constant<i>>
│ │ │ │ +
267 {
│ │ │ │ +
268 using type = std::true_type;
│ │ │ │ +
269 };
│ │ │ │ +
270
│ │ │ │ +
271 }
│ │ │ │ +
272
│ │ │ │ +
273#endif // DOXYGEN
│ │ │ │ +
274
│ │ │ │ +
276 /*
│ │ │ │ +
277 * This type trait can be used to check whether T is a flat index (i.e. either `std::size_t`
│ │ │ │ +
278 * or `index_constant`). The type trait normalizes T before doing the check, so it will also
│ │ │ │ +
279 * work correctly for references and cv-qualified types.
│ │ │ │ +
280 */
│ │ │ │ +
281 template<typename T>
│ │ │ │ +
282 using is_flat_index = typename impl::_is_flat_index<std::decay_t<T>>::type;
│ │ │ │ +
283
│ │ │ │ +
284#ifndef DOXYGEN
│ │ │ │ +
285
│ │ │ │ +
286 namespace impl {
│ │ │ │ +
287
│ │ │ │ +
288 // helper function for check in member child() functions that tolerates being passed something that
│ │ │ │ +
289 // isn't a TreePath. It will just return 0 in that case
│ │ │ │ +
290
│ │ │ │ +
291 template<typename T>
│ │ │ │ +
292 constexpr typename std::enable_if<
│ │ │ │ + │ │ │ │ +
294 bool
│ │ │ │ +
295 >::type
│ │ │ │ +
296 _non_empty_tree_path (T)
│ │ │ │ +
297 {
│ │ │ │ +
298 return false;
│ │ │ │ +
299 }
│ │ │ │ +
300
│ │ │ │ +
301 template<typename T>
│ │ │ │ +
302 constexpr typename std::enable_if<
│ │ │ │ + │ │ │ │ +
304 bool
│ │ │ │ +
305 >::type
│ │ │ │ +
306 _non_empty_tree_path (T t)
│ │ │ │ +
307 {
│ │ │ │ +
308 return treePathSize(t) > 0;
│ │ │ │ +
309 }
│ │ │ │ +
310
│ │ │ │ +
311 }
│ │ │ │ +
312
│ │ │ │ +
313#endif // DOXYGEN
│ │ │ │ +
314
│ │ │ │ +
316
│ │ │ │ +
317 } // namespace TypeTree
│ │ │ │ +
318} //namespace Dune
│ │ │ │ +
319
│ │ │ │ +
320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
typename impl::_is_flat_index< std::decay_t< T > >::type is_flat_index
Type trait that determines whether T is a flat index in the context of child extraction.
Definition: childextraction.hh:282
│ │ │ │ +
ImplementationDefined childStorage(Node &&node, Indices... indices)
Definition: childextraction.hh:136
│ │ │ │ +
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │ +
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ +
typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath
Template alias for the type of a child node given by a TreePath or a HybridTreePath type.
Definition: childextraction.hh:250
│ │ │ │ +
ImplementationDefined child(Node &&node, HybridTreePath< Indices... > treePath)
Extracts the child of a node given by a HybridTreePath object.
Definition: childextraction.hh:171
│ │ │ │ +
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ +
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition: treepath.hh:199
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Type
Definition: treepath.hh:30
│ │ │ │ -
Base class for composite nodes representing a filtered view on an underlying composite node.
Definition: filteredcompositenode.hh:81
│ │ │ │ -
auto childStorage(index_constant< k >={}) const
Returns the storage of the k-th child (const version).
Definition: filteredcompositenode.hh:183
│ │ │ │ -
static constexpr auto degree()
Definition: filteredcompositenode.hh:119
│ │ │ │ -
mapped_children::NodeStorage NodeStorage
The type used for storing the children.
Definition: filteredcompositenode.hh:101
│ │ │ │ -
void setChild(ChildType &&child, typename std::enable_if< lazy_enable< k >::value, void * >::type=0)
Sets the k-th child to the passed-in value.
Definition: filteredcompositenode.hh:190
│ │ │ │ -
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: filteredcompositenode.hh:107
│ │ │ │ -
const Node & unfiltered() const
Returns the unfiltered node (const version).
Definition: filteredcompositenode.hh:217
│ │ │ │ -
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: filteredcompositenode.hh:113
│ │ │ │ -
std::enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage()
Returns the storage object of the unfiltered node.
Definition: filteredcompositenode.hh:228
│ │ │ │ -
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: filteredcompositenode.hh:110
│ │ │ │ -
FilteredCompositeNode(Node &node)
Initialize the CompositeNode with a copy of the passed-in storage type.
Definition: filteredcompositenode.hh:255
│ │ │ │ -
FilteredCompositeNode(std::shared_ptr< Node > node)
Initialize the CompositeNode with copies of the passed in Storage objects.
Definition: filteredcompositenode.hh:250
│ │ │ │ -
auto childStorage(index_constant< k >={})
Returns the storage of the k-th child.
Definition: filteredcompositenode.hh:173
│ │ │ │ -
const auto & child(index_constant< k >={}) const
Returns the k-th child (const version).
Definition: filteredcompositenode.hh:162
│ │ │ │ -
auto & child(index_constant< k >={})
Returns the k-th child.
Definition: filteredcompositenode.hh:152
│ │ │ │ -
CompositeNodeTag NodeTag
The type tag that describes a CompositeNode.
Definition: filteredcompositenode.hh:98
│ │ │ │ -
mapped_children::ChildTypes ChildTypes
A tuple storing the types of all children.
Definition: filteredcompositenode.hh:104
│ │ │ │ -
std::enable_if< enabled, Node & >::type unfiltered()
Returns the unfiltered node.
Definition: filteredcompositenode.hh:208
│ │ │ │ -
static const std::size_t CHILDREN
The number of children.
Definition: filteredcompositenode.hh:117
│ │ │ │ -
std::shared_ptr< const Node > unfilteredStorage() const
Returns the storage object of the unfiltered node (const version).
Definition: filteredcompositenode.hh:237
│ │ │ │ -
Access to the type and storage type of the i-th child.
Definition: filteredcompositenode.hh:126
│ │ │ │ -
OriginalChild::type type
The type of the child.
Definition: filteredcompositenode.hh:140
│ │ │ │ -
OriginalChild::Type Type
The type of the child.
Definition: filteredcompositenode.hh:137
│ │ │ │ -
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │ +
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,342 +4,329 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -filteredcompositenode.hh │ │ │ │ │ +childextraction.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16 │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19 │ │ │ │ │ - 20namespace Dune { │ │ │ │ │ - 21 namespace TypeTree { │ │ │ │ │ - 22 │ │ │ │ │ - 28#ifndef DOXYGEN │ │ │ │ │ - 29 namespace { │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17 │ │ │ │ │ + 18 │ │ │ │ │ + 19namespace Dune { │ │ │ │ │ + 20 namespace TypeTree { │ │ │ │ │ + 21 │ │ │ │ │ + 26 │ │ │ │ │ + 27#ifndef DOXYGEN │ │ │ │ │ + 28 │ │ │ │ │ + 29 namespace Impl { │ │ │ │ │ 30 │ │ │ │ │ - 31 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 32 // Utility structs for filter construction and application │ │ │ │ │ - 33 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 34 │ │ │ │ │ - 35 // Gets the filter and wraps it in case of a SimpleFilter. │ │ │ │ │ - 36 template │ │ │ │ │ - 37 struct get_filter; │ │ │ │ │ + 31 // check at run time whether index is a valid child index │ │ │ │ │ + 32 template │ │ │ │ │ + 33 std::true_type checkChildIndex (Node const& node, Index i) │ │ │ │ │ + 34 { │ │ │ │ │ + 35 assert(std::size_t(i) < node.degree() && "Child index out of range"); │ │ │ │ │ + 36 return {}; │ │ │ │ │ + 37 } │ │ │ │ │ 38 │ │ │ │ │ - 39 // Helper struct to extract the child template parameter pack from the │ │ │ │ │ -ChildTypes tuple. │ │ │ │ │ - 40 template │ │ │ │ │ - 41 struct apply_filter_wrapper; │ │ │ │ │ - 42 │ │ │ │ │ - 43 template │ │ │ │ │ - 44 struct apply_filter_wrapper > │ │ │ │ │ - 45 : public Filter::template apply │ │ │ │ │ - 46 {}; │ │ │ │ │ - 47 │ │ │ │ │ - 48 // specialization for SimpleFilter │ │ │ │ │ - 49 template │ │ │ │ │ - 50 struct get_filter │ │ │ │ │ + 39 // check at compile time whether index is a valid index │ │ │ │ │ + 40 template │ │ │ │ │ + 41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node, │ │ │ │ │ +index_constant) │ │ │ │ │ + 42 { │ │ │ │ │ + 43 static_assert(i < Node::degree(), "Child index out of range"); │ │ │ │ │ + 44 return {}; │ │ │ │ │ + 45 } │ │ │ │ │ + 46 │ │ │ │ │ + 47 // finally return the node itself if no further indices are provided. Break │ │ │ │ │ +condition │ │ │ │ │ + 48 // for the recursion over the node childs. │ │ │ │ │ + 49 template │ │ │ │ │ + 50 decltype(auto) childImpl (Node&& node) │ │ │ │ │ 51 { │ │ │ │ │ - 52 struct type │ │ │ │ │ - 53 { │ │ │ │ │ - 54 template │ │ │ │ │ - 55 struct apply │ │ │ │ │ - 56 : public apply_filter_wrapper,Node,ChildTypes> │ │ │ │ │ - 57 {}; │ │ │ │ │ - 58 }; │ │ │ │ │ - 59 }; │ │ │ │ │ + 52 return std::forward(node); │ │ │ │ │ + 53 } │ │ │ │ │ + 54 │ │ │ │ │ + 55 template │ │ │ │ │ + 56 auto childStorageImpl (NodePtr&& nodePtr) │ │ │ │ │ + 57 { │ │ │ │ │ + 58 return std::forward(nodePtr); │ │ │ │ │ + 59 } │ │ │ │ │ 60 │ │ │ │ │ - 61 // specialization for AdvancedFilter │ │ │ │ │ - 62 template │ │ │ │ │ - 63 struct get_filter │ │ │ │ │ + 61 // recursively call `node.child(...)` with the given indices │ │ │ │ │ + 62 template │ │ │ │ │ + 63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i) │ │ │ │ │ 64 { │ │ │ │ │ - 65 struct type │ │ │ │ │ - 66 { │ │ │ │ │ - 67 template │ │ │ │ │ - 68 struct apply │ │ │ │ │ - 69 : public apply_filter_wrapper │ │ │ │ │ - 70 {}; │ │ │ │ │ - 71 }; │ │ │ │ │ - 72 }; │ │ │ │ │ - 73 │ │ │ │ │ - 74 } // anonymous namespace │ │ │ │ │ - 75#endif // DOXYGEN │ │ │ │ │ - 76 │ │ │ │ │ - 77 │ │ │ │ │ - 79 template │ │ │ │ │ -80 class FilteredCompositeNode │ │ │ │ │ - 81 { │ │ │ │ │ + 65 auto valid = checkChildIndex(node,i0); │ │ │ │ │ + 66 if constexpr (valid) │ │ │ │ │ + 67 return childImpl(node.child(i0),i...); │ │ │ │ │ + 68 else │ │ │ │ │ + 69 return; │ │ │ │ │ + 70 } │ │ │ │ │ + 71 │ │ │ │ │ + 72 // recursively call `node.childStorage(...)` with the given indices │ │ │ │ │ + 73 template │ │ │ │ │ + 74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]] │ │ │ │ │ +I... i) │ │ │ │ │ + 75 { │ │ │ │ │ + 76 auto valid = checkChildIndex(*nodePtr,i0); │ │ │ │ │ + 77 if constexpr (valid) │ │ │ │ │ + 78 return childStorageImpl(nodePtr->childStorage(i0),i...); │ │ │ │ │ + 79 else │ │ │ │ │ + 80 return; │ │ │ │ │ + 81 } │ │ │ │ │ 82 │ │ │ │ │ - 83 typedef typename get_filter::type │ │ │ │ │ -filter; │ │ │ │ │ - 84 typedef typename filter::template apply:: │ │ │ │ │ -type filter_result; │ │ │ │ │ - 85 typedef typename filter_result::template apply mapped_children; │ │ │ │ │ - 86 │ │ │ │ │ - 87 static const bool nodeIsConst = std::is_const::type>::value; │ │ │ │ │ - 88 │ │ │ │ │ - 89 template │ │ │ │ │ - 90 struct lazy_enable │ │ │ │ │ - 91 { │ │ │ │ │ - 92 static const bool value = !nodeIsConst; │ │ │ │ │ - 93 }; │ │ │ │ │ - 94 │ │ │ │ │ - 95 public: │ │ │ │ │ + 83 // forward to the impl methods by extracting the indices from the treepath │ │ │ │ │ + 84 template │ │ │ │ │ + 85 decltype(auto) child (Node&& node, [[maybe_unused]] │ │ │ │ │ +HybridTreePath tp, std::index_sequence) │ │ │ │ │ + 86 { │ │ │ │ │ + 87 return childImpl(std::forward(node),treePathEntry(tp)...); │ │ │ │ │ + 88 } │ │ │ │ │ + 89 │ │ │ │ │ + 90 // forward to the impl methods by extracting the indices from the treepath │ │ │ │ │ + 91 template │ │ │ │ │ + 92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]] │ │ │ │ │ +HybridTreePath tp, std::index_sequence) │ │ │ │ │ + 93 { │ │ │ │ │ + 94 return childStorageImpl(std::forward(nodePtr),treePathEntry │ │ │ │ │ +(tp)...); │ │ │ │ │ + 95 } │ │ │ │ │ 96 │ │ │ │ │ -98 typedef CompositeNodeTag NodeTag; │ │ │ │ │ - 99 │ │ │ │ │ -101 typedef typename mapped_children::NodeStorage NodeStorage; │ │ │ │ │ + 97 } // end namespace Impl │ │ │ │ │ + 98 │ │ │ │ │ + 99#endif // DOXYGEN │ │ │ │ │ + 100 │ │ │ │ │ 102 │ │ │ │ │ -104 typedef typename mapped_children::ChildTypes ChildTypes; │ │ │ │ │ - 105 │ │ │ │ │ -107 static const bool isLeaf = false; │ │ │ │ │ - 108 │ │ │ │ │ -110 static const bool isPower = false; │ │ │ │ │ - 111 │ │ │ │ │ -113 static const bool isComposite = true; │ │ │ │ │ - 114 │ │ │ │ │ - 116 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -117 static const std::size_t CHILDREN = filter_result::size; │ │ │ │ │ - 118 │ │ │ │ │ -119 static constexpr auto degree () │ │ │ │ │ - 120 { │ │ │ │ │ - 121 return std::integral_constant{}; │ │ │ │ │ - 122 } │ │ │ │ │ - 123 │ │ │ │ │ - 125 template │ │ │ │ │ -126 struct Child { │ │ │ │ │ - 127 │ │ │ │ │ - 128#ifndef DOXYGEN │ │ │ │ │ - 129 │ │ │ │ │ - 130 typedef typename std::tuple_element::type OriginalChild; │ │ │ │ │ - 131 │ │ │ │ │ - 132 static const std::size_t mapped_index = std::tuple_element::type::original_index; │ │ │ │ │ + 124 template │ │ │ │ │ + 125#ifdef DOXYGEN │ │ │ │ │ +126 ImplementationDefined child (Node&& node, Indices... indices) │ │ │ │ │ + 127#else │ │ │ │ │ + 128 decltype(auto) child (Node&& node, Indices... indices) │ │ │ │ │ + 129#endif │ │ │ │ │ + 130 { │ │ │ │ │ + 131 return Impl::childImpl(std::forward(node),indices...); │ │ │ │ │ + 132 } │ │ │ │ │ 133 │ │ │ │ │ - 134#endif // DOXYGEN │ │ │ │ │ - 135 │ │ │ │ │ -137 typedef typename OriginalChild::Type Type; │ │ │ │ │ - 138 │ │ │ │ │ -140 typedef typename OriginalChild::type type; │ │ │ │ │ - 141 }; │ │ │ │ │ - 142 │ │ │ │ │ - 145 │ │ │ │ │ - 147 │ │ │ │ │ - 150 template::value, int>::type = 0> │ │ │ │ │ -152 auto& child (index_constant = {}) │ │ │ │ │ - 153 { │ │ │ │ │ - 154 return _node->template child::mapped_index>(); │ │ │ │ │ - 155 } │ │ │ │ │ - 156 │ │ │ │ │ - 158 │ │ │ │ │ - 161 template │ │ │ │ │ -162 const auto& child (index_constant = {}) const │ │ │ │ │ - 163 { │ │ │ │ │ - 164 return _node->template child::mapped_index>(); │ │ │ │ │ - 165 } │ │ │ │ │ - 166 │ │ │ │ │ - 168 │ │ │ │ │ - 171 template::value, int>::type = 0> │ │ │ │ │ -173 auto childStorage (index_constant = {}) │ │ │ │ │ - 174 { │ │ │ │ │ - 175 return _node->template childStorage::mapped_index>(); │ │ │ │ │ - 176 } │ │ │ │ │ - 177 │ │ │ │ │ - 179 │ │ │ │ │ - 182 template │ │ │ │ │ -183 auto childStorage (index_constant = {}) const │ │ │ │ │ - 184 { │ │ │ │ │ - 185 return _node->template childStorage::mapped_index>(); │ │ │ │ │ - 186 } │ │ │ │ │ - 187 │ │ │ │ │ - 189 template │ │ │ │ │ -190 void setChild (ChildType&& child, typename std::enable_if:: │ │ │ │ │ -value,void*>::type = 0) │ │ │ │ │ - 191 { │ │ │ │ │ - 192 _node->template setChild::mapped_index>(std::forward │ │ │ │ │ -(child)); │ │ │ │ │ - 193 } │ │ │ │ │ + 134 template │ │ │ │ │ + 135#ifdef DOXYGEN │ │ │ │ │ +136 ImplementationDefined childStorage (Node&& node, Indices... indices) │ │ │ │ │ + 137#else │ │ │ │ │ + 138 auto childStorage (Node&& node, Indices... indices) │ │ │ │ │ + 139#endif │ │ │ │ │ + 140 { │ │ │ │ │ + 141 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called │ │ │ │ │ +with an empty list of child indices"); │ │ │ │ │ + 142 return Impl::childStorageImpl(&node,indices...); │ │ │ │ │ + 143 } │ │ │ │ │ + 144 │ │ │ │ │ + 146 │ │ │ │ │ + 169 template │ │ │ │ │ + 170#ifdef DOXYGEN │ │ │ │ │ +171 ImplementationDefined child (Node&& node, HybridTreePath │ │ │ │ │ +treePath) │ │ │ │ │ + 172#else │ │ │ │ │ + 173 decltype(auto) child (Node&& node, HybridTreePath tp) │ │ │ │ │ + 174#endif │ │ │ │ │ + 175 { │ │ │ │ │ + 176 return Impl::child(std::forward(node),tp,std:: │ │ │ │ │ +index_sequence_for{}); │ │ │ │ │ + 177 } │ │ │ │ │ + 178 │ │ │ │ │ + 179 template │ │ │ │ │ + 180#ifdef DOXYGEN │ │ │ │ │ + 181 ImplementationDefined child (Node&& node, HybridTreePath │ │ │ │ │ +treePath) │ │ │ │ │ + 182#else │ │ │ │ │ + 183 auto childStorage (Node&& node, HybridTreePath tp) │ │ │ │ │ + 184#endif │ │ │ │ │ + 185 { │ │ │ │ │ + 186 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called │ │ │ │ │ +with an empty TreePath"); │ │ │ │ │ + 187 return Impl::childStorage(&node,tp,std::index_sequence_for{}); │ │ │ │ │ + 188 } │ │ │ │ │ + 189 │ │ │ │ │ + 190 │ │ │ │ │ + 191#ifndef DOXYGEN │ │ │ │ │ + 192 │ │ │ │ │ + 193 namespace impl { │ │ │ │ │ 194 │ │ │ │ │ - 196 │ │ │ │ │ - 199 │ │ │ │ │ - 200 protected: │ │ │ │ │ - 201 │ │ │ │ │ - 203 │ │ │ │ │ - 206 template │ │ │ │ │ - 207 typename std::enable_if::type │ │ │ │ │ -208 unfiltered () │ │ │ │ │ - 209 { │ │ │ │ │ - 210 return *_node; │ │ │ │ │ - 211 } │ │ │ │ │ - 212 │ │ │ │ │ - 214 │ │ │ │ │ -217 const Node& unfiltered () const │ │ │ │ │ - 218 { │ │ │ │ │ - 219 return *_node; │ │ │ │ │ - 220 } │ │ │ │ │ - 221 │ │ │ │ │ - 223 │ │ │ │ │ - 226 template │ │ │ │ │ - 227 typename std::enable_if >::type │ │ │ │ │ -228 unfilteredStorage () │ │ │ │ │ - 229 { │ │ │ │ │ - 230 return _node; │ │ │ │ │ - 231 } │ │ │ │ │ - 232 │ │ │ │ │ - 234 │ │ │ │ │ -237 std::shared_ptr unfilteredStorage () const │ │ │ │ │ - 238 { │ │ │ │ │ - 239 return _node; │ │ │ │ │ - 240 } │ │ │ │ │ + 195 template │ │ │ │ │ + 196 struct filter_void │ │ │ │ │ + 197 { │ │ │ │ │ + 198 using type = T; │ │ │ │ │ + 199 }; │ │ │ │ │ + 200 │ │ │ │ │ + 201 template<> │ │ │ │ │ + 202 struct filter_void │ │ │ │ │ + 203 {}; │ │ │ │ │ + 204 │ │ │ │ │ + 205 template │ │ │ │ │ + 206 struct _Child │ │ │ │ │ + 207 : public filter_void │ │ │ │ │ +(),index_constant{}...))>> │ │ │ │ │ + 208 {}; │ │ │ │ │ + 209 │ │ │ │ │ + 210 } │ │ │ │ │ + 211 │ │ │ │ │ + 212#endif // DOXYGEN │ │ │ │ │ + 213 │ │ │ │ │ + 215 │ │ │ │ │ + 222 template │ │ │ │ │ +223 using Child = typename impl::_Child::type; │ │ │ │ │ + 224 │ │ │ │ │ + 225 │ │ │ │ │ + 226#ifndef DOXYGEN │ │ │ │ │ + 227 │ │ │ │ │ + 228 namespace impl { │ │ │ │ │ + 229 │ │ │ │ │ + 230 template │ │ │ │ │ + 231 struct _ChildForTreePath │ │ │ │ │ + 232 { │ │ │ │ │ + 233 using type = typename std::decay(),std:: │ │ │ │ │ +declval()))>::type; │ │ │ │ │ + 234 }; │ │ │ │ │ + 235 │ │ │ │ │ + 236 } │ │ │ │ │ + 237 │ │ │ │ │ + 238#endif // DOXYGEN │ │ │ │ │ + 239 │ │ │ │ │ 241 │ │ │ │ │ - 243 │ │ │ │ │ - 244 public: │ │ │ │ │ - 245 │ │ │ │ │ - 248 │ │ │ │ │ -250 FilteredCompositeNode (std::shared_ptr node) │ │ │ │ │ - 251 : _node(std::move(node)) │ │ │ │ │ - 252 {} │ │ │ │ │ - 253 │ │ │ │ │ -255 FilteredCompositeNode (Node& node) │ │ │ │ │ - 256 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ - 257 {} │ │ │ │ │ - 258 │ │ │ │ │ - 260 │ │ │ │ │ - 261 private: │ │ │ │ │ - 262 std::shared_ptr _node; │ │ │ │ │ - 263 }; │ │ │ │ │ - 264 │ │ │ │ │ - 266 │ │ │ │ │ - 267 } // namespace TypeTree │ │ │ │ │ - 268} //namespace Dune │ │ │ │ │ - 269 │ │ │ │ │ - 270#endif // DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ -filters.hh │ │ │ │ │ -nodetags.hh │ │ │ │ │ + 249 template │ │ │ │ │ +250 using ChildForTreePath = typename impl::_ChildForTreePath:: │ │ │ │ │ +type; │ │ │ │ │ + 251 │ │ │ │ │ + 252 │ │ │ │ │ + 253#ifndef DOXYGEN │ │ │ │ │ + 254 │ │ │ │ │ + 255 namespace impl { │ │ │ │ │ + 256 │ │ │ │ │ + 257 // By default, types are flat indices if they are integral │ │ │ │ │ + 258 template │ │ │ │ │ + 259 struct _is_flat_index │ │ │ │ │ + 260 { │ │ │ │ │ + 261 using type = std::is_integral; │ │ │ │ │ + 262 }; │ │ │ │ │ + 263 │ │ │ │ │ + 264 // And so is any index_constant │ │ │ │ │ + 265 template │ │ │ │ │ + 266 struct _is_flat_index> │ │ │ │ │ + 267 { │ │ │ │ │ + 268 using type = std::true_type; │ │ │ │ │ + 269 }; │ │ │ │ │ + 270 │ │ │ │ │ + 271 } │ │ │ │ │ + 272 │ │ │ │ │ + 273#endif // DOXYGEN │ │ │ │ │ + 274 │ │ │ │ │ + 276 /* │ │ │ │ │ + 277 * This type trait can be used to check whether T is a flat index (i.e. │ │ │ │ │ +either `std::size_t` │ │ │ │ │ + 278 * or `index_constant`). The type trait normalizes T before doing the │ │ │ │ │ +check, so it will also │ │ │ │ │ + 279 * work correctly for references and cv-qualified types. │ │ │ │ │ + 280 */ │ │ │ │ │ + 281 template │ │ │ │ │ +282 using is_flat_index = typename impl::_is_flat_index>::type; │ │ │ │ │ + 283 │ │ │ │ │ + 284#ifndef DOXYGEN │ │ │ │ │ + 285 │ │ │ │ │ + 286 namespace impl { │ │ │ │ │ + 287 │ │ │ │ │ + 288 // helper function for check in member child() functions that tolerates │ │ │ │ │ +being passed something that │ │ │ │ │ + 289 // isn't a TreePath. It will just return 0 in that case │ │ │ │ │ + 290 │ │ │ │ │ + 291 template │ │ │ │ │ + 292 constexpr typename std::enable_if< │ │ │ │ │ + 293 Dune::TypeTree::is_flat_index::value, │ │ │ │ │ + 294 bool │ │ │ │ │ + 295 >::type │ │ │ │ │ + 296 _non_empty_tree_path (T) │ │ │ │ │ + 297 { │ │ │ │ │ + 298 return false; │ │ │ │ │ + 299 } │ │ │ │ │ + 300 │ │ │ │ │ + 301 template │ │ │ │ │ + 302 constexpr typename std::enable_if< │ │ │ │ │ + 303 !Dune::TypeTree::is_flat_index::value, │ │ │ │ │ + 304 bool │ │ │ │ │ + 305 >::type │ │ │ │ │ + 306 _non_empty_tree_path (T t) │ │ │ │ │ + 307 { │ │ │ │ │ + 308 return treePathSize(t) > 0; │ │ │ │ │ + 309 } │ │ │ │ │ + 310 │ │ │ │ │ + 311 } │ │ │ │ │ + 312 │ │ │ │ │ + 313#endif // DOXYGEN │ │ │ │ │ + 314 │ │ │ │ │ + 316 │ │ │ │ │ + 317 } // namespace TypeTree │ │ │ │ │ + 318} //namespace Dune │ │ │ │ │ + 319 │ │ │ │ │ + 320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ +treepath.hh │ │ │ │ │ +Dune::TypeTree::is_flat_index │ │ │ │ │ +typename impl::_is_flat_index< std::decay_t< T > >::type is_flat_index │ │ │ │ │ +Type trait that determines whether T is a flat index in the context of child │ │ │ │ │ +extraction. │ │ │ │ │ +Definition: childextraction.hh:282 │ │ │ │ │ +Dune::TypeTree::childStorage │ │ │ │ │ +ImplementationDefined childStorage(Node &&node, Indices... indices) │ │ │ │ │ +Definition: childextraction.hh:136 │ │ │ │ │ +Dune::TypeTree::Child │ │ │ │ │ +typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ +Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ +Definition: childextraction.hh:223 │ │ │ │ │ +Dune::TypeTree::child │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: childextraction.hh:126 │ │ │ │ │ +Dune::TypeTree::ChildForTreePath │ │ │ │ │ +typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath │ │ │ │ │ +Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ +HybridTreePath type. │ │ │ │ │ +Definition: childextraction.hh:250 │ │ │ │ │ +Dune::TypeTree::child │ │ │ │ │ +ImplementationDefined child(Node &&node, HybridTreePath< Indices... > treePath) │ │ │ │ │ +Extracts the child of a node given by a HybridTreePath object. │ │ │ │ │ +Definition: childextraction.hh:171 │ │ │ │ │ +Dune::TypeTree::degree │ │ │ │ │ +std::size_t degree(const Node &node) │ │ │ │ │ +Returns the degree of node as run time information. │ │ │ │ │ +Definition: nodeinterface.hh:85 │ │ │ │ │ +Dune::TypeTree::treePathSize │ │ │ │ │ +constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ +Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:199 │ │ │ │ │ +Dune::TypeTree::treePath │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:191 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::TreePathType::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode │ │ │ │ │ -Base class for composite nodes representing a filtered view on an underlying │ │ │ │ │ -composite node. │ │ │ │ │ -Definition: filteredcompositenode.hh:81 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::childStorage │ │ │ │ │ -auto childStorage(index_constant< k >={}) const │ │ │ │ │ -Returns the storage of the k-th child (const version). │ │ │ │ │ -Definition: filteredcompositenode.hh:183 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::degree │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -Definition: filteredcompositenode.hh:119 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::NodeStorage │ │ │ │ │ -mapped_children::NodeStorage NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -Definition: filteredcompositenode.hh:101 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::setChild │ │ │ │ │ -void setChild(ChildType &&child, typename std::enable_if< lazy_enable< k >:: │ │ │ │ │ -value, void * >::type=0) │ │ │ │ │ -Sets the k-th child to the passed-in value. │ │ │ │ │ -Definition: filteredcompositenode.hh:190 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -Definition: filteredcompositenode.hh:107 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::unfiltered │ │ │ │ │ -const Node & unfiltered() const │ │ │ │ │ -Returns the unfiltered node (const version). │ │ │ │ │ -Definition: filteredcompositenode.hh:217 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::isComposite │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a composite in the dune-typetree. │ │ │ │ │ -Definition: filteredcompositenode.hh:113 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::unfilteredStorage │ │ │ │ │ -std::enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage() │ │ │ │ │ -Returns the storage object of the unfiltered node. │ │ │ │ │ -Definition: filteredcompositenode.hh:228 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -Definition: filteredcompositenode.hh:110 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::FilteredCompositeNode │ │ │ │ │ -FilteredCompositeNode(Node &node) │ │ │ │ │ -Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ -Definition: filteredcompositenode.hh:255 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::FilteredCompositeNode │ │ │ │ │ -FilteredCompositeNode(std::shared_ptr< Node > node) │ │ │ │ │ -Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ -Definition: filteredcompositenode.hh:250 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::childStorage │ │ │ │ │ -auto childStorage(index_constant< k >={}) │ │ │ │ │ -Returns the storage of the k-th child. │ │ │ │ │ -Definition: filteredcompositenode.hh:173 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::child │ │ │ │ │ -const auto & child(index_constant< k >={}) const │ │ │ │ │ -Returns the k-th child (const version). │ │ │ │ │ -Definition: filteredcompositenode.hh:162 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::child │ │ │ │ │ -auto & child(index_constant< k >={}) │ │ │ │ │ -Returns the k-th child. │ │ │ │ │ -Definition: filteredcompositenode.hh:152 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::NodeTag │ │ │ │ │ -CompositeNodeTag NodeTag │ │ │ │ │ -The type tag that describes a CompositeNode. │ │ │ │ │ -Definition: filteredcompositenode.hh:98 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::ChildTypes │ │ │ │ │ -mapped_children::ChildTypes ChildTypes │ │ │ │ │ -A tuple storing the types of all children. │ │ │ │ │ -Definition: filteredcompositenode.hh:104 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::unfiltered │ │ │ │ │ -std::enable_if< enabled, Node & >::type unfiltered() │ │ │ │ │ -Returns the unfiltered node. │ │ │ │ │ -Definition: filteredcompositenode.hh:208 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::CHILDREN │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -Definition: filteredcompositenode.hh:117 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::unfilteredStorage │ │ │ │ │ -std::shared_ptr< const Node > unfilteredStorage() const │ │ │ │ │ -Returns the storage object of the unfiltered node (const version). │ │ │ │ │ -Definition: filteredcompositenode.hh:237 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::Child │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -Definition: filteredcompositenode.hh:126 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::Child::type │ │ │ │ │ -OriginalChild::type type │ │ │ │ │ -The type of the child. │ │ │ │ │ -Definition: filteredcompositenode.hh:140 │ │ │ │ │ -Dune::TypeTree::FilteredCompositeNode::Child::Type │ │ │ │ │ -OriginalChild::Type Type │ │ │ │ │ -The type of the child. │ │ │ │ │ -Definition: filteredcompositenode.hh:137 │ │ │ │ │ -Dune::TypeTree::CompositeNodeTag │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -Definition: nodetags.hh:25 │ │ │ │ │ +Dune::TypeTree::HybridTreePath │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: treepath.hh:79 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: visitor.hh File Reference │ │ │ │ +dune-typetree: treecontainer.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,108 +65,73 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Functions | │ │ │ │ -Variables
│ │ │ │ -
visitor.hh File Reference
│ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
treecontainer.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/typetree/treepath.hh>
│ │ │ │ -#include <dune/typetree/utility.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <functional>
│ │ │ │ +#include <array>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/common/rangeutilities.hh>
│ │ │ │ +#include <dune/common/tuplevector.hh>
│ │ │ │ +#include <dune/typetree/treepath.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::DefaultVisitor
 Visitor interface and base class for TypeTree visitors. More...
class  Dune::TypeTree::Detail::ContainerFactory< LeafToValue >
 
struct  Dune::TypeTree::DefaultPairVisitor
 Visitor interface and base class for visitors of pairs of TypeTrees. More...
class  Dune::TypeTree::Detail::TreeContainerVectorBackend< Container >
 
struct  Dune::TypeTree::Experimental::DefaultHybridVisitor
 Hybrid visitor interface and base class for TypeTree hybrid visitors. More...
 
struct  Dune::TypeTree::VisitDirectChildren
 Mixin base class for visitors that only want to visit the direct children of a node. More...
 
struct  Dune::TypeTree::VisitDirectChildren::VisitChild< Node1, Child1, Node2, Child2, TreePath >
 Template struct for determining whether or not to visit a given child. More...
 
struct  Dune::TypeTree::VisitTree
 Mixin base class for visitors that want to visit the complete tree. More...
 
struct  Dune::TypeTree::VisitTree::VisitChild< Node1, Child1, Node2, Child2, TreePath >
 Template struct for determining whether or not to visit a given child. More...
 
struct  Dune::TypeTree::StaticTraversal
 Mixin base class for visitors that require a static TreePath during traversal. More...
 
struct  Dune::TypeTree::DynamicTraversal
 Mixin base class for visitors that only need a dynamic TreePath during traversal. More...
 
struct  Dune::TypeTree::TreeVisitor
 Convenience base class for visiting the entire tree. More...
 
struct  Dune::TypeTree::DirectChildrenVisitor
 Convenience base class for visiting the direct children of a node. More...
 
struct  Dune::TypeTree::TreePairVisitor
 Convenience base class for visiting an entire tree pair. More...
 
struct  Dune::TypeTree::DirectChildrenPairVisitor
 Convenience base class for visiting the direct children of a node pair. More...
 
struct  Dune::TypeTree::Experimental::Info::LeafCounterVisitor
 
struct  Dune::TypeTree::Experimental::Info::NodeCounterVisitor
 
struct  Dune::TypeTree::Experimental::Info::DepthVisitor
struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Experimental
 
namespace  Dune::TypeTree::Experimental::Info
namespace  Dune::TypeTree::Detail
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

template<class Value , class Tree >
using Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >()))>
 Alias to container type generated by makeTreeContainer for given tree type and uniform value type. More...
 
template<template< class Node > class LeafToValue, class Tree >
using Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))>
 Alias to container type generated by makeTreeContainer for give tree type and when using LeafToValue to create values. More...
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Functions

template<typename Tree >
auto Dune::TypeTree::Experimental::Info::depth (const Tree &tree)
 The depth of the TypeTree. More...
 
template<typename Tree >
constexpr auto Dune::TypeTree::Experimental::Info::depth ()
 The depth of the Tree. More...
 
template<typename Tree >
auto Dune::TypeTree::Experimental::Info::nodeCount (const Tree &tree)
 The total number of nodes in the Tree. More...
 
template<typename Tree >
auto Dune::TypeTree::Experimental::Info::leafCount (const Tree &tree)
 The number of leaf nodes in the Tree. More...
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ -Variables

template<typename Tree >
constexpr bool Dune::TypeTree::Experimental::Info::isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{}
 true if any of the nodes in the tree only has dynamic degree. More...
 
template<class Container >
auto Dune::TypeTree::Detail::makeTreeContainerVectorBackend (Container &&container)
 
template<class Tree , class LeafToValue >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue &&leafToValue)
 Create container havin the same structure as the given tree. More...
 
template<class Value , class Tree >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree)
 Create container havin the same structure as the given tree. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,109 +4,64 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Functions | Variables │ │ │ │ │ -visitor.hh File Reference │ │ │ │ │ +Classes | Namespaces | Typedefs | Functions │ │ │ │ │ +treecontainer.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::DefaultVisitor │ │ │ │ │ -  Visitor interface and base class for TypeTree visitors. More... │ │ │ │ │ + class  Dune::TypeTree::Detail::ContainerFactory<_LeafToValue_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::DefaultPairVisitor │ │ │ │ │ -  Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ - More... │ │ │ │ │ + class  Dune::TypeTree::Detail::TreeContainerVectorBackend<_Container_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::Experimental::DefaultHybridVisitor │ │ │ │ │ -  Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::VisitDirectChildren │ │ │ │ │ -  Mixin base class for visitors that only want to visit the direct │ │ │ │ │ - children of a node. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::VisitDirectChildren::VisitChild<_Node1,_Child1,_Node2, │ │ │ │ │ - Child2,_TreePath_> │ │ │ │ │ -  Template struct for determining whether or not to visit a given child. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::VisitTree │ │ │ │ │ -  Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::VisitTree::VisitChild<_Node1,_Child1,_Node2,_Child2, │ │ │ │ │ - TreePath_> │ │ │ │ │ -  Template struct for determining whether or not to visit a given child. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::StaticTraversal │ │ │ │ │ -  Mixin base class for visitors that require a static TreePath during │ │ │ │ │ - traversal. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::DynamicTraversal │ │ │ │ │ -  Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ - traversal. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreeVisitor │ │ │ │ │ -  Convenience base class for visiting the entire tree. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::DirectChildrenVisitor │ │ │ │ │ -  Convenience base class for visiting the direct children of a node. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePairVisitor │ │ │ │ │ -  Convenience base class for visiting an entire tree pair. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::DirectChildrenPairVisitor │ │ │ │ │ -  Convenience base class for visiting the direct children of a node │ │ │ │ │ - pair. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::Experimental::Info::LeafCounterVisitor │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::Experimental::Info::NodeCounterVisitor │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::Experimental::Info::DepthVisitor │ │ │ │ │ +struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue<_LeafToValue_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::Experimental │ │ │ │ │ +namespace  Dune::TypeTree::Detail │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::Experimental::Info │ │ │ │ │ + Typedefs │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype │ │ │ │ │ + (makeTreeContainer< Value >(std::declval< const Tree & >()))> │ │ │ │ │ +  Alias to container type generated by makeTreeContainer for given tree │ │ │ │ │ + type and uniform value type. More... │ │ │ │ │ +  │ │ │ │ │ +template class LeafToValue, class Tree > │ │ │ │ │ +using Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer │ │ │ │ │ + (std::declval< const Tree & >(), std::declval< Detail:: │ │ │ │ │ + LeafToDefaultConstructibleValue< LeafToValue > >()))> │ │ │ │ │ +  Alias to container type generated by makeTreeContainer for give tree │ │ │ │ │ + type and when using LeafToValue to create values. More... │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ - auto Dune::TypeTree::Experimental::Info::depth (const Tree &tree) │ │ │ │ │ -  The depth of the TypeTree. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto Dune::TypeTree::Experimental::Info::depth () │ │ │ │ │ -  The depth of the Tree. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - auto Dune::TypeTree::Experimental::Info::nodeCount (const Tree │ │ │ │ │ - &tree) │ │ │ │ │ -  The total number of nodes in the Tree. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - auto Dune::TypeTree::Experimental::Info::leafCount (const Tree │ │ │ │ │ - &tree) │ │ │ │ │ -  The number of leaf nodes in the Tree. More... │ │ │ │ │ -  │ │ │ │ │ - Variables │ │ │ │ │ -template │ │ │ │ │ -constexpr bool Dune::TypeTree::Experimental::Info::isDynamic = std:: │ │ │ │ │ - is_same()))> │ │ │ │ │ - {} │ │ │ │ │ -  true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ - More... │ │ │ │ │ +template │ │ │ │ │ +auto Dune::TypeTree::Detail::makeTreeContainerVectorBackend (Container │ │ │ │ │ + &&container) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +auto Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue │ │ │ │ │ + &&leafToValue) │ │ │ │ │ +  Create container havin the same structure as the given tree. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +auto Dune::TypeTree::makeTreeContainer (const Tree &tree) │ │ │ │ │ +  Create container havin the same structure as the given tree. More... │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: visitor.hh Source File │ │ │ │ +dune-typetree: treecontainer.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,333 +62,297 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
visitor.hh
│ │ │ │ +
treecontainer.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_VISITOR_HH
│ │ │ │ -
5#define DUNE_TYPETREE_VISITOR_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ - │ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11 namespace TypeTree {
│ │ │ │ -
12
│ │ │ │ -
19
│ │ │ │ - │ │ │ │ -
47 {
│ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <utility>
│ │ │ │ +
9#include <functional>
│ │ │ │ +
10#include <array>
│ │ │ │ +
11
│ │ │ │ +
12#include <dune/common/indices.hh>
│ │ │ │ +
13#include <dune/common/hybridutilities.hh>
│ │ │ │ +
14#include <dune/common/rangeutilities.hh>
│ │ │ │ +
15#include <dune/common/tuplevector.hh>
│ │ │ │ +
16
│ │ │ │ + │ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20 namespace TypeTree {
│ │ │ │ +
21
│ │ │ │ +
22 namespace Detail {
│ │ │ │ +
23
│ │ │ │ +
24 /*
│ │ │ │ +
25 * \brief A factory class creating a hybrid container compatible with a type tree
│ │ │ │ +
26 *
│ │ │ │ +
27 * This class allows to create a nested hybrid container having the same structure
│ │ │ │ +
28 * as a given type tree. Power nodes are represented as std::array's while composite
│ │ │ │ +
29 * nodes are represented as Dune::TupleVector's. The stored values for the leaf nodes
│ │ │ │ +
30 * are creating using a given predicate. Once created, the factory provides an
│ │ │ │ +
31 * operator() creating the container for the tree given as argument.
│ │ │ │ +
32 *
│ │ │ │ +
33 * \tparam LeafToValue Type of a predicate that determines the stored values at the leafs
│ │ │ │ +
34 */
│ │ │ │ +
35 template<class LeafToValue>
│ │ │ │ + │ │ │ │ +
37 {
│ │ │ │ +
38 template<class N>
│ │ │ │ +
39 using DynamicDegreeConcept = decltype((std::size_t(std::declval<N>().degree()), true));
│ │ │ │ +
40
│ │ │ │ +
41 template<class N>
│ │ │ │ +
42 using StaticDegreeConcept = decltype((std::integral_constant<std::size_t, N::degree()>{}, true));
│ │ │ │ +
43
│ │ │ │ +
44 template<class N>
│ │ │ │ +
45 using DynamicChildAccessConcept = decltype((std::declval<N>().child(0u), true));
│ │ │ │ +
46
│ │ │ │ +
47 public:
│ │ │ │
48
│ │ │ │ -
50
│ │ │ │ -
57 template<typename T, typename TreePath>
│ │ │ │ -
58 void pre(T&&, TreePath) const {}
│ │ │ │ +
56 ContainerFactory(LeafToValue leafToValue) :
│ │ │ │ +
57 leafToValue_(leafToValue)
│ │ │ │ +
58 {}
│ │ │ │
59
│ │ │ │ -
61
│ │ │ │ -
69 template<typename T, typename TreePath>
│ │ │ │ -
70 void in(T&&, TreePath) const {}
│ │ │ │ -
71
│ │ │ │ -
73
│ │ │ │ -
80 template<typename T, typename TreePath>
│ │ │ │ -
81 void post(T&&, TreePath) const {}
│ │ │ │ -
82
│ │ │ │ +
60 template<class Node>
│ │ │ │ +
61 auto operator()(const Node& node)
│ │ │ │ +
62 {
│ │ │ │ +
63 return (*this)(node, Dune::PriorityTag<5>{});
│ │ │ │ +
64 }
│ │ │ │ +
65
│ │ │ │ +
66 private:
│ │ │ │ +
67
│ │ │ │ +
68 template<class Node,
│ │ │ │ +
69 std::enable_if_t<Node::isLeaf, bool> = true>
│ │ │ │ +
70 auto operator()(const Node& node, Dune::PriorityTag<4>)
│ │ │ │ +
71 {
│ │ │ │ +
72 return leafToValue_(node);
│ │ │ │ +
73 }
│ │ │ │ +
74
│ │ │ │ +
75 template<class Node,
│ │ │ │ +
76 StaticDegreeConcept<Node> = true,
│ │ │ │ +
77 DynamicChildAccessConcept<Node> = true>
│ │ │ │ +
78 auto operator()(const Node& node, Dune::PriorityTag<3>)
│ │ │ │ +
79 {
│ │ │ │ +
80 return Dune::unpackIntegerSequence([&](auto... indices) {
│ │ │ │ +
81 return std::array{(*this)(node.child(indices))...};
│ │ │ │ +
82 }, std::make_index_sequence<std::size_t(Node::degree())>());
│ │ │ │ +
83 }
│ │ │ │
84
│ │ │ │ -
90 template<typename T, typename TreePath>
│ │ │ │ -
91 void leaf(T&&, TreePath) const {}
│ │ │ │ -
92
│ │ │ │ -
94
│ │ │ │ -
104 template<typename T, typename Child, typename TreePath, typename ChildIndex>
│ │ │ │ -
105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}
│ │ │ │ +
85 template<class Node,
│ │ │ │ +
86 DynamicDegreeConcept<Node> = true,
│ │ │ │ +
87 DynamicChildAccessConcept<Node> = true>
│ │ │ │ +
88 auto operator()(const Node& node, Dune::PriorityTag<2>)
│ │ │ │ +
89 {
│ │ │ │ +
90 using TransformedChild = decltype((*this)(node.child(0)));
│ │ │ │ +
91 std::vector<TransformedChild> container;
│ │ │ │ +
92 container.reserve(node.degree());
│ │ │ │ +
93 for (std::size_t i = 0; i < node.degree(); ++i)
│ │ │ │ +
94 container.emplace_back((*this)(node.child(i)));
│ │ │ │ +
95 return container;
│ │ │ │ +
96 }
│ │ │ │ +
97
│ │ │ │ +
98 template<class Node,
│ │ │ │ +
99 StaticDegreeConcept<Node> = true>
│ │ │ │ +
100 auto operator()(const Node& node, Dune::PriorityTag<1>)
│ │ │ │ +
101 {
│ │ │ │ +
102 return Dune::unpackIntegerSequence([&](auto... indices) {
│ │ │ │ +
103 return Dune::makeTupleVector((*this)(node.child(indices))...);
│ │ │ │ +
104 }, std::make_index_sequence<std::size_t(Node::degree())>());
│ │ │ │ +
105 }
│ │ │ │
106
│ │ │ │ -
108
│ │ │ │ -
119 template<typename T, typename Child, typename TreePath, typename ChildIndex>
│ │ │ │ -
120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}
│ │ │ │ -
121
│ │ │ │ -
122 };
│ │ │ │ +
107 private:
│ │ │ │ +
108 LeafToValue leafToValue_;
│ │ │ │ +
109 };
│ │ │ │ +
110
│ │ │ │ +
111
│ │ │ │ +
112 /*
│ │ │ │ +
113 * \brief Wrap nested container to provide a VectorBackend
│ │ │ │ +
114 */
│ │ │ │ +
115 template<class Container>
│ │ │ │ + │ │ │ │ +
117 {
│ │ │ │ +
118 template<class C>
│ │ │ │ +
119 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<>& path)
│ │ │ │ +
120 {
│ │ │ │ +
121 return container;
│ │ │ │ +
122 }
│ │ │ │
123
│ │ │ │ -
124
│ │ │ │ -
126
│ │ │ │ - │ │ │ │ -
162 {
│ │ │ │ -
163
│ │ │ │ -
165
│ │ │ │ -
173 template<typename T1, typename T2, typename TreePath>
│ │ │ │ -
174 void pre(T1&&, T2&&, TreePath) const {}
│ │ │ │ -
175
│ │ │ │ -
177
│ │ │ │ -
186 template<typename T1, typename T2, typename TreePath>
│ │ │ │ -
187 void in(T1&&, T2&&, TreePath) const {}
│ │ │ │ -
188
│ │ │ │ -
190
│ │ │ │ -
198 template<typename T1, typename T2, typename TreePath>
│ │ │ │ -
199 void post(T1&&, T2&&, TreePath) const {}
│ │ │ │ -
200
│ │ │ │ -
202
│ │ │ │ -
213 template<typename T1, typename T2, typename TreePath>
│ │ │ │ -
214 void leaf(T1&&, T2&&, TreePath) const {}
│ │ │ │ -
215
│ │ │ │ -
217
│ │ │ │ -
229 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
│ │ │ │ -
230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
│ │ │ │ -
231
│ │ │ │ -
233
│ │ │ │ -
245 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
│ │ │ │ -
246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
│ │ │ │ -
247
│ │ │ │ -
248 };
│ │ │ │ -
249
│ │ │ │ -
250
│ │ │ │ -
251 namespace Experimental {
│ │ │ │ -
252
│ │ │ │ - │ │ │ │ -
284 {
│ │ │ │ -
285
│ │ │ │ -
293 template<typename T, typename TreePath, typename U>
│ │ │ │ -
294 auto pre(T&&, TreePath, const U& u) const { return u;}
│ │ │ │ -
295
│ │ │ │ -
303 template<typename T, typename TreePath, typename U>
│ │ │ │ -
304 auto in(T&&, TreePath, const U& u) const {return u;}
│ │ │ │ +
124 template<class C, class... T>
│ │ │ │ +
125 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<T...>& path)
│ │ │ │ +
126 {
│ │ │ │ +
127 auto head = path[Dune::Indices::_0];
│ │ │ │ +
128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){
│ │ │ │ +
129 return treePath(path[Dune::index_constant<i+1>{}]...);
│ │ │ │ +
130 }, std::make_index_sequence<sizeof...(T)-1>());
│ │ │ │ +
131 return accessByTreePath(container[head], tailPath);
│ │ │ │ +
132 }
│ │ │ │ +
133
│ │ │ │ +
134 template<class C, class Tree,
│ │ │ │ +
135 std::enable_if_t<Tree::isLeaf, bool> = true>
│ │ │ │ +
136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune::PriorityTag<2>)
│ │ │ │ +
137 {
│ │ │ │ +
138 /* do nothing */
│ │ │ │ +
139 }
│ │ │ │ +
140
│ │ │ │ +
141 template<class C, class Tree,
│ │ │ │ +
142 class = decltype(std::declval<C>().resize(0u))>
│ │ │ │ +
143 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<1>)
│ │ │ │ +
144 {
│ │ │ │ +
145 container.resize(tree.degree());
│ │ │ │ +
146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
│ │ │ │ +
147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
│ │ │ │ +
148 });
│ │ │ │ +
149 }
│ │ │ │ +
150
│ │ │ │ +
151 template<class C, class Tree>
│ │ │ │ +
152 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<0>)
│ │ │ │ +
153 {
│ │ │ │ +
154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
│ │ │ │ +
155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
│ │ │ │ +
156 });
│ │ │ │ +
157 }
│ │ │ │ +
158
│ │ │ │ +
159 template<class T>
│ │ │ │ +
160 using TypeTreeConcept = decltype((
│ │ │ │ +
161 std::declval<T>().degree(),
│ │ │ │ +
162 T::isLeaf,
│ │ │ │ +
163 T::isPower,
│ │ │ │ +
164 T::isComposite,
│ │ │ │ +
165 true));
│ │ │ │ +
166
│ │ │ │ +
167 public:
│ │ │ │ +
169 TreeContainerVectorBackend(Container&& container) :
│ │ │ │ +
170 container_(std::move(container))
│ │ │ │ +
171 {}
│ │ │ │ +
172
│ │ │ │ +
174 template <class Tree, TypeTreeConcept<Tree> = true>
│ │ │ │ +
175 TreeContainerVectorBackend(const Tree& tree) :
│ │ │ │ + │ │ │ │ +
177 {
│ │ │ │ +
178 this->resize(tree);
│ │ │ │ +
179 }
│ │ │ │ +
180
│ │ │ │ +
182 template <class C = Container,
│ │ │ │ +
183 std::enable_if_t<std::is_default_constructible_v<C>, bool> = true>
│ │ │ │ + │ │ │ │ +
185 container_()
│ │ │ │ +
186 {}
│ │ │ │ +
187
│ │ │ │ +
188 template<class... T>
│ │ │ │ +
189 decltype(auto) operator[](const HybridTreePath<T...>& path) const
│ │ │ │ +
190 {
│ │ │ │ +
191 return accessByTreePath(container_, path);
│ │ │ │ +
192 }
│ │ │ │ +
193
│ │ │ │ +
194 template<class... T>
│ │ │ │ +
195 decltype(auto) operator[](const HybridTreePath<T...>& path)
│ │ │ │ +
196 {
│ │ │ │ +
197 return accessByTreePath(container_, path);
│ │ │ │ +
198 }
│ │ │ │ +
199
│ │ │ │ +
201 template<class Tree, TypeTreeConcept<Tree> = true>
│ │ │ │ +
202 void resize(const Tree& tree)
│ │ │ │ +
203 {
│ │ │ │ +
204 resizeImpl(container_, tree, Dune::PriorityTag<5>{});
│ │ │ │ +
205 }
│ │ │ │ +
206
│ │ │ │ +
207 const Container& data() const
│ │ │ │ +
208 {
│ │ │ │ +
209 return container_;
│ │ │ │ +
210 }
│ │ │ │ +
211
│ │ │ │ +
212 Container& data()
│ │ │ │ +
213 {
│ │ │ │ +
214 return container_;
│ │ │ │ +
215 }
│ │ │ │ +
216
│ │ │ │ +
217 private:
│ │ │ │ +
218 Container container_;
│ │ │ │ +
219 };
│ │ │ │ +
220
│ │ │ │ +
221 template<class Container>
│ │ │ │ +
222 auto makeTreeContainerVectorBackend(Container&& container)
│ │ │ │ +
223 {
│ │ │ │ +
224 return TreeContainerVectorBackend<std::decay_t<Container>>(std::forward<Container>(container));
│ │ │ │ +
225 }
│ │ │ │ +
226
│ │ │ │ +
227 /*
│ │ │ │ +
228 * \brief A simple lambda for creating default constructible values from a node
│ │ │ │ +
229 *
│ │ │ │ +
230 * This simply returns LeafToValue<Node>{} for a given Node. It's needed
│ │ │ │ +
231 * because using a lambda expression in a using declaration is not allowed
│ │ │ │ +
232 * because it's an unevaluated context.
│ │ │ │ +
233 */
│ │ │ │ +
234 template<template<class Node> class LeafToValue>
│ │ │ │ + │ │ │ │ +
236 {
│ │ │ │ +
237 template<class Node>
│ │ │ │ +
238 auto operator()(const Node& node) const
│ │ │ │ +
239 {
│ │ │ │ +
240 return LeafToValue<Node>{};
│ │ │ │ +
241 }
│ │ │ │ +
242 };
│ │ │ │ +
243
│ │ │ │ +
244 } // namespace Detail
│ │ │ │ +
245
│ │ │ │ +
265 template<class Tree, class LeafToValue>
│ │ │ │ +
266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue)
│ │ │ │ +
267 {
│ │ │ │ +
268 auto f = std::ref(leafToValue);
│ │ │ │ + │ │ │ │ +
270 return Detail::makeTreeContainerVectorBackend(factory(tree));
│ │ │ │ +
271 }
│ │ │ │ +
272
│ │ │ │ +
288 template<class Value, class Tree>
│ │ │ │ +
289 auto makeTreeContainer(const Tree& tree)
│ │ │ │ +
290 {
│ │ │ │ +
291 return makeTreeContainer(tree, [](const auto&) {return Value{};});
│ │ │ │ +
292 }
│ │ │ │ +
293
│ │ │ │ +
297 template<class Value, class Tree>
│ │ │ │ +
298 using UniformTreeContainer = std::decay_t<decltype(makeTreeContainer<Value>(std::declval<const Tree&>()))>;
│ │ │ │ +
299
│ │ │ │ +
303 template<template<class Node> class LeafToValue, class Tree>
│ │ │ │ +
304 using TreeContainer = std::decay_t<decltype(makeTreeContainer(std::declval<const Tree&>(), std::declval<Detail::LeafToDefaultConstructibleValue<LeafToValue>>()))>;
│ │ │ │
305
│ │ │ │ -
313 template<typename T, typename TreePath, typename U>
│ │ │ │ -
314 auto post(T&&, TreePath, const U& u) const {return u;}
│ │ │ │ -
315
│ │ │ │ -
323 template<typename T, typename TreePath, typename U>
│ │ │ │ -
324 auto leaf(T&&, TreePath, const U& u) const { return u;}
│ │ │ │ -
325
│ │ │ │ -
333 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
│ │ │ │ -
334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
│ │ │ │ -
335
│ │ │ │ -
343 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
│ │ │ │ -
344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
│ │ │ │ -
345
│ │ │ │ -
346 };
│ │ │ │ -
347 } // namespace Experimental
│ │ │ │ -
348
│ │ │ │ -
350
│ │ │ │ - │ │ │ │ -
356 {
│ │ │ │ -
357
│ │ │ │ -
358 // the little trick with the default template arguments
│ │ │ │ -
359 // makes the class usable for both single-tree visitors
│ │ │ │ -
360 // and visitors for pairs of trees
│ │ │ │ -
362 template<typename Node1,
│ │ │ │ -
363 typename Child1,
│ │ │ │ -
364 typename Node2,
│ │ │ │ -
365 typename Child2 = void,
│ │ │ │ -
366 typename TreePath = void>
│ │ │ │ - │ │ │ │ -
368 {
│ │ │ │ -
370 static const bool value = false;
│ │ │ │ -
371 };
│ │ │ │ -
372
│ │ │ │ -
373 };
│ │ │ │ -
374
│ │ │ │ -
375
│ │ │ │ -
377
│ │ │ │ - │ │ │ │ -
382 {
│ │ │ │ -
383
│ │ │ │ -
384 // the little trick with the default template arguments
│ │ │ │ -
385 // makes the class usable for both single-tree visitors
│ │ │ │ -
386 // and visitors for pairs of trees
│ │ │ │ -
388 template<typename Node1,
│ │ │ │ -
389 typename Child1,
│ │ │ │ -
390 typename Node2,
│ │ │ │ -
391 typename Child2 = void,
│ │ │ │ -
392 typename TreePath = void>
│ │ │ │ - │ │ │ │ -
394 {
│ │ │ │ -
396 static const bool value = true;
│ │ │ │ -
397 };
│ │ │ │ -
398
│ │ │ │ -
399 };
│ │ │ │ -
400
│ │ │ │ -
402
│ │ │ │ - │ │ │ │ -
410 {
│ │ │ │ - │ │ │ │ -
413 };
│ │ │ │ -
414
│ │ │ │ -
416
│ │ │ │ - │ │ │ │ -
424 {
│ │ │ │ - │ │ │ │ -
427 };
│ │ │ │ -
428
│ │ │ │ - │ │ │ │ -
431 : public DefaultVisitor
│ │ │ │ -
432 , public VisitTree
│ │ │ │ -
433 {};
│ │ │ │ -
434
│ │ │ │ - │ │ │ │ -
437 : public DefaultVisitor
│ │ │ │ -
438 , public VisitDirectChildren
│ │ │ │ -
439 {};
│ │ │ │ -
440
│ │ │ │ - │ │ │ │ -
443 : public DefaultPairVisitor
│ │ │ │ -
444 , public VisitTree
│ │ │ │ -
445 {};
│ │ │ │ -
446
│ │ │ │ - │ │ │ │ -
449 : public DefaultPairVisitor
│ │ │ │ -
450 , public VisitDirectChildren
│ │ │ │ -
451 {};
│ │ │ │ -
452
│ │ │ │ -
453 namespace Experimental::Info {
│ │ │ │ -
454
│ │ │ │ - │ │ │ │ -
456 : public DefaultHybridVisitor
│ │ │ │ -
457 , public StaticTraversal
│ │ │ │ -
458 , public VisitTree
│ │ │ │ -
459 {
│ │ │ │ -
460 template<class Tree, class Child, class TreePath, class ChildIndex, class U>
│ │ │ │ -
461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const {
│ │ │ │ -
462 // in this case child index is an integral constant: forward u
│ │ │ │ -
463 return u;
│ │ │ │ -
464 }
│ │ │ │ -
465
│ │ │ │ -
466 template<class Tree, class Child, class TreePath, class U>
│ │ │ │ -
467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t /*childIndex*/, U u) const {
│ │ │ │ -
468 // in this case child index is a run-time index: cast accumulated u to std::size_t
│ │ │ │ -
469 return std::size_t{u};
│ │ │ │ -
470 }
│ │ │ │ -
471
│ │ │ │ -
472 template<class Tree, class TreePath, class U>
│ │ │ │ -
473 auto leaf(Tree&&, TreePath, U u) const
│ │ │ │ -
474 {
│ │ │ │ -
475 return Hybrid::plus(u,Dune::Indices::_1);
│ │ │ │ -
476 }
│ │ │ │ -
477
│ │ │ │ -
478 };
│ │ │ │ -
479
│ │ │ │ - │ │ │ │ -
481 : public LeafCounterVisitor
│ │ │ │ -
482 {
│ │ │ │ -
483 template<typename Tree, typename TreePath, typename U>
│ │ │ │ -
484 auto pre(Tree&&, TreePath, U u) const {
│ │ │ │ -
485 return Hybrid::plus(u,Indices::_1);
│ │ │ │ -
486 }
│ │ │ │ -
487 };
│ │ │ │ -
488
│ │ │ │ - │ │ │ │ -
490 : public DefaultHybridVisitor
│ │ │ │ -
491 , public StaticTraversal
│ │ │ │ -
492 , public VisitTree
│ │ │ │ -
493 {
│ │ │ │ -
494 template<class Tree, class TreePath, class U>
│ │ │ │ -
495 auto leaf(Tree&&, TreePath, U u) const
│ │ │ │ -
496 {
│ │ │ │ -
497 auto path_size = index_constant<treePathSize(TreePath{})>{};
│ │ │ │ -
498 auto depth = Hybrid::plus(path_size,Indices::_1);
│ │ │ │ -
499 return Hybrid::max(depth,u);
│ │ │ │ -
500 }
│ │ │ │ -
501 };
│ │ │ │ -
502
│ │ │ │ -
504 // result is alwayas an integral constant
│ │ │ │ -
505 template<typename Tree>
│ │ │ │ -
506 auto depth(const Tree& tree)
│ │ │ │ -
507 {
│ │ │ │ -
508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0);
│ │ │ │ -
509 }
│ │ │ │ -
510
│ │ │ │ -
512 // return types is std::integral_constant.
│ │ │ │ -
513 template<typename Tree>
│ │ │ │ -
514 constexpr auto depth()
│ │ │ │ -
515 {
│ │ │ │ -
516 return decltype(hybridApplyToTree(std::declval<Tree>(),DepthVisitor{},Indices::_0)){};
│ │ │ │ -
517 }
│ │ │ │ -
518
│ │ │ │ -
520 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
│ │ │ │ -
521 template<typename Tree>
│ │ │ │ -
522 auto nodeCount(const Tree& tree)
│ │ │ │ -
523 {
│ │ │ │ -
524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0);
│ │ │ │ -
525 }
│ │ │ │ -
526
│ │ │ │ -
528 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
│ │ │ │ -
529 template<typename Tree>
│ │ │ │ -
530 auto leafCount(const Tree& tree)
│ │ │ │ -
531 {
│ │ │ │ -
532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0);
│ │ │ │ -
533 }
│ │ │ │ -
534
│ │ │ │ -
536 template<typename Tree>
│ │ │ │ -
537 constexpr bool isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{};
│ │ │ │ -
538
│ │ │ │ -
539 } // namespace Experimental::Info
│ │ │ │ -
540
│ │ │ │ -
542
│ │ │ │ -
543 } // namespace TypeTree
│ │ │ │ -
544} //namespace Dune
│ │ │ │ -
545
│ │ │ │ -
546#endif // DUNE_TYPETREE_VISITOR_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │ -
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition: treepath.hh:199
│ │ │ │ +
307
│ │ │ │ +
308 } // namespace TypeTree
│ │ │ │ +
309} //namespace Dune
│ │ │ │ +
310
│ │ │ │ +
311#endif // DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ + │ │ │ │ +
std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >()))> UniformTreeContainer
Alias to container type generated by makeTreeContainer for given tree type and uniform value type.
Definition: treecontainer.hh:298
│ │ │ │ +
std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))> TreeContainer
Alias to container type generated by makeTreeContainer for give tree type and when using LeafToValue ...
Definition: treecontainer.hh:304
│ │ │ │ +
auto makeTreeContainer(const Tree &tree)
Create container havin the same structure as the given tree.
Definition: treecontainer.hh:289
│ │ │ │ +
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
Apply hybrid visitor to TypeTree.
Definition: accumulate_static.hh:698
│ │ │ │ -
Type
Definition: treepath.hh:30
│ │ │ │ -
@ fullyStatic
Definition: treepath.hh:30
│ │ │ │ -
@ dynamic
Definition: treepath.hh:30
│ │ │ │ -
constexpr bool isDynamic
true if any of the nodes in the tree only has dynamic degree.
Definition: visitor.hh:537
│ │ │ │ -
auto leafCount(const Tree &tree)
The number of leaf nodes in the Tree.
Definition: visitor.hh:530
│ │ │ │ -
auto nodeCount(const Tree &tree)
The total number of nodes in the Tree.
Definition: visitor.hh:522
│ │ │ │ -
auto depth(const Tree &tree)
The depth of the TypeTree.
Definition: visitor.hh:506
│ │ │ │ +
auto makeTreeContainerVectorBackend(Container &&container)
Definition: treecontainer.hh:222
│ │ │ │ +
Definition: treecontainer.hh:37
│ │ │ │ +
auto operator()(const Node &node)
Definition: treecontainer.hh:61
│ │ │ │ +
ContainerFactory(LeafToValue leafToValue)
Create ContainerFactory.
Definition: treecontainer.hh:56
│ │ │ │ + │ │ │ │ +
void resize(const Tree &tree)
Resize the (nested) container depending on the degree of the tree nodes.
Definition: treecontainer.hh:202
│ │ │ │ +
Container & data()
Definition: treecontainer.hh:212
│ │ │ │ +
const Container & data() const
Definition: treecontainer.hh:207
│ │ │ │ +
TreeContainerVectorBackend(Container &&container)
Move the passed container into the internal storage.
Definition: treecontainer.hh:169
│ │ │ │ +
TreeContainerVectorBackend()
Default constructor. The stored container might need to be resized before usage.
Definition: treecontainer.hh:184
│ │ │ │ +
TreeContainerVectorBackend(const Tree &tree)
Default construct the container and perform a resize depending on the tree-node degrees.
Definition: treecontainer.hh:175
│ │ │ │ + │ │ │ │ +
auto operator()(const Node &node) const
Definition: treecontainer.hh:238
│ │ │ │
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ -
Visitor interface and base class for TypeTree visitors.
Definition: visitor.hh:47
│ │ │ │ -
void in(T &&, TreePath) const
Method for infix tree traversal.
Definition: visitor.hh:70
│ │ │ │ -
void afterChild(T &&, Child &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition: visitor.hh:120
│ │ │ │ -
void beforeChild(T &&, Child &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition: visitor.hh:105
│ │ │ │ -
void post(T &&, TreePath) const
Method for postfix tree traversal.
Definition: visitor.hh:81
│ │ │ │ -
void leaf(T &&, TreePath) const
Method for leaf traversal.
Definition: visitor.hh:91
│ │ │ │ -
void pre(T &&, TreePath) const
Method for prefix tree traversal.
Definition: visitor.hh:58
│ │ │ │ -
Visitor interface and base class for visitors of pairs of TypeTrees.
Definition: visitor.hh:162
│ │ │ │ -
void leaf(T1 &&, T2 &&, TreePath) const
Method for leaf traversal.
Definition: visitor.hh:214
│ │ │ │ -
void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition: visitor.hh:230
│ │ │ │ -
void pre(T1 &&, T2 &&, TreePath) const
Method for prefix tree traversal.
Definition: visitor.hh:174
│ │ │ │ -
void post(T1 &&, T2 &&, TreePath) const
Method for postfix traversal.
Definition: visitor.hh:199
│ │ │ │ -
void in(T1 &&, T2 &&, TreePath) const
Method for infix tree traversal.
Definition: visitor.hh:187
│ │ │ │ -
void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition: visitor.hh:246
│ │ │ │ -
Hybrid visitor interface and base class for TypeTree hybrid visitors.
Definition: visitor.hh:284
│ │ │ │ -
auto post(T &&, TreePath, const U &u) const
Method for postfix tree traversal.
Definition: visitor.hh:314
│ │ │ │ -
auto pre(T &&, TreePath, const U &u) const
Method for prefix tree traversal.
Definition: visitor.hh:294
│ │ │ │ -
auto leaf(T &&, TreePath, const U &u) const
Method for leaf traversal.
Definition: visitor.hh:324
│ │ │ │ -
auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for child-parent traversal.
Definition: visitor.hh:344
│ │ │ │ -
auto in(T &&, TreePath, const U &u) const
Method for infix tree traversal.
Definition: visitor.hh:304
│ │ │ │ -
auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for parent-child traversal.
Definition: visitor.hh:334
│ │ │ │ -
Mixin base class for visitors that only want to visit the direct children of a node.
Definition: visitor.hh:356
│ │ │ │ -
Template struct for determining whether or not to visit a given child.
Definition: visitor.hh:368
│ │ │ │ -
static const bool value
Do not visit any child.
Definition: visitor.hh:370
│ │ │ │ -
Mixin base class for visitors that want to visit the complete tree.
Definition: visitor.hh:382
│ │ │ │ -
Template struct for determining whether or not to visit a given child.
Definition: visitor.hh:394
│ │ │ │ -
static const bool value
Visit any child.
Definition: visitor.hh:396
│ │ │ │ -
Mixin base class for visitors that require a static TreePath during traversal.
Definition: visitor.hh:410
│ │ │ │ -
static const TreePathType::Type treePathType
Use the static tree traversal algorithm.
Definition: visitor.hh:412
│ │ │ │ -
Mixin base class for visitors that only need a dynamic TreePath during traversal.
Definition: visitor.hh:424
│ │ │ │ -
static const TreePathType::Type treePathType
Use the dynamic tree traversal algorithm.
Definition: visitor.hh:426
│ │ │ │ -
Convenience base class for visiting the entire tree.
Definition: visitor.hh:433
│ │ │ │ -
Convenience base class for visiting the direct children of a node.
Definition: visitor.hh:439
│ │ │ │ -
Convenience base class for visiting an entire tree pair.
Definition: visitor.hh:445
│ │ │ │ -
Convenience base class for visiting the direct children of a node pair.
Definition: visitor.hh:451
│ │ │ │ - │ │ │ │ -
auto leaf(Tree &&, TreePath, U u) const
Definition: visitor.hh:473
│ │ │ │ -
auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const
Definition: visitor.hh:461
│ │ │ │ -
std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const
Definition: visitor.hh:467
│ │ │ │ - │ │ │ │ -
auto pre(Tree &&, TreePath, U u) const
Definition: visitor.hh:484
│ │ │ │ - │ │ │ │ -
auto leaf(Tree &&, TreePath, U u) const
Definition: visitor.hh:495
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,484 +4,365 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -visitor.hh │ │ │ │ │ +treecontainer.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10namespace Dune { │ │ │ │ │ - 11 namespace TypeTree { │ │ │ │ │ - 12 │ │ │ │ │ - 19 │ │ │ │ │ -46 struct DefaultVisitor │ │ │ │ │ - 47 { │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11 │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16 │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19namespace Dune { │ │ │ │ │ + 20 namespace TypeTree { │ │ │ │ │ + 21 │ │ │ │ │ + 22 namespace Detail { │ │ │ │ │ + 23 │ │ │ │ │ + 24 /* │ │ │ │ │ + 25 * \brief A factory class creating a hybrid container compatible with a type │ │ │ │ │ +tree │ │ │ │ │ + 26 * │ │ │ │ │ + 27 * This class allows to create a nested hybrid container having the same │ │ │ │ │ +structure │ │ │ │ │ + 28 * as a given type tree. Power nodes are represented as std::array's while │ │ │ │ │ +composite │ │ │ │ │ + 29 * nodes are represented as Dune::TupleVector's. The stored values for the │ │ │ │ │ +leaf nodes │ │ │ │ │ + 30 * are creating using a given predicate. Once created, the factory provides │ │ │ │ │ +an │ │ │ │ │ + 31 * operator() creating the container for the tree given as argument. │ │ │ │ │ + 32 * │ │ │ │ │ + 33 * \tparam LeafToValue Type of a predicate that determines the stored values │ │ │ │ │ +at the leafs │ │ │ │ │ + 34 */ │ │ │ │ │ + 35 template │ │ │ │ │ +36 class ContainerFactory │ │ │ │ │ + 37 { │ │ │ │ │ + 38 template │ │ │ │ │ + 39 using DynamicDegreeConcept = decltype((std::size_t(std::declval().degree │ │ │ │ │ +()), true)); │ │ │ │ │ + 40 │ │ │ │ │ + 41 template │ │ │ │ │ + 42 using StaticDegreeConcept = decltype((std::integral_constant{}, true)); │ │ │ │ │ + 43 │ │ │ │ │ + 44 template │ │ │ │ │ + 45 using DynamicChildAccessConcept = decltype((std::declval().child(0u), │ │ │ │ │ +true)); │ │ │ │ │ + 46 │ │ │ │ │ + 47 public: │ │ │ │ │ 48 │ │ │ │ │ - 50 │ │ │ │ │ - 57 template │ │ │ │ │ -58 void pre(T&&, TreePath) const {} │ │ │ │ │ +56 ContainerFactory(LeafToValue leafToValue) : │ │ │ │ │ + 57 leafToValue_(leafToValue) │ │ │ │ │ + 58 {} │ │ │ │ │ 59 │ │ │ │ │ - 61 │ │ │ │ │ - 69 template │ │ │ │ │ -70 void in(T&&, TreePath) const {} │ │ │ │ │ - 71 │ │ │ │ │ - 73 │ │ │ │ │ - 80 template │ │ │ │ │ -81 void post(T&&, TreePath) const {} │ │ │ │ │ - 82 │ │ │ │ │ + 60 template │ │ │ │ │ +61 auto operator()(const Node& node) │ │ │ │ │ + 62 { │ │ │ │ │ + 63 return (*this)(node, Dune::PriorityTag<5>{}); │ │ │ │ │ + 64 } │ │ │ │ │ + 65 │ │ │ │ │ + 66 private: │ │ │ │ │ + 67 │ │ │ │ │ + 68 template = true> │ │ │ │ │ + 70 auto operator()(const Node& node, Dune::PriorityTag<4>) │ │ │ │ │ + 71 { │ │ │ │ │ + 72 return leafToValue_(node); │ │ │ │ │ + 73 } │ │ │ │ │ + 74 │ │ │ │ │ + 75 template = true, │ │ │ │ │ + 77 DynamicChildAccessConcept = true> │ │ │ │ │ + 78 auto operator()(const Node& node, Dune::PriorityTag<3>) │ │ │ │ │ + 79 { │ │ │ │ │ + 80 return Dune::unpackIntegerSequence([&](auto... indices) { │ │ │ │ │ + 81 return std::array{(*this)(node.child(indices))...}; │ │ │ │ │ + 82 }, std::make_index_sequence()); │ │ │ │ │ + 83 } │ │ │ │ │ 84 │ │ │ │ │ - 90 template │ │ │ │ │ -91 void leaf(T&&, TreePath) const {} │ │ │ │ │ - 92 │ │ │ │ │ - 94 │ │ │ │ │ - 104 template │ │ │ │ │ -105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {} │ │ │ │ │ + 85 template = true, │ │ │ │ │ + 87 DynamicChildAccessConcept = true> │ │ │ │ │ + 88 auto operator()(const Node& node, Dune::PriorityTag<2>) │ │ │ │ │ + 89 { │ │ │ │ │ + 90 using TransformedChild = decltype((*this)(node.child(0))); │ │ │ │ │ + 91 std::vector container; │ │ │ │ │ + 92 container.reserve(node.degree()); │ │ │ │ │ + 93 for (std::size_t i = 0; i < node.degree(); ++i) │ │ │ │ │ + 94 container.emplace_back((*this)(node.child(i))); │ │ │ │ │ + 95 return container; │ │ │ │ │ + 96 } │ │ │ │ │ + 97 │ │ │ │ │ + 98 template = true> │ │ │ │ │ + 100 auto operator()(const Node& node, Dune::PriorityTag<1>) │ │ │ │ │ + 101 { │ │ │ │ │ + 102 return Dune::unpackIntegerSequence([&](auto... indices) { │ │ │ │ │ + 103 return Dune::makeTupleVector((*this)(node.child(indices))...); │ │ │ │ │ + 104 }, std::make_index_sequence()); │ │ │ │ │ + 105 } │ │ │ │ │ 106 │ │ │ │ │ - 108 │ │ │ │ │ - 119 template │ │ │ │ │ -120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {} │ │ │ │ │ - 121 │ │ │ │ │ - 122 }; │ │ │ │ │ + 107 private: │ │ │ │ │ + 108 LeafToValue leafToValue_; │ │ │ │ │ + 109 }; │ │ │ │ │ + 110 │ │ │ │ │ + 111 │ │ │ │ │ + 112 /* │ │ │ │ │ + 113 * \brief Wrap nested container to provide a VectorBackend │ │ │ │ │ + 114 */ │ │ │ │ │ + 115 template │ │ │ │ │ +116 class TreeContainerVectorBackend │ │ │ │ │ + 117 { │ │ │ │ │ + 118 template │ │ │ │ │ + 119 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ +HybridTreePath<>& path) │ │ │ │ │ + 120 { │ │ │ │ │ + 121 return container; │ │ │ │ │ + 122 } │ │ │ │ │ 123 │ │ │ │ │ - 124 │ │ │ │ │ - 126 │ │ │ │ │ -161 struct DefaultPairVisitor │ │ │ │ │ - 162 { │ │ │ │ │ - 163 │ │ │ │ │ - 165 │ │ │ │ │ - 173 template │ │ │ │ │ -174 void pre(T1&&, T2&&, TreePath) const {} │ │ │ │ │ - 175 │ │ │ │ │ - 177 │ │ │ │ │ - 186 template │ │ │ │ │ -187 void in(T1&&, T2&&, TreePath) const {} │ │ │ │ │ - 188 │ │ │ │ │ - 190 │ │ │ │ │ - 198 template │ │ │ │ │ -199 void post(T1&&, T2&&, TreePath) const {} │ │ │ │ │ - 200 │ │ │ │ │ - 202 │ │ │ │ │ - 213 template │ │ │ │ │ -214 void leaf(T1&&, T2&&, TreePath) const {} │ │ │ │ │ - 215 │ │ │ │ │ - 217 │ │ │ │ │ - 229 template │ │ │ │ │ -230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) │ │ │ │ │ -const {} │ │ │ │ │ - 231 │ │ │ │ │ - 233 │ │ │ │ │ - 245 template │ │ │ │ │ -246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const │ │ │ │ │ -{} │ │ │ │ │ - 247 │ │ │ │ │ - 248 }; │ │ │ │ │ - 249 │ │ │ │ │ - 250 │ │ │ │ │ - 251 namespace Experimental { │ │ │ │ │ - 252 │ │ │ │ │ -283 struct DefaultHybridVisitor │ │ │ │ │ - 284 { │ │ │ │ │ - 285 │ │ │ │ │ - 293 template │ │ │ │ │ -294 auto pre(T&&, TreePath, const U& u) const { return u;} │ │ │ │ │ - 295 │ │ │ │ │ - 303 template │ │ │ │ │ -304 auto in(T&&, TreePath, const U& u) const {return u;} │ │ │ │ │ + 124 template │ │ │ │ │ + 125 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ +HybridTreePath& path) │ │ │ │ │ + 126 { │ │ │ │ │ + 127 auto head = path[Dune::Indices::_0]; │ │ │ │ │ + 128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){ │ │ │ │ │ + 129 return treePath(path[Dune::index_constant{}]...); │ │ │ │ │ + 130 }, std::make_index_sequence()); │ │ │ │ │ + 131 return accessByTreePath(container[head], tailPath); │ │ │ │ │ + 132 } │ │ │ │ │ + 133 │ │ │ │ │ + 134 template = true> │ │ │ │ │ + 136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune:: │ │ │ │ │ +PriorityTag<2>) │ │ │ │ │ + 137 { │ │ │ │ │ + 138 /* do nothing */ │ │ │ │ │ + 139 } │ │ │ │ │ + 140 │ │ │ │ │ + 141 template().resize(0u))> │ │ │ │ │ + 143 static void resizeImpl(C& container, const Tree& tree, Dune:: │ │ │ │ │ +PriorityTag<1>) │ │ │ │ │ + 144 { │ │ │ │ │ + 145 container.resize(tree.degree()); │ │ │ │ │ + 146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) { │ │ │ │ │ + 147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{}); │ │ │ │ │ + 148 }); │ │ │ │ │ + 149 } │ │ │ │ │ + 150 │ │ │ │ │ + 151 template │ │ │ │ │ + 152 static void resizeImpl(C& container, const Tree& tree, Dune:: │ │ │ │ │ +PriorityTag<0>) │ │ │ │ │ + 153 { │ │ │ │ │ + 154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) { │ │ │ │ │ + 155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{}); │ │ │ │ │ + 156 }); │ │ │ │ │ + 157 } │ │ │ │ │ + 158 │ │ │ │ │ + 159 template │ │ │ │ │ + 160 using TypeTreeConcept = decltype(( │ │ │ │ │ + 161 std::declval().degree(), │ │ │ │ │ + 162 T::isLeaf, │ │ │ │ │ + 163 T::isPower, │ │ │ │ │ + 164 T::isComposite, │ │ │ │ │ + 165 true)); │ │ │ │ │ + 166 │ │ │ │ │ + 167 public: │ │ │ │ │ +169 TreeContainerVectorBackend(Container&& container) : │ │ │ │ │ + 170 container_(std::move(container)) │ │ │ │ │ + 171 {} │ │ │ │ │ + 172 │ │ │ │ │ + 174 template = true> │ │ │ │ │ +175 TreeContainerVectorBackend(const Tree& tree) : │ │ │ │ │ + 176 TreeContainerVectorBackend() │ │ │ │ │ + 177 { │ │ │ │ │ + 178 this->resize(tree); │ │ │ │ │ + 179 } │ │ │ │ │ + 180 │ │ │ │ │ + 182 template , bool> = true> │ │ │ │ │ +184 TreeContainerVectorBackend() : │ │ │ │ │ + 185 container_() │ │ │ │ │ + 186 {} │ │ │ │ │ + 187 │ │ │ │ │ + 188 template │ │ │ │ │ +189 decltype(auto) operator[](const HybridTreePath& path) const │ │ │ │ │ + 190 { │ │ │ │ │ + 191 return accessByTreePath(container_, path); │ │ │ │ │ + 192 } │ │ │ │ │ + 193 │ │ │ │ │ + 194 template │ │ │ │ │ +195 decltype(auto) operator[](const HybridTreePath& path) │ │ │ │ │ + 196 { │ │ │ │ │ + 197 return accessByTreePath(container_, path); │ │ │ │ │ + 198 } │ │ │ │ │ + 199 │ │ │ │ │ + 201 template = true> │ │ │ │ │ +202 void resize(const Tree& tree) │ │ │ │ │ + 203 { │ │ │ │ │ + 204 resizeImpl(container_, tree, Dune::PriorityTag<5>{}); │ │ │ │ │ + 205 } │ │ │ │ │ + 206 │ │ │ │ │ +207 const Container& data() const │ │ │ │ │ + 208 { │ │ │ │ │ + 209 return container_; │ │ │ │ │ + 210 } │ │ │ │ │ + 211 │ │ │ │ │ +212 Container& data() │ │ │ │ │ + 213 { │ │ │ │ │ + 214 return container_; │ │ │ │ │ + 215 } │ │ │ │ │ + 216 │ │ │ │ │ + 217 private: │ │ │ │ │ + 218 Container container_; │ │ │ │ │ + 219 }; │ │ │ │ │ + 220 │ │ │ │ │ + 221 template │ │ │ │ │ +222 auto makeTreeContainerVectorBackend(Container&& container) │ │ │ │ │ + 223 { │ │ │ │ │ + 224 return TreeContainerVectorBackend>(std:: │ │ │ │ │ +forward(container)); │ │ │ │ │ + 225 } │ │ │ │ │ + 226 │ │ │ │ │ + 227 /* │ │ │ │ │ + 228 * \brief A simple lambda for creating default constructible values from a │ │ │ │ │ +node │ │ │ │ │ + 229 * │ │ │ │ │ + 230 * This simply returns LeafToValue{} for a given Node. It's needed │ │ │ │ │ + 231 * because using a lambda expression in a using declaration is not allowed │ │ │ │ │ + 232 * because it's an unevaluated context. │ │ │ │ │ + 233 */ │ │ │ │ │ + 234 template class LeafToValue> │ │ │ │ │ +235 struct LeafToDefaultConstructibleValue │ │ │ │ │ + 236 { │ │ │ │ │ + 237 template │ │ │ │ │ +238 auto operator()(const Node& node) const │ │ │ │ │ + 239 { │ │ │ │ │ + 240 return LeafToValue{}; │ │ │ │ │ + 241 } │ │ │ │ │ + 242 }; │ │ │ │ │ + 243 │ │ │ │ │ + 244 } // namespace Detail │ │ │ │ │ + 245 │ │ │ │ │ + 265 template │ │ │ │ │ +266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue) │ │ │ │ │ + 267 { │ │ │ │ │ + 268 auto f = std::ref(leafToValue); │ │ │ │ │ + 269 auto factory = Detail::ContainerFactory(f); │ │ │ │ │ + 270 return Detail::makeTreeContainerVectorBackend(factory(tree)); │ │ │ │ │ + 271 } │ │ │ │ │ + 272 │ │ │ │ │ + 288 template │ │ │ │ │ +289 auto makeTreeContainer(const Tree& tree) │ │ │ │ │ + 290 { │ │ │ │ │ + 291 return makeTreeContainer(tree, [](const auto&) {return Value{};}); │ │ │ │ │ + 292 } │ │ │ │ │ + 293 │ │ │ │ │ + 297 template │ │ │ │ │ +298 using UniformTreeContainer = std::decay_t │ │ │ │ │ +(std::declval()))>; │ │ │ │ │ + 299 │ │ │ │ │ + 303 template class LeafToValue, class Tree> │ │ │ │ │ +304 using TreeContainer = std::decay_t(), std::declval>()))>; │ │ │ │ │ 305 │ │ │ │ │ - 313 template │ │ │ │ │ -314 auto post(T&&, TreePath, const U& u) const {return u;} │ │ │ │ │ - 315 │ │ │ │ │ - 323 template │ │ │ │ │ -324 auto leaf(T&&, TreePath, const U& u) const { return u;} │ │ │ │ │ - 325 │ │ │ │ │ - 333 template │ │ │ │ │ -334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const │ │ │ │ │ -{return u;} │ │ │ │ │ - 335 │ │ │ │ │ - 343 template │ │ │ │ │ -344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const │ │ │ │ │ -{return u;} │ │ │ │ │ - 345 │ │ │ │ │ - 346 }; │ │ │ │ │ - 347 } // namespace Experimental │ │ │ │ │ - 348 │ │ │ │ │ - 350 │ │ │ │ │ -355 struct VisitDirectChildren │ │ │ │ │ - 356 { │ │ │ │ │ - 357 │ │ │ │ │ - 358 // the little trick with the default template arguments │ │ │ │ │ - 359 // makes the class usable for both single-tree visitors │ │ │ │ │ - 360 // and visitors for pairs of trees │ │ │ │ │ - 362 template │ │ │ │ │ -367 struct VisitChild │ │ │ │ │ - 368 { │ │ │ │ │ -370 static const bool value = false; │ │ │ │ │ - 371 }; │ │ │ │ │ - 372 │ │ │ │ │ - 373 }; │ │ │ │ │ - 374 │ │ │ │ │ - 375 │ │ │ │ │ - 377 │ │ │ │ │ -381 struct VisitTree │ │ │ │ │ - 382 { │ │ │ │ │ - 383 │ │ │ │ │ - 384 // the little trick with the default template arguments │ │ │ │ │ - 385 // makes the class usable for both single-tree visitors │ │ │ │ │ - 386 // and visitors for pairs of trees │ │ │ │ │ - 388 template │ │ │ │ │ -393 struct VisitChild │ │ │ │ │ - 394 { │ │ │ │ │ -396 static const bool value = true; │ │ │ │ │ - 397 }; │ │ │ │ │ - 398 │ │ │ │ │ - 399 }; │ │ │ │ │ - 400 │ │ │ │ │ - 402 │ │ │ │ │ -409 struct StaticTraversal │ │ │ │ │ - 410 { │ │ │ │ │ -412 static const TreePathType::Type treePathType = TreePathType::fullyStatic; │ │ │ │ │ - 413 }; │ │ │ │ │ - 414 │ │ │ │ │ - 416 │ │ │ │ │ -423 struct DynamicTraversal │ │ │ │ │ - 424 { │ │ │ │ │ -426 static const TreePathType::Type treePathType = TreePathType::dynamic; │ │ │ │ │ - 427 }; │ │ │ │ │ - 428 │ │ │ │ │ -430 struct TreeVisitor │ │ │ │ │ - 431 : public DefaultVisitor │ │ │ │ │ - 432 , public VisitTree │ │ │ │ │ - 433 {}; │ │ │ │ │ - 434 │ │ │ │ │ -436 struct DirectChildrenVisitor │ │ │ │ │ - 437 : public DefaultVisitor │ │ │ │ │ - 438 , public VisitDirectChildren │ │ │ │ │ - 439 {}; │ │ │ │ │ - 440 │ │ │ │ │ -442 struct TreePairVisitor │ │ │ │ │ - 443 : public DefaultPairVisitor │ │ │ │ │ - 444 , public VisitTree │ │ │ │ │ - 445 {}; │ │ │ │ │ - 446 │ │ │ │ │ -448 struct DirectChildrenPairVisitor │ │ │ │ │ - 449 : public DefaultPairVisitor │ │ │ │ │ - 450 , public VisitDirectChildren │ │ │ │ │ - 451 {}; │ │ │ │ │ - 452 │ │ │ │ │ -453 namespace Experimental::Info { │ │ │ │ │ - 454 │ │ │ │ │ -455 struct LeafCounterVisitor │ │ │ │ │ - 456 : public DefaultHybridVisitor │ │ │ │ │ - 457 , public StaticTraversal │ │ │ │ │ - 458 , public VisitTree │ │ │ │ │ - 459 { │ │ │ │ │ - 460 template │ │ │ │ │ -461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const { │ │ │ │ │ - 462 // in this case child index is an integral constant: forward u │ │ │ │ │ - 463 return u; │ │ │ │ │ - 464 } │ │ │ │ │ - 465 │ │ │ │ │ - 466 template │ │ │ │ │ -467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t / │ │ │ │ │ -*childIndex*/, U u) const { │ │ │ │ │ - 468 // in this case child index is a run-time index: cast accumulated u to │ │ │ │ │ -std::size_t │ │ │ │ │ - 469 return std::size_t{u}; │ │ │ │ │ - 470 } │ │ │ │ │ - 471 │ │ │ │ │ - 472 template │ │ │ │ │ -473 auto leaf(Tree&&, TreePath, U u) const │ │ │ │ │ - 474 { │ │ │ │ │ - 475 return Hybrid::plus(u,Dune::Indices::_1); │ │ │ │ │ - 476 } │ │ │ │ │ - 477 │ │ │ │ │ - 478 }; │ │ │ │ │ - 479 │ │ │ │ │ -480 struct NodeCounterVisitor │ │ │ │ │ - 481 : public LeafCounterVisitor │ │ │ │ │ - 482 { │ │ │ │ │ - 483 template │ │ │ │ │ -484 auto pre(Tree&&, TreePath, U u) const { │ │ │ │ │ - 485 return Hybrid::plus(u,Indices::_1); │ │ │ │ │ - 486 } │ │ │ │ │ - 487 }; │ │ │ │ │ - 488 │ │ │ │ │ -489 struct DepthVisitor │ │ │ │ │ - 490 : public DefaultHybridVisitor │ │ │ │ │ - 491 , public StaticTraversal │ │ │ │ │ - 492 , public VisitTree │ │ │ │ │ - 493 { │ │ │ │ │ - 494 template │ │ │ │ │ -495 auto leaf(Tree&&, TreePath, U u) const │ │ │ │ │ - 496 { │ │ │ │ │ - 497 auto path_size = index_constant{}; │ │ │ │ │ - 498 auto depth = Hybrid::plus(path_size,Indices::_1); │ │ │ │ │ - 499 return Hybrid::max(depth,u); │ │ │ │ │ - 500 } │ │ │ │ │ - 501 }; │ │ │ │ │ - 502 │ │ │ │ │ - 504 // result is alwayas an integral constant │ │ │ │ │ - 505 template │ │ │ │ │ -506 auto depth(const Tree& tree) │ │ │ │ │ - 507 { │ │ │ │ │ - 508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0); │ │ │ │ │ - 509 } │ │ │ │ │ - 510 │ │ │ │ │ - 512 // return types is std::integral_constant. │ │ │ │ │ - 513 template │ │ │ │ │ -514 constexpr auto depth() │ │ │ │ │ - 515 { │ │ │ │ │ - 516 return decltype(hybridApplyToTree(std::declval(),DepthVisitor │ │ │ │ │ -{},Indices::_0)){}; │ │ │ │ │ - 517 } │ │ │ │ │ - 518 │ │ │ │ │ - 520 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ - 521 template │ │ │ │ │ -522 auto nodeCount(const Tree& tree) │ │ │ │ │ - 523 { │ │ │ │ │ - 524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0); │ │ │ │ │ - 525 } │ │ │ │ │ - 526 │ │ │ │ │ - 528 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ - 529 template │ │ │ │ │ -530 auto leafCount(const Tree& tree) │ │ │ │ │ - 531 { │ │ │ │ │ - 532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0); │ │ │ │ │ - 533 } │ │ │ │ │ - 534 │ │ │ │ │ - 536 template │ │ │ │ │ -537 constexpr bool isDynamic = std::is_same()))>{}; │ │ │ │ │ - 538 │ │ │ │ │ - 539 } // namespace Experimental::Info │ │ │ │ │ - 540 │ │ │ │ │ - 542 │ │ │ │ │ - 543 } // namespace TypeTree │ │ │ │ │ - 544} //namespace Dune │ │ │ │ │ - 545 │ │ │ │ │ - 546#endif // DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ -utility.hh │ │ │ │ │ + 307 │ │ │ │ │ + 308 } // namespace TypeTree │ │ │ │ │ + 309} //namespace Dune │ │ │ │ │ + 310 │ │ │ │ │ + 311#endif // DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ treepath.hh │ │ │ │ │ -Dune::TypeTree::Child │ │ │ │ │ -typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ -Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ -Definition: childextraction.hh:223 │ │ │ │ │ -Dune::TypeTree::treePathSize │ │ │ │ │ -constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ -Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:199 │ │ │ │ │ +Dune::TypeTree::UniformTreeContainer │ │ │ │ │ +std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & > │ │ │ │ │ +()))> UniformTreeContainer │ │ │ │ │ +Alias to container type generated by makeTreeContainer for given tree type and │ │ │ │ │ +uniform value type. │ │ │ │ │ +Definition: treecontainer.hh:298 │ │ │ │ │ +Dune::TypeTree::TreeContainer │ │ │ │ │ +std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std:: │ │ │ │ │ +declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))> │ │ │ │ │ +TreeContainer │ │ │ │ │ +Alias to container type generated by makeTreeContainer for give tree type and │ │ │ │ │ +when using LeafToValue ... │ │ │ │ │ +Definition: treecontainer.hh:304 │ │ │ │ │ +Dune::TypeTree::makeTreeContainer │ │ │ │ │ +auto makeTreeContainer(const Tree &tree) │ │ │ │ │ +Create container havin the same structure as the given tree. │ │ │ │ │ +Definition: treecontainer.hh:289 │ │ │ │ │ +Dune::TypeTree::degree │ │ │ │ │ +std::size_t degree(const Node &node) │ │ │ │ │ +Returns the degree of node as run time information. │ │ │ │ │ +Definition: nodeinterface.hh:85 │ │ │ │ │ +Dune::TypeTree::treePath │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:191 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::Experimental::hybridApplyToTree │ │ │ │ │ -auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ -Apply hybrid visitor to TypeTree. │ │ │ │ │ -Definition: accumulate_static.hh:698 │ │ │ │ │ -Dune::TypeTree::TreePathType::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::TreePathType::fullyStatic │ │ │ │ │ -@ fullyStatic │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ -@ dynamic │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::isDynamic │ │ │ │ │ -constexpr bool isDynamic │ │ │ │ │ -true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ -Definition: visitor.hh:537 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::leafCount │ │ │ │ │ -auto leafCount(const Tree &tree) │ │ │ │ │ -The number of leaf nodes in the Tree. │ │ │ │ │ -Definition: visitor.hh:530 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::nodeCount │ │ │ │ │ -auto nodeCount(const Tree &tree) │ │ │ │ │ -The total number of nodes in the Tree. │ │ │ │ │ -Definition: visitor.hh:522 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::depth │ │ │ │ │ -auto depth(const Tree &tree) │ │ │ │ │ -The depth of the TypeTree. │ │ │ │ │ -Definition: visitor.hh:506 │ │ │ │ │ +Dune::TypeTree::Detail::makeTreeContainerVectorBackend │ │ │ │ │ +auto makeTreeContainerVectorBackend(Container &&container) │ │ │ │ │ +Definition: treecontainer.hh:222 │ │ │ │ │ +Dune::TypeTree::Detail::ContainerFactory │ │ │ │ │ +Definition: treecontainer.hh:37 │ │ │ │ │ +Dune::TypeTree::Detail::ContainerFactory::operator() │ │ │ │ │ +auto operator()(const Node &node) │ │ │ │ │ +Definition: treecontainer.hh:61 │ │ │ │ │ +Dune::TypeTree::Detail::ContainerFactory::ContainerFactory │ │ │ │ │ +ContainerFactory(LeafToValue leafToValue) │ │ │ │ │ +Create ContainerFactory. │ │ │ │ │ +Definition: treecontainer.hh:56 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend │ │ │ │ │ +Definition: treecontainer.hh:117 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend::resize │ │ │ │ │ +void resize(const Tree &tree) │ │ │ │ │ +Resize the (nested) container depending on the degree of the tree nodes. │ │ │ │ │ +Definition: treecontainer.hh:202 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend::data │ │ │ │ │ +Container & data() │ │ │ │ │ +Definition: treecontainer.hh:212 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend::data │ │ │ │ │ +const Container & data() const │ │ │ │ │ +Definition: treecontainer.hh:207 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend │ │ │ │ │ +TreeContainerVectorBackend(Container &&container) │ │ │ │ │ +Move the passed container into the internal storage. │ │ │ │ │ +Definition: treecontainer.hh:169 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend │ │ │ │ │ +TreeContainerVectorBackend() │ │ │ │ │ +Default constructor. The stored container might need to be resized before │ │ │ │ │ +usage. │ │ │ │ │ +Definition: treecontainer.hh:184 │ │ │ │ │ +Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend │ │ │ │ │ +TreeContainerVectorBackend(const Tree &tree) │ │ │ │ │ +Default construct the container and perform a resize depending on the tree-node │ │ │ │ │ +degrees. │ │ │ │ │ +Definition: treecontainer.hh:175 │ │ │ │ │ +Dune::TypeTree::Detail::LeafToDefaultConstructibleValue │ │ │ │ │ +Definition: treecontainer.hh:236 │ │ │ │ │ +Dune::TypeTree::Detail::LeafToDefaultConstructibleValue::operator() │ │ │ │ │ +auto operator()(const Node &node) const │ │ │ │ │ +Definition: treecontainer.hh:238 │ │ │ │ │ Dune::TypeTree::HybridTreePath │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ Definition: treepath.hh:79 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor │ │ │ │ │ -Visitor interface and base class for TypeTree visitors. │ │ │ │ │ -Definition: visitor.hh:47 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor::in │ │ │ │ │ -void in(T &&, TreePath) const │ │ │ │ │ -Method for infix tree traversal. │ │ │ │ │ -Definition: visitor.hh:70 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor::afterChild │ │ │ │ │ -void afterChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ -Method for child-parent traversal. │ │ │ │ │ -Definition: visitor.hh:120 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor::beforeChild │ │ │ │ │ -void beforeChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ -Method for parent-child traversal. │ │ │ │ │ -Definition: visitor.hh:105 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor::post │ │ │ │ │ -void post(T &&, TreePath) const │ │ │ │ │ -Method for postfix tree traversal. │ │ │ │ │ -Definition: visitor.hh:81 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor::leaf │ │ │ │ │ -void leaf(T &&, TreePath) const │ │ │ │ │ -Method for leaf traversal. │ │ │ │ │ -Definition: visitor.hh:91 │ │ │ │ │ -Dune::TypeTree::DefaultVisitor::pre │ │ │ │ │ -void pre(T &&, TreePath) const │ │ │ │ │ -Method for prefix tree traversal. │ │ │ │ │ -Definition: visitor.hh:58 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor │ │ │ │ │ -Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ -Definition: visitor.hh:162 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor::leaf │ │ │ │ │ -void leaf(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for leaf traversal. │ │ │ │ │ -Definition: visitor.hh:214 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor::beforeChild │ │ │ │ │ -void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) │ │ │ │ │ -const │ │ │ │ │ -Method for parent-child traversal. │ │ │ │ │ -Definition: visitor.hh:230 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor::pre │ │ │ │ │ -void pre(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for prefix tree traversal. │ │ │ │ │ -Definition: visitor.hh:174 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor::post │ │ │ │ │ -void post(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for postfix traversal. │ │ │ │ │ -Definition: visitor.hh:199 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor::in │ │ │ │ │ -void in(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for infix tree traversal. │ │ │ │ │ -Definition: visitor.hh:187 │ │ │ │ │ -Dune::TypeTree::DefaultPairVisitor::afterChild │ │ │ │ │ -void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const │ │ │ │ │ -Method for child-parent traversal. │ │ │ │ │ -Definition: visitor.hh:246 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor │ │ │ │ │ -Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ │ -Definition: visitor.hh:284 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor::post │ │ │ │ │ -auto post(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for postfix tree traversal. │ │ │ │ │ -Definition: visitor.hh:314 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor::pre │ │ │ │ │ -auto pre(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for prefix tree traversal. │ │ │ │ │ -Definition: visitor.hh:294 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor::leaf │ │ │ │ │ -auto leaf(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for leaf traversal. │ │ │ │ │ -Definition: visitor.hh:324 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor::afterChild │ │ │ │ │ -auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ -Method for child-parent traversal. │ │ │ │ │ -Definition: visitor.hh:344 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor::in │ │ │ │ │ -auto in(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for infix tree traversal. │ │ │ │ │ -Definition: visitor.hh:304 │ │ │ │ │ -Dune::TypeTree::Experimental::DefaultHybridVisitor::beforeChild │ │ │ │ │ -auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ -Method for parent-child traversal. │ │ │ │ │ -Definition: visitor.hh:334 │ │ │ │ │ -Dune::TypeTree::VisitDirectChildren │ │ │ │ │ -Mixin base class for visitors that only want to visit the direct children of a │ │ │ │ │ -node. │ │ │ │ │ -Definition: visitor.hh:356 │ │ │ │ │ -Dune::TypeTree::VisitDirectChildren::VisitChild │ │ │ │ │ -Template struct for determining whether or not to visit a given child. │ │ │ │ │ -Definition: visitor.hh:368 │ │ │ │ │ -Dune::TypeTree::VisitDirectChildren::VisitChild::value │ │ │ │ │ -static const bool value │ │ │ │ │ -Do not visit any child. │ │ │ │ │ -Definition: visitor.hh:370 │ │ │ │ │ -Dune::TypeTree::VisitTree │ │ │ │ │ -Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ -Definition: visitor.hh:382 │ │ │ │ │ -Dune::TypeTree::VisitTree::VisitChild │ │ │ │ │ -Template struct for determining whether or not to visit a given child. │ │ │ │ │ -Definition: visitor.hh:394 │ │ │ │ │ -Dune::TypeTree::VisitTree::VisitChild::value │ │ │ │ │ -static const bool value │ │ │ │ │ -Visit any child. │ │ │ │ │ -Definition: visitor.hh:396 │ │ │ │ │ -Dune::TypeTree::StaticTraversal │ │ │ │ │ -Mixin base class for visitors that require a static TreePath during traversal. │ │ │ │ │ -Definition: visitor.hh:410 │ │ │ │ │ -Dune::TypeTree::StaticTraversal::treePathType │ │ │ │ │ -static const TreePathType::Type treePathType │ │ │ │ │ -Use the static tree traversal algorithm. │ │ │ │ │ -Definition: visitor.hh:412 │ │ │ │ │ -Dune::TypeTree::DynamicTraversal │ │ │ │ │ -Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ -traversal. │ │ │ │ │ -Definition: visitor.hh:424 │ │ │ │ │ -Dune::TypeTree::DynamicTraversal::treePathType │ │ │ │ │ -static const TreePathType::Type treePathType │ │ │ │ │ -Use the dynamic tree traversal algorithm. │ │ │ │ │ -Definition: visitor.hh:426 │ │ │ │ │ -Dune::TypeTree::TreeVisitor │ │ │ │ │ -Convenience base class for visiting the entire tree. │ │ │ │ │ -Definition: visitor.hh:433 │ │ │ │ │ -Dune::TypeTree::DirectChildrenVisitor │ │ │ │ │ -Convenience base class for visiting the direct children of a node. │ │ │ │ │ -Definition: visitor.hh:439 │ │ │ │ │ -Dune::TypeTree::TreePairVisitor │ │ │ │ │ -Convenience base class for visiting an entire tree pair. │ │ │ │ │ -Definition: visitor.hh:445 │ │ │ │ │ -Dune::TypeTree::DirectChildrenPairVisitor │ │ │ │ │ -Convenience base class for visiting the direct children of a node pair. │ │ │ │ │ -Definition: visitor.hh:451 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::LeafCounterVisitor │ │ │ │ │ -Definition: visitor.hh:459 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::LeafCounterVisitor::leaf │ │ │ │ │ -auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ -Definition: visitor.hh:473 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild │ │ │ │ │ -auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const │ │ │ │ │ -Definition: visitor.hh:461 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild │ │ │ │ │ -std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const │ │ │ │ │ -Definition: visitor.hh:467 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::NodeCounterVisitor │ │ │ │ │ -Definition: visitor.hh:482 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::NodeCounterVisitor::pre │ │ │ │ │ -auto pre(Tree &&, TreePath, U u) const │ │ │ │ │ -Definition: visitor.hh:484 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::DepthVisitor │ │ │ │ │ -Definition: visitor.hh:493 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::DepthVisitor::leaf │ │ │ │ │ -auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ -Definition: visitor.hh:495 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: fixedcapacitystack.hh File Reference │ │ │ │ +dune-typetree: traversal.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,37 +63,86 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
fixedcapacitystack.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
traversal.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <cassert>
│ │ │ │ +
#include <utility>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/common/std/type_traits.hh>
│ │ │ │ +#include <dune/typetree/childextraction.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/treepath.hh>
│ │ │ │ +#include <dune/typetree/visitor.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  Dune::TypeTree::FixedCapacityStackView< T >
 
class  Dune::TypeTree::FixedCapacityStack< T, capacity >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Detail
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Typedefs

template<class Tree >
using Dune::TypeTree::Detail::DynamicTraversalConcept = decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u)))
 
template<class Tree >
using Dune::TypeTree::Detail::StaticTraversalConcept = decltype((std::integral_constant< std::size_t, Tree::degree()>{}))
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<class Tree , TreePathType::Type pathType, class Prefix , std::enable_if_t< Tree::isLeaf, int > = 0>
constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix)
 
template<class Tree , TreePathType::Type pathType, class Prefix , std::size_t... indices, std::enable_if_t<(Tree::isComposite or(Tree::isPower and(pathType!=TreePathType::dynamic))), int > = 0>
constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std::index_sequence< indices... >)
 
template<class T , class TreePath , class V , std::enable_if_t< std::decay_t< T >::isLeaf, int > = 0>
void Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath treePath, V &&visitor)
 
template<class T , class TreePath , class PreFunc , class LeafFunc , class PostFunc >
void Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
 
template<class Tree , TreePathType::Type pathType = TreePathType::dynamic>
constexpr auto Dune::TypeTree::leafTreePathTuple ()
 Create tuple of tree paths to leafs. More...
 
template<typename Tree , typename Visitor >
void Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor)
 Apply visitor to TypeTree. More...
 
template<class Tree , class PreFunc , class LeafFunc , class PostFunc >
void Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
 Traverse tree and visit each node. More...
 
template<class Tree , class InnerFunc , class LeafFunc >
void Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc &&innerFunc, LeafFunc &&leafFunc)
 Traverse tree and visit each node. More...
 
template<class Tree , class NodeFunc >
void Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc)
 Traverse tree and visit each node. More...
 
template<class Tree , class LeafFunc >
void Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc &&leafFunc)
 Traverse tree and visit each leaf node. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,25 +4,85 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -fixedcapacitystack.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Typedefs | Functions │ │ │ │ │ +traversal.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  Dune::TypeTree::FixedCapacityStackView<_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::TypeTree::FixedCapacityStack<_T,_capacity_> │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ +namespace  Dune::TypeTree::Detail │ │ │ │ │ +  │ │ │ │ │ + Typedefs │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::Detail::DynamicTraversalConcept = decltype((std:: │ │ │ │ │ + declval< Tree >().degree(), std::declval< Tree >().child(0u))) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using Dune::TypeTree::Detail::StaticTraversalConcept = decltype((std:: │ │ │ │ │ + integral_constant< std::size_t, Tree::degree()>{})) │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template = 0> │ │ │ │ │ +constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix) │ │ │ │ │ +  │ │ │ │ │ +template = 0> │ │ │ │ │ +constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std:: │ │ │ │ │ + index_sequence< indices... >) │ │ │ │ │ +  │ │ │ │ │ +template::isLeaf, int > = 0> │ │ │ │ │ + void Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath │ │ │ │ │ + treePath, V &&visitor) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath │ │ │ │ │ + treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc │ │ │ │ │ + &&postFunc) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto Dune::TypeTree::leafTreePathTuple () │ │ │ │ │ +  Create tuple of tree paths to leafs. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor) │ │ │ │ │ +  Apply visitor to TypeTree. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc, │ │ │ │ │ + LeafFunc &&leafFunc, PostFunc &&postFunc) │ │ │ │ │ +  Traverse tree and visit each node. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc │ │ │ │ │ + &&innerFunc, LeafFunc &&leafFunc) │ │ │ │ │ +  Traverse tree and visit each node. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc) │ │ │ │ │ +  Traverse tree and visit each node. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc │ │ │ │ │ + &&leafFunc) │ │ │ │ │ +  Traverse tree and visit each leaf node. More... │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00047_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: fixedcapacitystack.hh Source File │ │ │ │ +dune-typetree: traversal.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,181 +62,278 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
fixedcapacitystack.hh
│ │ │ │ +
traversal.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │ -
5#define DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TRAVERSAL_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TRAVERSAL_HH
│ │ │ │
6
│ │ │ │ -
7#include <array>
│ │ │ │ -
8#include <cassert>
│ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11 namespace TypeTree {
│ │ │ │ -
12
│ │ │ │ -
13
│ │ │ │ -
17
│ │ │ │ -
18 template<typename T>
│ │ │ │ - │ │ │ │ -
20 {
│ │ │ │ -
21
│ │ │ │ -
22 public:
│ │ │ │ -
23
│ │ │ │ -
24 struct Impl
│ │ │ │ -
25 {
│ │ │ │ -
26
│ │ │ │ -
27 Impl(T* data, std::size_t capacity)
│ │ │ │ -
28 : _data(data)
│ │ │ │ -
29 , _size(0)
│ │ │ │ -
30 , _capacity(capacity)
│ │ │ │ -
31 {}
│ │ │ │ -
32
│ │ │ │ -
33 T * const _data;
│ │ │ │ -
34 std::size_t _size;
│ │ │ │ -
35 const std::size_t _capacity;
│ │ │ │ -
36 };
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
39 : _impl(impl)
│ │ │ │ -
40 {}
│ │ │ │ -
41
│ │ │ │ -
42 public:
│ │ │ │ -
43
│ │ │ │ -
44 std::size_t size() const
│ │ │ │ -
45 {
│ │ │ │ -
46 return _impl._size;
│ │ │ │ -
47 }
│ │ │ │ +
7#include <utility>
│ │ │ │ +
8
│ │ │ │ +
9#include <dune/common/hybridutilities.hh>
│ │ │ │ +
10#include <dune/common/std/type_traits.hh>
│ │ │ │ +
11
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
16
│ │ │ │ +
17namespace Dune {
│ │ │ │ +
18 namespace TypeTree {
│ │ │ │ +
19
│ │ │ │ +
25#ifndef DOXYGEN
│ │ │ │ +
27 struct NoOp
│ │ │ │ +
28 {
│ │ │ │ +
29 template<class... T>
│ │ │ │ +
30 constexpr void operator()(T&&...) const { /* do nothing */ }
│ │ │ │ +
31 };
│ │ │ │ +
32#endif
│ │ │ │ +
33
│ │ │ │ +
34 namespace Detail {
│ │ │ │ +
35
│ │ │ │ +
36 // SFINAE template check that Tree has a degree() function and a child() function accepting integer indices
│ │ │ │ +
37 template<class Tree>
│ │ │ │ +
38 using DynamicTraversalConcept = decltype((
│ │ │ │ +
39 std::declval<Tree>().degree(),
│ │ │ │ +
40 std::declval<Tree>().child(0u)
│ │ │ │ +
41 ));
│ │ │ │ +
42
│ │ │ │ +
43 // SFINAE template check that Tree has static (constexpr) function Tree::degree()
│ │ │ │ +
44 template<class Tree>
│ │ │ │ +
45 using StaticTraversalConcept = decltype((
│ │ │ │ +
46 std::integral_constant<std::size_t, Tree::degree()>{}
│ │ │ │ +
47 ));
│ │ │ │
48
│ │ │ │ -
49 std::size_t capacity() const
│ │ │ │ -
50 {
│ │ │ │ -
51 return _impl._capacity;
│ │ │ │ -
52 }
│ │ │ │ -
53
│ │ │ │ -
54 bool empty() const
│ │ │ │ -
55 {
│ │ │ │ -
56 return _impl._size == 0;
│ │ │ │ -
57 }
│ │ │ │ -
58
│ │ │ │ -
59 bool full() const
│ │ │ │ -
60 {
│ │ │ │ -
61 return _impl._size == _impl._capacity;
│ │ │ │ -
62 }
│ │ │ │ -
63
│ │ │ │ -
64 void push_back(const T& t)
│ │ │ │ -
65 {
│ │ │ │ -
66 assert(!full());
│ │ │ │ -
67 _impl._data[_impl._size++] = t;
│ │ │ │ -
68 }
│ │ │ │ -
69
│ │ │ │ -
70 void pop_back()
│ │ │ │ +
49
│ │ │ │ +
50 template<class Tree, TreePathType::Type pathType, class Prefix,
│ │ │ │ +
51 std::enable_if_t<Tree::isLeaf, int> = 0>
│ │ │ │ +
52 constexpr auto leafTreePathTuple(Prefix prefix)
│ │ │ │ +
53 {
│ │ │ │ +
54 return std::make_tuple(prefix);
│ │ │ │ +
55 }
│ │ │ │ +
56
│ │ │ │ +
57 template<class Tree, TreePathType::Type pathType, class Prefix,
│ │ │ │ +
58 std::enable_if_t<not Tree::isLeaf, int> = 0>
│ │ │ │ +
59 constexpr auto leafTreePathTuple(Prefix prefix);
│ │ │ │ +
60
│ │ │ │ +
61 template<class Tree, TreePathType::Type pathType, class Prefix, std::size_t... indices,
│ │ │ │ +
62 std::enable_if_t<(Tree::isComposite or (Tree::isPower and (pathType!=TreePathType::dynamic))), int> = 0>
│ │ │ │ +
63 constexpr auto leafTreePathTuple(Prefix prefix, std::index_sequence<indices...>)
│ │ │ │ +
64 {
│ │ │ │ +
65 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, Dune::index_constant<indices>{}))...);
│ │ │ │ +
66 }
│ │ │ │ +
67
│ │ │ │ +
68 template<class Tree, TreePathType::Type pathType, class Prefix, std::size_t... indices,
│ │ │ │ +
69 std::enable_if_t<(Tree::isPower and (pathType==TreePathType::dynamic)), int> = 0>
│ │ │ │ +
70 constexpr auto leafTreePathTuple(Prefix prefix, std::index_sequence<indices...>)
│ │ │ │
71 {
│ │ │ │ -
72 assert(!empty());
│ │ │ │ -
73 --_impl._size;
│ │ │ │ -
74 }
│ │ │ │ -
75
│ │ │ │ -
76 T& back()
│ │ │ │ -
77 {
│ │ │ │ -
78 assert(!empty());
│ │ │ │ -
79 return _impl._data[_impl._size-1];
│ │ │ │ +
72 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, indices))...);
│ │ │ │ +
73 }
│ │ │ │ +
74
│ │ │ │ +
75 template<class Tree, TreePathType::Type pathType, class Prefix,
│ │ │ │ +
76 std::enable_if_t<not Tree::isLeaf, int>>
│ │ │ │ +
77 constexpr auto leafTreePathTuple(Prefix prefix)
│ │ │ │ +
78 {
│ │ │ │ +
79 return Detail::leafTreePathTuple<Tree, pathType>(prefix, std::make_index_sequence<Tree::degree()>{});
│ │ │ │
80 }
│ │ │ │
81
│ │ │ │ -
82 const T& back() const
│ │ │ │ -
83 {
│ │ │ │ -
84 assert(!empty());
│ │ │ │ -
85 return _impl._data[_impl._size-1];
│ │ │ │ -
86 }
│ │ │ │ -
87
│ │ │ │ -
88 T& front()
│ │ │ │ -
89 {
│ │ │ │ -
90 assert(!empty());
│ │ │ │ -
91 return _impl._data[0];
│ │ │ │ -
92 }
│ │ │ │ -
93
│ │ │ │ -
94 const T& front() const
│ │ │ │ -
95 {
│ │ │ │ -
96 assert(!empty());
│ │ │ │ -
97 return _impl._data[0];
│ │ │ │ +
82 /* The signature is the same as for the public applyToTree
│ │ │ │ +
83 * function in Dune::Typetree, despite the additionally passed
│ │ │ │ +
84 * treePath argument. The path passed here is associated to
│ │ │ │ +
85 * the tree and the relative paths of the children (wrt. to tree)
│ │ │ │ +
86 * are appended to this. Hence the behavior of the public function
│ │ │ │ +
87 * is resembled by passing an empty treePath.
│ │ │ │ +
88 */
│ │ │ │ +
89
│ │ │ │ +
90 /*
│ │ │ │ +
91 * This is the overload for leaf traversal
│ │ │ │ +
92 */
│ │ │ │ +
93 template<class T, class TreePath, class V,
│ │ │ │ +
94 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ +
95 void applyToTree(T&& tree, TreePath treePath, V&& visitor)
│ │ │ │ +
96 {
│ │ │ │ +
97 visitor.leaf(tree, treePath);
│ │ │ │
98 }
│ │ │ │
99
│ │ │ │ -
100 T& operator[](std::size_t k)
│ │ │ │ -
101 {
│ │ │ │ -
102 assert(k < _impl._size);
│ │ │ │ -
103 return _impl._data[k];
│ │ │ │ -
104 }
│ │ │ │ -
105
│ │ │ │ -
106 const T& operator[](std::size_t k) const
│ │ │ │ -
107 {
│ │ │ │ -
108 assert(k < _impl._size);
│ │ │ │ -
109 return _impl._data[k];
│ │ │ │ -
110 }
│ │ │ │ -
111
│ │ │ │ -
112 private:
│ │ │ │ -
113 Impl& _impl;
│ │ │ │ +
100 /*
│ │ │ │ +
101 * This is the general overload doing child traversal.
│ │ │ │ +
102 */
│ │ │ │ +
103 template<class T, class TreePath, class V,
│ │ │ │ +
104 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ +
105 void applyToTree(T&& tree, TreePath treePath, V&& visitor)
│ │ │ │ +
106 {
│ │ │ │ +
107 using Tree = std::remove_reference_t<T>;
│ │ │ │ +
108 using Visitor = std::remove_reference_t<V>;
│ │ │ │ +
109 visitor.pre(tree, treePath);
│ │ │ │ +
110
│ │ │ │ +
111 // check which type of traversal is supported by the tree
│ │ │ │ +
112 using allowDynamicTraversal = Dune::Std::is_detected<DynamicTraversalConcept,Tree>;
│ │ │ │ +
113 using allowStaticTraversal = Dune::Std::is_detected<StaticTraversalConcept,Tree>;
│ │ │ │
114
│ │ │ │ -
115 };
│ │ │ │ -
116
│ │ │ │ +
115 // the tree must support either dynamic or static traversal
│ │ │ │ +
116 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │
117
│ │ │ │ -
118 template<typename T, std::size_t capacity>
│ │ │ │ - │ │ │ │ -
120 : private std::array<T,capacity>
│ │ │ │ -
121 , private FixedCapacityStackView<T>::Impl
│ │ │ │ -
122 , public FixedCapacityStackView<T>
│ │ │ │ -
123 {
│ │ │ │ -
124
│ │ │ │ - │ │ │ │ -
126
│ │ │ │ -
127 public:
│ │ │ │ +
118 // the visitor may specify preferred dynamic traversal
│ │ │ │ +
119 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
│ │ │ │ +
120
│ │ │ │ +
121 // create a dynamic or static index range
│ │ │ │ +
122 auto indices = [&]{
│ │ │ │ +
123 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
│ │ │ │ +
124 return Dune::range(std::size_t(tree.degree()));
│ │ │ │ +
125 else
│ │ │ │ +
126 return Dune::range(tree.degree());
│ │ │ │ +
127 }();
│ │ │ │
128
│ │ │ │ -
129 using view_base::back;
│ │ │ │ -
130 using view_base::front;
│ │ │ │ -
131 using view_base::size;
│ │ │ │ -
132 using view_base::operator[];
│ │ │ │ +
129 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
│ │ │ │ +
130 Hybrid::forEach(indices, [&](auto i) {
│ │ │ │ +
131 auto&& child = tree.child(i);
│ │ │ │ +
132 using Child = std::decay_t<decltype(child)>;
│ │ │ │
133
│ │ │ │ - │ │ │ │ -
135 : FixedCapacityStackView<T>::Impl(&(static_cast<std::array<T,capacity>&>(*this)[0]),capacity)
│ │ │ │ -
136 , FixedCapacityStackView<T>(static_cast<typename FixedCapacityStackView<T>::Impl&>(*this))
│ │ │ │ -
137 {}
│ │ │ │ -
138
│ │ │ │ -
139 private:
│ │ │ │ +
134 visitor.beforeChild(tree, child, treePath, i);
│ │ │ │ +
135
│ │ │ │ +
136 // This requires that visitor.in(...) can always be instantiated,
│ │ │ │ +
137 // even if there's a single child only.
│ │ │ │ +
138 if (i>0)
│ │ │ │ +
139 visitor.in(tree, treePath);
│ │ │ │
140
│ │ │ │ -
141 //FixedCapacityStack(const FixedCapacityStack&);
│ │ │ │ -
142 FixedCapacityStack& operator=(const FixedCapacityStack&);
│ │ │ │ -
143
│ │ │ │ -
144 };
│ │ │ │ -
145
│ │ │ │ -
147
│ │ │ │ -
148 } // namespace TypeTree
│ │ │ │ -
149} //namespace Dune
│ │ │ │ -
150
│ │ │ │ -
151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │ +
141 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
│ │ │ │ +
142 if constexpr(visitChild) {
│ │ │ │ +
143 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ +
144 applyToTree(child, childTreePath, visitor);
│ │ │ │ +
145 }
│ │ │ │ +
146
│ │ │ │ +
147 visitor.afterChild(tree, child, treePath, i);
│ │ │ │ +
148 });
│ │ │ │ +
149 }
│ │ │ │ +
150 visitor.post(tree, treePath);
│ │ │ │ +
151 }
│ │ │ │ +
152
│ │ │ │ +
153 /* Traverse tree and visit each node. The signature is the same
│ │ │ │ +
154 * as for the public forEachNode function in Dune::Typtree,
│ │ │ │ +
155 * despite the additionally passed treePath argument. The path
│ │ │ │ +
156 * passed here is associated to the tree and the relative
│ │ │ │ +
157 * paths of the children (wrt. to tree) are appended to this.
│ │ │ │ +
158 * Hence the behavior of the public function is resembled
│ │ │ │ +
159 * by passing an empty treePath.
│ │ │ │ +
160 */
│ │ │ │ +
161 template<class T, class TreePath, class PreFunc, class LeafFunc, class PostFunc>
│ │ │ │ +
162 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
│ │ │ │ +
163 {
│ │ │ │ +
164 using Tree = std::decay_t<T>;
│ │ │ │ +
165 if constexpr(Tree::isLeaf) {
│ │ │ │ +
166 leafFunc(tree, treePath);
│ │ │ │ +
167 } else {
│ │ │ │ +
168 preFunc(tree, treePath);
│ │ │ │ +
169
│ │ │ │ +
170 // check which type of traversal is supported by the tree, prefer dynamic traversal
│ │ │ │ +
171 using allowDynamicTraversal = Dune::Std::is_detected<DynamicTraversalConcept,Tree>;
│ │ │ │ +
172 using allowStaticTraversal = Dune::Std::is_detected<StaticTraversalConcept,Tree>;
│ │ │ │ +
173
│ │ │ │ +
174 // the tree must support either dynamic or static traversal
│ │ │ │ +
175 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ +
176
│ │ │ │ +
177 if constexpr(allowDynamicTraversal::value) {
│ │ │ │ +
178 // Specialization for dynamic traversal
│ │ │ │ +
179 for (std::size_t i = 0; i < tree.degree(); ++i) {
│ │ │ │ +
180 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ +
181 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);
│ │ │ │ +
182 }
│ │ │ │ +
183 } else if constexpr(allowStaticTraversal::value) {
│ │ │ │ +
184 // Specialization for static traversal
│ │ │ │ +
185 auto indices = std::make_index_sequence<Tree::degree()>{};
│ │ │ │ +
186 Hybrid::forEach(indices, [&](auto i) {
│ │ │ │ +
187 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ +
188 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);
│ │ │ │ +
189 });
│ │ │ │ +
190 }
│ │ │ │ +
191 postFunc(tree, treePath);
│ │ │ │ +
192 }
│ │ │ │ +
193 }
│ │ │ │ +
194
│ │ │ │ +
195 } // namespace Detail
│ │ │ │ +
196
│ │ │ │ +
197
│ │ │ │ +
198 // ********************************************************************************
│ │ │ │ +
199 // Public Interface
│ │ │ │ +
200 // ********************************************************************************
│ │ │ │ +
201
│ │ │ │ +
215 template<class Tree, TreePathType::Type pathType=TreePathType::dynamic>
│ │ │ │ +
216 constexpr auto leafTreePathTuple()
│ │ │ │ +
217 {
│ │ │ │ +
218 return Detail::leafTreePathTuple<std::decay_t<Tree>, pathType>(hybridTreePath());
│ │ │ │ +
219 }
│ │ │ │ +
220
│ │ │ │ +
222
│ │ │ │ +
236 template<typename Tree, typename Visitor>
│ │ │ │ +
237 void applyToTree(Tree&& tree, Visitor&& visitor)
│ │ │ │ +
238 {
│ │ │ │ +
239 Detail::applyToTree(tree, hybridTreePath(), visitor);
│ │ │ │ +
240 }
│ │ │ │ +
241
│ │ │ │ +
255 template<class Tree, class PreFunc, class LeafFunc, class PostFunc>
│ │ │ │ +
256 [[deprecated]] void forEachNode(Tree&& tree, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
│ │ │ │ +
257 {
│ │ │ │ +
258 Detail::forEachNode(tree, hybridTreePath(), preFunc, leafFunc, postFunc);
│ │ │ │ +
259 }
│ │ │ │ +
260
│ │ │ │ +
273 template<class Tree, class InnerFunc, class LeafFunc>
│ │ │ │ +
274 [[deprecated]] void forEachNode(Tree&& tree, InnerFunc&& innerFunc, LeafFunc&& leafFunc)
│ │ │ │ +
275 {
│ │ │ │ +
276 Detail::forEachNode(tree, hybridTreePath(), innerFunc, leafFunc, NoOp{});
│ │ │ │ +
277 }
│ │ │ │ +
278
│ │ │ │ +
288 template<class Tree, class NodeFunc>
│ │ │ │ +
289 void forEachNode(Tree&& tree, NodeFunc&& nodeFunc)
│ │ │ │ +
290 {
│ │ │ │ +
291 Detail::forEachNode(tree, hybridTreePath(), nodeFunc, nodeFunc, NoOp{});
│ │ │ │ +
292 }
│ │ │ │ +
293
│ │ │ │ +
303 template<class Tree, class LeafFunc>
│ │ │ │ +
304 void forEachLeafNode(Tree&& tree, LeafFunc&& leafFunc)
│ │ │ │ +
305 {
│ │ │ │ +
306 Detail::forEachNode(tree, hybridTreePath(), NoOp{}, leafFunc, NoOp{});
│ │ │ │ +
307 }
│ │ │ │ +
308
│ │ │ │ +
310
│ │ │ │ +
311 } // namespace TypeTree
│ │ │ │ +
312} //namespace Dune
│ │ │ │ +
313
│ │ │ │ +
314#endif // DUNE_TYPETREE_TRAVERSAL_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
Traverse tree and visit each node.
Definition: traversal.hh:256
│ │ │ │ +
constexpr auto leafTreePathTuple()
Create tuple of tree paths to leafs.
Definition: traversal.hh:216
│ │ │ │ +
void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc)
Traverse tree and visit each leaf node.
Definition: traversal.hh:304
│ │ │ │ +
void applyToTree(Tree &&tree, Visitor &&visitor)
Apply visitor to TypeTree.
Definition: traversal.hh:237
│ │ │ │ +
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │ +
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ +
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ +
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ +
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ +
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Definition: fixedcapacitystack.hh:20
│ │ │ │ -
bool empty() const
Definition: fixedcapacitystack.hh:54
│ │ │ │ -
bool full() const
Definition: fixedcapacitystack.hh:59
│ │ │ │ -
T & operator[](std::size_t k)
Definition: fixedcapacitystack.hh:100
│ │ │ │ -
void pop_back()
Definition: fixedcapacitystack.hh:70
│ │ │ │ -
T & back()
Definition: fixedcapacitystack.hh:76
│ │ │ │ -
std::size_t capacity() const
Definition: fixedcapacitystack.hh:49
│ │ │ │ -
T & front()
Definition: fixedcapacitystack.hh:88
│ │ │ │ -
const T & front() const
Definition: fixedcapacitystack.hh:94
│ │ │ │ -
const T & operator[](std::size_t k) const
Definition: fixedcapacitystack.hh:106
│ │ │ │ -
void push_back(const T &t)
Definition: fixedcapacitystack.hh:64
│ │ │ │ -
const T & back() const
Definition: fixedcapacitystack.hh:82
│ │ │ │ -
std::size_t size() const
Definition: fixedcapacitystack.hh:44
│ │ │ │ -
FixedCapacityStackView(Impl &impl)
Definition: fixedcapacitystack.hh:38
│ │ │ │ -
Definition: fixedcapacitystack.hh:123
│ │ │ │ -
FixedCapacityStack()
Definition: fixedcapacitystack.hh:134
│ │ │ │ +
void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
Definition: traversal.hh:162
│ │ │ │ +
decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) DynamicTraversalConcept
Definition: traversal.hh:41
│ │ │ │ +
decltype((std::integral_constant< std::size_t, Tree::degree()>{})) StaticTraversalConcept
Definition: traversal.hh:47
│ │ │ │ +
void applyToTree(T &&tree, TreePath treePath, V &&visitor)
Definition: traversal.hh:95
│ │ │ │ +
constexpr auto leafTreePathTuple(Prefix prefix)
Definition: traversal.hh:52
│ │ │ │ +
Type
Definition: treepath.hh:30
│ │ │ │ +
@ dynamic
Definition: treepath.hh:30
│ │ │ │ +
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,209 +4,361 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -fixedcapacitystack.hh │ │ │ │ │ +traversal.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10namespace Dune { │ │ │ │ │ - 11 namespace TypeTree { │ │ │ │ │ - 12 │ │ │ │ │ - 13 │ │ │ │ │ - 17 │ │ │ │ │ - 18 template │ │ │ │ │ -19 class FixedCapacityStackView │ │ │ │ │ - 20 { │ │ │ │ │ - 21 │ │ │ │ │ - 22 public: │ │ │ │ │ - 23 │ │ │ │ │ - 24 struct Impl │ │ │ │ │ - 25 { │ │ │ │ │ - 26 │ │ │ │ │ - 27 Impl(T* data, std::size_t capacity) │ │ │ │ │ - 28 : _data(data) │ │ │ │ │ - 29 , _size(0) │ │ │ │ │ - 30 , _capacity(capacity) │ │ │ │ │ - 31 {} │ │ │ │ │ - 32 │ │ │ │ │ - 33 T * const _data; │ │ │ │ │ - 34 std::size_t _size; │ │ │ │ │ - 35 const std::size_t _capacity; │ │ │ │ │ - 36 }; │ │ │ │ │ - 37 │ │ │ │ │ -38 FixedCapacityStackView(Impl& impl) │ │ │ │ │ - 39 : _impl(impl) │ │ │ │ │ - 40 {} │ │ │ │ │ - 41 │ │ │ │ │ - 42 public: │ │ │ │ │ - 43 │ │ │ │ │ -44 std::size_t size() const │ │ │ │ │ - 45 { │ │ │ │ │ - 46 return _impl._size; │ │ │ │ │ - 47 } │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11 │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16 │ │ │ │ │ + 17namespace Dune { │ │ │ │ │ + 18 namespace TypeTree { │ │ │ │ │ + 19 │ │ │ │ │ + 25#ifndef DOXYGEN │ │ │ │ │ + 27 struct NoOp │ │ │ │ │ + 28 { │ │ │ │ │ + 29 template │ │ │ │ │ + 30 constexpr void operator()(T&&...) const { /* do nothing */ } │ │ │ │ │ + 31 }; │ │ │ │ │ + 32#endif │ │ │ │ │ + 33 │ │ │ │ │ + 34 namespace Detail { │ │ │ │ │ + 35 │ │ │ │ │ + 36 // SFINAE template check that Tree has a degree() function and a child() │ │ │ │ │ +function accepting integer indices │ │ │ │ │ + 37 template │ │ │ │ │ +38 using DynamicTraversalConcept = decltype(( │ │ │ │ │ + 39 std::declval().degree(), │ │ │ │ │ + 40 std::declval().child(0u) │ │ │ │ │ + 41 )); │ │ │ │ │ + 42 │ │ │ │ │ + 43 // SFINAE template check that Tree has static (constexpr) function Tree:: │ │ │ │ │ +degree() │ │ │ │ │ + 44 template │ │ │ │ │ +45 using StaticTraversalConcept = decltype(( │ │ │ │ │ + 46 std::integral_constant{} │ │ │ │ │ + 47 )); │ │ │ │ │ 48 │ │ │ │ │ -49 std::size_t capacity() const │ │ │ │ │ - 50 { │ │ │ │ │ - 51 return _impl._capacity; │ │ │ │ │ - 52 } │ │ │ │ │ - 53 │ │ │ │ │ -54 bool empty() const │ │ │ │ │ - 55 { │ │ │ │ │ - 56 return _impl._size == 0; │ │ │ │ │ - 57 } │ │ │ │ │ - 58 │ │ │ │ │ -59 bool full() const │ │ │ │ │ - 60 { │ │ │ │ │ - 61 return _impl._size == _impl._capacity; │ │ │ │ │ - 62 } │ │ │ │ │ - 63 │ │ │ │ │ -64 void push_back(const T& t) │ │ │ │ │ - 65 { │ │ │ │ │ - 66 assert(!full()); │ │ │ │ │ - 67 _impl._data[_impl._size++] = t; │ │ │ │ │ - 68 } │ │ │ │ │ - 69 │ │ │ │ │ -70 void pop_back() │ │ │ │ │ + 49 │ │ │ │ │ + 50 template = 0> │ │ │ │ │ +52 constexpr auto leafTreePathTuple(Prefix prefix) │ │ │ │ │ + 53 { │ │ │ │ │ + 54 return std::make_tuple(prefix); │ │ │ │ │ + 55 } │ │ │ │ │ + 56 │ │ │ │ │ + 57 template = 0> │ │ │ │ │ + 59 constexpr auto leafTreePathTuple(Prefix prefix); │ │ │ │ │ + 60 │ │ │ │ │ + 61 template = 0> │ │ │ │ │ +63 constexpr auto leafTreePathTuple(Prefix prefix, std:: │ │ │ │ │ +index_sequence) │ │ │ │ │ + 64 { │ │ │ │ │ + 65 return std::tuple_cat(Detail::leafTreePathTuple, pathType>(Dune::TypeTree::push_back(prefix, Dune:: │ │ │ │ │ +index_constant{}))...); │ │ │ │ │ + 66 } │ │ │ │ │ + 67 │ │ │ │ │ + 68 template = 0> │ │ │ │ │ + 70 constexpr auto leafTreePathTuple(Prefix prefix, std:: │ │ │ │ │ +index_sequence) │ │ │ │ │ 71 { │ │ │ │ │ - 72 assert(!empty()); │ │ │ │ │ - 73 --_impl._size; │ │ │ │ │ - 74 } │ │ │ │ │ - 75 │ │ │ │ │ -76 T& back() │ │ │ │ │ - 77 { │ │ │ │ │ - 78 assert(!empty()); │ │ │ │ │ - 79 return _impl._data[_impl._size-1]; │ │ │ │ │ + 72 return std::tuple_cat(Detail::leafTreePathTuple, pathType>(Dune::TypeTree::push_back(prefix, indices))...); │ │ │ │ │ + 73 } │ │ │ │ │ + 74 │ │ │ │ │ + 75 template> │ │ │ │ │ + 77 constexpr auto leafTreePathTuple(Prefix prefix) │ │ │ │ │ + 78 { │ │ │ │ │ + 79 return Detail::leafTreePathTuple(prefix, std:: │ │ │ │ │ +make_index_sequence{}); │ │ │ │ │ 80 } │ │ │ │ │ 81 │ │ │ │ │ -82 const T& back() const │ │ │ │ │ - 83 { │ │ │ │ │ - 84 assert(!empty()); │ │ │ │ │ - 85 return _impl._data[_impl._size-1]; │ │ │ │ │ - 86 } │ │ │ │ │ - 87 │ │ │ │ │ -88 T& front() │ │ │ │ │ - 89 { │ │ │ │ │ - 90 assert(!empty()); │ │ │ │ │ - 91 return _impl._data[0]; │ │ │ │ │ - 92 } │ │ │ │ │ - 93 │ │ │ │ │ -94 const T& front() const │ │ │ │ │ - 95 { │ │ │ │ │ - 96 assert(!empty()); │ │ │ │ │ - 97 return _impl._data[0]; │ │ │ │ │ + 82 /* The signature is the same as for the public applyToTree │ │ │ │ │ + 83 * function in Dune::Typetree, despite the additionally passed │ │ │ │ │ + 84 * treePath argument. The path passed here is associated to │ │ │ │ │ + 85 * the tree and the relative paths of the children (wrt. to tree) │ │ │ │ │ + 86 * are appended to this. Hence the behavior of the public function │ │ │ │ │ + 87 * is resembled by passing an empty treePath. │ │ │ │ │ + 88 */ │ │ │ │ │ + 89 │ │ │ │ │ + 90 /* │ │ │ │ │ + 91 * This is the overload for leaf traversal │ │ │ │ │ + 92 */ │ │ │ │ │ + 93 template::isLeaf, int> = 0> │ │ │ │ │ +95 void applyToTree(T&& tree, TreePath treePath, V&& visitor) │ │ │ │ │ + 96 { │ │ │ │ │ + 97 visitor.leaf(tree, treePath); │ │ │ │ │ 98 } │ │ │ │ │ 99 │ │ │ │ │ -100 T& operator[](std::size_t k) │ │ │ │ │ - 101 { │ │ │ │ │ - 102 assert(k < _impl._size); │ │ │ │ │ - 103 return _impl._data[k]; │ │ │ │ │ - 104 } │ │ │ │ │ - 105 │ │ │ │ │ -106 const T& operator[](std::size_t k) const │ │ │ │ │ - 107 { │ │ │ │ │ - 108 assert(k < _impl._size); │ │ │ │ │ - 109 return _impl._data[k]; │ │ │ │ │ - 110 } │ │ │ │ │ - 111 │ │ │ │ │ - 112 private: │ │ │ │ │ - 113 Impl& _impl; │ │ │ │ │ + 100 /* │ │ │ │ │ + 101 * This is the general overload doing child traversal. │ │ │ │ │ + 102 */ │ │ │ │ │ + 103 template::isLeaf, int> = 0> │ │ │ │ │ + 105 void applyToTree(T&& tree, TreePath treePath, V&& visitor) │ │ │ │ │ + 106 { │ │ │ │ │ + 107 using Tree = std::remove_reference_t; │ │ │ │ │ + 108 using Visitor = std::remove_reference_t; │ │ │ │ │ + 109 visitor.pre(tree, treePath); │ │ │ │ │ + 110 │ │ │ │ │ + 111 // check which type of traversal is supported by the tree │ │ │ │ │ + 112 using allowDynamicTraversal = Dune::Std:: │ │ │ │ │ +is_detected; │ │ │ │ │ + 113 using allowStaticTraversal = Dune::Std:: │ │ │ │ │ +is_detected; │ │ │ │ │ 114 │ │ │ │ │ - 115 }; │ │ │ │ │ - 116 │ │ │ │ │ + 115 // the tree must support either dynamic or static traversal │ │ │ │ │ + 116 static_assert(allowDynamicTraversal::value || allowStaticTraversal:: │ │ │ │ │ +value); │ │ │ │ │ 117 │ │ │ │ │ - 118 template │ │ │ │ │ -119 class FixedCapacityStack │ │ │ │ │ - 120 : private std::array │ │ │ │ │ - 121 , private FixedCapacityStackView::Impl │ │ │ │ │ - 122 , public FixedCapacityStackView │ │ │ │ │ - 123 { │ │ │ │ │ - 124 │ │ │ │ │ - 125 typedef FixedCapacityStackView view_base; │ │ │ │ │ - 126 │ │ │ │ │ - 127 public: │ │ │ │ │ + 118 // the visitor may specify preferred dynamic traversal │ │ │ │ │ + 119 using preferDynamicTraversal = std::bool_constant; │ │ │ │ │ + 120 │ │ │ │ │ + 121 // create a dynamic or static index range │ │ │ │ │ + 122 auto indices = [&]{ │ │ │ │ │ + 123 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal:: │ │ │ │ │ +value) │ │ │ │ │ + 124 return Dune::range(std::size_t(tree.degree())); │ │ │ │ │ + 125 else │ │ │ │ │ + 126 return Dune::range(tree.degree()); │ │ │ │ │ + 127 }(); │ │ │ │ │ 128 │ │ │ │ │ - 129 using view_base::back; │ │ │ │ │ - 130 using view_base::front; │ │ │ │ │ - 131 using view_base::size; │ │ │ │ │ - 132 using view_base::operator[]; │ │ │ │ │ + 129 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) │ │ │ │ │ +{ │ │ │ │ │ + 130 Hybrid::forEach(indices, [&](auto i) { │ │ │ │ │ + 131 auto&& child = tree.child(i); │ │ │ │ │ + 132 using Child = std::decay_t; │ │ │ │ │ 133 │ │ │ │ │ -134 FixedCapacityStack() │ │ │ │ │ - 135 : FixedCapacityStackView::Impl(&(static_cast&> │ │ │ │ │ -(*this)[0]),capacity) │ │ │ │ │ - 136 , FixedCapacityStackView(static_cast::Impl&>(*this)) │ │ │ │ │ - 137 {} │ │ │ │ │ - 138 │ │ │ │ │ - 139 private: │ │ │ │ │ + 134 visitor.beforeChild(tree, child, treePath, i); │ │ │ │ │ + 135 │ │ │ │ │ + 136 // This requires that visitor.in(...) can always be instantiated, │ │ │ │ │ + 137 // even if there's a single child only. │ │ │ │ │ + 138 if (i>0) │ │ │ │ │ + 139 visitor.in(tree, treePath); │ │ │ │ │ 140 │ │ │ │ │ - 141 //FixedCapacityStack(const FixedCapacityStack&); │ │ │ │ │ - 142 FixedCapacityStack& operator=(const FixedCapacityStack&); │ │ │ │ │ - 143 │ │ │ │ │ - 144 }; │ │ │ │ │ - 145 │ │ │ │ │ - 147 │ │ │ │ │ - 148 } // namespace TypeTree │ │ │ │ │ - 149} //namespace Dune │ │ │ │ │ - 150 │ │ │ │ │ - 151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ + 141 constexpr bool visitChild = Visitor::template │ │ │ │ │ +VisitChild::value; │ │ │ │ │ + 142 if constexpr(visitChild) { │ │ │ │ │ + 143 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ + 144 applyToTree(child, childTreePath, visitor); │ │ │ │ │ + 145 } │ │ │ │ │ + 146 │ │ │ │ │ + 147 visitor.afterChild(tree, child, treePath, i); │ │ │ │ │ + 148 }); │ │ │ │ │ + 149 } │ │ │ │ │ + 150 visitor.post(tree, treePath); │ │ │ │ │ + 151 } │ │ │ │ │ + 152 │ │ │ │ │ + 153 /* Traverse tree and visit each node. The signature is the same │ │ │ │ │ + 154 * as for the public forEachNode function in Dune::Typtree, │ │ │ │ │ + 155 * despite the additionally passed treePath argument. The path │ │ │ │ │ + 156 * passed here is associated to the tree and the relative │ │ │ │ │ + 157 * paths of the children (wrt. to tree) are appended to this. │ │ │ │ │ + 158 * Hence the behavior of the public function is resembled │ │ │ │ │ + 159 * by passing an empty treePath. │ │ │ │ │ + 160 */ │ │ │ │ │ + 161 template │ │ │ │ │ +162 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&& │ │ │ │ │ +leafFunc, PostFunc&& postFunc) │ │ │ │ │ + 163 { │ │ │ │ │ + 164 using Tree = std::decay_t; │ │ │ │ │ + 165 if constexpr(Tree::isLeaf) { │ │ │ │ │ + 166 leafFunc(tree, treePath); │ │ │ │ │ + 167 } else { │ │ │ │ │ + 168 preFunc(tree, treePath); │ │ │ │ │ + 169 │ │ │ │ │ + 170 // check which type of traversal is supported by the tree, prefer dynamic │ │ │ │ │ +traversal │ │ │ │ │ + 171 using allowDynamicTraversal = Dune::Std:: │ │ │ │ │ +is_detected; │ │ │ │ │ + 172 using allowStaticTraversal = Dune::Std:: │ │ │ │ │ +is_detected; │ │ │ │ │ + 173 │ │ │ │ │ + 174 // the tree must support either dynamic or static traversal │ │ │ │ │ + 175 static_assert(allowDynamicTraversal::value || allowStaticTraversal:: │ │ │ │ │ +value); │ │ │ │ │ + 176 │ │ │ │ │ + 177 if constexpr(allowDynamicTraversal::value) { │ │ │ │ │ + 178 // Specialization for dynamic traversal │ │ │ │ │ + 179 for (std::size_t i = 0; i < tree.degree(); ++i) { │ │ │ │ │ + 180 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ + 181 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc); │ │ │ │ │ + 182 } │ │ │ │ │ + 183 } else if constexpr(allowStaticTraversal::value) { │ │ │ │ │ + 184 // Specialization for static traversal │ │ │ │ │ + 185 auto indices = std::make_index_sequence{}; │ │ │ │ │ + 186 Hybrid::forEach(indices, [&](auto i) { │ │ │ │ │ + 187 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ + 188 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc); │ │ │ │ │ + 189 }); │ │ │ │ │ + 190 } │ │ │ │ │ + 191 postFunc(tree, treePath); │ │ │ │ │ + 192 } │ │ │ │ │ + 193 } │ │ │ │ │ + 194 │ │ │ │ │ + 195 } // namespace Detail │ │ │ │ │ + 196 │ │ │ │ │ + 197 │ │ │ │ │ + 198 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 199 // Public Interface │ │ │ │ │ + 200 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 201 │ │ │ │ │ + 215 template │ │ │ │ │ +216 constexpr auto leafTreePathTuple() │ │ │ │ │ + 217 { │ │ │ │ │ + 218 return Detail::leafTreePathTuple, pathType> │ │ │ │ │ +(hybridTreePath()); │ │ │ │ │ + 219 } │ │ │ │ │ + 220 │ │ │ │ │ + 222 │ │ │ │ │ + 236 template │ │ │ │ │ +237 void applyToTree(Tree&& tree, Visitor&& visitor) │ │ │ │ │ + 238 { │ │ │ │ │ + 239 Detail::applyToTree(tree, hybridTreePath(), visitor); │ │ │ │ │ + 240 } │ │ │ │ │ + 241 │ │ │ │ │ + 255 template │ │ │ │ │ +256 [[deprecated]] void forEachNode(Tree&& tree, PreFunc&& preFunc, LeafFunc&& │ │ │ │ │ +leafFunc, PostFunc&& postFunc) │ │ │ │ │ + 257 { │ │ │ │ │ + 258 Detail::forEachNode(tree, hybridTreePath(), preFunc, leafFunc, postFunc); │ │ │ │ │ + 259 } │ │ │ │ │ + 260 │ │ │ │ │ + 273 template │ │ │ │ │ +274 [[deprecated]] void forEachNode(Tree&& tree, InnerFunc&& innerFunc, │ │ │ │ │ +LeafFunc&& leafFunc) │ │ │ │ │ + 275 { │ │ │ │ │ + 276 Detail::forEachNode(tree, hybridTreePath(), innerFunc, leafFunc, NoOp{}); │ │ │ │ │ + 277 } │ │ │ │ │ + 278 │ │ │ │ │ + 288 template │ │ │ │ │ +289 void forEachNode(Tree&& tree, NodeFunc&& nodeFunc) │ │ │ │ │ + 290 { │ │ │ │ │ + 291 Detail::forEachNode(tree, hybridTreePath(), nodeFunc, nodeFunc, NoOp{}); │ │ │ │ │ + 292 } │ │ │ │ │ + 293 │ │ │ │ │ + 303 template │ │ │ │ │ +304 void forEachLeafNode(Tree&& tree, LeafFunc&& leafFunc) │ │ │ │ │ + 305 { │ │ │ │ │ + 306 Detail::forEachNode(tree, hybridTreePath(), NoOp{}, leafFunc, NoOp{}); │ │ │ │ │ + 307 } │ │ │ │ │ + 308 │ │ │ │ │ + 310 │ │ │ │ │ + 311 } // namespace TypeTree │ │ │ │ │ + 312} //namespace Dune │ │ │ │ │ + 313 │ │ │ │ │ + 314#endif // DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ +treepath.hh │ │ │ │ │ +childextraction.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ +visitor.hh │ │ │ │ │ +Dune::TypeTree::forEachNode │ │ │ │ │ +void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc │ │ │ │ │ +&&postFunc) │ │ │ │ │ +Traverse tree and visit each node. │ │ │ │ │ +Definition: traversal.hh:256 │ │ │ │ │ +Dune::TypeTree::leafTreePathTuple │ │ │ │ │ +constexpr auto leafTreePathTuple() │ │ │ │ │ +Create tuple of tree paths to leafs. │ │ │ │ │ +Definition: traversal.hh:216 │ │ │ │ │ +Dune::TypeTree::forEachLeafNode │ │ │ │ │ +void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc) │ │ │ │ │ +Traverse tree and visit each leaf node. │ │ │ │ │ +Definition: traversal.hh:304 │ │ │ │ │ +Dune::TypeTree::applyToTree │ │ │ │ │ +void applyToTree(Tree &&tree, Visitor &&visitor) │ │ │ │ │ +Apply visitor to TypeTree. │ │ │ │ │ +Definition: traversal.hh:237 │ │ │ │ │ +Dune::TypeTree::Child │ │ │ │ │ +typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ +Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ +Definition: childextraction.hh:223 │ │ │ │ │ +Dune::TypeTree::child │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: childextraction.hh:126 │ │ │ │ │ +Dune::TypeTree::degree │ │ │ │ │ +std::size_t degree(const Node &node) │ │ │ │ │ +Returns the degree of node as run time information. │ │ │ │ │ +Definition: nodeinterface.hh:85 │ │ │ │ │ +Dune::TypeTree::push_back │ │ │ │ │ +constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t i) │ │ │ │ │ +Appends a run time index to a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:281 │ │ │ │ │ +Dune::TypeTree::hybridTreePath │ │ │ │ │ +constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:180 │ │ │ │ │ +Dune::TypeTree::treePath │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:191 │ │ │ │ │ +Dune::TypeTree::TreePath │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +Definition: treepath.hh:521 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView │ │ │ │ │ -Definition: fixedcapacitystack.hh:20 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::empty │ │ │ │ │ -bool empty() const │ │ │ │ │ -Definition: fixedcapacitystack.hh:54 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::full │ │ │ │ │ -bool full() const │ │ │ │ │ -Definition: fixedcapacitystack.hh:59 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::operator[] │ │ │ │ │ -T & operator[](std::size_t k) │ │ │ │ │ -Definition: fixedcapacitystack.hh:100 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::pop_back │ │ │ │ │ -void pop_back() │ │ │ │ │ -Definition: fixedcapacitystack.hh:70 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::back │ │ │ │ │ -T & back() │ │ │ │ │ -Definition: fixedcapacitystack.hh:76 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::capacity │ │ │ │ │ -std::size_t capacity() const │ │ │ │ │ -Definition: fixedcapacitystack.hh:49 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::front │ │ │ │ │ -T & front() │ │ │ │ │ -Definition: fixedcapacitystack.hh:88 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::front │ │ │ │ │ -const T & front() const │ │ │ │ │ -Definition: fixedcapacitystack.hh:94 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::operator[] │ │ │ │ │ -const T & operator[](std::size_t k) const │ │ │ │ │ -Definition: fixedcapacitystack.hh:106 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::push_back │ │ │ │ │ -void push_back(const T &t) │ │ │ │ │ -Definition: fixedcapacitystack.hh:64 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::back │ │ │ │ │ -const T & back() const │ │ │ │ │ -Definition: fixedcapacitystack.hh:82 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::size │ │ │ │ │ -std::size_t size() const │ │ │ │ │ -Definition: fixedcapacitystack.hh:44 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStackView::FixedCapacityStackView │ │ │ │ │ -FixedCapacityStackView(Impl &impl) │ │ │ │ │ -Definition: fixedcapacitystack.hh:38 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStack │ │ │ │ │ -Definition: fixedcapacitystack.hh:123 │ │ │ │ │ -Dune::TypeTree::FixedCapacityStack::FixedCapacityStack │ │ │ │ │ -FixedCapacityStack() │ │ │ │ │ -Definition: fixedcapacitystack.hh:134 │ │ │ │ │ +Dune::TypeTree::Detail::forEachNode │ │ │ │ │ +void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc │ │ │ │ │ +&&leafFunc, PostFunc &&postFunc) │ │ │ │ │ +Definition: traversal.hh:162 │ │ │ │ │ +Dune::TypeTree::Detail::DynamicTraversalConcept │ │ │ │ │ +decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) │ │ │ │ │ +DynamicTraversalConcept │ │ │ │ │ +Definition: traversal.hh:41 │ │ │ │ │ +Dune::TypeTree::Detail::StaticTraversalConcept │ │ │ │ │ +decltype((std::integral_constant< std::size_t, Tree::degree()>{})) │ │ │ │ │ +StaticTraversalConcept │ │ │ │ │ +Definition: traversal.hh:47 │ │ │ │ │ +Dune::TypeTree::Detail::applyToTree │ │ │ │ │ +void applyToTree(T &&tree, TreePath treePath, V &&visitor) │ │ │ │ │ +Definition: traversal.hh:95 │ │ │ │ │ +Dune::TypeTree::Detail::leafTreePathTuple │ │ │ │ │ +constexpr auto leafTreePathTuple(Prefix prefix) │ │ │ │ │ +Definition: traversal.hh:52 │ │ │ │ │ +Dune::TypeTree::TreePathType::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ +@ dynamic │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::HybridTreePath │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: treepath.hh:79 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: dynamicpowernode.hh File Reference │ │ │ │ +dune-typetree: utility.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,33 +65,34 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
dynamicpowernode.hh File Reference
│ │ │ │ +
utility.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <memory>
│ │ │ │ +
#include <memory>
│ │ │ │ +#include <tuple>
│ │ │ │ #include <type_traits>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/std/type_traits.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/utility.hh>
│ │ │ │ -#include <dune/typetree/typetraits.hh>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <algorithm>
│ │ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::TypeTree::DynamicPowerNode< T >
 Collect multiple instances of type T within a dune-typetree. More...
struct  Dune::TypeTree::TreeInfo< Tree, Tag >
 Struct for obtaining some basic structural information about a TypeTree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,28 +5,30 @@ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -dynamicpowernode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +utility.hh File Reference │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::TypeTree::DynamicPowerNode<_T_> │ │ │ │ │ -  Collect multiple instances of type T within a dune-typetree. More... │ │ │ │ │ +struct  Dune::TypeTree::TreeInfo<_Tree,_Tag_> │ │ │ │ │ +  Struct for obtaining some basic structural information about a │ │ │ │ │ + TypeTree. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00050_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: dynamicpowernode.hh Source File │ │ │ │ +dune-typetree: utility.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,193 +62,284 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
dynamicpowernode.hh
│ │ │ │ +
utility.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_UTILITY_HH
│ │ │ │ +
5#define DUNE_TYPETREE_UTILITY_HH
│ │ │ │
6
│ │ │ │ -
7#include <cassert>
│ │ │ │ -
8#include <vector>
│ │ │ │ -
9#include <memory>
│ │ │ │ -
10#include <type_traits>
│ │ │ │ -
11
│ │ │ │ -
12#include <dune/common/typetraits.hh>
│ │ │ │ -
13#include <dune/common/std/type_traits.hh>
│ │ │ │ -
14
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
7#include <memory>
│ │ │ │ +
8#include <tuple>
│ │ │ │ +
9#include <type_traits>
│ │ │ │ +
10#include <utility>
│ │ │ │ +
11#include <algorithm>
│ │ │ │ +
12
│ │ │ │ +
13#include <dune/common/shared_ptr.hh>
│ │ │ │ +
14#include <dune/common/indices.hh>
│ │ │ │ +
15#include <dune/common/hybridutilities.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │
18
│ │ │ │
19namespace Dune {
│ │ │ │
20 namespace TypeTree {
│ │ │ │
21
│ │ │ │ -
31 template<typename T>
│ │ │ │ - │ │ │ │ -
33 {
│ │ │ │ -
34
│ │ │ │ -
35 public:
│ │ │ │ -
36
│ │ │ │ -
38 static const bool isLeaf = false;
│ │ │ │ +
26#ifndef DOXYGEN
│ │ │ │ +
27
│ │ │ │ +
28 template<typename T>
│ │ │ │ +
29 std::shared_ptr<T> convert_arg(const T& t)
│ │ │ │ +
30 {
│ │ │ │ +
31 return std::make_shared<T>(t);
│ │ │ │ +
32 }
│ │ │ │ +
33
│ │ │ │ +
34 template<typename T>
│ │ │ │ +
35 std::shared_ptr<T> convert_arg(T& t)
│ │ │ │ +
36 {
│ │ │ │ +
37 return stackobject_to_shared_ptr(t);
│ │ │ │ +
38 }
│ │ │ │
39
│ │ │ │ -
41 static const bool isPower = true;
│ │ │ │ -
42
│ │ │ │ -
44 static const bool isComposite = false;
│ │ │ │ -
45
│ │ │ │ -
47 std::size_t degree() const
│ │ │ │ -
48 {
│ │ │ │ -
49 return _children.size();
│ │ │ │ -
50 }
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ -
54
│ │ │ │ -
56 typedef T ChildType;
│ │ │ │ -
57
│ │ │ │ -
59 typedef std::shared_ptr<T> ChildStorageType;
│ │ │ │ -
60
│ │ │ │ -
62 typedef std::shared_ptr<const T> ChildConstStorageType;
│ │ │ │ -
63
│ │ │ │ -
65 typedef std::vector<ChildStorageType> NodeStorage;
│ │ │ │ -
66
│ │ │ │ -
67
│ │ │ │ -
70
│ │ │ │ -
72
│ │ │ │ -
75 ChildType& child (std::size_t i)
│ │ │ │ -
76 {
│ │ │ │ -
77 assert(i < degree() && "child index out of range");
│ │ │ │ -
78 return *_children[i];
│ │ │ │ -
79 }
│ │ │ │ -
80
│ │ │ │ -
82
│ │ │ │ -
85 const ChildType& child (std::size_t i) const
│ │ │ │ -
86 {
│ │ │ │ -
87 assert(i < degree() && "child index out of range");
│ │ │ │ -
88 return *_children[i];
│ │ │ │ -
89 }
│ │ │ │ -
90
│ │ │ │ -
92
│ │ │ │ - │ │ │ │ -
96 {
│ │ │ │ -
97 assert(i < degree() && "child index out of range");
│ │ │ │ -
98 return _children[i];
│ │ │ │ -
99 }
│ │ │ │ -
100
│ │ │ │ -
102
│ │ │ │ - │ │ │ │ -
109 {
│ │ │ │ -
110 assert(i < degree() && "child index out of range");
│ │ │ │ -
111 return _children[i];
│ │ │ │ -
112 }
│ │ │ │ -
113
│ │ │ │ -
115 void setChild (std::size_t i, ChildType& t)
│ │ │ │ -
116 {
│ │ │ │ -
117 assert(i < degree() && "child index out of range");
│ │ │ │ -
118 _children[i] = stackobject_to_shared_ptr(t);
│ │ │ │ -
119 }
│ │ │ │ -
120
│ │ │ │ -
122 void setChild (std::size_t i, ChildType&& t)
│ │ │ │ -
123 {
│ │ │ │ -
124 assert(i < degree() && "child index out of range");
│ │ │ │ -
125 _children[i] = convert_arg(std::move(t));
│ │ │ │ -
126 }
│ │ │ │ -
127
│ │ │ │ -
129 void setChild (std::size_t i, ChildStorageType st)
│ │ │ │ -
130 {
│ │ │ │ -
131 assert(i < degree() && "child index out of range");
│ │ │ │ -
132 _children[i] = std::move(st);
│ │ │ │ -
133 }
│ │ │ │ -
134
│ │ │ │ -
135 const NodeStorage& nodeStorage () const
│ │ │ │ -
136 {
│ │ │ │ -
137 return _children;
│ │ │ │ -
138 }
│ │ │ │ -
139
│ │ │ │ +
40 template<typename BaseType, typename T>
│ │ │ │ +
41 T& assertGridViewType(T& t)
│ │ │ │ +
42 {
│ │ │ │ +
43 static_assert((std::is_same<typename BaseType::Traits::GridViewType,
│ │ │ │ +
44 typename T::Traits::GridViewType>::value),
│ │ │ │ +
45 "GridViewType must be equal in all components of composite type");
│ │ │ │ +
46 return t;
│ │ │ │ +
47 }
│ │ │ │ +
48
│ │ │ │ +
49 // only bind to real rvalues
│ │ │ │ +
50 template<typename T>
│ │ │ │ +
51 typename std::enable_if<!std::is_lvalue_reference<T>::value,std::shared_ptr<T> >::type convert_arg(T&& t)
│ │ │ │ +
52 {
│ │ │ │ +
53 return std::make_shared<T>(std::forward<T>(t));
│ │ │ │ +
54 }
│ │ │ │ +
55
│ │ │ │ +
56
│ │ │ │ +
57 namespace Experimental {
│ │ │ │ +
58
│ │ │ │ +
67 template<class BinaryOp, class Arg>
│ │ │ │ +
68 constexpr decltype(auto)
│ │ │ │ +
69 left_fold(BinaryOp&& binary_op, Arg&& arg)
│ │ │ │ +
70 {
│ │ │ │ +
71 return std::forward<Arg>(arg);
│ │ │ │ +
72 }
│ │ │ │ +
73
│ │ │ │ +
95 template<class BinaryOp, class Init, class Arg0, class... Args>
│ │ │ │ +
96 constexpr decltype(auto)
│ │ │ │ +
97 left_fold(BinaryOp&& binary_op, Init&& init, Arg0&& arg_0, Args&&... args)
│ │ │ │ +
98 {
│ │ │ │ +
99 return left_fold(
│ │ │ │ +
100 std::forward<BinaryOp>(binary_op),
│ │ │ │ +
101 binary_op(std::forward<Init>(init), std::forward<Arg0>(arg_0)),
│ │ │ │ +
102 std::forward<Args>(args)...);
│ │ │ │ +
103 }
│ │ │ │ +
104
│ │ │ │ +
105
│ │ │ │ +
106 namespace Hybrid {
│ │ │ │ +
107 using namespace Dune::Hybrid;
│ │ │ │ +
108
│ │ │ │ +
109 namespace Detail {
│ │ │ │ +
110 template<class Op, class... Args>
│ │ │ │ +
111 constexpr auto applyOperator(Op&& op, Args&&... args)
│ │ │ │ +
112 {
│ │ │ │ +
113 using T = std::common_type_t<Args...>;
│ │ │ │ +
114 return op(static_cast<T>(args)...);
│ │ │ │ +
115 }
│ │ │ │ +
116
│ │ │ │ +
117 template<class Op, class T, T... Args>
│ │ │ │ +
118 constexpr auto applyOperator(Op, std::integral_constant<T,Args>...)
│ │ │ │ +
119 {
│ │ │ │ +
120 static_assert(std::is_default_constructible_v<Op>,
│ │ │ │ +
121 "Operator in integral expressions shall be default constructible");
│ │ │ │ +
122 constexpr auto result = Op{}(T{Args}...);
│ │ │ │ +
123 return std::integral_constant<std::decay_t<decltype(result)>,result>{};
│ │ │ │ +
124 }
│ │ │ │ +
125
│ │ │ │ +
126 // FIXME: use lambda when we adpot c++20
│ │ │ │ +
127 struct Max {
│ │ │ │ +
128 template<class... Args>
│ │ │ │ +
129 constexpr auto operator()(Args&&... args) const
│ │ │ │ +
130 {
│ │ │ │ +
131 using T = std::common_type_t<Args...>;
│ │ │ │ +
132 return std::max({static_cast<T>(args)...});
│ │ │ │ +
133 }
│ │ │ │ +
134 };
│ │ │ │ +
135 }
│ │ │ │ +
136
│ │ │ │ +
137 static constexpr auto max = [](const auto& a, const auto& b)
│ │ │ │ +
138 {
│ │ │ │ +
139 return Detail::applyOperator(Detail::Max{}, a, b);
│ │ │ │ +
140 };
│ │ │ │
141
│ │ │ │ -
144
│ │ │ │ -
145 protected:
│ │ │ │ +
142 static constexpr auto plus = [](const auto& a, const auto& b)
│ │ │ │ +
143 {
│ │ │ │ +
144 return Detail::applyOperator(std::plus<>{}, a, b);
│ │ │ │ +
145 };
│ │ │ │
146
│ │ │ │ -
149 DynamicPowerNode () = delete;
│ │ │ │ -
150
│ │ │ │ +
147 static constexpr auto minus = [](const auto& a, const auto& b)
│ │ │ │ +
148 {
│ │ │ │ +
149 return Detail::applyOperator(std::minus<>{}, a, b);
│ │ │ │ +
150 };
│ │ │ │ +
151 } // namespace Hybrid
│ │ │ │
152
│ │ │ │ -
160 explicit DynamicPowerNode (std::size_t size)
│ │ │ │ -
161 : _children(size)
│ │ │ │ -
162 {}
│ │ │ │ -
163
│ │ │ │ -
165 explicit DynamicPowerNode (NodeStorage children)
│ │ │ │ -
166 : _children(std::move(children))
│ │ │ │ -
167 {}
│ │ │ │ -
168
│ │ │ │ -
169#ifdef DOXYGEN
│ │ │ │ -
170
│ │ │ │ -
172 DynamicPowerNode (T& t1, T& t2, ...)
│ │ │ │ -
173 {}
│ │ │ │ -
174
│ │ │ │ -
175#else
│ │ │ │ -
176
│ │ │ │ -
177 template<typename... Children,
│ │ │ │ -
178 std::enable_if_t<(std::is_same_v<ChildType, std::decay_t<Children>> &&...), bool> = true>
│ │ │ │ -
179 DynamicPowerNode (Children&&... children)
│ │ │ │ -
180 {
│ │ │ │ -
181 _children = NodeStorage{convert_arg(std::forward<Children>(children))...};
│ │ │ │ -
182 }
│ │ │ │ -
183
│ │ │ │ -
184 template<typename... Children,
│ │ │ │ -
185 std::enable_if_t<(std::is_same_v<ChildType, std::decay_t<Children>> &&...), bool> = true>
│ │ │ │ -
186 DynamicPowerNode (std::shared_ptr<Children>... children)
│ │ │ │ -
187 {
│ │ │ │ -
188 _children = NodeStorage{std::move(children)...};
│ │ │ │ -
189 }
│ │ │ │ -
190
│ │ │ │ -
191#endif // DOXYGEN
│ │ │ │ -
192
│ │ │ │ +
153 } // namespace Experimental
│ │ │ │ +
154
│ │ │ │ +
155
│ │ │ │ +
156#endif // DOXYGEN
│ │ │ │ +
157
│ │ │ │ +
159
│ │ │ │ +
166 template<typename Tree, typename Tag = StartTag>
│ │ │ │ +
167 struct TreeInfo
│ │ │ │ +
168 {
│ │ │ │ +
169
│ │ │ │ +
170 private:
│ │ │ │ +
171 // Start the tree traversal
│ │ │ │ + │ │ │ │ +
173
│ │ │ │ +
174 public:
│ │ │ │ +
175
│ │ │ │ +
177 static const std::size_t depth = NodeInfo::depth;
│ │ │ │ +
178
│ │ │ │ +
180 static const std::size_t nodeCount = NodeInfo::nodeCount;
│ │ │ │ +
181
│ │ │ │ +
183 static const std::size_t leafCount = NodeInfo::leafCount;
│ │ │ │ +
184
│ │ │ │ +
185 };
│ │ │ │ +
186
│ │ │ │ +
187
│ │ │ │ +
188#ifndef DOXYGEN
│ │ │ │ +
189
│ │ │ │ +
190 // ********************************************************************************
│ │ │ │ +
191 // TreeInfo specializations for the different node types
│ │ │ │ +
192 // ********************************************************************************
│ │ │ │ +
193
│ │ │ │
194
│ │ │ │ -
195 private:
│ │ │ │ -
196 NodeStorage _children;
│ │ │ │ -
197 };
│ │ │ │ -
198
│ │ │ │ -
200
│ │ │ │ -
201 } // namespace TypeTree
│ │ │ │ -
202} //namespace Dune
│ │ │ │ +
195 // leaf node
│ │ │ │ +
196 template<typename Node>
│ │ │ │ +
197 struct TreeInfo<Node,LeafNodeTag>
│ │ │ │ +
198 {
│ │ │ │ +
199
│ │ │ │ +
200 static const std::size_t depth = 1;
│ │ │ │ +
201
│ │ │ │ +
202 static const std::size_t nodeCount = 1;
│ │ │ │
203
│ │ │ │ -
204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
204 static const std::size_t leafCount = 1;
│ │ │ │ +
205
│ │ │ │ +
206 };
│ │ │ │ +
207
│ │ │ │ +
208
│ │ │ │ +
209 // power node - exploit the fact that all children are identical
│ │ │ │ +
210 template<typename Node>
│ │ │ │ +
211 struct TreeInfo<Node,PowerNodeTag>
│ │ │ │ +
212 {
│ │ │ │ +
213
│ │ │ │ +
214 typedef TreeInfo<typename Node::ChildType,NodeTag<typename Node::ChildType>> ChildInfo;
│ │ │ │ +
215
│ │ │ │ +
216 static const std::size_t depth = 1 + ChildInfo::depth;
│ │ │ │ +
217
│ │ │ │ +
218 static const std::size_t nodeCount = 1 + StaticDegree<Node>::value * ChildInfo::nodeCount;
│ │ │ │ +
219
│ │ │ │ +
220 static const std::size_t leafCount = StaticDegree<Node>::value * ChildInfo::leafCount;
│ │ │ │ +
221
│ │ │ │ +
222 };
│ │ │ │ +
223
│ │ │ │ +
224
│ │ │ │ +
225 namespace {
│ │ │ │ +
226
│ │ │ │ +
227 // TMP for iterating over the children of a composite node
│ │ │ │ +
228 // identical for both composite node implementations
│ │ │ │ +
229 template<typename Node, std::size_t k, std::size_t n>
│ │ │ │ +
230 struct generic_compositenode_children_info
│ │ │ │ +
231 {
│ │ │ │ +
232
│ │ │ │ +
233 typedef generic_compositenode_children_info<Node,k+1,n> NextChild;
│ │ │ │ +
234
│ │ │ │ +
235 // extract child info
│ │ │ │ +
236 typedef typename Node::template Child<k>::Type Child;
│ │ │ │ +
237 typedef NodeTag<Child> ChildTag;
│ │ │ │ +
238 typedef TreeInfo<Child,ChildTag> ChildInfo;
│ │ │ │ +
239
│ │ │ │ +
240 // combine information of current child with info about following children
│ │ │ │ +
241 static const std::size_t maxDepth = ChildInfo::depth > NextChild::maxDepth ? ChildInfo::depth : NextChild::maxDepth;
│ │ │ │ +
242
│ │ │ │ +
243 static const std::size_t nodeCount = ChildInfo::nodeCount + NextChild::nodeCount;
│ │ │ │ +
244
│ │ │ │ +
245 static const std::size_t leafCount = ChildInfo::leafCount + NextChild::leafCount;
│ │ │ │ +
246
│ │ │ │ +
247 };
│ │ │ │ +
248
│ │ │ │ +
249 // End of recursion
│ │ │ │ +
250 template<typename Node, std::size_t n>
│ │ │ │ +
251 struct generic_compositenode_children_info<Node,n,n>
│ │ │ │ +
252 {
│ │ │ │ +
253 static const std::size_t maxDepth = 0;
│ │ │ │ +
254
│ │ │ │ +
255 static const std::size_t nodeCount = 0;
│ │ │ │ +
256
│ │ │ │ +
257 static const std::size_t leafCount = 0;
│ │ │ │ +
258 };
│ │ │ │ +
259
│ │ │ │ +
260 } // anonymous namespace
│ │ │ │ +
261
│ │ │ │ +
262
│ │ │ │ +
263 // Struct for building information about composite node
│ │ │ │ +
264 template<typename Node>
│ │ │ │ +
265 struct GenericCompositeNodeInfo
│ │ │ │ +
266 {
│ │ │ │ +
267
│ │ │ │ +
268 typedef generic_compositenode_children_info<Node,0,StaticDegree<Node>::value> Children;
│ │ │ │ +
269
│ │ │ │ +
270 static const std::size_t depth = 1 + Children::maxDepth;
│ │ │ │ +
271
│ │ │ │ +
272 static const std::size_t nodeCount = 1 + Children::nodeCount;
│ │ │ │ +
273
│ │ │ │ +
274 static const std::size_t leafCount = Children::leafCount;
│ │ │ │ +
275
│ │ │ │ +
276 };
│ │ │ │ +
277
│ │ │ │ +
278
│ │ │ │ +
279 // CompositeNode: delegate to GenericCompositeNodeInfo
│ │ │ │ +
280 template<typename Node>
│ │ │ │ +
281 struct TreeInfo<Node,CompositeNodeTag>
│ │ │ │ +
282 : public GenericCompositeNodeInfo<Node>
│ │ │ │ +
283 {};
│ │ │ │ +
284
│ │ │ │ +
285
│ │ │ │ +
286#endif // DOXYGEN
│ │ │ │ +
287
│ │ │ │ +
288
│ │ │ │ +
289 using Dune::index_constant;
│ │ │ │ +
290 namespace Indices = Dune::Indices;
│ │ │ │ +
291
│ │ │ │ +
293
│ │ │ │ +
294 } // namespace TypeTree
│ │ │ │ +
295} //namespace Dune
│ │ │ │ +
296
│ │ │ │ +
297#endif // DUNE_TYPETREE_UTILITY_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │ +
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Collect multiple instances of type T within a dune-typetree.
Definition: dynamicpowernode.hh:33
│ │ │ │ -
static const bool isPower
Mark this class as a power in the dune-typetree.
Definition: dynamicpowernode.hh:41
│ │ │ │ -
std::vector< ChildStorageType > NodeStorage
The type used for storing the children.
Definition: dynamicpowernode.hh:65
│ │ │ │ -
const NodeStorage & nodeStorage() const
Definition: dynamicpowernode.hh:135
│ │ │ │ -
ChildConstStorageType childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition: dynamicpowernode.hh:108
│ │ │ │ -
const ChildType & child(std::size_t i) const
Returns the i-th child (const version).
Definition: dynamicpowernode.hh:85
│ │ │ │ -
std::shared_ptr< T > ChildStorageType
The storage type of each child.
Definition: dynamicpowernode.hh:59
│ │ │ │ -
DynamicPowerNode(T &t1, T &t2,...)
Initialize all children with the passed-in objects.
Definition: dynamicpowernode.hh:172
│ │ │ │ -
std::shared_ptr< const T > ChildConstStorageType
The const version of the storage type of each child.
Definition: dynamicpowernode.hh:62
│ │ │ │ -
DynamicPowerNode(NodeStorage children)
Initialize the DynamicPowerNode with a copy of the passed-in storage type.
Definition: dynamicpowernode.hh:165
│ │ │ │ -
DynamicPowerNodeTag NodeTag
The type tag that describes the node.
Definition: dynamicpowernode.hh:53
│ │ │ │ -
T ChildType
The type of each child.
Definition: dynamicpowernode.hh:56
│ │ │ │ -
void setChild(std::size_t i, ChildType &t)
Sets the i-th child to the passed-in value.
Definition: dynamicpowernode.hh:115
│ │ │ │ -
void setChild(std::size_t i, ChildStorageType st)
Sets the stored value representing the i-th child to the passed-in value.
Definition: dynamicpowernode.hh:129
│ │ │ │ -
DynamicPowerNode(std::size_t size)
Construct a node with the given number of children.
Definition: dynamicpowernode.hh:160
│ │ │ │ -
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: dynamicpowernode.hh:44
│ │ │ │ -
void setChild(std::size_t i, ChildType &&t)
Store the passed value in i-th child.
Definition: dynamicpowernode.hh:122
│ │ │ │ -
ChildType & child(std::size_t i)
Returns the i-th child.
Definition: dynamicpowernode.hh:75
│ │ │ │ -
std::size_t degree() const
The number of children.
Definition: dynamicpowernode.hh:47
│ │ │ │ -
ChildStorageType childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition: dynamicpowernode.hh:95
│ │ │ │ -
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: dynamicpowernode.hh:38
│ │ │ │ - │ │ │ │ -
Tag designating a power node with runtime degree.
Definition: nodetags.hh:22
│ │ │ │ +
Type
Definition: treepath.hh:30
│ │ │ │ +
auto leafCount(const Tree &tree)
The number of leaf nodes in the Tree.
Definition: visitor.hh:530
│ │ │ │ +
auto nodeCount(const Tree &tree)
The total number of nodes in the Tree.
Definition: visitor.hh:522
│ │ │ │ +
auto depth(const Tree &tree)
The depth of the TypeTree.
Definition: visitor.hh:506
│ │ │ │ +
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ +
Struct for obtaining some basic structural information about a TypeTree.
Definition: utility.hh:168
│ │ │ │ +
static const std::size_t leafCount
The number of leaf nodes in the TypeTree.
Definition: utility.hh:183
│ │ │ │ +
static const std::size_t depth
The depth of the TypeTree.
Definition: utility.hh:177
│ │ │ │ +
static const std::size_t nodeCount
The total number of nodes in the TypeTree.
Definition: utility.hh:180
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,255 +4,321 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -dynamicpowernode.hh │ │ │ │ │ +utility.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11 │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12 │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ 18 │ │ │ │ │ 19namespace Dune { │ │ │ │ │ 20 namespace TypeTree { │ │ │ │ │ 21 │ │ │ │ │ - 31 template │ │ │ │ │ -32 class DynamicPowerNode │ │ │ │ │ - 33 { │ │ │ │ │ - 34 │ │ │ │ │ - 35 public: │ │ │ │ │ - 36 │ │ │ │ │ -38 static const bool isLeaf = false; │ │ │ │ │ + 26#ifndef DOXYGEN │ │ │ │ │ + 27 │ │ │ │ │ + 28 template │ │ │ │ │ + 29 std::shared_ptr convert_arg(const T& t) │ │ │ │ │ + 30 { │ │ │ │ │ + 31 return std::make_shared(t); │ │ │ │ │ + 32 } │ │ │ │ │ + 33 │ │ │ │ │ + 34 template │ │ │ │ │ + 35 std::shared_ptr convert_arg(T& t) │ │ │ │ │ + 36 { │ │ │ │ │ + 37 return stackobject_to_shared_ptr(t); │ │ │ │ │ + 38 } │ │ │ │ │ 39 │ │ │ │ │ -41 static const bool isPower = true; │ │ │ │ │ - 42 │ │ │ │ │ -44 static const bool isComposite = false; │ │ │ │ │ - 45 │ │ │ │ │ -47 std::size_t degree() const │ │ │ │ │ - 48 { │ │ │ │ │ - 49 return _children.size(); │ │ │ │ │ - 50 } │ │ │ │ │ - 51 │ │ │ │ │ -53 typedef DynamicPowerNodeTag NodeTag; │ │ │ │ │ - 54 │ │ │ │ │ -56 typedef T ChildType; │ │ │ │ │ - 57 │ │ │ │ │ -59 typedef std::shared_ptr ChildStorageType; │ │ │ │ │ - 60 │ │ │ │ │ -62 typedef std::shared_ptr ChildConstStorageType; │ │ │ │ │ - 63 │ │ │ │ │ -65 typedef std::vector NodeStorage; │ │ │ │ │ - 66 │ │ │ │ │ - 67 │ │ │ │ │ - 70 │ │ │ │ │ - 72 │ │ │ │ │ -75 ChildType& child (std::size_t i) │ │ │ │ │ - 76 { │ │ │ │ │ - 77 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 78 return *_children[i]; │ │ │ │ │ - 79 } │ │ │ │ │ - 80 │ │ │ │ │ - 82 │ │ │ │ │ -85 const ChildType& child (std::size_t i) const │ │ │ │ │ - 86 { │ │ │ │ │ - 87 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 88 return *_children[i]; │ │ │ │ │ - 89 } │ │ │ │ │ - 90 │ │ │ │ │ - 92 │ │ │ │ │ -95 ChildStorageType childStorage (std::size_t i) │ │ │ │ │ - 96 { │ │ │ │ │ - 97 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 98 return _children[i]; │ │ │ │ │ - 99 } │ │ │ │ │ - 100 │ │ │ │ │ - 102 │ │ │ │ │ -108 ChildConstStorageType childStorage (std::size_t i) const │ │ │ │ │ - 109 { │ │ │ │ │ - 110 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 111 return _children[i]; │ │ │ │ │ - 112 } │ │ │ │ │ - 113 │ │ │ │ │ -115 void setChild (std::size_t i, ChildType& t) │ │ │ │ │ - 116 { │ │ │ │ │ - 117 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 118 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ - 119 } │ │ │ │ │ - 120 │ │ │ │ │ -122 void setChild (std::size_t i, ChildType&& t) │ │ │ │ │ - 123 { │ │ │ │ │ - 124 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 125 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ - 126 } │ │ │ │ │ - 127 │ │ │ │ │ -129 void setChild (std::size_t i, ChildStorageType st) │ │ │ │ │ + 40 template │ │ │ │ │ + 41 T& assertGridViewType(T& t) │ │ │ │ │ + 42 { │ │ │ │ │ + 43 static_assert((std::is_same::value), │ │ │ │ │ + 45 "GridViewType must be equal in all components of composite type"); │ │ │ │ │ + 46 return t; │ │ │ │ │ + 47 } │ │ │ │ │ + 48 │ │ │ │ │ + 49 // only bind to real rvalues │ │ │ │ │ + 50 template │ │ │ │ │ + 51 typename std::enable_if::value,std:: │ │ │ │ │ +shared_ptr >::type convert_arg(T&& t) │ │ │ │ │ + 52 { │ │ │ │ │ + 53 return std::make_shared(std::forward(t)); │ │ │ │ │ + 54 } │ │ │ │ │ + 55 │ │ │ │ │ + 56 │ │ │ │ │ + 57 namespace Experimental { │ │ │ │ │ + 58 │ │ │ │ │ + 67 template │ │ │ │ │ + 68 constexpr decltype(auto) │ │ │ │ │ + 69 left_fold(BinaryOp&& binary_op, Arg&& arg) │ │ │ │ │ + 70 { │ │ │ │ │ + 71 return std::forward(arg); │ │ │ │ │ + 72 } │ │ │ │ │ + 73 │ │ │ │ │ + 95 template │ │ │ │ │ + 96 constexpr decltype(auto) │ │ │ │ │ + 97 left_fold(BinaryOp&& binary_op, Init&& init, Arg0&& arg_0, Args&&... args) │ │ │ │ │ + 98 { │ │ │ │ │ + 99 return left_fold( │ │ │ │ │ + 100 std::forward(binary_op), │ │ │ │ │ + 101 binary_op(std::forward(init), std::forward(arg_0)), │ │ │ │ │ + 102 std::forward(args)...); │ │ │ │ │ + 103 } │ │ │ │ │ + 104 │ │ │ │ │ + 105 │ │ │ │ │ + 106 namespace Hybrid { │ │ │ │ │ + 107 using namespace Dune::Hybrid; │ │ │ │ │ + 108 │ │ │ │ │ + 109 namespace Detail { │ │ │ │ │ + 110 template │ │ │ │ │ + 111 constexpr auto applyOperator(Op&& op, Args&&... args) │ │ │ │ │ + 112 { │ │ │ │ │ + 113 using T = std::common_type_t; │ │ │ │ │ + 114 return op(static_cast(args)...); │ │ │ │ │ + 115 } │ │ │ │ │ + 116 │ │ │ │ │ + 117 template │ │ │ │ │ + 118 constexpr auto applyOperator(Op, std::integral_constant...) │ │ │ │ │ + 119 { │ │ │ │ │ + 120 static_assert(std::is_default_constructible_v, │ │ │ │ │ + 121 "Operator in integral expressions shall be default constructible"); │ │ │ │ │ + 122 constexpr auto result = Op{}(T{Args}...); │ │ │ │ │ + 123 return std::integral_constant,result>{}; │ │ │ │ │ + 124 } │ │ │ │ │ + 125 │ │ │ │ │ + 126 // FIXME: use lambda when we adpot c++20 │ │ │ │ │ + 127 struct Max { │ │ │ │ │ + 128 template │ │ │ │ │ + 129 constexpr auto operator()(Args&&... args) const │ │ │ │ │ 130 { │ │ │ │ │ - 131 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 132 _children[i] = std::move(st); │ │ │ │ │ + 131 using T = std::common_type_t; │ │ │ │ │ + 132 return std::max({static_cast(args)...}); │ │ │ │ │ 133 } │ │ │ │ │ - 134 │ │ │ │ │ -135 const NodeStorage& nodeStorage () const │ │ │ │ │ - 136 { │ │ │ │ │ - 137 return _children; │ │ │ │ │ - 138 } │ │ │ │ │ - 139 │ │ │ │ │ + 134 }; │ │ │ │ │ + 135 } │ │ │ │ │ + 136 │ │ │ │ │ + 137 static constexpr auto max = [](const auto& a, const auto& b) │ │ │ │ │ + 138 { │ │ │ │ │ + 139 return Detail::applyOperator(Detail::Max{}, a, b); │ │ │ │ │ + 140 }; │ │ │ │ │ 141 │ │ │ │ │ - 144 │ │ │ │ │ - 145 protected: │ │ │ │ │ + 142 static constexpr auto plus = [](const auto& a, const auto& b) │ │ │ │ │ + 143 { │ │ │ │ │ + 144 return Detail::applyOperator(std::plus<>{}, a, b); │ │ │ │ │ + 145 }; │ │ │ │ │ 146 │ │ │ │ │ -149 DynamicPowerNode () = delete; │ │ │ │ │ - 150 │ │ │ │ │ + 147 static constexpr auto minus = [](const auto& a, const auto& b) │ │ │ │ │ + 148 { │ │ │ │ │ + 149 return Detail::applyOperator(std::minus<>{}, a, b); │ │ │ │ │ + 150 }; │ │ │ │ │ + 151 } // namespace Hybrid │ │ │ │ │ 152 │ │ │ │ │ -160 explicit DynamicPowerNode (std::size_t size) │ │ │ │ │ - 161 : _children(size) │ │ │ │ │ - 162 {} │ │ │ │ │ - 163 │ │ │ │ │ -165 explicit DynamicPowerNode (NodeStorage children) │ │ │ │ │ - 166 : _children(std::move(children)) │ │ │ │ │ - 167 {} │ │ │ │ │ - 168 │ │ │ │ │ - 169#ifdef DOXYGEN │ │ │ │ │ - 170 │ │ │ │ │ -172 DynamicPowerNode (T& t1, T& t2, ...) │ │ │ │ │ - 173 {} │ │ │ │ │ - 174 │ │ │ │ │ - 175#else │ │ │ │ │ - 176 │ │ │ │ │ - 177 template> │ │ │ │ │ -&&...), bool> = true> │ │ │ │ │ - 179 DynamicPowerNode (Children&&... children) │ │ │ │ │ - 180 { │ │ │ │ │ - 181 _children = NodeStorage{convert_arg(std::forward(children))...}; │ │ │ │ │ - 182 } │ │ │ │ │ - 183 │ │ │ │ │ - 184 template> │ │ │ │ │ -&&...), bool> = true> │ │ │ │ │ - 186 DynamicPowerNode (std::shared_ptr... children) │ │ │ │ │ - 187 { │ │ │ │ │ - 188 _children = NodeStorage{std::move(children)...}; │ │ │ │ │ - 189 } │ │ │ │ │ - 190 │ │ │ │ │ - 191#endif // DOXYGEN │ │ │ │ │ - 192 │ │ │ │ │ + 153 } // namespace Experimental │ │ │ │ │ + 154 │ │ │ │ │ + 155 │ │ │ │ │ + 156#endif // DOXYGEN │ │ │ │ │ + 157 │ │ │ │ │ + 159 │ │ │ │ │ + 166 template │ │ │ │ │ +167 struct TreeInfo │ │ │ │ │ + 168 { │ │ │ │ │ + 169 │ │ │ │ │ + 170 private: │ │ │ │ │ + 171 // Start the tree traversal │ │ │ │ │ + 172 typedef TreeInfo> NodeInfo; │ │ │ │ │ + 173 │ │ │ │ │ + 174 public: │ │ │ │ │ + 175 │ │ │ │ │ +177 static const std::size_t depth = NodeInfo::depth; │ │ │ │ │ + 178 │ │ │ │ │ +180 static const std::size_t nodeCount = NodeInfo::nodeCount; │ │ │ │ │ + 181 │ │ │ │ │ +183 static const std::size_t leafCount = NodeInfo::leafCount; │ │ │ │ │ + 184 │ │ │ │ │ + 185 }; │ │ │ │ │ + 186 │ │ │ │ │ + 187 │ │ │ │ │ + 188#ifndef DOXYGEN │ │ │ │ │ + 189 │ │ │ │ │ + 190 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 191 // TreeInfo specializations for the different node types │ │ │ │ │ + 192 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 193 │ │ │ │ │ 194 │ │ │ │ │ - 195 private: │ │ │ │ │ - 196 NodeStorage _children; │ │ │ │ │ - 197 }; │ │ │ │ │ - 198 │ │ │ │ │ - 200 │ │ │ │ │ - 201 } // namespace TypeTree │ │ │ │ │ - 202} //namespace Dune │ │ │ │ │ + 195 // leaf node │ │ │ │ │ + 196 template │ │ │ │ │ + 197 struct TreeInfo │ │ │ │ │ + 198 { │ │ │ │ │ + 199 │ │ │ │ │ + 200 static const std::size_t depth = 1; │ │ │ │ │ + 201 │ │ │ │ │ + 202 static const std::size_t nodeCount = 1; │ │ │ │ │ 203 │ │ │ │ │ - 204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ + 204 static const std::size_t leafCount = 1; │ │ │ │ │ + 205 │ │ │ │ │ + 206 }; │ │ │ │ │ + 207 │ │ │ │ │ + 208 │ │ │ │ │ + 209 // power node - exploit the fact that all children are identical │ │ │ │ │ + 210 template │ │ │ │ │ + 211 struct TreeInfo │ │ │ │ │ + 212 { │ │ │ │ │ + 213 │ │ │ │ │ + 214 typedef TreeInfo> ChildInfo; │ │ │ │ │ + 215 │ │ │ │ │ + 216 static const std::size_t depth = 1 + ChildInfo::depth; │ │ │ │ │ + 217 │ │ │ │ │ + 218 static const std::size_t nodeCount = 1 + StaticDegree::value * │ │ │ │ │ +ChildInfo::nodeCount; │ │ │ │ │ + 219 │ │ │ │ │ + 220 static const std::size_t leafCount = StaticDegree::value * │ │ │ │ │ +ChildInfo::leafCount; │ │ │ │ │ + 221 │ │ │ │ │ + 222 }; │ │ │ │ │ + 223 │ │ │ │ │ + 224 │ │ │ │ │ + 225 namespace { │ │ │ │ │ + 226 │ │ │ │ │ + 227 // TMP for iterating over the children of a composite node │ │ │ │ │ + 228 // identical for both composite node implementations │ │ │ │ │ + 229 template │ │ │ │ │ + 230 struct generic_compositenode_children_info │ │ │ │ │ + 231 { │ │ │ │ │ + 232 │ │ │ │ │ + 233 typedef generic_compositenode_children_info NextChild; │ │ │ │ │ + 234 │ │ │ │ │ + 235 // extract child info │ │ │ │ │ + 236 typedef typename Node::template Child::Type Child; │ │ │ │ │ + 237 typedef NodeTag ChildTag; │ │ │ │ │ + 238 typedef TreeInfo ChildInfo; │ │ │ │ │ + 239 │ │ │ │ │ + 240 // combine information of current child with info about following children │ │ │ │ │ + 241 static const std::size_t maxDepth = ChildInfo::depth > NextChild::maxDepth │ │ │ │ │ +? ChildInfo::depth : NextChild::maxDepth; │ │ │ │ │ + 242 │ │ │ │ │ + 243 static const std::size_t nodeCount = ChildInfo::nodeCount + NextChild:: │ │ │ │ │ +nodeCount; │ │ │ │ │ + 244 │ │ │ │ │ + 245 static const std::size_t leafCount = ChildInfo::leafCount + NextChild:: │ │ │ │ │ +leafCount; │ │ │ │ │ + 246 │ │ │ │ │ + 247 }; │ │ │ │ │ + 248 │ │ │ │ │ + 249 // End of recursion │ │ │ │ │ + 250 template │ │ │ │ │ + 251 struct generic_compositenode_children_info │ │ │ │ │ + 252 { │ │ │ │ │ + 253 static const std::size_t maxDepth = 0; │ │ │ │ │ + 254 │ │ │ │ │ + 255 static const std::size_t nodeCount = 0; │ │ │ │ │ + 256 │ │ │ │ │ + 257 static const std::size_t leafCount = 0; │ │ │ │ │ + 258 }; │ │ │ │ │ + 259 │ │ │ │ │ + 260 } // anonymous namespace │ │ │ │ │ + 261 │ │ │ │ │ + 262 │ │ │ │ │ + 263 // Struct for building information about composite node │ │ │ │ │ + 264 template │ │ │ │ │ + 265 struct GenericCompositeNodeInfo │ │ │ │ │ + 266 { │ │ │ │ │ + 267 │ │ │ │ │ + 268 typedef generic_compositenode_children_info:: │ │ │ │ │ +value> Children; │ │ │ │ │ + 269 │ │ │ │ │ + 270 static const std::size_t depth = 1 + Children::maxDepth; │ │ │ │ │ + 271 │ │ │ │ │ + 272 static const std::size_t nodeCount = 1 + Children::nodeCount; │ │ │ │ │ + 273 │ │ │ │ │ + 274 static const std::size_t leafCount = Children::leafCount; │ │ │ │ │ + 275 │ │ │ │ │ + 276 }; │ │ │ │ │ + 277 │ │ │ │ │ + 278 │ │ │ │ │ + 279 // CompositeNode: delegate to GenericCompositeNodeInfo │ │ │ │ │ + 280 template │ │ │ │ │ + 281 struct TreeInfo │ │ │ │ │ + 282 : public GenericCompositeNodeInfo │ │ │ │ │ + 283 {}; │ │ │ │ │ + 284 │ │ │ │ │ + 285 │ │ │ │ │ + 286#endif // DOXYGEN │ │ │ │ │ + 287 │ │ │ │ │ + 288 │ │ │ │ │ + 289 using Dune::index_constant; │ │ │ │ │ + 290 namespace Indices = Dune::Indices; │ │ │ │ │ + 291 │ │ │ │ │ + 293 │ │ │ │ │ + 294 } // namespace TypeTree │ │ │ │ │ + 295} //namespace Dune │ │ │ │ │ + 296 │ │ │ │ │ + 297#endif // DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ nodetags.hh │ │ │ │ │ -utility.hh │ │ │ │ │ -typetraits.hh │ │ │ │ │ +result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:110 │ │ │ │ │ +Dune::TypeTree::Child │ │ │ │ │ +typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ +Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ +Definition: childextraction.hh:223 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode │ │ │ │ │ -Collect multiple instances of type T within a dune-typetree. │ │ │ │ │ -Definition: dynamicpowernode.hh:33 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a power in the dune-typetree. │ │ │ │ │ -Definition: dynamicpowernode.hh:41 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::NodeStorage │ │ │ │ │ -std::vector< ChildStorageType > NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -Definition: dynamicpowernode.hh:65 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::nodeStorage │ │ │ │ │ -const NodeStorage & nodeStorage() const │ │ │ │ │ -Definition: dynamicpowernode.hh:135 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::childStorage │ │ │ │ │ -ChildConstStorageType childStorage(std::size_t i) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -Definition: dynamicpowernode.hh:108 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::child │ │ │ │ │ -const ChildType & child(std::size_t i) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -Definition: dynamicpowernode.hh:85 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::ChildStorageType │ │ │ │ │ -std::shared_ptr< T > ChildStorageType │ │ │ │ │ -The storage type of each child. │ │ │ │ │ -Definition: dynamicpowernode.hh:59 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ -DynamicPowerNode(T &t1, T &t2,...) │ │ │ │ │ -Initialize all children with the passed-in objects. │ │ │ │ │ -Definition: dynamicpowernode.hh:172 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::ChildConstStorageType │ │ │ │ │ -std::shared_ptr< const T > ChildConstStorageType │ │ │ │ │ -The const version of the storage type of each child. │ │ │ │ │ -Definition: dynamicpowernode.hh:62 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ -DynamicPowerNode(NodeStorage children) │ │ │ │ │ -Initialize the DynamicPowerNode with a copy of the passed-in storage type. │ │ │ │ │ -Definition: dynamicpowernode.hh:165 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::NodeTag │ │ │ │ │ -DynamicPowerNodeTag NodeTag │ │ │ │ │ -The type tag that describes the node. │ │ │ │ │ -Definition: dynamicpowernode.hh:53 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::ChildType │ │ │ │ │ -T ChildType │ │ │ │ │ -The type of each child. │ │ │ │ │ -Definition: dynamicpowernode.hh:56 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::setChild │ │ │ │ │ -void setChild(std::size_t i, ChildType &t) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -Definition: dynamicpowernode.hh:115 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::setChild │ │ │ │ │ -void setChild(std::size_t i, ChildStorageType st) │ │ │ │ │ -Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ -Definition: dynamicpowernode.hh:129 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ -DynamicPowerNode(std::size_t size) │ │ │ │ │ -Construct a node with the given number of children. │ │ │ │ │ -Definition: dynamicpowernode.hh:160 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::isComposite │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a non composite in the dune-typetree. │ │ │ │ │ -Definition: dynamicpowernode.hh:44 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::setChild │ │ │ │ │ -void setChild(std::size_t i, ChildType &&t) │ │ │ │ │ -Store the passed value in i-th child. │ │ │ │ │ -Definition: dynamicpowernode.hh:122 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::child │ │ │ │ │ -ChildType & child(std::size_t i) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -Definition: dynamicpowernode.hh:75 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::degree │ │ │ │ │ -std::size_t degree() const │ │ │ │ │ -The number of children. │ │ │ │ │ -Definition: dynamicpowernode.hh:47 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::childStorage │ │ │ │ │ -ChildStorageType childStorage(std::size_t i) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -Definition: dynamicpowernode.hh:95 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -Definition: dynamicpowernode.hh:38 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ -DynamicPowerNode()=delete │ │ │ │ │ -Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ -Tag designating a power node with runtime degree. │ │ │ │ │ -Definition: nodetags.hh:22 │ │ │ │ │ +Dune::TypeTree::TreePathType::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::leafCount │ │ │ │ │ +auto leafCount(const Tree &tree) │ │ │ │ │ +The number of leaf nodes in the Tree. │ │ │ │ │ +Definition: visitor.hh:530 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::nodeCount │ │ │ │ │ +auto nodeCount(const Tree &tree) │ │ │ │ │ +The total number of nodes in the Tree. │ │ │ │ │ +Definition: visitor.hh:522 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::depth │ │ │ │ │ +auto depth(const Tree &tree) │ │ │ │ │ +The depth of the TypeTree. │ │ │ │ │ +Definition: visitor.hh:506 │ │ │ │ │ +Dune::TypeTree::LeafNodeTag │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +Definition: nodetags.hh:16 │ │ │ │ │ +Dune::TypeTree::TreeInfo │ │ │ │ │ +Struct for obtaining some basic structural information about a TypeTree. │ │ │ │ │ +Definition: utility.hh:168 │ │ │ │ │ +Dune::TypeTree::TreeInfo::leafCount │ │ │ │ │ +static const std::size_t leafCount │ │ │ │ │ +The number of leaf nodes in the TypeTree. │ │ │ │ │ +Definition: utility.hh:183 │ │ │ │ │ +Dune::TypeTree::TreeInfo::depth │ │ │ │ │ +static const std::size_t depth │ │ │ │ │ +The depth of the TypeTree. │ │ │ │ │ +Definition: utility.hh:177 │ │ │ │ │ +Dune::TypeTree::TreeInfo::nodeCount │ │ │ │ │ +static const std::size_t nodeCount │ │ │ │ │ +The total number of nodes in the TypeTree. │ │ │ │ │ +Definition: utility.hh:180 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodeinterface.hh File Reference │ │ │ │ +dune-typetree: nodetags.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,60 +64,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
nodeinterface.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
nodetags.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/common/documentation.hh>
│ │ │ │ -
│ │ │ │ + │ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::NodeInterface
 Interface for nodes in a dune-typetree. More...
struct  Dune::TypeTree::LeafNodeTag
 Tag designating a leaf node. More...
 
struct  Dune::TypeTree::PowerNodeTag
 Tag designating a power node. More...
 
struct  Dune::TypeTree::DynamicPowerNodeTag
 Tag designating a power node with runtime degree. More...
 
struct  Dune::TypeTree::CompositeNodeTag
 Tag designating a composite node. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Typedefs

template<typename Node >
using Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag
 Returns the node tag of the given Node. More...
 
template<typename T >
using Dune::TypeTree::ImplementationTag = typename std::decay_t< T >::ImplementationTag
 Returns the implementation tag of the given Node. More...
 
template<typename Node >
using Dune::TypeTree::StaticDegree = decltype(Node::degree())
 Returns the statically known degree of the given Node type as a std::integral_constant. More...
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<typename Node >
std::size_t Dune::TypeTree::degree (const Node &node)
 Returns the degree of node as run time information. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,45 +4,31 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Typedefs | Functions │ │ │ │ │ -nodeinterface.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +nodetags.hh File Reference │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::NodeInterface │ │ │ │ │ -  Interface for nodes in a dune-typetree. More... │ │ │ │ │ +struct  Dune::TypeTree::LeafNodeTag │ │ │ │ │ +  Tag designating a leaf node. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::PowerNodeTag │ │ │ │ │ +  Tag designating a power node. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ +  Tag designating a power node with runtime degree. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::CompositeNodeTag │ │ │ │ │ +  Tag designating a composite node. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag │ │ │ │ │ -  Returns the node tag of the given Node. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::ImplementationTag = typename std::decay_t< T >:: │ │ │ │ │ - ImplementationTag │ │ │ │ │ -  Returns the implementation tag of the given Node. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::StaticDegree = decltype(Node::degree()) │ │ │ │ │ -  Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ - integral_constant. More... │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -std::size_t Dune::TypeTree::degree (const Node &node) │ │ │ │ │ -  Returns the degree of node as run time information. More... │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodeinterface.hh Source File │ │ │ │ +dune-typetree: nodetags.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,98 +62,52 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
nodeinterface.hh
│ │ │ │ +
nodetags.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_NODETAGS_HH
│ │ │ │
6
│ │ │ │ -
7#include <cstddef>
│ │ │ │ -
8#include <type_traits>
│ │ │ │ +
7namespace Dune {
│ │ │ │ +
8 namespace TypeTree {
│ │ │ │
9
│ │ │ │ -
10#include <dune/common/documentation.hh>
│ │ │ │ -
11
│ │ │ │ -
12namespace Dune {
│ │ │ │ -
13 namespace TypeTree {
│ │ │ │ -
14
│ │ │ │ - │ │ │ │ -
33 {
│ │ │ │ -
35 static const bool isLeaf = implementationDefined;
│ │ │ │ -
36
│ │ │ │ -
38 static const bool isPower = implementationDefined;
│ │ │ │ -
39
│ │ │ │ -
41 static const bool isComposite = implementationDefined;
│ │ │ │ -
42
│ │ │ │ -
44
│ │ │ │ -
49 static const std::size_t CHILDREN = implementationDefined;
│ │ │ │ -
50
│ │ │ │ -
52
│ │ │ │ -
57 static auto degree();
│ │ │ │ -
58
│ │ │ │ -
60
│ │ │ │ -
65 typedef ImplementationDefined NodeTag;
│ │ │ │ -
66
│ │ │ │ -
68
│ │ │ │ -
71 typedef ImplementationDefined NodeStorage;
│ │ │ │ -
72 };
│ │ │ │ -
73
│ │ │ │ -
75 template<typename Node>
│ │ │ │ - │ │ │ │ -
77
│ │ │ │ -
79 template<typename T>
│ │ │ │ - │ │ │ │ -
81
│ │ │ │ -
82
│ │ │ │ -
84 template<typename Node>
│ │ │ │ -
85 std::size_t degree(const Node& node)
│ │ │ │ -
86 {
│ │ │ │ -
87 return degree(&node,NodeTag<Node>());
│ │ │ │ -
88 }
│ │ │ │ -
89
│ │ │ │ -
90#ifndef DOXYGEN
│ │ │ │ -
91
│ │ │ │ -
93
│ │ │ │ -
99 template<typename Node, typename NodeTag>
│ │ │ │ -
100 std::size_t degree(const Node* node, NodeTag)
│ │ │ │ -
101 {
│ │ │ │ -
102 return node->degree();
│ │ │ │ -
103 }
│ │ │ │ -
104
│ │ │ │ -
105#endif // DOXYGEN
│ │ │ │ -
106
│ │ │ │ -
108
│ │ │ │ -
112 template<typename Node>
│ │ │ │ -
113 using StaticDegree = decltype(Node::degree());
│ │ │ │ -
114
│ │ │ │ -
116
│ │ │ │ -
117 } // namespace TypeTree
│ │ │ │ -
118} //namespace Dune
│ │ │ │ -
119
│ │ │ │ -
120#endif // DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │ -
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ -
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition: nodeinterface.hh:80
│ │ │ │ -
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:113
│ │ │ │ +
16 struct LeafNodeTag {};
│ │ │ │ +
17
│ │ │ │ +
19 struct PowerNodeTag {};
│ │ │ │ +
20
│ │ │ │ + │ │ │ │ +
23
│ │ │ │ + │ │ │ │ +
26
│ │ │ │ +
27#ifndef DOXYGEN
│ │ │ │ +
28
│ │ │ │ +
30 struct StartTag {};
│ │ │ │ +
31
│ │ │ │ +
32
│ │ │ │ +
33
│ │ │ │ +
34#endif // DOXYGEN
│ │ │ │ +
35
│ │ │ │ +
37
│ │ │ │ +
38 } // namespace TypeTree
│ │ │ │ +
39} //namespace Dune
│ │ │ │ +
40
│ │ │ │ +
41#endif // DUNE_TYPETREE_NODETAGS_HH
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Interface for nodes in a dune-typetree.
Definition: nodeinterface.hh:33
│ │ │ │ -
static const std::size_t CHILDREN
Number of children of this node in the dune-typetree.
Definition: nodeinterface.hh:49
│ │ │ │ -
static auto degree()
Number of children of this node in the dune-typetree.
│ │ │ │ -
static const bool isPower
Whether this is a power node in the dune-typetree.
Definition: nodeinterface.hh:38
│ │ │ │ -
static const bool isLeaf
Whether this is a leaf node in a dune-typetree.
Definition: nodeinterface.hh:35
│ │ │ │ -
ImplementationDefined NodeStorage
container type to pass around a collection of children
Definition: nodeinterface.hh:71
│ │ │ │ -
static const bool isComposite
Whether this is a composite node in the dune-typetree.
Definition: nodeinterface.hh:41
│ │ │ │ -
ImplementationDefined NodeTag
The type tag that describes what kind of node this is.
Definition: nodeinterface.hh:65
│ │ │ │ +
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ +
Tag designating a power node.
Definition: nodetags.hh:19
│ │ │ │ +
Tag designating a power node with runtime degree.
Definition: nodetags.hh:22
│ │ │ │ +
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,129 +4,56 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ + 7namespace Dune { │ │ │ │ │ + 8 namespace TypeTree { │ │ │ │ │ 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11 │ │ │ │ │ - 12namespace Dune { │ │ │ │ │ - 13 namespace TypeTree { │ │ │ │ │ - 14 │ │ │ │ │ -32 struct NodeInterface │ │ │ │ │ - 33 { │ │ │ │ │ -35 static const bool isLeaf = implementationDefined; │ │ │ │ │ - 36 │ │ │ │ │ -38 static const bool isPower = implementationDefined; │ │ │ │ │ - 39 │ │ │ │ │ -41 static const bool isComposite = implementationDefined; │ │ │ │ │ - 42 │ │ │ │ │ - 44 │ │ │ │ │ -49 static const std::size_t CHILDREN = implementationDefined; │ │ │ │ │ - 50 │ │ │ │ │ - 52 │ │ │ │ │ -57 static auto degree(); │ │ │ │ │ - 58 │ │ │ │ │ - 60 │ │ │ │ │ -65 typedef ImplementationDefined NodeTag; │ │ │ │ │ - 66 │ │ │ │ │ - 68 │ │ │ │ │ -71 typedef ImplementationDefined NodeStorage; │ │ │ │ │ - 72 }; │ │ │ │ │ - 73 │ │ │ │ │ - 75 template │ │ │ │ │ -76 using NodeTag = typename std::decay_t::NodeTag; │ │ │ │ │ - 77 │ │ │ │ │ - 79 template │ │ │ │ │ -80 using ImplementationTag = typename std::decay_t::ImplementationTag; │ │ │ │ │ - 81 │ │ │ │ │ - 82 │ │ │ │ │ - 84 template │ │ │ │ │ -85 std::size_t degree(const Node& node) │ │ │ │ │ - 86 { │ │ │ │ │ - 87 return degree(&node,NodeTag()); │ │ │ │ │ - 88 } │ │ │ │ │ - 89 │ │ │ │ │ - 90#ifndef DOXYGEN │ │ │ │ │ - 91 │ │ │ │ │ - 93 │ │ │ │ │ - 99 template │ │ │ │ │ - 100 std::size_t degree(const Node* node, NodeTag) │ │ │ │ │ - 101 { │ │ │ │ │ - 102 return node->degree(); │ │ │ │ │ - 103 } │ │ │ │ │ - 104 │ │ │ │ │ - 105#endif // DOXYGEN │ │ │ │ │ - 106 │ │ │ │ │ - 108 │ │ │ │ │ - 112 template │ │ │ │ │ -113 using StaticDegree = decltype(Node::degree()); │ │ │ │ │ - 114 │ │ │ │ │ - 116 │ │ │ │ │ - 117 } // namespace TypeTree │ │ │ │ │ - 118} //namespace Dune │ │ │ │ │ - 119 │ │ │ │ │ - 120#endif // DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ -Dune::TypeTree::degree │ │ │ │ │ -std::size_t degree(const Node &node) │ │ │ │ │ -Returns the degree of node as run time information. │ │ │ │ │ -Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::NodeTag │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -Definition: nodeinterface.hh:76 │ │ │ │ │ -Dune::TypeTree::ImplementationTag │ │ │ │ │ -typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ -Returns the implementation tag of the given Node. │ │ │ │ │ -Definition: nodeinterface.hh:80 │ │ │ │ │ -Dune::TypeTree::StaticDegree │ │ │ │ │ -decltype(Node::degree()) StaticDegree │ │ │ │ │ -Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -Definition: nodeinterface.hh:113 │ │ │ │ │ +16 struct LeafNodeTag {}; │ │ │ │ │ + 17 │ │ │ │ │ +19 struct PowerNodeTag {}; │ │ │ │ │ + 20 │ │ │ │ │ +22 struct DynamicPowerNodeTag {}; │ │ │ │ │ + 23 │ │ │ │ │ +25 struct CompositeNodeTag {}; │ │ │ │ │ + 26 │ │ │ │ │ + 27#ifndef DOXYGEN │ │ │ │ │ + 28 │ │ │ │ │ + 30 struct StartTag {}; │ │ │ │ │ + 31 │ │ │ │ │ + 32 │ │ │ │ │ + 33 │ │ │ │ │ + 34#endif // DOXYGEN │ │ │ │ │ + 35 │ │ │ │ │ + 37 │ │ │ │ │ + 38 } // namespace TypeTree │ │ │ │ │ + 39} //namespace Dune │ │ │ │ │ + 40 │ │ │ │ │ + 41#endif // DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::NodeInterface │ │ │ │ │ -Interface for nodes in a dune-typetree. │ │ │ │ │ -Definition: nodeinterface.hh:33 │ │ │ │ │ -Dune::TypeTree::NodeInterface::CHILDREN │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -Number of children of this node in the dune-typetree. │ │ │ │ │ -Definition: nodeinterface.hh:49 │ │ │ │ │ -Dune::TypeTree::NodeInterface::degree │ │ │ │ │ -static auto degree() │ │ │ │ │ -Number of children of this node in the dune-typetree. │ │ │ │ │ -Dune::TypeTree::NodeInterface::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Whether this is a power node in the dune-typetree. │ │ │ │ │ -Definition: nodeinterface.hh:38 │ │ │ │ │ -Dune::TypeTree::NodeInterface::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Whether this is a leaf node in a dune-typetree. │ │ │ │ │ -Definition: nodeinterface.hh:35 │ │ │ │ │ -Dune::TypeTree::NodeInterface::NodeStorage │ │ │ │ │ -ImplementationDefined NodeStorage │ │ │ │ │ -container type to pass around a collection of children │ │ │ │ │ -Definition: nodeinterface.hh:71 │ │ │ │ │ -Dune::TypeTree::NodeInterface::isComposite │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Whether this is a composite node in the dune-typetree. │ │ │ │ │ -Definition: nodeinterface.hh:41 │ │ │ │ │ -Dune::TypeTree::NodeInterface::NodeTag │ │ │ │ │ -ImplementationDefined NodeTag │ │ │ │ │ -The type tag that describes what kind of node this is. │ │ │ │ │ -Definition: nodeinterface.hh:65 │ │ │ │ │ +Dune::TypeTree::LeafNodeTag │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +Definition: nodetags.hh:16 │ │ │ │ │ +Dune::TypeTree::PowerNodeTag │ │ │ │ │ +Tag designating a power node. │ │ │ │ │ +Definition: nodetags.hh:19 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ +Tag designating a power node with runtime degree. │ │ │ │ │ +Definition: nodetags.hh:22 │ │ │ │ │ +Dune::TypeTree::CompositeNodeTag │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +Definition: nodetags.hh:25 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetree.hh File Reference │ │ │ │ +dune-typetree: filteredcompositenode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,32 +62,47 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
typetree.hh File Reference
│ │ │ │ +
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
filteredcompositenode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/utility.hh>
│ │ │ │ -#include <dune/typetree/leafnode.hh>
│ │ │ │ -#include <dune/typetree/powernode.hh>
│ │ │ │ -#include <dune/typetree/dynamicpowernode.hh>
│ │ │ │ -#include <dune/typetree/compositenode.hh>
│ │ │ │ -#include <dune/typetree/traversal.hh>
│ │ │ │ -#include <dune/typetree/pairtraversal.hh>
│ │ │ │ -#include <dune/typetree/traversalutilities.hh>
│ │ │ │ -#include <dune/typetree/transformation.hh>
│ │ │ │ -#include <dune/typetree/transformationutilities.hh>
│ │ │ │ -#include <dune/typetree/accumulate_static.hh>
│ │ │ │ -#include <dune/typetree/childextraction.hh>
│ │ │ │ +
#include <memory>
│ │ │ │ +#include <tuple>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/filters.hh>
│ │ │ │ +#include <dune/common/shared_ptr.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  Dune::TypeTree::FilteredCompositeNode< Node, Filter >
 Base class for composite nodes representing a filtered view on an underlying composite node. More...
 
struct  Dune::TypeTree::FilteredCompositeNode< Node, Filter >::Child< k >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,25 +4,34 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -typetree.hh File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +filteredcompositenode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ + class  Dune::TypeTree::FilteredCompositeNode<_Node,_Filter_> │ │ │ │ │ +  Base class for composite nodes representing a filtered view on an │ │ │ │ │ + underlying composite node. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::FilteredCompositeNode<_Node,_Filter_>::Child<_k_> │ │ │ │ │ +  Access to the type and storage type of the i-th child. More... │ │ │ │ │ +  │ │ │ │ │ + Namespaces │ │ │ │ │ +namespace  Dune │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::TypeTree │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetree.hh Source File │ │ │ │ +dune-typetree: filteredcompositenode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,51 +62,262 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
typetree.hh
│ │ │ │ +
filteredcompositenode.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
20
│ │ │ │ -
21#endif // DUNE_TYPETREE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
7#include <memory>
│ │ │ │ +
8#include <tuple>
│ │ │ │ +
9#include <type_traits>
│ │ │ │ +
10
│ │ │ │ + │ │ │ │ + │ │ │ │ +
13#include <dune/common/shared_ptr.hh>
│ │ │ │ +
14#include <dune/common/typetraits.hh>
│ │ │ │ +
15#include <dune/common/indices.hh>
│ │ │ │ +
16
│ │ │ │ + │ │ │ │ + │ │ │ │ +
19
│ │ │ │ +
20namespace Dune {
│ │ │ │ +
21 namespace TypeTree {
│ │ │ │ +
22
│ │ │ │ +
28#ifndef DOXYGEN
│ │ │ │ +
29 namespace {
│ │ │ │ +
30
│ │ │ │ +
31 // ********************************************************************************
│ │ │ │ +
32 // Utility structs for filter construction and application
│ │ │ │ +
33 // ********************************************************************************
│ │ │ │ +
34
│ │ │ │ +
35 // Gets the filter and wraps it in case of a SimpleFilter.
│ │ │ │ +
36 template<typename Filter, typename Tag>
│ │ │ │ +
37 struct get_filter;
│ │ │ │ +
38
│ │ │ │ +
39 // Helper struct to extract the child template parameter pack from the ChildTypes tuple.
│ │ │ │ +
40 template<typename Filter, typename Node, typename ChildTypes>
│ │ │ │ +
41 struct apply_filter_wrapper;
│ │ │ │ +
42
│ │ │ │ +
43 template<typename Filter, typename Node, typename... Children>
│ │ │ │ +
44 struct apply_filter_wrapper<Filter,Node,std::tuple<Children...> >
│ │ │ │ +
45 : public Filter::template apply<Node,Children...>
│ │ │ │ +
46 {};
│ │ │ │ +
47
│ │ │ │ +
48 // specialization for SimpleFilter
│ │ │ │ +
49 template<typename Filter>
│ │ │ │ +
50 struct get_filter<Filter,SimpleFilterTag>
│ │ │ │ +
51 {
│ │ │ │ +
52 struct type
│ │ │ │ +
53 {
│ │ │ │ +
54 template<typename Node, typename ChildTypes>
│ │ │ │ +
55 struct apply
│ │ │ │ +
56 : public apply_filter_wrapper<filter<Filter>,Node,ChildTypes>
│ │ │ │ +
57 {};
│ │ │ │ +
58 };
│ │ │ │ +
59 };
│ │ │ │ +
60
│ │ │ │ +
61 // specialization for AdvancedFilter
│ │ │ │ +
62 template<typename Filter>
│ │ │ │ +
63 struct get_filter<Filter,AdvancedFilterTag>
│ │ │ │ +
64 {
│ │ │ │ +
65 struct type
│ │ │ │ +
66 {
│ │ │ │ +
67 template<typename Node, typename ChildTypes>
│ │ │ │ +
68 struct apply
│ │ │ │ +
69 : public apply_filter_wrapper<Filter,Node,ChildTypes>
│ │ │ │ +
70 {};
│ │ │ │ +
71 };
│ │ │ │ +
72 };
│ │ │ │ +
73
│ │ │ │ +
74 } // anonymous namespace
│ │ │ │ +
75#endif // DOXYGEN
│ │ │ │ +
76
│ │ │ │ +
77
│ │ │ │ +
79 template<typename Node, typename Filter>
│ │ │ │ + │ │ │ │ +
81 {
│ │ │ │ +
82
│ │ │ │ +
83 typedef typename get_filter<Filter,typename Filter::FilterTag>::type filter;
│ │ │ │ +
84 typedef typename filter::template apply<Node,typename Node::ChildTypes>::type filter_result;
│ │ │ │ +
85 typedef typename filter_result::template apply<Node> mapped_children;
│ │ │ │ +
86
│ │ │ │ +
87 static const bool nodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
│ │ │ │ +
88
│ │ │ │ +
89 template<std::size_t k>
│ │ │ │ +
90 struct lazy_enable
│ │ │ │ +
91 {
│ │ │ │ +
92 static const bool value = !nodeIsConst;
│ │ │ │ +
93 };
│ │ │ │ +
94
│ │ │ │ +
95 public:
│ │ │ │ +
96
│ │ │ │ + │ │ │ │ +
99
│ │ │ │ +
101 typedef typename mapped_children::NodeStorage NodeStorage;
│ │ │ │ +
102
│ │ │ │ +
104 typedef typename mapped_children::ChildTypes ChildTypes;
│ │ │ │ +
105
│ │ │ │ +
107 static const bool isLeaf = false;
│ │ │ │ +
108
│ │ │ │ +
110 static const bool isPower = false;
│ │ │ │ +
111
│ │ │ │ +
113 static const bool isComposite = true;
│ │ │ │ +
114
│ │ │ │ +
116 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ +
117 static const std::size_t CHILDREN = filter_result::size;
│ │ │ │ +
118
│ │ │ │ +
119 static constexpr auto degree ()
│ │ │ │ +
120 {
│ │ │ │ +
121 return std::integral_constant<std::size_t,filter_result::size>{};
│ │ │ │ +
122 }
│ │ │ │ +
123
│ │ │ │ +
125 template<std::size_t k>
│ │ │ │ +
126 struct Child {
│ │ │ │ +
127
│ │ │ │ +
128#ifndef DOXYGEN
│ │ │ │ +
129
│ │ │ │ +
130 typedef typename std::tuple_element<k,typename mapped_children::Children>::type OriginalChild;
│ │ │ │ +
131
│ │ │ │ +
132 static const std::size_t mapped_index = std::tuple_element<k,typename filter_result::IndexMap>::type::original_index;
│ │ │ │ +
133
│ │ │ │ +
134#endif // DOXYGEN
│ │ │ │ +
135
│ │ │ │ +
137 typedef typename OriginalChild::Type Type;
│ │ │ │ +
138
│ │ │ │ +
140 typedef typename OriginalChild::type type;
│ │ │ │ +
141 };
│ │ │ │ +
142
│ │ │ │ +
145
│ │ │ │ +
147
│ │ │ │ +
150 template<std::size_t k,
│ │ │ │ +
151 typename std::enable_if<lazy_enable<k>::value, int>::type = 0>
│ │ │ │ +
152 auto& child (index_constant<k> = {})
│ │ │ │ +
153 {
│ │ │ │ +
154 return _node->template child<Child<k>::mapped_index>();
│ │ │ │ +
155 }
│ │ │ │ +
156
│ │ │ │ +
158
│ │ │ │ +
161 template<std::size_t k>
│ │ │ │ +
162 const auto& child (index_constant<k> = {}) const
│ │ │ │ +
163 {
│ │ │ │ +
164 return _node->template child<Child<k>::mapped_index>();
│ │ │ │ +
165 }
│ │ │ │ +
166
│ │ │ │ +
168
│ │ │ │ +
171 template<std::size_t k,
│ │ │ │ +
172 typename std::enable_if<lazy_enable<k>::value, int>::type = 0>
│ │ │ │ +
173 auto childStorage (index_constant<k> = {})
│ │ │ │ +
174 {
│ │ │ │ +
175 return _node->template childStorage<Child<k>::mapped_index>();
│ │ │ │ +
176 }
│ │ │ │ +
177
│ │ │ │ +
179
│ │ │ │ +
182 template<std::size_t k>
│ │ │ │ +
183 auto childStorage (index_constant<k> = {}) const
│ │ │ │ +
184 {
│ │ │ │ +
185 return _node->template childStorage<Child<k>::mapped_index>();
│ │ │ │ +
186 }
│ │ │ │ +
187
│ │ │ │ +
189 template<std::size_t k, class ChildType>
│ │ │ │ +
190 void setChild (ChildType&& child, typename std::enable_if<lazy_enable<k>::value,void*>::type = 0)
│ │ │ │ +
191 {
│ │ │ │ +
192 _node->template setChild<Child<k>::mapped_index>(std::forward<ChildType>(child));
│ │ │ │ +
193 }
│ │ │ │ +
194
│ │ │ │ +
196
│ │ │ │ +
199
│ │ │ │ +
200 protected:
│ │ │ │ +
201
│ │ │ │ +
203
│ │ │ │ +
206 template<bool enabled = !nodeIsConst>
│ │ │ │ +
207 typename std::enable_if<enabled,Node&>::type
│ │ │ │ + │ │ │ │ +
209 {
│ │ │ │ +
210 return *_node;
│ │ │ │ +
211 }
│ │ │ │ +
212
│ │ │ │ +
214
│ │ │ │ +
217 const Node& unfiltered () const
│ │ │ │ +
218 {
│ │ │ │ +
219 return *_node;
│ │ │ │ +
220 }
│ │ │ │ +
221
│ │ │ │ +
223
│ │ │ │ +
226 template<bool enabled = !nodeIsConst>
│ │ │ │ +
227 typename std::enable_if<enabled,std::shared_ptr<Node> >::type
│ │ │ │ + │ │ │ │ +
229 {
│ │ │ │ +
230 return _node;
│ │ │ │ +
231 }
│ │ │ │ +
232
│ │ │ │ +
234
│ │ │ │ +
237 std::shared_ptr<const Node> unfilteredStorage () const
│ │ │ │ +
238 {
│ │ │ │ +
239 return _node;
│ │ │ │ +
240 }
│ │ │ │ +
241
│ │ │ │ +
243
│ │ │ │ +
244 public:
│ │ │ │ +
245
│ │ │ │ +
248
│ │ │ │ +
250 FilteredCompositeNode (std::shared_ptr<Node> node)
│ │ │ │ +
251 : _node(std::move(node))
│ │ │ │ +
252 {}
│ │ │ │ +
253
│ │ │ │ + │ │ │ │ +
256 : _node(stackobject_to_shared_ptr(node))
│ │ │ │ +
257 {}
│ │ │ │ +
258
│ │ │ │ +
260
│ │ │ │ +
261 private:
│ │ │ │ +
262 std::shared_ptr<Node> _node;
│ │ │ │ +
263 };
│ │ │ │ +
264
│ │ │ │ +
266
│ │ │ │ +
267 } // namespace TypeTree
│ │ │ │ +
268} //namespace Dune
│ │ │ │ +
269
│ │ │ │ +
270#endif // DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Definition: accumulate_static.hh:13
│ │ │ │ +
Type
Definition: treepath.hh:30
│ │ │ │ +
Base class for composite nodes representing a filtered view on an underlying composite node.
Definition: filteredcompositenode.hh:81
│ │ │ │ +
auto childStorage(index_constant< k >={}) const
Returns the storage of the k-th child (const version).
Definition: filteredcompositenode.hh:183
│ │ │ │ +
static constexpr auto degree()
Definition: filteredcompositenode.hh:119
│ │ │ │ +
mapped_children::NodeStorage NodeStorage
The type used for storing the children.
Definition: filteredcompositenode.hh:101
│ │ │ │ +
void setChild(ChildType &&child, typename std::enable_if< lazy_enable< k >::value, void * >::type=0)
Sets the k-th child to the passed-in value.
Definition: filteredcompositenode.hh:190
│ │ │ │ +
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: filteredcompositenode.hh:107
│ │ │ │ +
const Node & unfiltered() const
Returns the unfiltered node (const version).
Definition: filteredcompositenode.hh:217
│ │ │ │ +
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: filteredcompositenode.hh:113
│ │ │ │ +
std::enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage()
Returns the storage object of the unfiltered node.
Definition: filteredcompositenode.hh:228
│ │ │ │ +
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: filteredcompositenode.hh:110
│ │ │ │ +
FilteredCompositeNode(Node &node)
Initialize the CompositeNode with a copy of the passed-in storage type.
Definition: filteredcompositenode.hh:255
│ │ │ │ +
FilteredCompositeNode(std::shared_ptr< Node > node)
Initialize the CompositeNode with copies of the passed in Storage objects.
Definition: filteredcompositenode.hh:250
│ │ │ │ +
auto childStorage(index_constant< k >={})
Returns the storage of the k-th child.
Definition: filteredcompositenode.hh:173
│ │ │ │ +
const auto & child(index_constant< k >={}) const
Returns the k-th child (const version).
Definition: filteredcompositenode.hh:162
│ │ │ │ +
auto & child(index_constant< k >={})
Returns the k-th child.
Definition: filteredcompositenode.hh:152
│ │ │ │ +
CompositeNodeTag NodeTag
The type tag that describes a CompositeNode.
Definition: filteredcompositenode.hh:98
│ │ │ │ +
mapped_children::ChildTypes ChildTypes
A tuple storing the types of all children.
Definition: filteredcompositenode.hh:104
│ │ │ │ +
std::enable_if< enabled, Node & >::type unfiltered()
Returns the unfiltered node.
Definition: filteredcompositenode.hh:208
│ │ │ │ +
static const std::size_t CHILDREN
The number of children.
Definition: filteredcompositenode.hh:117
│ │ │ │ +
std::shared_ptr< const Node > unfilteredStorage() const
Returns the storage object of the unfiltered node (const version).
Definition: filteredcompositenode.hh:237
│ │ │ │ +
Access to the type and storage type of the i-th child.
Definition: filteredcompositenode.hh:126
│ │ │ │ +
OriginalChild::type type
The type of the child.
Definition: filteredcompositenode.hh:140
│ │ │ │ +
OriginalChild::Type Type
The type of the child.
Definition: filteredcompositenode.hh:137
│ │ │ │ +
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,46 +4,342 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -typetree.hh │ │ │ │ │ +filteredcompositenode.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20 │ │ │ │ │ - 21#endif // DUNE_TYPETREE_HH │ │ │ │ │ -pairtraversal.hh │ │ │ │ │ -transformation.hh │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16 │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19 │ │ │ │ │ + 20namespace Dune { │ │ │ │ │ + 21 namespace TypeTree { │ │ │ │ │ + 22 │ │ │ │ │ + 28#ifndef DOXYGEN │ │ │ │ │ + 29 namespace { │ │ │ │ │ + 30 │ │ │ │ │ + 31 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 32 // Utility structs for filter construction and application │ │ │ │ │ + 33 / │ │ │ │ │ +/ │ │ │ │ │ +******************************************************************************** │ │ │ │ │ + 34 │ │ │ │ │ + 35 // Gets the filter and wraps it in case of a SimpleFilter. │ │ │ │ │ + 36 template │ │ │ │ │ + 37 struct get_filter; │ │ │ │ │ + 38 │ │ │ │ │ + 39 // Helper struct to extract the child template parameter pack from the │ │ │ │ │ +ChildTypes tuple. │ │ │ │ │ + 40 template │ │ │ │ │ + 41 struct apply_filter_wrapper; │ │ │ │ │ + 42 │ │ │ │ │ + 43 template │ │ │ │ │ + 44 struct apply_filter_wrapper > │ │ │ │ │ + 45 : public Filter::template apply │ │ │ │ │ + 46 {}; │ │ │ │ │ + 47 │ │ │ │ │ + 48 // specialization for SimpleFilter │ │ │ │ │ + 49 template │ │ │ │ │ + 50 struct get_filter │ │ │ │ │ + 51 { │ │ │ │ │ + 52 struct type │ │ │ │ │ + 53 { │ │ │ │ │ + 54 template │ │ │ │ │ + 55 struct apply │ │ │ │ │ + 56 : public apply_filter_wrapper,Node,ChildTypes> │ │ │ │ │ + 57 {}; │ │ │ │ │ + 58 }; │ │ │ │ │ + 59 }; │ │ │ │ │ + 60 │ │ │ │ │ + 61 // specialization for AdvancedFilter │ │ │ │ │ + 62 template │ │ │ │ │ + 63 struct get_filter │ │ │ │ │ + 64 { │ │ │ │ │ + 65 struct type │ │ │ │ │ + 66 { │ │ │ │ │ + 67 template │ │ │ │ │ + 68 struct apply │ │ │ │ │ + 69 : public apply_filter_wrapper │ │ │ │ │ + 70 {}; │ │ │ │ │ + 71 }; │ │ │ │ │ + 72 }; │ │ │ │ │ + 73 │ │ │ │ │ + 74 } // anonymous namespace │ │ │ │ │ + 75#endif // DOXYGEN │ │ │ │ │ + 76 │ │ │ │ │ + 77 │ │ │ │ │ + 79 template │ │ │ │ │ +80 class FilteredCompositeNode │ │ │ │ │ + 81 { │ │ │ │ │ + 82 │ │ │ │ │ + 83 typedef typename get_filter::type │ │ │ │ │ +filter; │ │ │ │ │ + 84 typedef typename filter::template apply:: │ │ │ │ │ +type filter_result; │ │ │ │ │ + 85 typedef typename filter_result::template apply mapped_children; │ │ │ │ │ + 86 │ │ │ │ │ + 87 static const bool nodeIsConst = std::is_const::type>::value; │ │ │ │ │ + 88 │ │ │ │ │ + 89 template │ │ │ │ │ + 90 struct lazy_enable │ │ │ │ │ + 91 { │ │ │ │ │ + 92 static const bool value = !nodeIsConst; │ │ │ │ │ + 93 }; │ │ │ │ │ + 94 │ │ │ │ │ + 95 public: │ │ │ │ │ + 96 │ │ │ │ │ +98 typedef CompositeNodeTag NodeTag; │ │ │ │ │ + 99 │ │ │ │ │ +101 typedef typename mapped_children::NodeStorage NodeStorage; │ │ │ │ │ + 102 │ │ │ │ │ +104 typedef typename mapped_children::ChildTypes ChildTypes; │ │ │ │ │ + 105 │ │ │ │ │ +107 static const bool isLeaf = false; │ │ │ │ │ + 108 │ │ │ │ │ +110 static const bool isPower = false; │ │ │ │ │ + 111 │ │ │ │ │ +113 static const bool isComposite = true; │ │ │ │ │ + 114 │ │ │ │ │ + 116 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +117 static const std::size_t CHILDREN = filter_result::size; │ │ │ │ │ + 118 │ │ │ │ │ +119 static constexpr auto degree () │ │ │ │ │ + 120 { │ │ │ │ │ + 121 return std::integral_constant{}; │ │ │ │ │ + 122 } │ │ │ │ │ + 123 │ │ │ │ │ + 125 template │ │ │ │ │ +126 struct Child { │ │ │ │ │ + 127 │ │ │ │ │ + 128#ifndef DOXYGEN │ │ │ │ │ + 129 │ │ │ │ │ + 130 typedef typename std::tuple_element::type OriginalChild; │ │ │ │ │ + 131 │ │ │ │ │ + 132 static const std::size_t mapped_index = std::tuple_element::type::original_index; │ │ │ │ │ + 133 │ │ │ │ │ + 134#endif // DOXYGEN │ │ │ │ │ + 135 │ │ │ │ │ +137 typedef typename OriginalChild::Type Type; │ │ │ │ │ + 138 │ │ │ │ │ +140 typedef typename OriginalChild::type type; │ │ │ │ │ + 141 }; │ │ │ │ │ + 142 │ │ │ │ │ + 145 │ │ │ │ │ + 147 │ │ │ │ │ + 150 template::value, int>::type = 0> │ │ │ │ │ +152 auto& child (index_constant = {}) │ │ │ │ │ + 153 { │ │ │ │ │ + 154 return _node->template child::mapped_index>(); │ │ │ │ │ + 155 } │ │ │ │ │ + 156 │ │ │ │ │ + 158 │ │ │ │ │ + 161 template │ │ │ │ │ +162 const auto& child (index_constant = {}) const │ │ │ │ │ + 163 { │ │ │ │ │ + 164 return _node->template child::mapped_index>(); │ │ │ │ │ + 165 } │ │ │ │ │ + 166 │ │ │ │ │ + 168 │ │ │ │ │ + 171 template::value, int>::type = 0> │ │ │ │ │ +173 auto childStorage (index_constant = {}) │ │ │ │ │ + 174 { │ │ │ │ │ + 175 return _node->template childStorage::mapped_index>(); │ │ │ │ │ + 176 } │ │ │ │ │ + 177 │ │ │ │ │ + 179 │ │ │ │ │ + 182 template │ │ │ │ │ +183 auto childStorage (index_constant = {}) const │ │ │ │ │ + 184 { │ │ │ │ │ + 185 return _node->template childStorage::mapped_index>(); │ │ │ │ │ + 186 } │ │ │ │ │ + 187 │ │ │ │ │ + 189 template │ │ │ │ │ +190 void setChild (ChildType&& child, typename std::enable_if:: │ │ │ │ │ +value,void*>::type = 0) │ │ │ │ │ + 191 { │ │ │ │ │ + 192 _node->template setChild::mapped_index>(std::forward │ │ │ │ │ +(child)); │ │ │ │ │ + 193 } │ │ │ │ │ + 194 │ │ │ │ │ + 196 │ │ │ │ │ + 199 │ │ │ │ │ + 200 protected: │ │ │ │ │ + 201 │ │ │ │ │ + 203 │ │ │ │ │ + 206 template │ │ │ │ │ + 207 typename std::enable_if::type │ │ │ │ │ +208 unfiltered () │ │ │ │ │ + 209 { │ │ │ │ │ + 210 return *_node; │ │ │ │ │ + 211 } │ │ │ │ │ + 212 │ │ │ │ │ + 214 │ │ │ │ │ +217 const Node& unfiltered () const │ │ │ │ │ + 218 { │ │ │ │ │ + 219 return *_node; │ │ │ │ │ + 220 } │ │ │ │ │ + 221 │ │ │ │ │ + 223 │ │ │ │ │ + 226 template │ │ │ │ │ + 227 typename std::enable_if >::type │ │ │ │ │ +228 unfilteredStorage () │ │ │ │ │ + 229 { │ │ │ │ │ + 230 return _node; │ │ │ │ │ + 231 } │ │ │ │ │ + 232 │ │ │ │ │ + 234 │ │ │ │ │ +237 std::shared_ptr unfilteredStorage () const │ │ │ │ │ + 238 { │ │ │ │ │ + 239 return _node; │ │ │ │ │ + 240 } │ │ │ │ │ + 241 │ │ │ │ │ + 243 │ │ │ │ │ + 244 public: │ │ │ │ │ + 245 │ │ │ │ │ + 248 │ │ │ │ │ +250 FilteredCompositeNode (std::shared_ptr node) │ │ │ │ │ + 251 : _node(std::move(node)) │ │ │ │ │ + 252 {} │ │ │ │ │ + 253 │ │ │ │ │ +255 FilteredCompositeNode (Node& node) │ │ │ │ │ + 256 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ + 257 {} │ │ │ │ │ + 258 │ │ │ │ │ + 260 │ │ │ │ │ + 261 private: │ │ │ │ │ + 262 std::shared_ptr _node; │ │ │ │ │ + 263 }; │ │ │ │ │ + 264 │ │ │ │ │ + 266 │ │ │ │ │ + 267 } // namespace TypeTree │ │ │ │ │ + 268} //namespace Dune │ │ │ │ │ + 269 │ │ │ │ │ + 270#endif // DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ +filters.hh │ │ │ │ │ nodetags.hh │ │ │ │ │ -compositenode.hh │ │ │ │ │ -accumulate_static.hh │ │ │ │ │ -dynamicpowernode.hh │ │ │ │ │ -traversal.hh │ │ │ │ │ -utility.hh │ │ │ │ │ -traversalutilities.hh │ │ │ │ │ -leafnode.hh │ │ │ │ │ -transformationutilities.hh │ │ │ │ │ -powernode.hh │ │ │ │ │ -childextraction.hh │ │ │ │ │ +Dune │ │ │ │ │ +Definition: accumulate_static.hh:13 │ │ │ │ │ +Dune::TypeTree::TreePathType::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode │ │ │ │ │ +Base class for composite nodes representing a filtered view on an underlying │ │ │ │ │ +composite node. │ │ │ │ │ +Definition: filteredcompositenode.hh:81 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::childStorage │ │ │ │ │ +auto childStorage(index_constant< k >={}) const │ │ │ │ │ +Returns the storage of the k-th child (const version). │ │ │ │ │ +Definition: filteredcompositenode.hh:183 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::degree │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +Definition: filteredcompositenode.hh:119 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::NodeStorage │ │ │ │ │ +mapped_children::NodeStorage NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +Definition: filteredcompositenode.hh:101 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::setChild │ │ │ │ │ +void setChild(ChildType &&child, typename std::enable_if< lazy_enable< k >:: │ │ │ │ │ +value, void * >::type=0) │ │ │ │ │ +Sets the k-th child to the passed-in value. │ │ │ │ │ +Definition: filteredcompositenode.hh:190 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +Definition: filteredcompositenode.hh:107 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::unfiltered │ │ │ │ │ +const Node & unfiltered() const │ │ │ │ │ +Returns the unfiltered node (const version). │ │ │ │ │ +Definition: filteredcompositenode.hh:217 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::isComposite │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a composite in the dune-typetree. │ │ │ │ │ +Definition: filteredcompositenode.hh:113 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::unfilteredStorage │ │ │ │ │ +std::enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage() │ │ │ │ │ +Returns the storage object of the unfiltered node. │ │ │ │ │ +Definition: filteredcompositenode.hh:228 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +Definition: filteredcompositenode.hh:110 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::FilteredCompositeNode │ │ │ │ │ +FilteredCompositeNode(Node &node) │ │ │ │ │ +Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ +Definition: filteredcompositenode.hh:255 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::FilteredCompositeNode │ │ │ │ │ +FilteredCompositeNode(std::shared_ptr< Node > node) │ │ │ │ │ +Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ +Definition: filteredcompositenode.hh:250 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::childStorage │ │ │ │ │ +auto childStorage(index_constant< k >={}) │ │ │ │ │ +Returns the storage of the k-th child. │ │ │ │ │ +Definition: filteredcompositenode.hh:173 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::child │ │ │ │ │ +const auto & child(index_constant< k >={}) const │ │ │ │ │ +Returns the k-th child (const version). │ │ │ │ │ +Definition: filteredcompositenode.hh:162 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::child │ │ │ │ │ +auto & child(index_constant< k >={}) │ │ │ │ │ +Returns the k-th child. │ │ │ │ │ +Definition: filteredcompositenode.hh:152 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::NodeTag │ │ │ │ │ +CompositeNodeTag NodeTag │ │ │ │ │ +The type tag that describes a CompositeNode. │ │ │ │ │ +Definition: filteredcompositenode.hh:98 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::ChildTypes │ │ │ │ │ +mapped_children::ChildTypes ChildTypes │ │ │ │ │ +A tuple storing the types of all children. │ │ │ │ │ +Definition: filteredcompositenode.hh:104 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::unfiltered │ │ │ │ │ +std::enable_if< enabled, Node & >::type unfiltered() │ │ │ │ │ +Returns the unfiltered node. │ │ │ │ │ +Definition: filteredcompositenode.hh:208 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::CHILDREN │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +Definition: filteredcompositenode.hh:117 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::unfilteredStorage │ │ │ │ │ +std::shared_ptr< const Node > unfilteredStorage() const │ │ │ │ │ +Returns the storage object of the unfiltered node (const version). │ │ │ │ │ +Definition: filteredcompositenode.hh:237 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::Child │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +Definition: filteredcompositenode.hh:126 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::Child::type │ │ │ │ │ +OriginalChild::type type │ │ │ │ │ +The type of the child. │ │ │ │ │ +Definition: filteredcompositenode.hh:140 │ │ │ │ │ +Dune::TypeTree::FilteredCompositeNode::Child::Type │ │ │ │ │ +OriginalChild::Type Type │ │ │ │ │ +The type of the child. │ │ │ │ │ +Definition: filteredcompositenode.hh:137 │ │ │ │ │ +Dune::TypeTree::CompositeNodeTag │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +Definition: nodetags.hh:25 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: traversal.hh File Reference │ │ │ │ +dune-typetree: visitor.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,86 +63,110 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
traversal.hh File Reference
│ │ │ │ +Functions | │ │ │ │ +Variables
│ │ │ │ +
visitor.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <utility>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/common/std/type_traits.hh>
│ │ │ │ -#include <dune/typetree/childextraction.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ -#include <dune/typetree/visitor.hh>
│ │ │ │ +
#include <dune/typetree/treepath.hh>
│ │ │ │ +#include <dune/typetree/utility.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

struct  Dune::TypeTree::DefaultVisitor
 Visitor interface and base class for TypeTree visitors. More...
 
struct  Dune::TypeTree::DefaultPairVisitor
 Visitor interface and base class for visitors of pairs of TypeTrees. More...
 
struct  Dune::TypeTree::Experimental::DefaultHybridVisitor
 Hybrid visitor interface and base class for TypeTree hybrid visitors. More...
 
struct  Dune::TypeTree::VisitDirectChildren
 Mixin base class for visitors that only want to visit the direct children of a node. More...
 
struct  Dune::TypeTree::VisitDirectChildren::VisitChild< Node1, Child1, Node2, Child2, TreePath >
 Template struct for determining whether or not to visit a given child. More...
 
struct  Dune::TypeTree::VisitTree
 Mixin base class for visitors that want to visit the complete tree. More...
 
struct  Dune::TypeTree::VisitTree::VisitChild< Node1, Child1, Node2, Child2, TreePath >
 Template struct for determining whether or not to visit a given child. More...
 
struct  Dune::TypeTree::StaticTraversal
 Mixin base class for visitors that require a static TreePath during traversal. More...
 
struct  Dune::TypeTree::DynamicTraversal
 Mixin base class for visitors that only need a dynamic TreePath during traversal. More...
 
struct  Dune::TypeTree::TreeVisitor
 Convenience base class for visiting the entire tree. More...
 
struct  Dune::TypeTree::DirectChildrenVisitor
 Convenience base class for visiting the direct children of a node. More...
 
struct  Dune::TypeTree::TreePairVisitor
 Convenience base class for visiting an entire tree pair. More...
 
struct  Dune::TypeTree::DirectChildrenPairVisitor
 Convenience base class for visiting the direct children of a node pair. More...
 
struct  Dune::TypeTree::Experimental::Info::LeafCounterVisitor
 
struct  Dune::TypeTree::Experimental::Info::NodeCounterVisitor
 
struct  Dune::TypeTree::Experimental::Info::DepthVisitor
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Detail
namespace  Dune::TypeTree::Experimental
 
namespace  Dune::TypeTree::Experimental::Info
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Typedefs

template<class Tree >
using Dune::TypeTree::Detail::DynamicTraversalConcept = decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u)))
 
template<class Tree >
using Dune::TypeTree::Detail::StaticTraversalConcept = decltype((std::integral_constant< std::size_t, Tree::degree()>{}))
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Functions

template<class Tree , TreePathType::Type pathType, class Prefix , std::enable_if_t< Tree::isLeaf, int > = 0>
constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix)
 
template<class Tree , TreePathType::Type pathType, class Prefix , std::size_t... indices, std::enable_if_t<(Tree::isComposite or(Tree::isPower and(pathType!=TreePathType::dynamic))), int > = 0>
constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std::index_sequence< indices... >)
 
template<class T , class TreePath , class V , std::enable_if_t< std::decay_t< T >::isLeaf, int > = 0>
void Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath treePath, V &&visitor)
 
template<class T , class TreePath , class PreFunc , class LeafFunc , class PostFunc >
void Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
 
template<class Tree , TreePathType::Type pathType = TreePathType::dynamic>
constexpr auto Dune::TypeTree::leafTreePathTuple ()
 Create tuple of tree paths to leafs. More...
 
template<typename Tree , typename Visitor >
void Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor)
 Apply visitor to TypeTree. More...
 
template<class Tree , class PreFunc , class LeafFunc , class PostFunc >
void Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
 Traverse tree and visit each node. More...
 
template<class Tree , class InnerFunc , class LeafFunc >
void Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc &&innerFunc, LeafFunc &&leafFunc)
 Traverse tree and visit each node. More...
 
template<class Tree , class NodeFunc >
void Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc)
 Traverse tree and visit each node. More...
 
template<class Tree , class LeafFunc >
void Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc &&leafFunc)
 Traverse tree and visit each leaf node. More...
 
template<typename Tree >
auto Dune::TypeTree::Experimental::Info::depth (const Tree &tree)
 The depth of the TypeTree. More...
 
template<typename Tree >
constexpr auto Dune::TypeTree::Experimental::Info::depth ()
 The depth of the Tree. More...
 
template<typename Tree >
auto Dune::TypeTree::Experimental::Info::nodeCount (const Tree &tree)
 The total number of nodes in the Tree. More...
 
template<typename Tree >
auto Dune::TypeTree::Experimental::Info::leafCount (const Tree &tree)
 The number of leaf nodes in the Tree. More...
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Variables

template<typename Tree >
constexpr bool Dune::TypeTree::Experimental::Info::isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{}
 true if any of the nodes in the tree only has dynamic degree. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,85 +4,109 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Namespaces | Typedefs | Functions │ │ │ │ │ -traversal.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces | Functions | Variables │ │ │ │ │ +visitor.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +struct  Dune::TypeTree::DefaultVisitor │ │ │ │ │ +  Visitor interface and base class for TypeTree visitors. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::DefaultPairVisitor │ │ │ │ │ +  Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::Experimental::DefaultHybridVisitor │ │ │ │ │ +  Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::VisitDirectChildren │ │ │ │ │ +  Mixin base class for visitors that only want to visit the direct │ │ │ │ │ + children of a node. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::VisitDirectChildren::VisitChild<_Node1,_Child1,_Node2, │ │ │ │ │ + Child2,_TreePath_> │ │ │ │ │ +  Template struct for determining whether or not to visit a given child. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::VisitTree │ │ │ │ │ +  Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::VisitTree::VisitChild<_Node1,_Child1,_Node2,_Child2, │ │ │ │ │ + TreePath_> │ │ │ │ │ +  Template struct for determining whether or not to visit a given child. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::StaticTraversal │ │ │ │ │ +  Mixin base class for visitors that require a static TreePath during │ │ │ │ │ + traversal. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::DynamicTraversal │ │ │ │ │ +  Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ + traversal. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreeVisitor │ │ │ │ │ +  Convenience base class for visiting the entire tree. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::DirectChildrenVisitor │ │ │ │ │ +  Convenience base class for visiting the direct children of a node. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TreePairVisitor │ │ │ │ │ +  Convenience base class for visiting an entire tree pair. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::DirectChildrenPairVisitor │ │ │ │ │ +  Convenience base class for visiting the direct children of a node │ │ │ │ │ + pair. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::Experimental::Info::LeafCounterVisitor │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::Experimental::Info::NodeCounterVisitor │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::Experimental::Info::DepthVisitor │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::Detail │ │ │ │ │ +namespace  Dune::TypeTree::Experimental │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::Detail::DynamicTraversalConcept = decltype((std:: │ │ │ │ │ - declval< Tree >().degree(), std::declval< Tree >().child(0u))) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::Detail::StaticTraversalConcept = decltype((std:: │ │ │ │ │ - integral_constant< std::size_t, Tree::degree()>{})) │ │ │ │ │ +namespace  Dune::TypeTree::Experimental::Info │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template = 0> │ │ │ │ │ -constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix) │ │ │ │ │ -  │ │ │ │ │ -template = 0> │ │ │ │ │ -constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std:: │ │ │ │ │ - index_sequence< indices... >) │ │ │ │ │ -  │ │ │ │ │ -template::isLeaf, int > = 0> │ │ │ │ │ - void Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath │ │ │ │ │ - treePath, V &&visitor) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath │ │ │ │ │ - treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc │ │ │ │ │ - &&postFunc) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto Dune::TypeTree::leafTreePathTuple () │ │ │ │ │ -  Create tuple of tree paths to leafs. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor) │ │ │ │ │ -  Apply visitor to TypeTree. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc, │ │ │ │ │ - LeafFunc &&leafFunc, PostFunc &&postFunc) │ │ │ │ │ -  Traverse tree and visit each node. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc │ │ │ │ │ - &&innerFunc, LeafFunc &&leafFunc) │ │ │ │ │ -  Traverse tree and visit each node. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc) │ │ │ │ │ -  Traverse tree and visit each node. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc │ │ │ │ │ - &&leafFunc) │ │ │ │ │ -  Traverse tree and visit each leaf node. More... │ │ │ │ │ +template │ │ │ │ │ + auto Dune::TypeTree::Experimental::Info::depth (const Tree &tree) │ │ │ │ │ +  The depth of the TypeTree. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto Dune::TypeTree::Experimental::Info::depth () │ │ │ │ │ +  The depth of the Tree. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + auto Dune::TypeTree::Experimental::Info::nodeCount (const Tree │ │ │ │ │ + &tree) │ │ │ │ │ +  The total number of nodes in the Tree. More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + auto Dune::TypeTree::Experimental::Info::leafCount (const Tree │ │ │ │ │ + &tree) │ │ │ │ │ +  The number of leaf nodes in the Tree. More... │ │ │ │ │ +  │ │ │ │ │ + Variables │ │ │ │ │ +template │ │ │ │ │ +constexpr bool Dune::TypeTree::Experimental::Info::isDynamic = std:: │ │ │ │ │ + is_same()))> │ │ │ │ │ + {} │ │ │ │ │ +  true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00059_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: traversal.hh Source File │ │ │ │ +dune-typetree: visitor.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,278 +62,333 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
traversal.hh
│ │ │ │ +
visitor.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TRAVERSAL_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TRAVERSAL_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_VISITOR_HH
│ │ │ │ +
5#define DUNE_TYPETREE_VISITOR_HH
│ │ │ │
6
│ │ │ │ -
7#include <utility>
│ │ │ │ -
8
│ │ │ │ -
9#include <dune/common/hybridutilities.hh>
│ │ │ │ -
10#include <dune/common/std/type_traits.hh>
│ │ │ │ -
11
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
16
│ │ │ │ -
17namespace Dune {
│ │ │ │ -
18 namespace TypeTree {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
9
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11 namespace TypeTree {
│ │ │ │ +
12
│ │ │ │
19
│ │ │ │ -
25#ifndef DOXYGEN
│ │ │ │ -
27 struct NoOp
│ │ │ │ -
28 {
│ │ │ │ -
29 template<class... T>
│ │ │ │ -
30 constexpr void operator()(T&&...) const { /* do nothing */ }
│ │ │ │ -
31 };
│ │ │ │ -
32#endif
│ │ │ │ -
33
│ │ │ │ -
34 namespace Detail {
│ │ │ │ -
35
│ │ │ │ -
36 // SFINAE template check that Tree has a degree() function and a child() function accepting integer indices
│ │ │ │ -
37 template<class Tree>
│ │ │ │ -
38 using DynamicTraversalConcept = decltype((
│ │ │ │ -
39 std::declval<Tree>().degree(),
│ │ │ │ -
40 std::declval<Tree>().child(0u)
│ │ │ │ -
41 ));
│ │ │ │ -
42
│ │ │ │ -
43 // SFINAE template check that Tree has static (constexpr) function Tree::degree()
│ │ │ │ -
44 template<class Tree>
│ │ │ │ -
45 using StaticTraversalConcept = decltype((
│ │ │ │ -
46 std::integral_constant<std::size_t, Tree::degree()>{}
│ │ │ │ -
47 ));
│ │ │ │ + │ │ │ │ +
47 {
│ │ │ │
48
│ │ │ │ -
49
│ │ │ │ -
50 template<class Tree, TreePathType::Type pathType, class Prefix,
│ │ │ │ -
51 std::enable_if_t<Tree::isLeaf, int> = 0>
│ │ │ │ -
52 constexpr auto leafTreePathTuple(Prefix prefix)
│ │ │ │ -
53 {
│ │ │ │ -
54 return std::make_tuple(prefix);
│ │ │ │ -
55 }
│ │ │ │ -
56
│ │ │ │ -
57 template<class Tree, TreePathType::Type pathType, class Prefix,
│ │ │ │ -
58 std::enable_if_t<not Tree::isLeaf, int> = 0>
│ │ │ │ -
59 constexpr auto leafTreePathTuple(Prefix prefix);
│ │ │ │ -
60
│ │ │ │ -
61 template<class Tree, TreePathType::Type pathType, class Prefix, std::size_t... indices,
│ │ │ │ -
62 std::enable_if_t<(Tree::isComposite or (Tree::isPower and (pathType!=TreePathType::dynamic))), int> = 0>
│ │ │ │ -
63 constexpr auto leafTreePathTuple(Prefix prefix, std::index_sequence<indices...>)
│ │ │ │ -
64 {
│ │ │ │ -
65 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, Dune::index_constant<indices>{}))...);
│ │ │ │ -
66 }
│ │ │ │ -
67
│ │ │ │ -
68 template<class Tree, TreePathType::Type pathType, class Prefix, std::size_t... indices,
│ │ │ │ -
69 std::enable_if_t<(Tree::isPower and (pathType==TreePathType::dynamic)), int> = 0>
│ │ │ │ -
70 constexpr auto leafTreePathTuple(Prefix prefix, std::index_sequence<indices...>)
│ │ │ │ -
71 {
│ │ │ │ -
72 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, indices))...);
│ │ │ │ -
73 }
│ │ │ │ -
74
│ │ │ │ -
75 template<class Tree, TreePathType::Type pathType, class Prefix,
│ │ │ │ -
76 std::enable_if_t<not Tree::isLeaf, int>>
│ │ │ │ -
77 constexpr auto leafTreePathTuple(Prefix prefix)
│ │ │ │ -
78 {
│ │ │ │ -
79 return Detail::leafTreePathTuple<Tree, pathType>(prefix, std::make_index_sequence<Tree::degree()>{});
│ │ │ │ -
80 }
│ │ │ │ -
81
│ │ │ │ -
82 /* The signature is the same as for the public applyToTree
│ │ │ │ -
83 * function in Dune::Typetree, despite the additionally passed
│ │ │ │ -
84 * treePath argument. The path passed here is associated to
│ │ │ │ -
85 * the tree and the relative paths of the children (wrt. to tree)
│ │ │ │ -
86 * are appended to this. Hence the behavior of the public function
│ │ │ │ -
87 * is resembled by passing an empty treePath.
│ │ │ │ -
88 */
│ │ │ │ -
89
│ │ │ │ -
90 /*
│ │ │ │ -
91 * This is the overload for leaf traversal
│ │ │ │ -
92 */
│ │ │ │ -
93 template<class T, class TreePath, class V,
│ │ │ │ -
94 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ -
95 void applyToTree(T&& tree, TreePath treePath, V&& visitor)
│ │ │ │ -
96 {
│ │ │ │ -
97 visitor.leaf(tree, treePath);
│ │ │ │ -
98 }
│ │ │ │ -
99
│ │ │ │ -
100 /*
│ │ │ │ -
101 * This is the general overload doing child traversal.
│ │ │ │ -
102 */
│ │ │ │ -
103 template<class T, class TreePath, class V,
│ │ │ │ -
104 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ -
105 void applyToTree(T&& tree, TreePath treePath, V&& visitor)
│ │ │ │ -
106 {
│ │ │ │ -
107 using Tree = std::remove_reference_t<T>;
│ │ │ │ -
108 using Visitor = std::remove_reference_t<V>;
│ │ │ │ -
109 visitor.pre(tree, treePath);
│ │ │ │ -
110
│ │ │ │ -
111 // check which type of traversal is supported by the tree
│ │ │ │ -
112 using allowDynamicTraversal = Dune::Std::is_detected<DynamicTraversalConcept,Tree>;
│ │ │ │ -
113 using allowStaticTraversal = Dune::Std::is_detected<StaticTraversalConcept,Tree>;
│ │ │ │ -
114
│ │ │ │ -
115 // the tree must support either dynamic or static traversal
│ │ │ │ -
116 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ -
117
│ │ │ │ -
118 // the visitor may specify preferred dynamic traversal
│ │ │ │ -
119 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
│ │ │ │ -
120
│ │ │ │ -
121 // create a dynamic or static index range
│ │ │ │ -
122 auto indices = [&]{
│ │ │ │ -
123 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
│ │ │ │ -
124 return Dune::range(std::size_t(tree.degree()));
│ │ │ │ -
125 else
│ │ │ │ -
126 return Dune::range(tree.degree());
│ │ │ │ -
127 }();
│ │ │ │ -
128
│ │ │ │ -
129 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
│ │ │ │ -
130 Hybrid::forEach(indices, [&](auto i) {
│ │ │ │ -
131 auto&& child = tree.child(i);
│ │ │ │ -
132 using Child = std::decay_t<decltype(child)>;
│ │ │ │ -
133
│ │ │ │ -
134 visitor.beforeChild(tree, child, treePath, i);
│ │ │ │ -
135
│ │ │ │ -
136 // This requires that visitor.in(...) can always be instantiated,
│ │ │ │ -
137 // even if there's a single child only.
│ │ │ │ -
138 if (i>0)
│ │ │ │ -
139 visitor.in(tree, treePath);
│ │ │ │ -
140
│ │ │ │ -
141 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
│ │ │ │ -
142 if constexpr(visitChild) {
│ │ │ │ -
143 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ -
144 applyToTree(child, childTreePath, visitor);
│ │ │ │ -
145 }
│ │ │ │ -
146
│ │ │ │ -
147 visitor.afterChild(tree, child, treePath, i);
│ │ │ │ -
148 });
│ │ │ │ -
149 }
│ │ │ │ -
150 visitor.post(tree, treePath);
│ │ │ │ -
151 }
│ │ │ │ -
152
│ │ │ │ -
153 /* Traverse tree and visit each node. The signature is the same
│ │ │ │ -
154 * as for the public forEachNode function in Dune::Typtree,
│ │ │ │ -
155 * despite the additionally passed treePath argument. The path
│ │ │ │ -
156 * passed here is associated to the tree and the relative
│ │ │ │ -
157 * paths of the children (wrt. to tree) are appended to this.
│ │ │ │ -
158 * Hence the behavior of the public function is resembled
│ │ │ │ -
159 * by passing an empty treePath.
│ │ │ │ -
160 */
│ │ │ │ -
161 template<class T, class TreePath, class PreFunc, class LeafFunc, class PostFunc>
│ │ │ │ -
162 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
│ │ │ │ -
163 {
│ │ │ │ -
164 using Tree = std::decay_t<T>;
│ │ │ │ -
165 if constexpr(Tree::isLeaf) {
│ │ │ │ -
166 leafFunc(tree, treePath);
│ │ │ │ -
167 } else {
│ │ │ │ -
168 preFunc(tree, treePath);
│ │ │ │ -
169
│ │ │ │ -
170 // check which type of traversal is supported by the tree, prefer dynamic traversal
│ │ │ │ -
171 using allowDynamicTraversal = Dune::Std::is_detected<DynamicTraversalConcept,Tree>;
│ │ │ │ -
172 using allowStaticTraversal = Dune::Std::is_detected<StaticTraversalConcept,Tree>;
│ │ │ │ -
173
│ │ │ │ -
174 // the tree must support either dynamic or static traversal
│ │ │ │ -
175 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ -
176
│ │ │ │ -
177 if constexpr(allowDynamicTraversal::value) {
│ │ │ │ -
178 // Specialization for dynamic traversal
│ │ │ │ -
179 for (std::size_t i = 0; i < tree.degree(); ++i) {
│ │ │ │ -
180 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ -
181 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);
│ │ │ │ -
182 }
│ │ │ │ -
183 } else if constexpr(allowStaticTraversal::value) {
│ │ │ │ -
184 // Specialization for static traversal
│ │ │ │ -
185 auto indices = std::make_index_sequence<Tree::degree()>{};
│ │ │ │ -
186 Hybrid::forEach(indices, [&](auto i) {
│ │ │ │ -
187 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ -
188 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);
│ │ │ │ -
189 });
│ │ │ │ -
190 }
│ │ │ │ -
191 postFunc(tree, treePath);
│ │ │ │ -
192 }
│ │ │ │ -
193 }
│ │ │ │ -
194
│ │ │ │ -
195 } // namespace Detail
│ │ │ │ -
196
│ │ │ │ -
197
│ │ │ │ -
198 // ********************************************************************************
│ │ │ │ -
199 // Public Interface
│ │ │ │ -
200 // ********************************************************************************
│ │ │ │ -
201
│ │ │ │ -
215 template<class Tree, TreePathType::Type pathType=TreePathType::dynamic>
│ │ │ │ -
216 constexpr auto leafTreePathTuple()
│ │ │ │ -
217 {
│ │ │ │ -
218 return Detail::leafTreePathTuple<std::decay_t<Tree>, pathType>(hybridTreePath());
│ │ │ │ -
219 }
│ │ │ │ -
220
│ │ │ │ -
222
│ │ │ │ -
236 template<typename Tree, typename Visitor>
│ │ │ │ -
237 void applyToTree(Tree&& tree, Visitor&& visitor)
│ │ │ │ -
238 {
│ │ │ │ -
239 Detail::applyToTree(tree, hybridTreePath(), visitor);
│ │ │ │ -
240 }
│ │ │ │ -
241
│ │ │ │ -
255 template<class Tree, class PreFunc, class LeafFunc, class PostFunc>
│ │ │ │ -
256 [[deprecated]] void forEachNode(Tree&& tree, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
│ │ │ │ -
257 {
│ │ │ │ -
258 Detail::forEachNode(tree, hybridTreePath(), preFunc, leafFunc, postFunc);
│ │ │ │ -
259 }
│ │ │ │ -
260
│ │ │ │ -
273 template<class Tree, class InnerFunc, class LeafFunc>
│ │ │ │ -
274 [[deprecated]] void forEachNode(Tree&& tree, InnerFunc&& innerFunc, LeafFunc&& leafFunc)
│ │ │ │ -
275 {
│ │ │ │ -
276 Detail::forEachNode(tree, hybridTreePath(), innerFunc, leafFunc, NoOp{});
│ │ │ │ -
277 }
│ │ │ │ -
278
│ │ │ │ -
288 template<class Tree, class NodeFunc>
│ │ │ │ -
289 void forEachNode(Tree&& tree, NodeFunc&& nodeFunc)
│ │ │ │ -
290 {
│ │ │ │ -
291 Detail::forEachNode(tree, hybridTreePath(), nodeFunc, nodeFunc, NoOp{});
│ │ │ │ -
292 }
│ │ │ │ -
293
│ │ │ │ -
303 template<class Tree, class LeafFunc>
│ │ │ │ -
304 void forEachLeafNode(Tree&& tree, LeafFunc&& leafFunc)
│ │ │ │ -
305 {
│ │ │ │ -
306 Detail::forEachNode(tree, hybridTreePath(), NoOp{}, leafFunc, NoOp{});
│ │ │ │ -
307 }
│ │ │ │ -
308
│ │ │ │ -
310
│ │ │ │ -
311 } // namespace TypeTree
│ │ │ │ -
312} //namespace Dune
│ │ │ │ -
313
│ │ │ │ -
314#endif // DUNE_TYPETREE_TRAVERSAL_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
Traverse tree and visit each node.
Definition: traversal.hh:256
│ │ │ │ -
constexpr auto leafTreePathTuple()
Create tuple of tree paths to leafs.
Definition: traversal.hh:216
│ │ │ │ -
void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc)
Traverse tree and visit each leaf node.
Definition: traversal.hh:304
│ │ │ │ -
void applyToTree(Tree &&tree, Visitor &&visitor)
Apply visitor to TypeTree.
Definition: traversal.hh:237
│ │ │ │ +
50
│ │ │ │ +
57 template<typename T, typename TreePath>
│ │ │ │ +
58 void pre(T&&, TreePath) const {}
│ │ │ │ +
59
│ │ │ │ +
61
│ │ │ │ +
69 template<typename T, typename TreePath>
│ │ │ │ +
70 void in(T&&, TreePath) const {}
│ │ │ │ +
71
│ │ │ │ +
73
│ │ │ │ +
80 template<typename T, typename TreePath>
│ │ │ │ +
81 void post(T&&, TreePath) const {}
│ │ │ │ +
82
│ │ │ │ +
84
│ │ │ │ +
90 template<typename T, typename TreePath>
│ │ │ │ +
91 void leaf(T&&, TreePath) const {}
│ │ │ │ +
92
│ │ │ │ +
94
│ │ │ │ +
104 template<typename T, typename Child, typename TreePath, typename ChildIndex>
│ │ │ │ +
105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}
│ │ │ │ +
106
│ │ │ │ +
108
│ │ │ │ +
119 template<typename T, typename Child, typename TreePath, typename ChildIndex>
│ │ │ │ +
120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}
│ │ │ │ +
121
│ │ │ │ +
122 };
│ │ │ │ +
123
│ │ │ │ +
124
│ │ │ │ +
126
│ │ │ │ + │ │ │ │ +
162 {
│ │ │ │ +
163
│ │ │ │ +
165
│ │ │ │ +
173 template<typename T1, typename T2, typename TreePath>
│ │ │ │ +
174 void pre(T1&&, T2&&, TreePath) const {}
│ │ │ │ +
175
│ │ │ │ +
177
│ │ │ │ +
186 template<typename T1, typename T2, typename TreePath>
│ │ │ │ +
187 void in(T1&&, T2&&, TreePath) const {}
│ │ │ │ +
188
│ │ │ │ +
190
│ │ │ │ +
198 template<typename T1, typename T2, typename TreePath>
│ │ │ │ +
199 void post(T1&&, T2&&, TreePath) const {}
│ │ │ │ +
200
│ │ │ │ +
202
│ │ │ │ +
213 template<typename T1, typename T2, typename TreePath>
│ │ │ │ +
214 void leaf(T1&&, T2&&, TreePath) const {}
│ │ │ │ +
215
│ │ │ │ +
217
│ │ │ │ +
229 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
│ │ │ │ +
230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
│ │ │ │ +
231
│ │ │ │ +
233
│ │ │ │ +
245 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
│ │ │ │ +
246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
│ │ │ │ +
247
│ │ │ │ +
248 };
│ │ │ │ +
249
│ │ │ │ +
250
│ │ │ │ +
251 namespace Experimental {
│ │ │ │ +
252
│ │ │ │ + │ │ │ │ +
284 {
│ │ │ │ +
285
│ │ │ │ +
293 template<typename T, typename TreePath, typename U>
│ │ │ │ +
294 auto pre(T&&, TreePath, const U& u) const { return u;}
│ │ │ │ +
295
│ │ │ │ +
303 template<typename T, typename TreePath, typename U>
│ │ │ │ +
304 auto in(T&&, TreePath, const U& u) const {return u;}
│ │ │ │ +
305
│ │ │ │ +
313 template<typename T, typename TreePath, typename U>
│ │ │ │ +
314 auto post(T&&, TreePath, const U& u) const {return u;}
│ │ │ │ +
315
│ │ │ │ +
323 template<typename T, typename TreePath, typename U>
│ │ │ │ +
324 auto leaf(T&&, TreePath, const U& u) const { return u;}
│ │ │ │ +
325
│ │ │ │ +
333 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
│ │ │ │ +
334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
│ │ │ │ +
335
│ │ │ │ +
343 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
│ │ │ │ +
344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
│ │ │ │ +
345
│ │ │ │ +
346 };
│ │ │ │ +
347 } // namespace Experimental
│ │ │ │ +
348
│ │ │ │ +
350
│ │ │ │ + │ │ │ │ +
356 {
│ │ │ │ +
357
│ │ │ │ +
358 // the little trick with the default template arguments
│ │ │ │ +
359 // makes the class usable for both single-tree visitors
│ │ │ │ +
360 // and visitors for pairs of trees
│ │ │ │ +
362 template<typename Node1,
│ │ │ │ +
363 typename Child1,
│ │ │ │ +
364 typename Node2,
│ │ │ │ +
365 typename Child2 = void,
│ │ │ │ +
366 typename TreePath = void>
│ │ │ │ + │ │ │ │ +
368 {
│ │ │ │ +
370 static const bool value = false;
│ │ │ │ +
371 };
│ │ │ │ +
372
│ │ │ │ +
373 };
│ │ │ │ +
374
│ │ │ │ +
375
│ │ │ │ +
377
│ │ │ │ + │ │ │ │ +
382 {
│ │ │ │ +
383
│ │ │ │ +
384 // the little trick with the default template arguments
│ │ │ │ +
385 // makes the class usable for both single-tree visitors
│ │ │ │ +
386 // and visitors for pairs of trees
│ │ │ │ +
388 template<typename Node1,
│ │ │ │ +
389 typename Child1,
│ │ │ │ +
390 typename Node2,
│ │ │ │ +
391 typename Child2 = void,
│ │ │ │ +
392 typename TreePath = void>
│ │ │ │ + │ │ │ │ +
394 {
│ │ │ │ +
396 static const bool value = true;
│ │ │ │ +
397 };
│ │ │ │ +
398
│ │ │ │ +
399 };
│ │ │ │ +
400
│ │ │ │ +
402
│ │ │ │ + │ │ │ │ +
410 {
│ │ │ │ + │ │ │ │ +
413 };
│ │ │ │ +
414
│ │ │ │ +
416
│ │ │ │ + │ │ │ │ +
424 {
│ │ │ │ + │ │ │ │ +
427 };
│ │ │ │ +
428
│ │ │ │ + │ │ │ │ +
431 : public DefaultVisitor
│ │ │ │ +
432 , public VisitTree
│ │ │ │ +
433 {};
│ │ │ │ +
434
│ │ │ │ + │ │ │ │ +
437 : public DefaultVisitor
│ │ │ │ +
438 , public VisitDirectChildren
│ │ │ │ +
439 {};
│ │ │ │ +
440
│ │ │ │ + │ │ │ │ +
443 : public DefaultPairVisitor
│ │ │ │ +
444 , public VisitTree
│ │ │ │ +
445 {};
│ │ │ │ +
446
│ │ │ │ + │ │ │ │ +
449 : public DefaultPairVisitor
│ │ │ │ +
450 , public VisitDirectChildren
│ │ │ │ +
451 {};
│ │ │ │ +
452
│ │ │ │ +
453 namespace Experimental::Info {
│ │ │ │ +
454
│ │ │ │ + │ │ │ │ +
456 : public DefaultHybridVisitor
│ │ │ │ +
457 , public StaticTraversal
│ │ │ │ +
458 , public VisitTree
│ │ │ │ +
459 {
│ │ │ │ +
460 template<class Tree, class Child, class TreePath, class ChildIndex, class U>
│ │ │ │ +
461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const {
│ │ │ │ +
462 // in this case child index is an integral constant: forward u
│ │ │ │ +
463 return u;
│ │ │ │ +
464 }
│ │ │ │ +
465
│ │ │ │ +
466 template<class Tree, class Child, class TreePath, class U>
│ │ │ │ +
467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t /*childIndex*/, U u) const {
│ │ │ │ +
468 // in this case child index is a run-time index: cast accumulated u to std::size_t
│ │ │ │ +
469 return std::size_t{u};
│ │ │ │ +
470 }
│ │ │ │ +
471
│ │ │ │ +
472 template<class Tree, class TreePath, class U>
│ │ │ │ +
473 auto leaf(Tree&&, TreePath, U u) const
│ │ │ │ +
474 {
│ │ │ │ +
475 return Hybrid::plus(u,Dune::Indices::_1);
│ │ │ │ +
476 }
│ │ │ │ +
477
│ │ │ │ +
478 };
│ │ │ │ +
479
│ │ │ │ + │ │ │ │ +
481 : public LeafCounterVisitor
│ │ │ │ +
482 {
│ │ │ │ +
483 template<typename Tree, typename TreePath, typename U>
│ │ │ │ +
484 auto pre(Tree&&, TreePath, U u) const {
│ │ │ │ +
485 return Hybrid::plus(u,Indices::_1);
│ │ │ │ +
486 }
│ │ │ │ +
487 };
│ │ │ │ +
488
│ │ │ │ + │ │ │ │ +
490 : public DefaultHybridVisitor
│ │ │ │ +
491 , public StaticTraversal
│ │ │ │ +
492 , public VisitTree
│ │ │ │ +
493 {
│ │ │ │ +
494 template<class Tree, class TreePath, class U>
│ │ │ │ +
495 auto leaf(Tree&&, TreePath, U u) const
│ │ │ │ +
496 {
│ │ │ │ +
497 auto path_size = index_constant<treePathSize(TreePath{})>{};
│ │ │ │ +
498 auto depth = Hybrid::plus(path_size,Indices::_1);
│ │ │ │ +
499 return Hybrid::max(depth,u);
│ │ │ │ +
500 }
│ │ │ │ +
501 };
│ │ │ │ +
502
│ │ │ │ +
504 // result is alwayas an integral constant
│ │ │ │ +
505 template<typename Tree>
│ │ │ │ +
506 auto depth(const Tree& tree)
│ │ │ │ +
507 {
│ │ │ │ +
508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0);
│ │ │ │ +
509 }
│ │ │ │ +
510
│ │ │ │ +
512 // return types is std::integral_constant.
│ │ │ │ +
513 template<typename Tree>
│ │ │ │ +
514 constexpr auto depth()
│ │ │ │ +
515 {
│ │ │ │ +
516 return decltype(hybridApplyToTree(std::declval<Tree>(),DepthVisitor{},Indices::_0)){};
│ │ │ │ +
517 }
│ │ │ │ +
518
│ │ │ │ +
520 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
│ │ │ │ +
521 template<typename Tree>
│ │ │ │ +
522 auto nodeCount(const Tree& tree)
│ │ │ │ +
523 {
│ │ │ │ +
524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0);
│ │ │ │ +
525 }
│ │ │ │ +
526
│ │ │ │ +
528 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
│ │ │ │ +
529 template<typename Tree>
│ │ │ │ +
530 auto leafCount(const Tree& tree)
│ │ │ │ +
531 {
│ │ │ │ +
532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0);
│ │ │ │ +
533 }
│ │ │ │ +
534
│ │ │ │ +
536 template<typename Tree>
│ │ │ │ +
537 constexpr bool isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{};
│ │ │ │ +
538
│ │ │ │ +
539 } // namespace Experimental::Info
│ │ │ │ +
540
│ │ │ │ +
542
│ │ │ │ +
543 } // namespace TypeTree
│ │ │ │ +
544} //namespace Dune
│ │ │ │ +
545
│ │ │ │ +
546#endif // DUNE_TYPETREE_VISITOR_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │ -
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ -
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ -
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ -
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ -
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │ +
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition: treepath.hh:199
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
Definition: traversal.hh:162
│ │ │ │ -
decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) DynamicTraversalConcept
Definition: traversal.hh:41
│ │ │ │ -
decltype((std::integral_constant< std::size_t, Tree::degree()>{})) StaticTraversalConcept
Definition: traversal.hh:47
│ │ │ │ -
void applyToTree(T &&tree, TreePath treePath, V &&visitor)
Definition: traversal.hh:95
│ │ │ │ -
constexpr auto leafTreePathTuple(Prefix prefix)
Definition: traversal.hh:52
│ │ │ │ +
auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
Apply hybrid visitor to TypeTree.
Definition: accumulate_static.hh:698
│ │ │ │
Type
Definition: treepath.hh:30
│ │ │ │ +
@ fullyStatic
Definition: treepath.hh:30
│ │ │ │
@ dynamic
Definition: treepath.hh:30
│ │ │ │ +
constexpr bool isDynamic
true if any of the nodes in the tree only has dynamic degree.
Definition: visitor.hh:537
│ │ │ │ +
auto leafCount(const Tree &tree)
The number of leaf nodes in the Tree.
Definition: visitor.hh:530
│ │ │ │ +
auto nodeCount(const Tree &tree)
The total number of nodes in the Tree.
Definition: visitor.hh:522
│ │ │ │ +
auto depth(const Tree &tree)
The depth of the TypeTree.
Definition: visitor.hh:506
│ │ │ │
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ +
Visitor interface and base class for TypeTree visitors.
Definition: visitor.hh:47
│ │ │ │ +
void in(T &&, TreePath) const
Method for infix tree traversal.
Definition: visitor.hh:70
│ │ │ │ +
void afterChild(T &&, Child &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition: visitor.hh:120
│ │ │ │ +
void beforeChild(T &&, Child &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition: visitor.hh:105
│ │ │ │ +
void post(T &&, TreePath) const
Method for postfix tree traversal.
Definition: visitor.hh:81
│ │ │ │ +
void leaf(T &&, TreePath) const
Method for leaf traversal.
Definition: visitor.hh:91
│ │ │ │ +
void pre(T &&, TreePath) const
Method for prefix tree traversal.
Definition: visitor.hh:58
│ │ │ │ +
Visitor interface and base class for visitors of pairs of TypeTrees.
Definition: visitor.hh:162
│ │ │ │ +
void leaf(T1 &&, T2 &&, TreePath) const
Method for leaf traversal.
Definition: visitor.hh:214
│ │ │ │ +
void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition: visitor.hh:230
│ │ │ │ +
void pre(T1 &&, T2 &&, TreePath) const
Method for prefix tree traversal.
Definition: visitor.hh:174
│ │ │ │ +
void post(T1 &&, T2 &&, TreePath) const
Method for postfix traversal.
Definition: visitor.hh:199
│ │ │ │ +
void in(T1 &&, T2 &&, TreePath) const
Method for infix tree traversal.
Definition: visitor.hh:187
│ │ │ │ +
void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition: visitor.hh:246
│ │ │ │ +
Hybrid visitor interface and base class for TypeTree hybrid visitors.
Definition: visitor.hh:284
│ │ │ │ +
auto post(T &&, TreePath, const U &u) const
Method for postfix tree traversal.
Definition: visitor.hh:314
│ │ │ │ +
auto pre(T &&, TreePath, const U &u) const
Method for prefix tree traversal.
Definition: visitor.hh:294
│ │ │ │ +
auto leaf(T &&, TreePath, const U &u) const
Method for leaf traversal.
Definition: visitor.hh:324
│ │ │ │ +
auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for child-parent traversal.
Definition: visitor.hh:344
│ │ │ │ +
auto in(T &&, TreePath, const U &u) const
Method for infix tree traversal.
Definition: visitor.hh:304
│ │ │ │ +
auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for parent-child traversal.
Definition: visitor.hh:334
│ │ │ │ +
Mixin base class for visitors that only want to visit the direct children of a node.
Definition: visitor.hh:356
│ │ │ │ +
Template struct for determining whether or not to visit a given child.
Definition: visitor.hh:368
│ │ │ │ +
static const bool value
Do not visit any child.
Definition: visitor.hh:370
│ │ │ │ +
Mixin base class for visitors that want to visit the complete tree.
Definition: visitor.hh:382
│ │ │ │ +
Template struct for determining whether or not to visit a given child.
Definition: visitor.hh:394
│ │ │ │ +
static const bool value
Visit any child.
Definition: visitor.hh:396
│ │ │ │ +
Mixin base class for visitors that require a static TreePath during traversal.
Definition: visitor.hh:410
│ │ │ │ +
static const TreePathType::Type treePathType
Use the static tree traversal algorithm.
Definition: visitor.hh:412
│ │ │ │ +
Mixin base class for visitors that only need a dynamic TreePath during traversal.
Definition: visitor.hh:424
│ │ │ │ +
static const TreePathType::Type treePathType
Use the dynamic tree traversal algorithm.
Definition: visitor.hh:426
│ │ │ │ +
Convenience base class for visiting the entire tree.
Definition: visitor.hh:433
│ │ │ │ +
Convenience base class for visiting the direct children of a node.
Definition: visitor.hh:439
│ │ │ │ +
Convenience base class for visiting an entire tree pair.
Definition: visitor.hh:445
│ │ │ │ +
Convenience base class for visiting the direct children of a node pair.
Definition: visitor.hh:451
│ │ │ │ + │ │ │ │ +
auto leaf(Tree &&, TreePath, U u) const
Definition: visitor.hh:473
│ │ │ │ +
auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const
Definition: visitor.hh:461
│ │ │ │ +
std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const
Definition: visitor.hh:467
│ │ │ │ + │ │ │ │ +
auto pre(Tree &&, TreePath, U u) const
Definition: visitor.hh:484
│ │ │ │ + │ │ │ │ +
auto leaf(Tree &&, TreePath, U u) const
Definition: visitor.hh:495
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,361 +4,484 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -traversal.hh │ │ │ │ │ +visitor.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11 │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16 │ │ │ │ │ - 17namespace Dune { │ │ │ │ │ - 18 namespace TypeTree { │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10namespace Dune { │ │ │ │ │ + 11 namespace TypeTree { │ │ │ │ │ + 12 │ │ │ │ │ 19 │ │ │ │ │ - 25#ifndef DOXYGEN │ │ │ │ │ - 27 struct NoOp │ │ │ │ │ - 28 { │ │ │ │ │ - 29 template │ │ │ │ │ - 30 constexpr void operator()(T&&...) const { /* do nothing */ } │ │ │ │ │ - 31 }; │ │ │ │ │ - 32#endif │ │ │ │ │ - 33 │ │ │ │ │ - 34 namespace Detail { │ │ │ │ │ - 35 │ │ │ │ │ - 36 // SFINAE template check that Tree has a degree() function and a child() │ │ │ │ │ -function accepting integer indices │ │ │ │ │ - 37 template │ │ │ │ │ -38 using DynamicTraversalConcept = decltype(( │ │ │ │ │ - 39 std::declval().degree(), │ │ │ │ │ - 40 std::declval().child(0u) │ │ │ │ │ - 41 )); │ │ │ │ │ - 42 │ │ │ │ │ - 43 // SFINAE template check that Tree has static (constexpr) function Tree:: │ │ │ │ │ -degree() │ │ │ │ │ - 44 template │ │ │ │ │ -45 using StaticTraversalConcept = decltype(( │ │ │ │ │ - 46 std::integral_constant{} │ │ │ │ │ - 47 )); │ │ │ │ │ +46 struct DefaultVisitor │ │ │ │ │ + 47 { │ │ │ │ │ 48 │ │ │ │ │ - 49 │ │ │ │ │ - 50 template = 0> │ │ │ │ │ -52 constexpr auto leafTreePathTuple(Prefix prefix) │ │ │ │ │ - 53 { │ │ │ │ │ - 54 return std::make_tuple(prefix); │ │ │ │ │ - 55 } │ │ │ │ │ - 56 │ │ │ │ │ - 57 template = 0> │ │ │ │ │ - 59 constexpr auto leafTreePathTuple(Prefix prefix); │ │ │ │ │ - 60 │ │ │ │ │ - 61 template = 0> │ │ │ │ │ -63 constexpr auto leafTreePathTuple(Prefix prefix, std:: │ │ │ │ │ -index_sequence) │ │ │ │ │ - 64 { │ │ │ │ │ - 65 return std::tuple_cat(Detail::leafTreePathTuple, pathType>(Dune::TypeTree::push_back(prefix, Dune:: │ │ │ │ │ -index_constant{}))...); │ │ │ │ │ - 66 } │ │ │ │ │ - 67 │ │ │ │ │ - 68 template = 0> │ │ │ │ │ - 70 constexpr auto leafTreePathTuple(Prefix prefix, std:: │ │ │ │ │ -index_sequence) │ │ │ │ │ - 71 { │ │ │ │ │ - 72 return std::tuple_cat(Detail::leafTreePathTuple, pathType>(Dune::TypeTree::push_back(prefix, indices))...); │ │ │ │ │ - 73 } │ │ │ │ │ - 74 │ │ │ │ │ - 75 template> │ │ │ │ │ - 77 constexpr auto leafTreePathTuple(Prefix prefix) │ │ │ │ │ - 78 { │ │ │ │ │ - 79 return Detail::leafTreePathTuple(prefix, std:: │ │ │ │ │ -make_index_sequence{}); │ │ │ │ │ - 80 } │ │ │ │ │ - 81 │ │ │ │ │ - 82 /* The signature is the same as for the public applyToTree │ │ │ │ │ - 83 * function in Dune::Typetree, despite the additionally passed │ │ │ │ │ - 84 * treePath argument. The path passed here is associated to │ │ │ │ │ - 85 * the tree and the relative paths of the children (wrt. to tree) │ │ │ │ │ - 86 * are appended to this. Hence the behavior of the public function │ │ │ │ │ - 87 * is resembled by passing an empty treePath. │ │ │ │ │ - 88 */ │ │ │ │ │ - 89 │ │ │ │ │ - 90 /* │ │ │ │ │ - 91 * This is the overload for leaf traversal │ │ │ │ │ - 92 */ │ │ │ │ │ - 93 template::isLeaf, int> = 0> │ │ │ │ │ -95 void applyToTree(T&& tree, TreePath treePath, V&& visitor) │ │ │ │ │ - 96 { │ │ │ │ │ - 97 visitor.leaf(tree, treePath); │ │ │ │ │ - 98 } │ │ │ │ │ - 99 │ │ │ │ │ - 100 /* │ │ │ │ │ - 101 * This is the general overload doing child traversal. │ │ │ │ │ - 102 */ │ │ │ │ │ - 103 template::isLeaf, int> = 0> │ │ │ │ │ - 105 void applyToTree(T&& tree, TreePath treePath, V&& visitor) │ │ │ │ │ - 106 { │ │ │ │ │ - 107 using Tree = std::remove_reference_t; │ │ │ │ │ - 108 using Visitor = std::remove_reference_t; │ │ │ │ │ - 109 visitor.pre(tree, treePath); │ │ │ │ │ - 110 │ │ │ │ │ - 111 // check which type of traversal is supported by the tree │ │ │ │ │ - 112 using allowDynamicTraversal = Dune::Std:: │ │ │ │ │ -is_detected; │ │ │ │ │ - 113 using allowStaticTraversal = Dune::Std:: │ │ │ │ │ -is_detected; │ │ │ │ │ - 114 │ │ │ │ │ - 115 // the tree must support either dynamic or static traversal │ │ │ │ │ - 116 static_assert(allowDynamicTraversal::value || allowStaticTraversal:: │ │ │ │ │ -value); │ │ │ │ │ - 117 │ │ │ │ │ - 118 // the visitor may specify preferred dynamic traversal │ │ │ │ │ - 119 using preferDynamicTraversal = std::bool_constant; │ │ │ │ │ - 120 │ │ │ │ │ - 121 // create a dynamic or static index range │ │ │ │ │ - 122 auto indices = [&]{ │ │ │ │ │ - 123 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal:: │ │ │ │ │ -value) │ │ │ │ │ - 124 return Dune::range(std::size_t(tree.degree())); │ │ │ │ │ - 125 else │ │ │ │ │ - 126 return Dune::range(tree.degree()); │ │ │ │ │ - 127 }(); │ │ │ │ │ - 128 │ │ │ │ │ - 129 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) │ │ │ │ │ -{ │ │ │ │ │ - 130 Hybrid::forEach(indices, [&](auto i) { │ │ │ │ │ - 131 auto&& child = tree.child(i); │ │ │ │ │ - 132 using Child = std::decay_t; │ │ │ │ │ - 133 │ │ │ │ │ - 134 visitor.beforeChild(tree, child, treePath, i); │ │ │ │ │ - 135 │ │ │ │ │ - 136 // This requires that visitor.in(...) can always be instantiated, │ │ │ │ │ - 137 // even if there's a single child only. │ │ │ │ │ - 138 if (i>0) │ │ │ │ │ - 139 visitor.in(tree, treePath); │ │ │ │ │ - 140 │ │ │ │ │ - 141 constexpr bool visitChild = Visitor::template │ │ │ │ │ -VisitChild::value; │ │ │ │ │ - 142 if constexpr(visitChild) { │ │ │ │ │ - 143 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ - 144 applyToTree(child, childTreePath, visitor); │ │ │ │ │ - 145 } │ │ │ │ │ - 146 │ │ │ │ │ - 147 visitor.afterChild(tree, child, treePath, i); │ │ │ │ │ - 148 }); │ │ │ │ │ - 149 } │ │ │ │ │ - 150 visitor.post(tree, treePath); │ │ │ │ │ - 151 } │ │ │ │ │ - 152 │ │ │ │ │ - 153 /* Traverse tree and visit each node. The signature is the same │ │ │ │ │ - 154 * as for the public forEachNode function in Dune::Typtree, │ │ │ │ │ - 155 * despite the additionally passed treePath argument. The path │ │ │ │ │ - 156 * passed here is associated to the tree and the relative │ │ │ │ │ - 157 * paths of the children (wrt. to tree) are appended to this. │ │ │ │ │ - 158 * Hence the behavior of the public function is resembled │ │ │ │ │ - 159 * by passing an empty treePath. │ │ │ │ │ - 160 */ │ │ │ │ │ - 161 template │ │ │ │ │ -162 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&& │ │ │ │ │ -leafFunc, PostFunc&& postFunc) │ │ │ │ │ - 163 { │ │ │ │ │ - 164 using Tree = std::decay_t; │ │ │ │ │ - 165 if constexpr(Tree::isLeaf) { │ │ │ │ │ - 166 leafFunc(tree, treePath); │ │ │ │ │ - 167 } else { │ │ │ │ │ - 168 preFunc(tree, treePath); │ │ │ │ │ - 169 │ │ │ │ │ - 170 // check which type of traversal is supported by the tree, prefer dynamic │ │ │ │ │ -traversal │ │ │ │ │ - 171 using allowDynamicTraversal = Dune::Std:: │ │ │ │ │ -is_detected; │ │ │ │ │ - 172 using allowStaticTraversal = Dune::Std:: │ │ │ │ │ -is_detected; │ │ │ │ │ - 173 │ │ │ │ │ - 174 // the tree must support either dynamic or static traversal │ │ │ │ │ - 175 static_assert(allowDynamicTraversal::value || allowStaticTraversal:: │ │ │ │ │ -value); │ │ │ │ │ - 176 │ │ │ │ │ - 177 if constexpr(allowDynamicTraversal::value) { │ │ │ │ │ - 178 // Specialization for dynamic traversal │ │ │ │ │ - 179 for (std::size_t i = 0; i < tree.degree(); ++i) { │ │ │ │ │ - 180 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ - 181 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc); │ │ │ │ │ - 182 } │ │ │ │ │ - 183 } else if constexpr(allowStaticTraversal::value) { │ │ │ │ │ - 184 // Specialization for static traversal │ │ │ │ │ - 185 auto indices = std::make_index_sequence{}; │ │ │ │ │ - 186 Hybrid::forEach(indices, [&](auto i) { │ │ │ │ │ - 187 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ - 188 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc); │ │ │ │ │ - 189 }); │ │ │ │ │ - 190 } │ │ │ │ │ - 191 postFunc(tree, treePath); │ │ │ │ │ - 192 } │ │ │ │ │ - 193 } │ │ │ │ │ - 194 │ │ │ │ │ - 195 } // namespace Detail │ │ │ │ │ - 196 │ │ │ │ │ - 197 │ │ │ │ │ - 198 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 199 // Public Interface │ │ │ │ │ - 200 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 201 │ │ │ │ │ - 215 template │ │ │ │ │ -216 constexpr auto leafTreePathTuple() │ │ │ │ │ - 217 { │ │ │ │ │ - 218 return Detail::leafTreePathTuple, pathType> │ │ │ │ │ -(hybridTreePath()); │ │ │ │ │ - 219 } │ │ │ │ │ - 220 │ │ │ │ │ - 222 │ │ │ │ │ - 236 template │ │ │ │ │ -237 void applyToTree(Tree&& tree, Visitor&& visitor) │ │ │ │ │ - 238 { │ │ │ │ │ - 239 Detail::applyToTree(tree, hybridTreePath(), visitor); │ │ │ │ │ - 240 } │ │ │ │ │ - 241 │ │ │ │ │ - 255 template │ │ │ │ │ -256 [[deprecated]] void forEachNode(Tree&& tree, PreFunc&& preFunc, LeafFunc&& │ │ │ │ │ -leafFunc, PostFunc&& postFunc) │ │ │ │ │ - 257 { │ │ │ │ │ - 258 Detail::forEachNode(tree, hybridTreePath(), preFunc, leafFunc, postFunc); │ │ │ │ │ - 259 } │ │ │ │ │ - 260 │ │ │ │ │ - 273 template │ │ │ │ │ -274 [[deprecated]] void forEachNode(Tree&& tree, InnerFunc&& innerFunc, │ │ │ │ │ -LeafFunc&& leafFunc) │ │ │ │ │ - 275 { │ │ │ │ │ - 276 Detail::forEachNode(tree, hybridTreePath(), innerFunc, leafFunc, NoOp{}); │ │ │ │ │ - 277 } │ │ │ │ │ - 278 │ │ │ │ │ - 288 template │ │ │ │ │ -289 void forEachNode(Tree&& tree, NodeFunc&& nodeFunc) │ │ │ │ │ - 290 { │ │ │ │ │ - 291 Detail::forEachNode(tree, hybridTreePath(), nodeFunc, nodeFunc, NoOp{}); │ │ │ │ │ - 292 } │ │ │ │ │ - 293 │ │ │ │ │ - 303 template │ │ │ │ │ -304 void forEachLeafNode(Tree&& tree, LeafFunc&& leafFunc) │ │ │ │ │ - 305 { │ │ │ │ │ - 306 Detail::forEachNode(tree, hybridTreePath(), NoOp{}, leafFunc, NoOp{}); │ │ │ │ │ - 307 } │ │ │ │ │ - 308 │ │ │ │ │ - 310 │ │ │ │ │ - 311 } // namespace TypeTree │ │ │ │ │ - 312} //namespace Dune │ │ │ │ │ - 313 │ │ │ │ │ - 314#endif // DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ -visitor.hh │ │ │ │ │ + 50 │ │ │ │ │ + 57 template │ │ │ │ │ +58 void pre(T&&, TreePath) const {} │ │ │ │ │ + 59 │ │ │ │ │ + 61 │ │ │ │ │ + 69 template │ │ │ │ │ +70 void in(T&&, TreePath) const {} │ │ │ │ │ + 71 │ │ │ │ │ + 73 │ │ │ │ │ + 80 template │ │ │ │ │ +81 void post(T&&, TreePath) const {} │ │ │ │ │ + 82 │ │ │ │ │ + 84 │ │ │ │ │ + 90 template │ │ │ │ │ +91 void leaf(T&&, TreePath) const {} │ │ │ │ │ + 92 │ │ │ │ │ + 94 │ │ │ │ │ + 104 template │ │ │ │ │ +105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {} │ │ │ │ │ + 106 │ │ │ │ │ + 108 │ │ │ │ │ + 119 template │ │ │ │ │ +120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {} │ │ │ │ │ + 121 │ │ │ │ │ + 122 }; │ │ │ │ │ + 123 │ │ │ │ │ + 124 │ │ │ │ │ + 126 │ │ │ │ │ +161 struct DefaultPairVisitor │ │ │ │ │ + 162 { │ │ │ │ │ + 163 │ │ │ │ │ + 165 │ │ │ │ │ + 173 template │ │ │ │ │ +174 void pre(T1&&, T2&&, TreePath) const {} │ │ │ │ │ + 175 │ │ │ │ │ + 177 │ │ │ │ │ + 186 template │ │ │ │ │ +187 void in(T1&&, T2&&, TreePath) const {} │ │ │ │ │ + 188 │ │ │ │ │ + 190 │ │ │ │ │ + 198 template │ │ │ │ │ +199 void post(T1&&, T2&&, TreePath) const {} │ │ │ │ │ + 200 │ │ │ │ │ + 202 │ │ │ │ │ + 213 template │ │ │ │ │ +214 void leaf(T1&&, T2&&, TreePath) const {} │ │ │ │ │ + 215 │ │ │ │ │ + 217 │ │ │ │ │ + 229 template │ │ │ │ │ +230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) │ │ │ │ │ +const {} │ │ │ │ │ + 231 │ │ │ │ │ + 233 │ │ │ │ │ + 245 template │ │ │ │ │ +246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const │ │ │ │ │ +{} │ │ │ │ │ + 247 │ │ │ │ │ + 248 }; │ │ │ │ │ + 249 │ │ │ │ │ + 250 │ │ │ │ │ + 251 namespace Experimental { │ │ │ │ │ + 252 │ │ │ │ │ +283 struct DefaultHybridVisitor │ │ │ │ │ + 284 { │ │ │ │ │ + 285 │ │ │ │ │ + 293 template │ │ │ │ │ +294 auto pre(T&&, TreePath, const U& u) const { return u;} │ │ │ │ │ + 295 │ │ │ │ │ + 303 template │ │ │ │ │ +304 auto in(T&&, TreePath, const U& u) const {return u;} │ │ │ │ │ + 305 │ │ │ │ │ + 313 template │ │ │ │ │ +314 auto post(T&&, TreePath, const U& u) const {return u;} │ │ │ │ │ + 315 │ │ │ │ │ + 323 template │ │ │ │ │ +324 auto leaf(T&&, TreePath, const U& u) const { return u;} │ │ │ │ │ + 325 │ │ │ │ │ + 333 template │ │ │ │ │ +334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const │ │ │ │ │ +{return u;} │ │ │ │ │ + 335 │ │ │ │ │ + 343 template │ │ │ │ │ +344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const │ │ │ │ │ +{return u;} │ │ │ │ │ + 345 │ │ │ │ │ + 346 }; │ │ │ │ │ + 347 } // namespace Experimental │ │ │ │ │ + 348 │ │ │ │ │ + 350 │ │ │ │ │ +355 struct VisitDirectChildren │ │ │ │ │ + 356 { │ │ │ │ │ + 357 │ │ │ │ │ + 358 // the little trick with the default template arguments │ │ │ │ │ + 359 // makes the class usable for both single-tree visitors │ │ │ │ │ + 360 // and visitors for pairs of trees │ │ │ │ │ + 362 template │ │ │ │ │ +367 struct VisitChild │ │ │ │ │ + 368 { │ │ │ │ │ +370 static const bool value = false; │ │ │ │ │ + 371 }; │ │ │ │ │ + 372 │ │ │ │ │ + 373 }; │ │ │ │ │ + 374 │ │ │ │ │ + 375 │ │ │ │ │ + 377 │ │ │ │ │ +381 struct VisitTree │ │ │ │ │ + 382 { │ │ │ │ │ + 383 │ │ │ │ │ + 384 // the little trick with the default template arguments │ │ │ │ │ + 385 // makes the class usable for both single-tree visitors │ │ │ │ │ + 386 // and visitors for pairs of trees │ │ │ │ │ + 388 template │ │ │ │ │ +393 struct VisitChild │ │ │ │ │ + 394 { │ │ │ │ │ +396 static const bool value = true; │ │ │ │ │ + 397 }; │ │ │ │ │ + 398 │ │ │ │ │ + 399 }; │ │ │ │ │ + 400 │ │ │ │ │ + 402 │ │ │ │ │ +409 struct StaticTraversal │ │ │ │ │ + 410 { │ │ │ │ │ +412 static const TreePathType::Type treePathType = TreePathType::fullyStatic; │ │ │ │ │ + 413 }; │ │ │ │ │ + 414 │ │ │ │ │ + 416 │ │ │ │ │ +423 struct DynamicTraversal │ │ │ │ │ + 424 { │ │ │ │ │ +426 static const TreePathType::Type treePathType = TreePathType::dynamic; │ │ │ │ │ + 427 }; │ │ │ │ │ + 428 │ │ │ │ │ +430 struct TreeVisitor │ │ │ │ │ + 431 : public DefaultVisitor │ │ │ │ │ + 432 , public VisitTree │ │ │ │ │ + 433 {}; │ │ │ │ │ + 434 │ │ │ │ │ +436 struct DirectChildrenVisitor │ │ │ │ │ + 437 : public DefaultVisitor │ │ │ │ │ + 438 , public VisitDirectChildren │ │ │ │ │ + 439 {}; │ │ │ │ │ + 440 │ │ │ │ │ +442 struct TreePairVisitor │ │ │ │ │ + 443 : public DefaultPairVisitor │ │ │ │ │ + 444 , public VisitTree │ │ │ │ │ + 445 {}; │ │ │ │ │ + 446 │ │ │ │ │ +448 struct DirectChildrenPairVisitor │ │ │ │ │ + 449 : public DefaultPairVisitor │ │ │ │ │ + 450 , public VisitDirectChildren │ │ │ │ │ + 451 {}; │ │ │ │ │ + 452 │ │ │ │ │ +453 namespace Experimental::Info { │ │ │ │ │ + 454 │ │ │ │ │ +455 struct LeafCounterVisitor │ │ │ │ │ + 456 : public DefaultHybridVisitor │ │ │ │ │ + 457 , public StaticTraversal │ │ │ │ │ + 458 , public VisitTree │ │ │ │ │ + 459 { │ │ │ │ │ + 460 template │ │ │ │ │ +461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const { │ │ │ │ │ + 462 // in this case child index is an integral constant: forward u │ │ │ │ │ + 463 return u; │ │ │ │ │ + 464 } │ │ │ │ │ + 465 │ │ │ │ │ + 466 template │ │ │ │ │ +467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t / │ │ │ │ │ +*childIndex*/, U u) const { │ │ │ │ │ + 468 // in this case child index is a run-time index: cast accumulated u to │ │ │ │ │ +std::size_t │ │ │ │ │ + 469 return std::size_t{u}; │ │ │ │ │ + 470 } │ │ │ │ │ + 471 │ │ │ │ │ + 472 template │ │ │ │ │ +473 auto leaf(Tree&&, TreePath, U u) const │ │ │ │ │ + 474 { │ │ │ │ │ + 475 return Hybrid::plus(u,Dune::Indices::_1); │ │ │ │ │ + 476 } │ │ │ │ │ + 477 │ │ │ │ │ + 478 }; │ │ │ │ │ + 479 │ │ │ │ │ +480 struct NodeCounterVisitor │ │ │ │ │ + 481 : public LeafCounterVisitor │ │ │ │ │ + 482 { │ │ │ │ │ + 483 template │ │ │ │ │ +484 auto pre(Tree&&, TreePath, U u) const { │ │ │ │ │ + 485 return Hybrid::plus(u,Indices::_1); │ │ │ │ │ + 486 } │ │ │ │ │ + 487 }; │ │ │ │ │ + 488 │ │ │ │ │ +489 struct DepthVisitor │ │ │ │ │ + 490 : public DefaultHybridVisitor │ │ │ │ │ + 491 , public StaticTraversal │ │ │ │ │ + 492 , public VisitTree │ │ │ │ │ + 493 { │ │ │ │ │ + 494 template │ │ │ │ │ +495 auto leaf(Tree&&, TreePath, U u) const │ │ │ │ │ + 496 { │ │ │ │ │ + 497 auto path_size = index_constant{}; │ │ │ │ │ + 498 auto depth = Hybrid::plus(path_size,Indices::_1); │ │ │ │ │ + 499 return Hybrid::max(depth,u); │ │ │ │ │ + 500 } │ │ │ │ │ + 501 }; │ │ │ │ │ + 502 │ │ │ │ │ + 504 // result is alwayas an integral constant │ │ │ │ │ + 505 template │ │ │ │ │ +506 auto depth(const Tree& tree) │ │ │ │ │ + 507 { │ │ │ │ │ + 508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0); │ │ │ │ │ + 509 } │ │ │ │ │ + 510 │ │ │ │ │ + 512 // return types is std::integral_constant. │ │ │ │ │ + 513 template │ │ │ │ │ +514 constexpr auto depth() │ │ │ │ │ + 515 { │ │ │ │ │ + 516 return decltype(hybridApplyToTree(std::declval(),DepthVisitor │ │ │ │ │ +{},Indices::_0)){}; │ │ │ │ │ + 517 } │ │ │ │ │ + 518 │ │ │ │ │ + 520 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ + 521 template │ │ │ │ │ +522 auto nodeCount(const Tree& tree) │ │ │ │ │ + 523 { │ │ │ │ │ + 524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0); │ │ │ │ │ + 525 } │ │ │ │ │ + 526 │ │ │ │ │ + 528 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ + 529 template │ │ │ │ │ +530 auto leafCount(const Tree& tree) │ │ │ │ │ + 531 { │ │ │ │ │ + 532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0); │ │ │ │ │ + 533 } │ │ │ │ │ + 534 │ │ │ │ │ + 536 template │ │ │ │ │ +537 constexpr bool isDynamic = std::is_same()))>{}; │ │ │ │ │ + 538 │ │ │ │ │ + 539 } // namespace Experimental::Info │ │ │ │ │ + 540 │ │ │ │ │ + 542 │ │ │ │ │ + 543 } // namespace TypeTree │ │ │ │ │ + 544} //namespace Dune │ │ │ │ │ + 545 │ │ │ │ │ + 546#endif // DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ treepath.hh │ │ │ │ │ -childextraction.hh │ │ │ │ │ -Dune::TypeTree::forEachNode │ │ │ │ │ -void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc │ │ │ │ │ -&&postFunc) │ │ │ │ │ -Traverse tree and visit each node. │ │ │ │ │ -Definition: traversal.hh:256 │ │ │ │ │ -Dune::TypeTree::leafTreePathTuple │ │ │ │ │ -constexpr auto leafTreePathTuple() │ │ │ │ │ -Create tuple of tree paths to leafs. │ │ │ │ │ -Definition: traversal.hh:216 │ │ │ │ │ -Dune::TypeTree::forEachLeafNode │ │ │ │ │ -void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc) │ │ │ │ │ -Traverse tree and visit each leaf node. │ │ │ │ │ -Definition: traversal.hh:304 │ │ │ │ │ -Dune::TypeTree::applyToTree │ │ │ │ │ -void applyToTree(Tree &&tree, Visitor &&visitor) │ │ │ │ │ -Apply visitor to TypeTree. │ │ │ │ │ -Definition: traversal.hh:237 │ │ │ │ │ +utility.hh │ │ │ │ │ Dune::TypeTree::Child │ │ │ │ │ typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ Definition: childextraction.hh:223 │ │ │ │ │ -Dune::TypeTree::child │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: childextraction.hh:126 │ │ │ │ │ -Dune::TypeTree::degree │ │ │ │ │ -std::size_t degree(const Node &node) │ │ │ │ │ -Returns the degree of node as run time information. │ │ │ │ │ -Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::push_back │ │ │ │ │ -constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t i) │ │ │ │ │ -Appends a run time index to a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:281 │ │ │ │ │ -Dune::TypeTree::hybridTreePath │ │ │ │ │ -constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:180 │ │ │ │ │ -Dune::TypeTree::treePath │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:191 │ │ │ │ │ -Dune::TypeTree::TreePath │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -Definition: treepath.hh:521 │ │ │ │ │ +Dune::TypeTree::treePathSize │ │ │ │ │ +constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ +Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:199 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::Detail::forEachNode │ │ │ │ │ -void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc │ │ │ │ │ -&&leafFunc, PostFunc &&postFunc) │ │ │ │ │ -Definition: traversal.hh:162 │ │ │ │ │ -Dune::TypeTree::Detail::DynamicTraversalConcept │ │ │ │ │ -decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) │ │ │ │ │ -DynamicTraversalConcept │ │ │ │ │ -Definition: traversal.hh:41 │ │ │ │ │ -Dune::TypeTree::Detail::StaticTraversalConcept │ │ │ │ │ -decltype((std::integral_constant< std::size_t, Tree::degree()>{})) │ │ │ │ │ -StaticTraversalConcept │ │ │ │ │ -Definition: traversal.hh:47 │ │ │ │ │ -Dune::TypeTree::Detail::applyToTree │ │ │ │ │ -void applyToTree(T &&tree, TreePath treePath, V &&visitor) │ │ │ │ │ -Definition: traversal.hh:95 │ │ │ │ │ -Dune::TypeTree::Detail::leafTreePathTuple │ │ │ │ │ -constexpr auto leafTreePathTuple(Prefix prefix) │ │ │ │ │ -Definition: traversal.hh:52 │ │ │ │ │ +Dune::TypeTree::Experimental::hybridApplyToTree │ │ │ │ │ +auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ +Apply hybrid visitor to TypeTree. │ │ │ │ │ +Definition: accumulate_static.hh:698 │ │ │ │ │ Dune::TypeTree::TreePathType::Type │ │ │ │ │ Type │ │ │ │ │ Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::TreePathType::fullyStatic │ │ │ │ │ +@ fullyStatic │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ @ dynamic │ │ │ │ │ Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::isDynamic │ │ │ │ │ +constexpr bool isDynamic │ │ │ │ │ +true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ +Definition: visitor.hh:537 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::leafCount │ │ │ │ │ +auto leafCount(const Tree &tree) │ │ │ │ │ +The number of leaf nodes in the Tree. │ │ │ │ │ +Definition: visitor.hh:530 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::nodeCount │ │ │ │ │ +auto nodeCount(const Tree &tree) │ │ │ │ │ +The total number of nodes in the Tree. │ │ │ │ │ +Definition: visitor.hh:522 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::depth │ │ │ │ │ +auto depth(const Tree &tree) │ │ │ │ │ +The depth of the TypeTree. │ │ │ │ │ +Definition: visitor.hh:506 │ │ │ │ │ Dune::TypeTree::HybridTreePath │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ Definition: treepath.hh:79 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor │ │ │ │ │ +Visitor interface and base class for TypeTree visitors. │ │ │ │ │ +Definition: visitor.hh:47 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor::in │ │ │ │ │ +void in(T &&, TreePath) const │ │ │ │ │ +Method for infix tree traversal. │ │ │ │ │ +Definition: visitor.hh:70 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor::afterChild │ │ │ │ │ +void afterChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ +Method for child-parent traversal. │ │ │ │ │ +Definition: visitor.hh:120 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor::beforeChild │ │ │ │ │ +void beforeChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ +Method for parent-child traversal. │ │ │ │ │ +Definition: visitor.hh:105 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor::post │ │ │ │ │ +void post(T &&, TreePath) const │ │ │ │ │ +Method for postfix tree traversal. │ │ │ │ │ +Definition: visitor.hh:81 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor::leaf │ │ │ │ │ +void leaf(T &&, TreePath) const │ │ │ │ │ +Method for leaf traversal. │ │ │ │ │ +Definition: visitor.hh:91 │ │ │ │ │ +Dune::TypeTree::DefaultVisitor::pre │ │ │ │ │ +void pre(T &&, TreePath) const │ │ │ │ │ +Method for prefix tree traversal. │ │ │ │ │ +Definition: visitor.hh:58 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor │ │ │ │ │ +Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ +Definition: visitor.hh:162 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor::leaf │ │ │ │ │ +void leaf(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for leaf traversal. │ │ │ │ │ +Definition: visitor.hh:214 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor::beforeChild │ │ │ │ │ +void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) │ │ │ │ │ +const │ │ │ │ │ +Method for parent-child traversal. │ │ │ │ │ +Definition: visitor.hh:230 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor::pre │ │ │ │ │ +void pre(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for prefix tree traversal. │ │ │ │ │ +Definition: visitor.hh:174 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor::post │ │ │ │ │ +void post(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for postfix traversal. │ │ │ │ │ +Definition: visitor.hh:199 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor::in │ │ │ │ │ +void in(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for infix tree traversal. │ │ │ │ │ +Definition: visitor.hh:187 │ │ │ │ │ +Dune::TypeTree::DefaultPairVisitor::afterChild │ │ │ │ │ +void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const │ │ │ │ │ +Method for child-parent traversal. │ │ │ │ │ +Definition: visitor.hh:246 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor │ │ │ │ │ +Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ │ +Definition: visitor.hh:284 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor::post │ │ │ │ │ +auto post(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for postfix tree traversal. │ │ │ │ │ +Definition: visitor.hh:314 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor::pre │ │ │ │ │ +auto pre(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for prefix tree traversal. │ │ │ │ │ +Definition: visitor.hh:294 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor::leaf │ │ │ │ │ +auto leaf(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for leaf traversal. │ │ │ │ │ +Definition: visitor.hh:324 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor::afterChild │ │ │ │ │ +auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ +Method for child-parent traversal. │ │ │ │ │ +Definition: visitor.hh:344 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor::in │ │ │ │ │ +auto in(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for infix tree traversal. │ │ │ │ │ +Definition: visitor.hh:304 │ │ │ │ │ +Dune::TypeTree::Experimental::DefaultHybridVisitor::beforeChild │ │ │ │ │ +auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ +Method for parent-child traversal. │ │ │ │ │ +Definition: visitor.hh:334 │ │ │ │ │ +Dune::TypeTree::VisitDirectChildren │ │ │ │ │ +Mixin base class for visitors that only want to visit the direct children of a │ │ │ │ │ +node. │ │ │ │ │ +Definition: visitor.hh:356 │ │ │ │ │ +Dune::TypeTree::VisitDirectChildren::VisitChild │ │ │ │ │ +Template struct for determining whether or not to visit a given child. │ │ │ │ │ +Definition: visitor.hh:368 │ │ │ │ │ +Dune::TypeTree::VisitDirectChildren::VisitChild::value │ │ │ │ │ +static const bool value │ │ │ │ │ +Do not visit any child. │ │ │ │ │ +Definition: visitor.hh:370 │ │ │ │ │ +Dune::TypeTree::VisitTree │ │ │ │ │ +Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ +Definition: visitor.hh:382 │ │ │ │ │ +Dune::TypeTree::VisitTree::VisitChild │ │ │ │ │ +Template struct for determining whether or not to visit a given child. │ │ │ │ │ +Definition: visitor.hh:394 │ │ │ │ │ +Dune::TypeTree::VisitTree::VisitChild::value │ │ │ │ │ +static const bool value │ │ │ │ │ +Visit any child. │ │ │ │ │ +Definition: visitor.hh:396 │ │ │ │ │ +Dune::TypeTree::StaticTraversal │ │ │ │ │ +Mixin base class for visitors that require a static TreePath during traversal. │ │ │ │ │ +Definition: visitor.hh:410 │ │ │ │ │ +Dune::TypeTree::StaticTraversal::treePathType │ │ │ │ │ +static const TreePathType::Type treePathType │ │ │ │ │ +Use the static tree traversal algorithm. │ │ │ │ │ +Definition: visitor.hh:412 │ │ │ │ │ +Dune::TypeTree::DynamicTraversal │ │ │ │ │ +Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ +traversal. │ │ │ │ │ +Definition: visitor.hh:424 │ │ │ │ │ +Dune::TypeTree::DynamicTraversal::treePathType │ │ │ │ │ +static const TreePathType::Type treePathType │ │ │ │ │ +Use the dynamic tree traversal algorithm. │ │ │ │ │ +Definition: visitor.hh:426 │ │ │ │ │ +Dune::TypeTree::TreeVisitor │ │ │ │ │ +Convenience base class for visiting the entire tree. │ │ │ │ │ +Definition: visitor.hh:433 │ │ │ │ │ +Dune::TypeTree::DirectChildrenVisitor │ │ │ │ │ +Convenience base class for visiting the direct children of a node. │ │ │ │ │ +Definition: visitor.hh:439 │ │ │ │ │ +Dune::TypeTree::TreePairVisitor │ │ │ │ │ +Convenience base class for visiting an entire tree pair. │ │ │ │ │ +Definition: visitor.hh:445 │ │ │ │ │ +Dune::TypeTree::DirectChildrenPairVisitor │ │ │ │ │ +Convenience base class for visiting the direct children of a node pair. │ │ │ │ │ +Definition: visitor.hh:451 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::LeafCounterVisitor │ │ │ │ │ +Definition: visitor.hh:459 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::LeafCounterVisitor::leaf │ │ │ │ │ +auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ +Definition: visitor.hh:473 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild │ │ │ │ │ +auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const │ │ │ │ │ +Definition: visitor.hh:461 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild │ │ │ │ │ +std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const │ │ │ │ │ +Definition: visitor.hh:467 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::NodeCounterVisitor │ │ │ │ │ +Definition: visitor.hh:482 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::NodeCounterVisitor::pre │ │ │ │ │ +auto pre(Tree &&, TreePath, U u) const │ │ │ │ │ +Definition: visitor.hh:484 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::DepthVisitor │ │ │ │ │ +Definition: visitor.hh:493 │ │ │ │ │ +Dune::TypeTree::Experimental::Info::DepthVisitor::leaf │ │ │ │ │ +auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ +Definition: visitor.hh:495 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: utility.hh File Reference │ │ │ │ +dune-typetree: powercompositenodetransformationtemplates.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,34 +65,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
utility.hh File Reference
│ │ │ │ +
powercompositenodetransformationtemplates.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <memory>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <algorithm>
│ │ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ +
#include <cstddef>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::TypeTree::TreeInfo< Tree, Tag >
 Struct for obtaining some basic structural information about a TypeTree. More...
struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >
 
struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >
 
struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,30 +5,36 @@ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -utility.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +powercompositenodetransformationtemplates.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TypeTree::TreeInfo<_Tree,_Tag_> │ │ │ │ │ -  Struct for obtaining some basic structural information about a │ │ │ │ │ - TypeTree. More... │ │ │ │ │ +struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::GenericPowerNodeTransformationTemplate<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< │ │ │ │ │ + SourceNode,_Transformation,_TransformedNode_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< │ │ │ │ │ + SourceNode,_Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< │ │ │ │ │ + SourceNode,_Transformation,_TransformedNode_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::GenericCompositeNodeTransformationTemplate< │ │ │ │ │ + SourceNode,_Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00062_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: utility.hh Source File │ │ │ │ +dune-typetree: powercompositenodetransformationtemplates.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,284 +62,77 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
utility.hh
│ │ │ │ +
powercompositenodetransformationtemplates.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_UTILITY_HH
│ │ │ │ -
5#define DUNE_TYPETREE_UTILITY_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ +
5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │
6
│ │ │ │ -
7#include <memory>
│ │ │ │ -
8#include <tuple>
│ │ │ │ -
9#include <type_traits>
│ │ │ │ -
10#include <utility>
│ │ │ │ -
11#include <algorithm>
│ │ │ │ -
12
│ │ │ │ -
13#include <dune/common/shared_ptr.hh>
│ │ │ │ -
14#include <dune/common/indices.hh>
│ │ │ │ -
15#include <dune/common/hybridutilities.hh>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20 namespace TypeTree {
│ │ │ │ -
21
│ │ │ │ -
26#ifndef DOXYGEN
│ │ │ │ -
27
│ │ │ │ -
28 template<typename T>
│ │ │ │ -
29 std::shared_ptr<T> convert_arg(const T& t)
│ │ │ │ -
30 {
│ │ │ │ -
31 return std::make_shared<T>(t);
│ │ │ │ -
32 }
│ │ │ │ -
33
│ │ │ │ -
34 template<typename T>
│ │ │ │ -
35 std::shared_ptr<T> convert_arg(T& t)
│ │ │ │ -
36 {
│ │ │ │ -
37 return stackobject_to_shared_ptr(t);
│ │ │ │ -
38 }
│ │ │ │ +
7#include <cstddef>
│ │ │ │ +
8
│ │ │ │ + │ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12 namespace TypeTree {
│ │ │ │ +
13
│ │ │ │ +
19 template<typename SourceNode, typename Transformation, template<typename,typename,std::size_t> class TransformedNode>
│ │ │ │ + │ │ │ │ +
21 {
│ │ │ │ +
22 template<typename TC>
│ │ │ │ +
23 struct result
│ │ │ │ +
24 {
│ │ │ │ +
25 typedef TransformedNode<SourceNode,TC,StaticDegree<SourceNode>::value> type;
│ │ │ │ +
26 };
│ │ │ │ +
27 };
│ │ │ │ +
28
│ │ │ │ +
29
│ │ │ │ +
30 template<typename SourceNode, typename Transformation, template<typename,typename> class TransformedNode>
│ │ │ │ + │ │ │ │ +
32 {
│ │ │ │ +
33 template<typename TC>
│ │ │ │ +
34 struct result
│ │ │ │ +
35 {
│ │ │ │ +
36 typedef TransformedNode<SourceNode,TC> type;
│ │ │ │ +
37 };
│ │ │ │ +
38 };
│ │ │ │
39
│ │ │ │ -
40 template<typename BaseType, typename T>
│ │ │ │ -
41 T& assertGridViewType(T& t)
│ │ │ │ +
40 template<typename SourceNode, typename Transformation, template<typename,typename...> class TransformedNode>
│ │ │ │ + │ │ │ │
42 {
│ │ │ │ -
43 static_assert((std::is_same<typename BaseType::Traits::GridViewType,
│ │ │ │ -
44 typename T::Traits::GridViewType>::value),
│ │ │ │ -
45 "GridViewType must be equal in all components of composite type");
│ │ │ │ -
46 return t;
│ │ │ │ -
47 }
│ │ │ │ -
48
│ │ │ │ -
49 // only bind to real rvalues
│ │ │ │ -
50 template<typename T>
│ │ │ │ -
51 typename std::enable_if<!std::is_lvalue_reference<T>::value,std::shared_ptr<T> >::type convert_arg(T&& t)
│ │ │ │ -
52 {
│ │ │ │ -
53 return std::make_shared<T>(std::forward<T>(t));
│ │ │ │ -
54 }
│ │ │ │ -
55
│ │ │ │ -
56
│ │ │ │ -
57 namespace Experimental {
│ │ │ │ -
58
│ │ │ │ -
67 template<class BinaryOp, class Arg>
│ │ │ │ -
68 constexpr decltype(auto)
│ │ │ │ -
69 left_fold(BinaryOp&& binary_op, Arg&& arg)
│ │ │ │ -
70 {
│ │ │ │ -
71 return std::forward<Arg>(arg);
│ │ │ │ -
72 }
│ │ │ │ -
73
│ │ │ │ -
95 template<class BinaryOp, class Init, class Arg0, class... Args>
│ │ │ │ -
96 constexpr decltype(auto)
│ │ │ │ -
97 left_fold(BinaryOp&& binary_op, Init&& init, Arg0&& arg_0, Args&&... args)
│ │ │ │ -
98 {
│ │ │ │ -
99 return left_fold(
│ │ │ │ -
100 std::forward<BinaryOp>(binary_op),
│ │ │ │ -
101 binary_op(std::forward<Init>(init), std::forward<Arg0>(arg_0)),
│ │ │ │ -
102 std::forward<Args>(args)...);
│ │ │ │ -
103 }
│ │ │ │ -
104
│ │ │ │ -
105
│ │ │ │ -
106 namespace Hybrid {
│ │ │ │ -
107 using namespace Dune::Hybrid;
│ │ │ │ -
108
│ │ │ │ -
109 namespace Detail {
│ │ │ │ -
110 template<class Op, class... Args>
│ │ │ │ -
111 constexpr auto applyOperator(Op&& op, Args&&... args)
│ │ │ │ -
112 {
│ │ │ │ -
113 using T = std::common_type_t<Args...>;
│ │ │ │ -
114 return op(static_cast<T>(args)...);
│ │ │ │ -
115 }
│ │ │ │ -
116
│ │ │ │ -
117 template<class Op, class T, T... Args>
│ │ │ │ -
118 constexpr auto applyOperator(Op, std::integral_constant<T,Args>...)
│ │ │ │ -
119 {
│ │ │ │ -
120 static_assert(std::is_default_constructible_v<Op>,
│ │ │ │ -
121 "Operator in integral expressions shall be default constructible");
│ │ │ │ -
122 constexpr auto result = Op{}(T{Args}...);
│ │ │ │ -
123 return std::integral_constant<std::decay_t<decltype(result)>,result>{};
│ │ │ │ -
124 }
│ │ │ │ -
125
│ │ │ │ -
126 // FIXME: use lambda when we adpot c++20
│ │ │ │ -
127 struct Max {
│ │ │ │ -
128 template<class... Args>
│ │ │ │ -
129 constexpr auto operator()(Args&&... args) const
│ │ │ │ -
130 {
│ │ │ │ -
131 using T = std::common_type_t<Args...>;
│ │ │ │ -
132 return std::max({static_cast<T>(args)...});
│ │ │ │ -
133 }
│ │ │ │ -
134 };
│ │ │ │ -
135 }
│ │ │ │ -
136
│ │ │ │ -
137 static constexpr auto max = [](const auto& a, const auto& b)
│ │ │ │ -
138 {
│ │ │ │ -
139 return Detail::applyOperator(Detail::Max{}, a, b);
│ │ │ │ -
140 };
│ │ │ │ -
141
│ │ │ │ -
142 static constexpr auto plus = [](const auto& a, const auto& b)
│ │ │ │ -
143 {
│ │ │ │ -
144 return Detail::applyOperator(std::plus<>{}, a, b);
│ │ │ │ -
145 };
│ │ │ │ -
146
│ │ │ │ -
147 static constexpr auto minus = [](const auto& a, const auto& b)
│ │ │ │ -
148 {
│ │ │ │ -
149 return Detail::applyOperator(std::minus<>{}, a, b);
│ │ │ │ -
150 };
│ │ │ │ -
151 } // namespace Hybrid
│ │ │ │ -
152
│ │ │ │ -
153 } // namespace Experimental
│ │ │ │ -
154
│ │ │ │ -
155
│ │ │ │ -
156#endif // DOXYGEN
│ │ │ │ -
157
│ │ │ │ -
159
│ │ │ │ -
166 template<typename Tree, typename Tag = StartTag>
│ │ │ │ -
167 struct TreeInfo
│ │ │ │ -
168 {
│ │ │ │ -
169
│ │ │ │ -
170 private:
│ │ │ │ -
171 // Start the tree traversal
│ │ │ │ - │ │ │ │ -
173
│ │ │ │ -
174 public:
│ │ │ │ -
175
│ │ │ │ -
177 static const std::size_t depth = NodeInfo::depth;
│ │ │ │ -
178
│ │ │ │ -
180 static const std::size_t nodeCount = NodeInfo::nodeCount;
│ │ │ │ -
181
│ │ │ │ -
183 static const std::size_t leafCount = NodeInfo::leafCount;
│ │ │ │ -
184
│ │ │ │ -
185 };
│ │ │ │ -
186
│ │ │ │ -
187
│ │ │ │ -
188#ifndef DOXYGEN
│ │ │ │ -
189
│ │ │ │ -
190 // ********************************************************************************
│ │ │ │ -
191 // TreeInfo specializations for the different node types
│ │ │ │ -
192 // ********************************************************************************
│ │ │ │ -
193
│ │ │ │ -
194
│ │ │ │ -
195 // leaf node
│ │ │ │ -
196 template<typename Node>
│ │ │ │ -
197 struct TreeInfo<Node,LeafNodeTag>
│ │ │ │ -
198 {
│ │ │ │ -
199
│ │ │ │ -
200 static const std::size_t depth = 1;
│ │ │ │ -
201
│ │ │ │ -
202 static const std::size_t nodeCount = 1;
│ │ │ │ -
203
│ │ │ │ -
204 static const std::size_t leafCount = 1;
│ │ │ │ -
205
│ │ │ │ -
206 };
│ │ │ │ -
207
│ │ │ │ -
208
│ │ │ │ -
209 // power node - exploit the fact that all children are identical
│ │ │ │ -
210 template<typename Node>
│ │ │ │ -
211 struct TreeInfo<Node,PowerNodeTag>
│ │ │ │ -
212 {
│ │ │ │ -
213
│ │ │ │ -
214 typedef TreeInfo<typename Node::ChildType,NodeTag<typename Node::ChildType>> ChildInfo;
│ │ │ │ -
215
│ │ │ │ -
216 static const std::size_t depth = 1 + ChildInfo::depth;
│ │ │ │ -
217
│ │ │ │ -
218 static const std::size_t nodeCount = 1 + StaticDegree<Node>::value * ChildInfo::nodeCount;
│ │ │ │ -
219
│ │ │ │ -
220 static const std::size_t leafCount = StaticDegree<Node>::value * ChildInfo::leafCount;
│ │ │ │ -
221
│ │ │ │ -
222 };
│ │ │ │ -
223
│ │ │ │ -
224
│ │ │ │ -
225 namespace {
│ │ │ │ -
226
│ │ │ │ -
227 // TMP for iterating over the children of a composite node
│ │ │ │ -
228 // identical for both composite node implementations
│ │ │ │ -
229 template<typename Node, std::size_t k, std::size_t n>
│ │ │ │ -
230 struct generic_compositenode_children_info
│ │ │ │ -
231 {
│ │ │ │ -
232
│ │ │ │ -
233 typedef generic_compositenode_children_info<Node,k+1,n> NextChild;
│ │ │ │ -
234
│ │ │ │ -
235 // extract child info
│ │ │ │ -
236 typedef typename Node::template Child<k>::Type Child;
│ │ │ │ -
237 typedef NodeTag<Child> ChildTag;
│ │ │ │ -
238 typedef TreeInfo<Child,ChildTag> ChildInfo;
│ │ │ │ -
239
│ │ │ │ -
240 // combine information of current child with info about following children
│ │ │ │ -
241 static const std::size_t maxDepth = ChildInfo::depth > NextChild::maxDepth ? ChildInfo::depth : NextChild::maxDepth;
│ │ │ │ -
242
│ │ │ │ -
243 static const std::size_t nodeCount = ChildInfo::nodeCount + NextChild::nodeCount;
│ │ │ │ -
244
│ │ │ │ -
245 static const std::size_t leafCount = ChildInfo::leafCount + NextChild::leafCount;
│ │ │ │ -
246
│ │ │ │ -
247 };
│ │ │ │ -
248
│ │ │ │ -
249 // End of recursion
│ │ │ │ -
250 template<typename Node, std::size_t n>
│ │ │ │ -
251 struct generic_compositenode_children_info<Node,n,n>
│ │ │ │ -
252 {
│ │ │ │ -
253 static const std::size_t maxDepth = 0;
│ │ │ │ -
254
│ │ │ │ -
255 static const std::size_t nodeCount = 0;
│ │ │ │ -
256
│ │ │ │ -
257 static const std::size_t leafCount = 0;
│ │ │ │ -
258 };
│ │ │ │ -
259
│ │ │ │ -
260 } // anonymous namespace
│ │ │ │ -
261
│ │ │ │ -
262
│ │ │ │ -
263 // Struct for building information about composite node
│ │ │ │ -
264 template<typename Node>
│ │ │ │ -
265 struct GenericCompositeNodeInfo
│ │ │ │ -
266 {
│ │ │ │ -
267
│ │ │ │ -
268 typedef generic_compositenode_children_info<Node,0,StaticDegree<Node>::value> Children;
│ │ │ │ -
269
│ │ │ │ -
270 static const std::size_t depth = 1 + Children::maxDepth;
│ │ │ │ -
271
│ │ │ │ -
272 static const std::size_t nodeCount = 1 + Children::nodeCount;
│ │ │ │ -
273
│ │ │ │ -
274 static const std::size_t leafCount = Children::leafCount;
│ │ │ │ -
275
│ │ │ │ -
276 };
│ │ │ │ -
277
│ │ │ │ -
278
│ │ │ │ -
279 // CompositeNode: delegate to GenericCompositeNodeInfo
│ │ │ │ -
280 template<typename Node>
│ │ │ │ -
281 struct TreeInfo<Node,CompositeNodeTag>
│ │ │ │ -
282 : public GenericCompositeNodeInfo<Node>
│ │ │ │ -
283 {};
│ │ │ │ -
284
│ │ │ │ -
285
│ │ │ │ -
286#endif // DOXYGEN
│ │ │ │ -
287
│ │ │ │ -
288
│ │ │ │ -
289 using Dune::index_constant;
│ │ │ │ -
290 namespace Indices = Dune::Indices;
│ │ │ │ -
291
│ │ │ │ -
293
│ │ │ │ -
294 } // namespace TypeTree
│ │ │ │ -
295} //namespace Dune
│ │ │ │ -
296
│ │ │ │ -
297#endif // DUNE_TYPETREE_UTILITY_HH
│ │ │ │ - │ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │ - │ │ │ │ -
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │ +
43 template<typename... TC>
│ │ │ │ +
44 struct result
│ │ │ │ +
45 {
│ │ │ │ +
46 typedef TransformedNode<SourceNode,TC...> type;
│ │ │ │ +
47 };
│ │ │ │ +
48 };
│ │ │ │ +
49
│ │ │ │ +
51
│ │ │ │ +
52 } // namespace TypeTree
│ │ │ │ +
53} //namespace Dune
│ │ │ │ +
54
│ │ │ │ +
55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ + │ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Type
Definition: treepath.hh:30
│ │ │ │ -
auto leafCount(const Tree &tree)
The number of leaf nodes in the Tree.
Definition: visitor.hh:530
│ │ │ │ -
auto nodeCount(const Tree &tree)
The total number of nodes in the Tree.
Definition: visitor.hh:522
│ │ │ │ -
auto depth(const Tree &tree)
The depth of the TypeTree.
Definition: visitor.hh:506
│ │ │ │ -
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ -
Struct for obtaining some basic structural information about a TypeTree.
Definition: utility.hh:168
│ │ │ │ -
static const std::size_t leafCount
The number of leaf nodes in the TypeTree.
Definition: utility.hh:183
│ │ │ │ -
static const std::size_t depth
The depth of the TypeTree.
Definition: utility.hh:177
│ │ │ │ -
static const std::size_t nodeCount
The total number of nodes in the TypeTree.
Definition: utility.hh:180
│ │ │ │ +
Definition: powercompositenodetransformationtemplates.hh:21
│ │ │ │ +
Definition: powercompositenodetransformationtemplates.hh:24
│ │ │ │ +
TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type
Definition: powercompositenodetransformationtemplates.hh:25
│ │ │ │ +
Definition: powercompositenodetransformationtemplates.hh:32
│ │ │ │ +
Definition: powercompositenodetransformationtemplates.hh:35
│ │ │ │ +
TransformedNode< SourceNode, TC > type
Definition: powercompositenodetransformationtemplates.hh:36
│ │ │ │ +
Definition: powercompositenodetransformationtemplates.hh:42
│ │ │ │ +
Definition: powercompositenodetransformationtemplates.hh:45
│ │ │ │ +
TransformedNode< SourceNode, TC... > type
Definition: powercompositenodetransformationtemplates.hh:46
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,321 +4,88 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -utility.hh │ │ │ │ │ +powercompositenodetransformationtemplates.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12 │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18 │ │ │ │ │ - 19namespace Dune { │ │ │ │ │ - 20 namespace TypeTree { │ │ │ │ │ - 21 │ │ │ │ │ - 26#ifndef DOXYGEN │ │ │ │ │ - 27 │ │ │ │ │ - 28 template │ │ │ │ │ - 29 std::shared_ptr convert_arg(const T& t) │ │ │ │ │ - 30 { │ │ │ │ │ - 31 return std::make_shared(t); │ │ │ │ │ - 32 } │ │ │ │ │ - 33 │ │ │ │ │ - 34 template │ │ │ │ │ - 35 std::shared_ptr convert_arg(T& t) │ │ │ │ │ - 36 { │ │ │ │ │ - 37 return stackobject_to_shared_ptr(t); │ │ │ │ │ - 38 } │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11namespace Dune { │ │ │ │ │ + 12 namespace TypeTree { │ │ │ │ │ + 13 │ │ │ │ │ + 19 template class TransformedNode> │ │ │ │ │ +20 struct GenericPowerNodeTransformationTemplate │ │ │ │ │ + 21 { │ │ │ │ │ + 22 template │ │ │ │ │ +23 struct result │ │ │ │ │ + 24 { │ │ │ │ │ +25 typedef TransformedNode::value> type; │ │ │ │ │ + 26 }; │ │ │ │ │ + 27 }; │ │ │ │ │ + 28 │ │ │ │ │ + 29 │ │ │ │ │ + 30 template class TransformedNode> │ │ │ │ │ +31 struct GenericDynamicPowerNodeTransformationTemplate │ │ │ │ │ + 32 { │ │ │ │ │ + 33 template │ │ │ │ │ +34 struct result │ │ │ │ │ + 35 { │ │ │ │ │ +36 typedef TransformedNode type; │ │ │ │ │ + 37 }; │ │ │ │ │ + 38 }; │ │ │ │ │ 39 │ │ │ │ │ - 40 template │ │ │ │ │ - 41 T& assertGridViewType(T& t) │ │ │ │ │ + 40 template class TransformedNode> │ │ │ │ │ +41 struct GenericCompositeNodeTransformationTemplate │ │ │ │ │ 42 { │ │ │ │ │ - 43 static_assert((std::is_same::value), │ │ │ │ │ - 45 "GridViewType must be equal in all components of composite type"); │ │ │ │ │ - 46 return t; │ │ │ │ │ - 47 } │ │ │ │ │ - 48 │ │ │ │ │ - 49 // only bind to real rvalues │ │ │ │ │ - 50 template │ │ │ │ │ - 51 typename std::enable_if::value,std:: │ │ │ │ │ -shared_ptr >::type convert_arg(T&& t) │ │ │ │ │ - 52 { │ │ │ │ │ - 53 return std::make_shared(std::forward(t)); │ │ │ │ │ - 54 } │ │ │ │ │ - 55 │ │ │ │ │ - 56 │ │ │ │ │ - 57 namespace Experimental { │ │ │ │ │ - 58 │ │ │ │ │ - 67 template │ │ │ │ │ - 68 constexpr decltype(auto) │ │ │ │ │ - 69 left_fold(BinaryOp&& binary_op, Arg&& arg) │ │ │ │ │ - 70 { │ │ │ │ │ - 71 return std::forward(arg); │ │ │ │ │ - 72 } │ │ │ │ │ - 73 │ │ │ │ │ - 95 template │ │ │ │ │ - 96 constexpr decltype(auto) │ │ │ │ │ - 97 left_fold(BinaryOp&& binary_op, Init&& init, Arg0&& arg_0, Args&&... args) │ │ │ │ │ - 98 { │ │ │ │ │ - 99 return left_fold( │ │ │ │ │ - 100 std::forward(binary_op), │ │ │ │ │ - 101 binary_op(std::forward(init), std::forward(arg_0)), │ │ │ │ │ - 102 std::forward(args)...); │ │ │ │ │ - 103 } │ │ │ │ │ - 104 │ │ │ │ │ - 105 │ │ │ │ │ - 106 namespace Hybrid { │ │ │ │ │ - 107 using namespace Dune::Hybrid; │ │ │ │ │ - 108 │ │ │ │ │ - 109 namespace Detail { │ │ │ │ │ - 110 template │ │ │ │ │ - 111 constexpr auto applyOperator(Op&& op, Args&&... args) │ │ │ │ │ - 112 { │ │ │ │ │ - 113 using T = std::common_type_t; │ │ │ │ │ - 114 return op(static_cast(args)...); │ │ │ │ │ - 115 } │ │ │ │ │ - 116 │ │ │ │ │ - 117 template │ │ │ │ │ - 118 constexpr auto applyOperator(Op, std::integral_constant...) │ │ │ │ │ - 119 { │ │ │ │ │ - 120 static_assert(std::is_default_constructible_v, │ │ │ │ │ - 121 "Operator in integral expressions shall be default constructible"); │ │ │ │ │ - 122 constexpr auto result = Op{}(T{Args}...); │ │ │ │ │ - 123 return std::integral_constant,result>{}; │ │ │ │ │ - 124 } │ │ │ │ │ - 125 │ │ │ │ │ - 126 // FIXME: use lambda when we adpot c++20 │ │ │ │ │ - 127 struct Max { │ │ │ │ │ - 128 template │ │ │ │ │ - 129 constexpr auto operator()(Args&&... args) const │ │ │ │ │ - 130 { │ │ │ │ │ - 131 using T = std::common_type_t; │ │ │ │ │ - 132 return std::max({static_cast(args)...}); │ │ │ │ │ - 133 } │ │ │ │ │ - 134 }; │ │ │ │ │ - 135 } │ │ │ │ │ - 136 │ │ │ │ │ - 137 static constexpr auto max = [](const auto& a, const auto& b) │ │ │ │ │ - 138 { │ │ │ │ │ - 139 return Detail::applyOperator(Detail::Max{}, a, b); │ │ │ │ │ - 140 }; │ │ │ │ │ - 141 │ │ │ │ │ - 142 static constexpr auto plus = [](const auto& a, const auto& b) │ │ │ │ │ - 143 { │ │ │ │ │ - 144 return Detail::applyOperator(std::plus<>{}, a, b); │ │ │ │ │ - 145 }; │ │ │ │ │ - 146 │ │ │ │ │ - 147 static constexpr auto minus = [](const auto& a, const auto& b) │ │ │ │ │ - 148 { │ │ │ │ │ - 149 return Detail::applyOperator(std::minus<>{}, a, b); │ │ │ │ │ - 150 }; │ │ │ │ │ - 151 } // namespace Hybrid │ │ │ │ │ - 152 │ │ │ │ │ - 153 } // namespace Experimental │ │ │ │ │ - 154 │ │ │ │ │ - 155 │ │ │ │ │ - 156#endif // DOXYGEN │ │ │ │ │ - 157 │ │ │ │ │ - 159 │ │ │ │ │ - 166 template │ │ │ │ │ -167 struct TreeInfo │ │ │ │ │ - 168 { │ │ │ │ │ - 169 │ │ │ │ │ - 170 private: │ │ │ │ │ - 171 // Start the tree traversal │ │ │ │ │ - 172 typedef TreeInfo> NodeInfo; │ │ │ │ │ - 173 │ │ │ │ │ - 174 public: │ │ │ │ │ - 175 │ │ │ │ │ -177 static const std::size_t depth = NodeInfo::depth; │ │ │ │ │ - 178 │ │ │ │ │ -180 static const std::size_t nodeCount = NodeInfo::nodeCount; │ │ │ │ │ - 181 │ │ │ │ │ -183 static const std::size_t leafCount = NodeInfo::leafCount; │ │ │ │ │ - 184 │ │ │ │ │ - 185 }; │ │ │ │ │ - 186 │ │ │ │ │ - 187 │ │ │ │ │ - 188#ifndef DOXYGEN │ │ │ │ │ - 189 │ │ │ │ │ - 190 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 191 // TreeInfo specializations for the different node types │ │ │ │ │ - 192 / │ │ │ │ │ -/ │ │ │ │ │ -******************************************************************************** │ │ │ │ │ - 193 │ │ │ │ │ - 194 │ │ │ │ │ - 195 // leaf node │ │ │ │ │ - 196 template │ │ │ │ │ - 197 struct TreeInfo │ │ │ │ │ - 198 { │ │ │ │ │ - 199 │ │ │ │ │ - 200 static const std::size_t depth = 1; │ │ │ │ │ - 201 │ │ │ │ │ - 202 static const std::size_t nodeCount = 1; │ │ │ │ │ - 203 │ │ │ │ │ - 204 static const std::size_t leafCount = 1; │ │ │ │ │ - 205 │ │ │ │ │ - 206 }; │ │ │ │ │ - 207 │ │ │ │ │ - 208 │ │ │ │ │ - 209 // power node - exploit the fact that all children are identical │ │ │ │ │ - 210 template │ │ │ │ │ - 211 struct TreeInfo │ │ │ │ │ - 212 { │ │ │ │ │ - 213 │ │ │ │ │ - 214 typedef TreeInfo> ChildInfo; │ │ │ │ │ - 215 │ │ │ │ │ - 216 static const std::size_t depth = 1 + ChildInfo::depth; │ │ │ │ │ - 217 │ │ │ │ │ - 218 static const std::size_t nodeCount = 1 + StaticDegree::value * │ │ │ │ │ -ChildInfo::nodeCount; │ │ │ │ │ - 219 │ │ │ │ │ - 220 static const std::size_t leafCount = StaticDegree::value * │ │ │ │ │ -ChildInfo::leafCount; │ │ │ │ │ - 221 │ │ │ │ │ - 222 }; │ │ │ │ │ - 223 │ │ │ │ │ - 224 │ │ │ │ │ - 225 namespace { │ │ │ │ │ - 226 │ │ │ │ │ - 227 // TMP for iterating over the children of a composite node │ │ │ │ │ - 228 // identical for both composite node implementations │ │ │ │ │ - 229 template │ │ │ │ │ - 230 struct generic_compositenode_children_info │ │ │ │ │ - 231 { │ │ │ │ │ - 232 │ │ │ │ │ - 233 typedef generic_compositenode_children_info NextChild; │ │ │ │ │ - 234 │ │ │ │ │ - 235 // extract child info │ │ │ │ │ - 236 typedef typename Node::template Child::Type Child; │ │ │ │ │ - 237 typedef NodeTag ChildTag; │ │ │ │ │ - 238 typedef TreeInfo ChildInfo; │ │ │ │ │ - 239 │ │ │ │ │ - 240 // combine information of current child with info about following children │ │ │ │ │ - 241 static const std::size_t maxDepth = ChildInfo::depth > NextChild::maxDepth │ │ │ │ │ -? ChildInfo::depth : NextChild::maxDepth; │ │ │ │ │ - 242 │ │ │ │ │ - 243 static const std::size_t nodeCount = ChildInfo::nodeCount + NextChild:: │ │ │ │ │ -nodeCount; │ │ │ │ │ - 244 │ │ │ │ │ - 245 static const std::size_t leafCount = ChildInfo::leafCount + NextChild:: │ │ │ │ │ -leafCount; │ │ │ │ │ - 246 │ │ │ │ │ - 247 }; │ │ │ │ │ - 248 │ │ │ │ │ - 249 // End of recursion │ │ │ │ │ - 250 template │ │ │ │ │ - 251 struct generic_compositenode_children_info │ │ │ │ │ - 252 { │ │ │ │ │ - 253 static const std::size_t maxDepth = 0; │ │ │ │ │ - 254 │ │ │ │ │ - 255 static const std::size_t nodeCount = 0; │ │ │ │ │ - 256 │ │ │ │ │ - 257 static const std::size_t leafCount = 0; │ │ │ │ │ - 258 }; │ │ │ │ │ - 259 │ │ │ │ │ - 260 } // anonymous namespace │ │ │ │ │ - 261 │ │ │ │ │ - 262 │ │ │ │ │ - 263 // Struct for building information about composite node │ │ │ │ │ - 264 template │ │ │ │ │ - 265 struct GenericCompositeNodeInfo │ │ │ │ │ - 266 { │ │ │ │ │ - 267 │ │ │ │ │ - 268 typedef generic_compositenode_children_info:: │ │ │ │ │ -value> Children; │ │ │ │ │ - 269 │ │ │ │ │ - 270 static const std::size_t depth = 1 + Children::maxDepth; │ │ │ │ │ - 271 │ │ │ │ │ - 272 static const std::size_t nodeCount = 1 + Children::nodeCount; │ │ │ │ │ - 273 │ │ │ │ │ - 274 static const std::size_t leafCount = Children::leafCount; │ │ │ │ │ - 275 │ │ │ │ │ - 276 }; │ │ │ │ │ - 277 │ │ │ │ │ - 278 │ │ │ │ │ - 279 // CompositeNode: delegate to GenericCompositeNodeInfo │ │ │ │ │ - 280 template │ │ │ │ │ - 281 struct TreeInfo │ │ │ │ │ - 282 : public GenericCompositeNodeInfo │ │ │ │ │ - 283 {}; │ │ │ │ │ - 284 │ │ │ │ │ - 285 │ │ │ │ │ - 286#endif // DOXYGEN │ │ │ │ │ - 287 │ │ │ │ │ - 288 │ │ │ │ │ - 289 using Dune::index_constant; │ │ │ │ │ - 290 namespace Indices = Dune::Indices; │ │ │ │ │ - 291 │ │ │ │ │ - 293 │ │ │ │ │ - 294 } // namespace TypeTree │ │ │ │ │ - 295} //namespace Dune │ │ │ │ │ - 296 │ │ │ │ │ - 297#endif // DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ -result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:110 │ │ │ │ │ + 43 template │ │ │ │ │ +44 struct result │ │ │ │ │ + 45 { │ │ │ │ │ +46 typedef TransformedNode type; │ │ │ │ │ + 47 }; │ │ │ │ │ + 48 }; │ │ │ │ │ + 49 │ │ │ │ │ + 51 │ │ │ │ │ + 52 } // namespace TypeTree │ │ │ │ │ + 53} //namespace Dune │ │ │ │ │ + 54 │ │ │ │ │ + 55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ nodeinterface.hh │ │ │ │ │ -Dune::TypeTree::Child │ │ │ │ │ -typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ -Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ -Definition: childextraction.hh:223 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::TreePathType::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::leafCount │ │ │ │ │ -auto leafCount(const Tree &tree) │ │ │ │ │ -The number of leaf nodes in the Tree. │ │ │ │ │ -Definition: visitor.hh:530 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::nodeCount │ │ │ │ │ -auto nodeCount(const Tree &tree) │ │ │ │ │ -The total number of nodes in the Tree. │ │ │ │ │ -Definition: visitor.hh:522 │ │ │ │ │ -Dune::TypeTree::Experimental::Info::depth │ │ │ │ │ -auto depth(const Tree &tree) │ │ │ │ │ -The depth of the TypeTree. │ │ │ │ │ -Definition: visitor.hh:506 │ │ │ │ │ -Dune::TypeTree::LeafNodeTag │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -Definition: nodetags.hh:16 │ │ │ │ │ -Dune::TypeTree::TreeInfo │ │ │ │ │ -Struct for obtaining some basic structural information about a TypeTree. │ │ │ │ │ -Definition: utility.hh:168 │ │ │ │ │ -Dune::TypeTree::TreeInfo::leafCount │ │ │ │ │ -static const std::size_t leafCount │ │ │ │ │ -The number of leaf nodes in the TypeTree. │ │ │ │ │ -Definition: utility.hh:183 │ │ │ │ │ -Dune::TypeTree::TreeInfo::depth │ │ │ │ │ -static const std::size_t depth │ │ │ │ │ -The depth of the TypeTree. │ │ │ │ │ -Definition: utility.hh:177 │ │ │ │ │ -Dune::TypeTree::TreeInfo::nodeCount │ │ │ │ │ -static const std::size_t nodeCount │ │ │ │ │ -The total number of nodes in the TypeTree. │ │ │ │ │ -Definition: utility.hh:180 │ │ │ │ │ +Dune::TypeTree::GenericPowerNodeTransformationTemplate │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:21 │ │ │ │ │ +Dune::TypeTree::GenericPowerNodeTransformationTemplate::result │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:24 │ │ │ │ │ +Dune::TypeTree::GenericPowerNodeTransformationTemplate::result::type │ │ │ │ │ +TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:25 │ │ │ │ │ +Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:32 │ │ │ │ │ +Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:35 │ │ │ │ │ +Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result::type │ │ │ │ │ +TransformedNode< SourceNode, TC > type │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:36 │ │ │ │ │ +Dune::TypeTree::GenericCompositeNodeTransformationTemplate │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:42 │ │ │ │ │ +Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:45 │ │ │ │ │ +Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result::type │ │ │ │ │ +TransformedNode< SourceNode, TC... > type │ │ │ │ │ +Definition: powercompositenodetransformationtemplates.hh:46 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treepath.hh File Reference │ │ │ │ +dune-typetree: exceptions.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,164 +64,40 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Enumerations | │ │ │ │ -Functions
│ │ │ │ -
treepath.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
exceptions.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <iostream>
│ │ │ │ -#include <dune/common/documentation.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/typetree/fixedcapacitystack.hh>
│ │ │ │ -#include <dune/typetree/utility.hh>
│ │ │ │ + │ │ │ │ +

TypeTree-specific exceptions. │ │ │ │ +More...

│ │ │ │ +
#include <dune/common/exceptions.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::TypeTree::HybridTreePath< T >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
 
struct  Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >
 
struct  Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k >
 
struct  Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k >
 
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >
 
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >
 
struct  Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
 
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... >
 
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >
 
struct  Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
 
struct  Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > >
class  Dune::TypeTree::Exception
 Base class for all TypeTree exceptions. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::TreePathType
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Typedefs

template<std::size_t... i>
using Dune::TypeTree::TreePath = HybridTreePath< Dune::index_constant< i >... >
 
template<std::size_t... i>
using Dune::TypeTree::StaticTreePath = HybridTreePath< Dune::index_constant< i >... >
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Enumerations

enum  Dune::TypeTree::TreePathType::Type { Dune::TypeTree::TreePathType::fullyStatic │ │ │ │ -, Dune::TypeTree::TreePathType::dynamic │ │ │ │ - }
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<std::size_t... i>
void Dune::TypeTree::print_tree_path (std::ostream &os)
 
template<std::size_t k, std::size_t... i>
void Dune::TypeTree::print_tree_path (std::ostream &os)
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::hybridTreePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... t)
 Constructs a new HybridTreePath from the given indices. More...
 
template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize (const HybridTreePath< T... > &)
 Returns the size (number of components) of the given HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr auto Dune::TypeTree::treePathEntry (const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
 Returns a copy of the i-th element of the HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr std::size_t Dune::TypeTree::treePathIndex (const HybridTreePath< T... > &tp, index_constant< i >={})
 Returns the index value of the i-th element of the HybridTreePath. More...
 
template<typename... T, typename std::enable_if<(sizeof...(T) > 0), bool >::type = true>
constexpr auto Dune::TypeTree::back (const HybridTreePath< T... > &tp) -> decltype(treePathEntry< sizeof...(T) -1 >(tp))
 Returns a copy of the last element of the HybridTreePath. More...
 
template<typename... T>
constexpr auto Dune::TypeTree::front (const HybridTreePath< T... > &tp) -> decltype(treePathEntry< 0 >(tp))
 Returns a copy of the first element of the HybridTreePath. More...
 
template<typename... T>
constexpr HybridTreePath< T..., std::size_t > Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, std::size_t i)
 Appends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr HybridTreePath< T..., index_constant< i > > Dune::TypeTree::push_back (const HybridTreePath< T... > &tp, index_constant< i > i_={})
 Appends a compile time index to a HybridTreePath. More...
 
template<typename... T>
constexpr HybridTreePath< std::size_t, T... > Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, std::size_t element)
 Prepends a run time index to a HybridTreePath. More...
 
template<std::size_t i, typename... T>
constexpr HybridTreePath< index_constant< i >, T... > Dune::TypeTree::push_front (const HybridTreePath< T... > &tp, index_constant< i > _i={})
 Prepends a compile time index to a HybridTreePath. More...
 
template<class... T>
constexpr auto Dune::TypeTree::pop_front (const HybridTreePath< T... > &tp)
 Removes first index on a HybridTreePath. More...
 
template<class... T>
constexpr auto Dune::TypeTree::pop_back (const HybridTreePath< T... > &tp)
 Removes last index on a HybridTreePath. More...
 
template<class... S, class... T>
constexpr bool Dune::TypeTree::operator== (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for value equality. More...
 
template<class S , S... lhs, class T , T... rhs>
constexpr auto Dune::TypeTree::operator== (const HybridTreePath< std::integral_constant< S, lhs >... > &, const HybridTreePath< std::integral_constant< T, rhs >... > &)
 Overload for purely static HybridTreePaths. More...
 
template<class... S, class... T>
constexpr auto Dune::TypeTree::operator!= (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for unequality. More...
 
template<class S , S... lhs, class T , T... rhs>
constexpr auto Dune::TypeTree::operator!= (const HybridTreePath< std::integral_constant< S, lhs >... > &, const HybridTreePath< std::integral_constant< T, rhs >... > &)
 Compare two static HybridTreePaths for unequality. More...
 
template<typename... T>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T... > &tp)
 Dumps a HybridTreePath to a stream. More...
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

TypeTree-specific exceptions.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,209 +4,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Typedefs | Enumerations | Functions │ │ │ │ │ -treepath.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +exceptions.hh File Reference │ │ │ │ │ +TypeTree-specific exceptions. More... │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::TypeTree::HybridTreePath<_T_> │ │ │ │ │ -  A hybrid version of TreePath that supports both compile time and run │ │ │ │ │ - time indices. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathSize<_HybridTreePath<_index_constant<_i_>..._> │ │ │ │ │ - > │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathPushBack<_HybridTreePath<_index_constant<_i │ │ │ │ │ - >..._>,_k_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathPushFront<_HybridTreePath<_index_constant<_i │ │ │ │ │ - >..._>,_k_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathBack<_HybridTreePath<_index_constant<_k_>_>_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathBack<_HybridTreePath<_index_constant<_j_>, │ │ │ │ │ - index_constant<_k_>,_index_constant<_l_>..._>_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathFront<_HybridTreePath<_index_constant<_k_>, │ │ │ │ │ - index_constant<_i_>..._>_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathPopBack<_HybridTreePath<_index_constant<_k_> │ │ │ │ │ - >,_i..._> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathPopBack<_HybridTreePath<_index_constant<_j_>, │ │ │ │ │ - index_constant<_k_>,_index_constant<_l_>..._>,_i..._> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathPopFront<_HybridTreePath<_index_constant<_k_>, │ │ │ │ │ - index_constant<_i_>..._>_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::TreePathConcat<_HybridTreePath<_index_constant<_i_>... │ │ │ │ │ - >,_HybridTreePath<_index_constant<_k_>..._>_> │ │ │ │ │ +class  Dune::TypeTree::Exception │ │ │ │ │ +  Base class for all TypeTree exceptions. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::TreePathType │ │ │ │ │ -  │ │ │ │ │ - Typedefs │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::TreePath = HybridTreePath< Dune::index_constant< i >... │ │ │ │ │ - > │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::StaticTreePath = HybridTreePath< Dune::index_constant< i │ │ │ │ │ - >... > │ │ │ │ │ -  │ │ │ │ │ - Enumerations │ │ │ │ │ -enum  Dune::TypeTree::TreePathType::Type { Dune::TypeTree::TreePathType:: │ │ │ │ │ - fullyStatic , Dune::TypeTree::TreePathType::dynamic } │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::print_tree_path (std:: │ │ │ │ │ - ostream &os) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void Dune::TypeTree::print_tree_path (std:: │ │ │ │ │ - ostream &os) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr HybridTreePath< T... > Dune::TypeTree::hybridTreePath (const T │ │ │ │ │ - &... t) │ │ │ │ │ -  Constructs a new HybridTreePath from the │ │ │ │ │ - given indices. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... │ │ │ │ │ - t) │ │ │ │ │ -  Constructs a new HybridTreePath from the │ │ │ │ │ - given indices. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr std::size_t Dune::TypeTree::treePathSize (const │ │ │ │ │ - HybridTreePath< T... > &) │ │ │ │ │ -  Returns the size (number of components) │ │ │ │ │ - of the given HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::treePathEntry (const │ │ │ │ │ - HybridTreePath< T... > &tp, │ │ │ │ │ - index_constant< i >={}) -> typename │ │ │ │ │ - std::decay< decltype(std::get< i > │ │ │ │ │ - (tp._data))>::type │ │ │ │ │ -  Returns a copy of the i-th element of │ │ │ │ │ - the HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr std::size_t Dune::TypeTree::treePathIndex (const │ │ │ │ │ - HybridTreePath< T... > &tp, │ │ │ │ │ - index_constant< i >={}) │ │ │ │ │ -  Returns the index value of the i-th │ │ │ │ │ - element of the HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template 0), bool >:: │ │ │ │ │ -type = true> │ │ │ │ │ - constexpr auto Dune::TypeTree::back (const │ │ │ │ │ - HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ - (treePathEntry< sizeof...(T) -1 >(tp)) │ │ │ │ │ -  Returns a copy of the last element of │ │ │ │ │ - the HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::front (const │ │ │ │ │ - HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ - (treePathEntry< 0 >(tp)) │ │ │ │ │ -  Returns a copy of the first element of │ │ │ │ │ - the HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr HybridTreePath< T..., std:: Dune::TypeTree::push_back (const │ │ │ │ │ - size_t > HybridTreePath< T... > &tp, std::size_t │ │ │ │ │ - i) │ │ │ │ │ -  Appends a run time index to a │ │ │ │ │ - HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr HybridTreePath< T..., Dune::TypeTree::push_back (const │ │ │ │ │ - index_constant< i > > HybridTreePath< T... > &tp, │ │ │ │ │ - index_constant< i > i_={}) │ │ │ │ │ -  Appends a compile time index to a │ │ │ │ │ - HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr HybridTreePath< std::size_t, Dune::TypeTree::push_front (const │ │ │ │ │ - T... > HybridTreePath< T... > &tp, std::size_t │ │ │ │ │ - element) │ │ │ │ │ -  Prepends a run time index to a │ │ │ │ │ - HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr HybridTreePath< Dune::TypeTree::push_front (const │ │ │ │ │ - index_constant< i >, T... > HybridTreePath< T... > &tp, │ │ │ │ │ - index_constant< i > _i={}) │ │ │ │ │ -  Prepends a compile time index to a │ │ │ │ │ - HybridTreePath. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::pop_front (const │ │ │ │ │ - HybridTreePath< T... > &tp) │ │ │ │ │ -  Removes first index on a HybridTreePath. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::pop_back (const │ │ │ │ │ - HybridTreePath< T... > &tp) │ │ │ │ │ -  Removes last index on a HybridTreePath. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr bool Dune::TypeTree::operator== (const │ │ │ │ │ - HybridTreePath< S... > &lhs, const │ │ │ │ │ - HybridTreePath< T... > &rhs) │ │ │ │ │ -  Compare two HybridTreePaths for value │ │ │ │ │ - equality. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::operator== (const │ │ │ │ │ - HybridTreePath< std::integral_constant< │ │ │ │ │ - S, lhs >... > &, const HybridTreePath< │ │ │ │ │ - std::integral_constant< T, rhs >... > &) │ │ │ │ │ -  Overload for purely static │ │ │ │ │ - HybridTreePaths. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::operator!= (const │ │ │ │ │ - HybridTreePath< S... > &lhs, const │ │ │ │ │ - HybridTreePath< T... > &rhs) │ │ │ │ │ -  Compare two HybridTreePaths for │ │ │ │ │ - unequality. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto Dune::TypeTree::operator!= (const │ │ │ │ │ - HybridTreePath< std::integral_constant< │ │ │ │ │ - S, lhs >... > &, const HybridTreePath< │ │ │ │ │ - std::integral_constant< T, rhs >... > &) │ │ │ │ │ -  Compare two static HybridTreePaths for │ │ │ │ │ - unequality. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - std::ostream & Dune::TypeTree::operator<< (std::ostream │ │ │ │ │ - &os, const HybridTreePath< T... > &tp) │ │ │ │ │ -  Dumps a HybridTreePath to a stream. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +TypeTree-specific exceptions. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treepath.hh Source File │ │ │ │ +dune-typetree: exceptions.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,469 +62,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
treepath.hh
│ │ │ │ +
exceptions.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │ -
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ -
6
│ │ │ │ -
7#include <cstddef>
│ │ │ │ -
8#include <iostream>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/documentation.hh>
│ │ │ │ -
11#include <dune/common/typetraits.hh>
│ │ │ │ -
12#include <dune/common/indices.hh>
│ │ │ │ -
13#include <dune/common/hybridutilities.hh>
│ │ │ │ -
14
│ │ │ │ - │ │ │ │ - │ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20 namespace TypeTree {
│ │ │ │ -
21
│ │ │ │ -
22 template<typename... T>
│ │ │ │ -
23 class HybridTreePath;
│ │ │ │ -
24
│ │ │ │ -
28
│ │ │ │ -
29 namespace TreePathType {
│ │ │ │ - │ │ │ │ -
31 }
│ │ │ │ -
32
│ │ │ │ -
33 template<typename>
│ │ │ │ - │ │ │ │ -
35
│ │ │ │ -
36 template<typename,std::size_t>
│ │ │ │ - │ │ │ │ -
38
│ │ │ │ -
39 template<typename,std::size_t>
│ │ │ │ - │ │ │ │ -
41
│ │ │ │ -
42 template<typename>
│ │ │ │ - │ │ │ │ -
44
│ │ │ │ -
45 template<typename>
│ │ │ │ - │ │ │ │ -
47
│ │ │ │ -
48 template<typename, std::size_t...>
│ │ │ │ - │ │ │ │ -
50
│ │ │ │ -
51 template<typename>
│ │ │ │ - │ │ │ │ -
53
│ │ │ │ -
54 template<typename, typename>
│ │ │ │ - │ │ │ │ -
56
│ │ │ │ -
57 template<std::size_t... i>
│ │ │ │ -
58 void print_tree_path(std::ostream& os)
│ │ │ │ -
59 {}
│ │ │ │ -
60
│ │ │ │ -
61 template<std::size_t k, std::size_t... i>
│ │ │ │ -
62 void print_tree_path(std::ostream& os)
│ │ │ │ -
63 {
│ │ │ │ -
64 os << k << " ";
│ │ │ │ -
65 print_tree_path<i...>(os);
│ │ │ │ -
66 }
│ │ │ │ -
67
│ │ │ │ -
69
│ │ │ │ -
77 template<typename... T>
│ │ │ │ - │ │ │ │ -
79 {
│ │ │ │ -
80
│ │ │ │ -
81 public:
│ │ │ │ -
82
│ │ │ │ -
84 using index_sequence = std::index_sequence_for<T...>;
│ │ │ │ -
85
│ │ │ │ -
87 constexpr HybridTreePath()
│ │ │ │ -
88 {}
│ │ │ │ -
89
│ │ │ │ -
90 constexpr HybridTreePath(const HybridTreePath& tp) = default;
│ │ │ │ -
91 constexpr HybridTreePath(HybridTreePath&& tp) = default;
│ │ │ │ -
92
│ │ │ │ -
93 constexpr HybridTreePath& operator=(const HybridTreePath& tp) = default;
│ │ │ │ -
94 constexpr HybridTreePath& operator=(HybridTreePath&& tp) = default;
│ │ │ │ -
95
│ │ │ │ -
97 explicit constexpr HybridTreePath(std::tuple<T...> t)
│ │ │ │ -
98 : _data(t)
│ │ │ │ -
99 {}
│ │ │ │ -
100
│ │ │ │ -
102 template<typename... U, typename std::enable_if<(sizeof...(T) > 0 && sizeof...(U) == sizeof...(T)),bool>::type = true>
│ │ │ │ -
103 explicit constexpr HybridTreePath(U... t)
│ │ │ │ -
104 : _data(t...)
│ │ │ │ -
105 {}
│ │ │ │ -
106
│ │ │ │ -
108 constexpr static index_sequence enumerate()
│ │ │ │ -
109 {
│ │ │ │ -
110 return {};
│ │ │ │ -
111 }
│ │ │ │ -
112
│ │ │ │ -
114 constexpr static std::size_t size()
│ │ │ │ -
115 {
│ │ │ │ -
116 return sizeof...(T);
│ │ │ │ -
117 }
│ │ │ │ -
118
│ │ │ │ -
120 template<std::size_t i>
│ │ │ │ -
121 constexpr auto operator[](Dune::index_constant<i>) const
│ │ │ │ -
122 {
│ │ │ │ -
123 return std::get<i>(_data);
│ │ │ │ -
124 }
│ │ │ │ -
125
│ │ │ │ -
127 constexpr std::size_t operator[](std::size_t pos) const
│ │ │ │ -
128 {
│ │ │ │ -
129 std::size_t entry = 0;
│ │ │ │ -
130 Dune::Hybrid::forEach(enumerate(), [&] (auto i) {
│ │ │ │ -
131 if (i==pos)
│ │ │ │ -
132 entry = this->element(i);
│ │ │ │ -
133 });
│ │ │ │ -
134 return entry;
│ │ │ │ -
135 }
│ │ │ │ -
136
│ │ │ │ -
138 template<std::size_t i>
│ │ │ │ -
139 constexpr auto element(Dune::index_constant<i> pos = {}) const
│ │ │ │ -
140 {
│ │ │ │ -
141 return std::get<i>(_data);
│ │ │ │ -
142 }
│ │ │ │ -
143
│ │ │ │ -
145 constexpr std::size_t element(std::size_t pos) const
│ │ │ │ -
146 {
│ │ │ │ -
147 std::size_t entry = 0;
│ │ │ │ -
148 Dune::Hybrid::forEach(enumerate(), [&] (auto i) {
│ │ │ │ -
149 if (i==pos)
│ │ │ │ -
150 entry = this->element(i);
│ │ │ │ -
151 });
│ │ │ │ -
152 return entry;
│ │ │ │ -
153 }
│ │ │ │ -
154
│ │ │ │ -
156 auto back() const
│ │ │ │ -
157 {
│ │ │ │ -
158 return std::get<sizeof...(T)-1>(_data);
│ │ │ │ -
159 }
│ │ │ │ -
160
│ │ │ │ -
161#ifndef DOXYGEN
│ │ │ │ -
162
│ │ │ │ -
163 // I can't be bothered to make all the external accessors friends of HybridTreePath,
│ │ │ │ -
164 // so we'll only hide the data tuple from the user in Doxygen.
│ │ │ │ -
165
│ │ │ │ -
166 using Data = std::tuple<T...>;
│ │ │ │ -
167 Data _data;
│ │ │ │ -
168
│ │ │ │ -
169#endif // DOXYGEN
│ │ │ │ -
170
│ │ │ │ -
171 };
│ │ │ │ -
172
│ │ │ │ -
173
│ │ │ │ -
175
│ │ │ │ -
179 template<typename... T>
│ │ │ │ -
180 constexpr HybridTreePath<T...> hybridTreePath(const T&... t)
│ │ │ │ -
181 {
│ │ │ │ -
182 return HybridTreePath<T...>(t...);
│ │ │ │ -
183 }
│ │ │ │ -
184
│ │ │ │ -
186
│ │ │ │ -
190 template<typename... T>
│ │ │ │ -
191 constexpr HybridTreePath<T...> treePath(const T&... t)
│ │ │ │ -
192 {
│ │ │ │ -
193 return HybridTreePath<T...>(t...);
│ │ │ │ -
194 }
│ │ │ │ -
195
│ │ │ │ -
196
│ │ │ │ -
198 template<typename... T>
│ │ │ │ -
199 constexpr std::size_t treePathSize(const HybridTreePath<T...>&)
│ │ │ │ -
200 {
│ │ │ │ -
201 return sizeof...(T);
│ │ │ │ -
202 }
│ │ │ │ -
203
│ │ │ │ -
205
│ │ │ │ -
221 template<std::size_t i, typename... T>
│ │ │ │ -
222 constexpr auto treePathEntry(const HybridTreePath<T...>& tp, index_constant<i> = {})
│ │ │ │ -
223 -> typename std::decay<decltype(std::get<i>(tp._data))>::type
│ │ │ │ -
224 {
│ │ │ │ -
225 return std::get<i>(tp._data);
│ │ │ │ -
226 }
│ │ │ │ -
227
│ │ │ │ -
229
│ │ │ │ -
244 template<std::size_t i,typename... T>
│ │ │ │ -
245 constexpr std::size_t treePathIndex(const HybridTreePath<T...>& tp, index_constant<i> = {})
│ │ │ │ -
246 {
│ │ │ │ -
247 return std::get<i>(tp._data);
│ │ │ │ -
248 }
│ │ │ │ -
249
│ │ │ │ -
251
│ │ │ │ -
256 template<typename... T, typename std::enable_if<(sizeof...(T) > 0),bool>::type = true>
│ │ │ │ -
257 constexpr auto back(const HybridTreePath<T...>& tp)
│ │ │ │ -
258 -> decltype(treePathEntry<sizeof...(T)-1>(tp))
│ │ │ │ -
259 {
│ │ │ │ -
260 return treePathEntry<sizeof...(T)-1>(tp);
│ │ │ │ -
261 }
│ │ │ │ -
262
│ │ │ │ -
264
│ │ │ │ -
269 template<typename... T>
│ │ │ │ -
270 constexpr auto front(const HybridTreePath<T...>& tp)
│ │ │ │ -
271 -> decltype(treePathEntry<0>(tp))
│ │ │ │ -
272 {
│ │ │ │ -
273 return treePathEntry<0>(tp);
│ │ │ │ -
274 }
│ │ │ │ -
275
│ │ │ │ -
277
│ │ │ │ -
280 template<typename... T>
│ │ │ │ -
281 constexpr HybridTreePath<T...,std::size_t> push_back(const HybridTreePath<T...>& tp, std::size_t i)
│ │ │ │ -
282 {
│ │ │ │ -
283 return HybridTreePath<T...,std::size_t>(std::tuple_cat(tp._data,std::make_tuple(i)));
│ │ │ │ -
284 }
│ │ │ │ -
285
│ │ │ │ -
287
│ │ │ │ -
301 template<std::size_t i, typename... T>
│ │ │ │ -
302 constexpr HybridTreePath<T...,index_constant<i>> push_back(const HybridTreePath<T...>& tp, index_constant<i> i_ = {})
│ │ │ │ -
303 {
│ │ │ │ -
304 return HybridTreePath<T...,index_constant<i> >(std::tuple_cat(tp._data,std::make_tuple(i_)));
│ │ │ │ -
305 }
│ │ │ │ -
306
│ │ │ │ -
308
│ │ │ │ -
311 template<typename... T>
│ │ │ │ -
312 constexpr HybridTreePath<std::size_t,T...> push_front(const HybridTreePath<T...>& tp, std::size_t element)
│ │ │ │ -
313 {
│ │ │ │ -
314 return HybridTreePath<std::size_t,T...>(std::tuple_cat(std::make_tuple(element),tp._data));
│ │ │ │ -
315 }
│ │ │ │ -
316
│ │ │ │ -
318
│ │ │ │ -
332 template<std::size_t i, typename... T>
│ │ │ │ -
333 constexpr HybridTreePath<index_constant<i>,T...> push_front(const HybridTreePath<T...>& tp, index_constant<i> _i = {})
│ │ │ │ -
334 {
│ │ │ │ -
335 return HybridTreePath<index_constant<i>,T...>(std::tuple_cat(std::make_tuple(_i),tp._data));
│ │ │ │ -
336 }
│ │ │ │ -
337
│ │ │ │ -
339
│ │ │ │ -
342 template <class... T>
│ │ │ │ -
343 constexpr auto pop_front(const HybridTreePath<T...>& tp)
│ │ │ │ -
344 {
│ │ │ │ -
345 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty");
│ │ │ │ -
346 return unpackIntegerSequence([&](auto... i){
│ │ │ │ -
347 return HybridTreePath{std::make_tuple(std::get<i+1>(tp._data)...)};
│ │ │ │ -
348 }, std::make_index_sequence<(sizeof...(T) - 1)>{});
│ │ │ │ -
349 }
│ │ │ │ -
350
│ │ │ │ -
352
│ │ │ │ -
355 template <class... T>
│ │ │ │ -
356 constexpr auto pop_back(const HybridTreePath<T...>& tp)
│ │ │ │ -
357 {
│ │ │ │ -
358 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty");
│ │ │ │ -
359 return unpackIntegerSequence([&](auto... i){
│ │ │ │ -
360 return HybridTreePath{std::make_tuple(std::get<i>(tp._data)...)};
│ │ │ │ -
361 }, std::make_index_sequence<(sizeof...(T) - 1)>{});
│ │ │ │ -
362 }
│ │ │ │ -
363
│ │ │ │ -
365
│ │ │ │ -
373 template <class... S, class... T>
│ │ │ │ -
374 constexpr bool operator==(
│ │ │ │ -
375 const HybridTreePath<S...>& lhs,
│ │ │ │ -
376 const HybridTreePath<T...>& rhs)
│ │ │ │ -
377 {
│ │ │ │ -
378 if constexpr (sizeof...(S) == sizeof...(T)) {
│ │ │ │ -
379 if constexpr ((Dune::IsInteroperable<S,T>::value &&...)) {
│ │ │ │ -
380 return unpackIntegerSequence([&](auto... i){
│ │ │ │ -
381 return ((std::get<i>(lhs._data) == std::get<i>(rhs._data)) &&...);
│ │ │ │ -
382 }, std::make_index_sequence<(sizeof...(S))>{});
│ │ │ │ -
383 } else {
│ │ │ │ -
384 return false;
│ │ │ │ -
385 }
│ │ │ │ -
386 } else {
│ │ │ │ -
387 return false;
│ │ │ │ -
388 }
│ │ │ │ -
389 }
│ │ │ │ -
390
│ │ │ │ -
392
│ │ │ │ -
397 template <class S, S... lhs, class T, T... rhs>
│ │ │ │ -
398 constexpr auto operator==(
│ │ │ │ -
399 const HybridTreePath<std::integral_constant<S,lhs>...>&,
│ │ │ │ -
400 const HybridTreePath<std::integral_constant<T,rhs>...>&)
│ │ │ │ -
401 {
│ │ │ │ -
402 return std::bool_constant<hybridTreePath(lhs...) == hybridTreePath(rhs...)>{};
│ │ │ │ -
403 }
│ │ │ │ -
404
│ │ │ │ -
405
│ │ │ │ -
407 template <class... S, class... T>
│ │ │ │ -
408 constexpr auto operator!=(
│ │ │ │ -
409 const HybridTreePath<S...>& lhs,
│ │ │ │ -
410 const HybridTreePath<T...>& rhs)
│ │ │ │ -
411 {
│ │ │ │ -
412 return !(lhs == rhs);
│ │ │ │ -
413 }
│ │ │ │ -
414
│ │ │ │ -
416 template <class S, S... lhs, class T, T... rhs>
│ │ │ │ -
417 constexpr auto operator!=(
│ │ │ │ -
418 const HybridTreePath<std::integral_constant<S,lhs>...>&,
│ │ │ │ -
419 const HybridTreePath<std::integral_constant<T,rhs>...>&)
│ │ │ │ -
420 {
│ │ │ │ -
421 return std::bool_constant<hybridTreePath(lhs...) != hybridTreePath(rhs...)>{};
│ │ │ │ -
422 }
│ │ │ │ -
423
│ │ │ │ -
424 template<std::size_t... i>
│ │ │ │ -
425 struct TreePathSize<HybridTreePath<index_constant<i>...> >
│ │ │ │ -
426 : public index_constant<sizeof...(i)>
│ │ │ │ -
427 {};
│ │ │ │ -
428
│ │ │ │ -
429
│ │ │ │ -
430 template<std::size_t k, std::size_t... i>
│ │ │ │ -
431 struct TreePathPushBack<HybridTreePath<index_constant<i>...>,k>
│ │ │ │ -
432 {
│ │ │ │ -
433 typedef HybridTreePath<index_constant<i>...,index_constant<k>> type;
│ │ │ │ -
434 };
│ │ │ │ -
435
│ │ │ │ -
436 template<std::size_t k, std::size_t... i>
│ │ │ │ -
437 struct TreePathPushFront<HybridTreePath<index_constant<i>...>,k>
│ │ │ │ -
438 {
│ │ │ │ -
439 typedef HybridTreePath<index_constant<k>,index_constant<i>...> type;
│ │ │ │ -
440 };
│ │ │ │ -
441
│ │ │ │ -
442 template<std::size_t k>
│ │ │ │ -
443 struct TreePathBack<HybridTreePath<index_constant<k>>>
│ │ │ │ -
444 : public index_constant<k>
│ │ │ │ -
445 {};
│ │ │ │ -
446
│ │ │ │ -
447 template<std::size_t j, std::size_t k, std::size_t... l>
│ │ │ │ -
448 struct TreePathBack<HybridTreePath<index_constant<j>,index_constant<k>,index_constant<l>...>>
│ │ │ │ -
449 : public TreePathBack<HybridTreePath<index_constant<k>,index_constant<l>...>>
│ │ │ │ -
450 {};
│ │ │ │ -
451
│ │ │ │ -
452 template<std::size_t k, std::size_t... i>
│ │ │ │ -
453 struct TreePathFront<HybridTreePath<index_constant<k>,index_constant<i>...>>
│ │ │ │ -
454 : public index_constant<k>
│ │ │ │ -
455 {};
│ │ │ │ -
456
│ │ │ │ -
457 template<std::size_t k, std::size_t... i>
│ │ │ │ -
458 struct TreePathPopBack<HybridTreePath<index_constant<k>>,i...>
│ │ │ │ -
459 {
│ │ │ │ - │ │ │ │ -
461 };
│ │ │ │ -
462
│ │ │ │ -
463 template<std::size_t j,
│ │ │ │ -
464 std::size_t k,
│ │ │ │ -
465 std::size_t... l,
│ │ │ │ -
466 std::size_t... i>
│ │ │ │ -
467 struct TreePathPopBack<HybridTreePath<index_constant<j>,index_constant<k>,index_constant<l>...>,i...>
│ │ │ │ -
468 : public TreePathPopBack<HybridTreePath<index_constant<k>,index_constant<l>...>,i...,j>
│ │ │ │ -
469 {};
│ │ │ │ -
470
│ │ │ │ -
471 template<std::size_t k, std::size_t... i>
│ │ │ │ -
472 struct TreePathPopFront<HybridTreePath<index_constant<k>,index_constant<i>...> >
│ │ │ │ -
473 {
│ │ │ │ - │ │ │ │ -
475 };
│ │ │ │ -
476
│ │ │ │ -
477 template<std::size_t... i, std::size_t... k>
│ │ │ │ -
478 struct TreePathConcat<HybridTreePath<index_constant<i>...>,HybridTreePath<index_constant<k>...> >
│ │ │ │ -
479 {
│ │ │ │ -
480 typedef HybridTreePath<index_constant<i>...,index_constant<k>...> type;
│ │ │ │ -
481 };
│ │ │ │ -
482
│ │ │ │ -
483#ifndef DOXYGEN
│ │ │ │ -
484
│ │ │ │ -
485 namespace impl {
│ │ │ │ -
486
│ │ │ │ -
487 // end of recursion
│ │ │ │ -
488 template<std::size_t i, typename... T>
│ │ │ │ -
489 typename std::enable_if<
│ │ │ │ -
490 (i == sizeof...(T))
│ │ │ │ -
491 >::type
│ │ │ │ -
492 print_hybrid_tree_path(std::ostream& os, const HybridTreePath<T...>& tp, index_constant<i> _i)
│ │ │ │ -
493 {}
│ │ │ │ -
494
│ │ │ │ -
495 // print current entry and recurse
│ │ │ │ -
496 template<std::size_t i, typename... T>
│ │ │ │ -
497 typename std::enable_if<
│ │ │ │ -
498 (i < sizeof...(T))
│ │ │ │ -
499 >::type
│ │ │ │ -
500 print_hybrid_tree_path(std::ostream& os, const HybridTreePath<T...>& tp, index_constant<i> _i)
│ │ │ │ -
501 {
│ │ │ │ -
502 os << treePathIndex(tp,_i) << " ";
│ │ │ │ -
503 print_hybrid_tree_path(os,tp,index_constant<i+1>{});
│ │ │ │ -
504 }
│ │ │ │ -
505
│ │ │ │ -
506 } // namespace impl
│ │ │ │ -
507
│ │ │ │ -
508#endif // DOXYGEN
│ │ │ │ -
509
│ │ │ │ -
511 template<typename... T>
│ │ │ │ -
512 std::ostream& operator<<(std::ostream& os, const HybridTreePath<T...>& tp)
│ │ │ │ -
513 {
│ │ │ │ -
514 os << "HybridTreePath< ";
│ │ │ │ -
515 impl::print_hybrid_tree_path(os, tp, index_constant<0>{});
│ │ │ │ -
516 os << ">";
│ │ │ │ -
517 return os;
│ │ │ │ -
518 }
│ │ │ │ -
519
│ │ │ │ -
520 template<std::size_t... i>
│ │ │ │ -
521 using TreePath [[deprecated("use StaticTreePath, this type will be removed after DUNE 2.7")]] = HybridTreePath<Dune::index_constant<i>...>;
│ │ │ │ -
522
│ │ │ │ -
523 template<std::size_t... i>
│ │ │ │ - │ │ │ │ -
525
│ │ │ │ -
527
│ │ │ │ -
528 } // namespace TypeTree
│ │ │ │ -
529} //namespace Dune
│ │ │ │ -
530
│ │ │ │ -
531#endif // DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ -
constexpr auto pop_front(const HybridTreePath< T... > &tp)
Removes first index on a HybridTreePath.
Definition: treepath.hh:343
│ │ │ │ -
std::ostream & operator<<(std::ostream &os, const HybridTreePath< T... > &tp)
Dumps a HybridTreePath to a stream.
Definition: treepath.hh:512
│ │ │ │ -
constexpr auto back(const HybridTreePath< T... > &tp) -> decltype(treePathEntry< sizeof...(T) -1 >(tp))
Returns a copy of the last element of the HybridTreePath.
Definition: treepath.hh:257
│ │ │ │ -
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition: treepath.hh:199
│ │ │ │ -
constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< T... > &tp, std::size_t element)
Prepends a run time index to a HybridTreePath.
Definition: treepath.hh:312
│ │ │ │ -
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ -
constexpr auto front(const HybridTreePath< T... > &tp) -> decltype(treePathEntry< 0 >(tp))
Returns a copy of the first element of the HybridTreePath.
Definition: treepath.hh:270
│ │ │ │ -
constexpr auto treePathEntry(const HybridTreePath< T... > &tp, index_constant< i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type
Returns a copy of the i-th element of the HybridTreePath.
Definition: treepath.hh:222
│ │ │ │ -
constexpr auto operator!=(const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
Compare two HybridTreePaths for unequality.
Definition: treepath.hh:408
│ │ │ │ -
constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, index_constant< i >={})
Returns the index value of the i-th element of the HybridTreePath.
Definition: treepath.hh:245
│ │ │ │ -
constexpr auto pop_back(const HybridTreePath< T... > &tp)
Removes last index on a HybridTreePath.
Definition: treepath.hh:356
│ │ │ │ -
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ -
constexpr bool operator==(const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
Compare two HybridTreePaths for value equality.
Definition: treepath.hh:374
│ │ │ │ -
void print_tree_path(std::ostream &os)
Definition: treepath.hh:58
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │ +
3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH
│ │ │ │ +
4#define DUNE_TYPETREE_EXCEPTIONS_HH
│ │ │ │ +
5
│ │ │ │ +
6#include <dune/common/exceptions.hh>
│ │ │ │ +
7
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14 namespace TypeTree {
│ │ │ │ +
15
│ │ │ │ + │ │ │ │ +
18 : public Dune::Exception
│ │ │ │ +
19 {};
│ │ │ │ +
20
│ │ │ │ +
21 } // namespace TypeTree
│ │ │ │ +
22} // namespace Dune
│ │ │ │ +
23
│ │ │ │ +
24#endif // DUNE_TYPETREE_EXCEPTIONS_HH
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Type
Definition: treepath.hh:30
│ │ │ │ -
@ fullyStatic
Definition: treepath.hh:30
│ │ │ │ -
@ dynamic
Definition: treepath.hh:30
│ │ │ │ -
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ -
constexpr HybridTreePath(HybridTreePath &&tp)=default
│ │ │ │ -
constexpr HybridTreePath & operator=(const HybridTreePath &tp)=default
│ │ │ │ -
constexpr std::size_t element(std::size_t pos) const
Get the index value at position pos.
Definition: treepath.hh:145
│ │ │ │ -
constexpr HybridTreePath(std::tuple< T... > t)
Constructor from a std::tuple
Definition: treepath.hh:97
│ │ │ │ -
constexpr HybridTreePath & operator=(HybridTreePath &&tp)=default
│ │ │ │ -
constexpr HybridTreePath(U... t)
Constructor from arguments.
Definition: treepath.hh:103
│ │ │ │ -
constexpr HybridTreePath()
Default constructor.
Definition: treepath.hh:87
│ │ │ │ -
static constexpr std::size_t size()
Get the size (length) of this path.
Definition: treepath.hh:114
│ │ │ │ -
constexpr auto operator[](Dune::index_constant< i >) const
Get the index value at position pos.
Definition: treepath.hh:121
│ │ │ │ -
constexpr auto element(Dune::index_constant< i > pos={}) const
Get the last index value.
Definition: treepath.hh:139
│ │ │ │ -
static constexpr index_sequence enumerate()
Returns an index_sequence for enumerating the components of this HybridTreePath.
Definition: treepath.hh:108
│ │ │ │ -
constexpr HybridTreePath(const HybridTreePath &tp)=default
│ │ │ │ -
constexpr std::size_t operator[](std::size_t pos) const
Get the index value at position pos.
Definition: treepath.hh:127
│ │ │ │ -
auto back() const
Get the last index value.
Definition: treepath.hh:156
│ │ │ │ -
std::index_sequence_for< T... > index_sequence
An index_sequence for the entries in this HybridTreePath.
Definition: treepath.hh:84
│ │ │ │ -
Definition: treepath.hh:34
│ │ │ │ -
Definition: treepath.hh:37
│ │ │ │ -
Definition: treepath.hh:40
│ │ │ │ -
Definition: treepath.hh:43
│ │ │ │ -
Definition: treepath.hh:46
│ │ │ │ -
Definition: treepath.hh:49
│ │ │ │ -
Definition: treepath.hh:52
│ │ │ │ -
Definition: treepath.hh:55
│ │ │ │ -
HybridTreePath< index_constant< i >..., index_constant< k > > type
Definition: treepath.hh:433
│ │ │ │ -
HybridTreePath< index_constant< k >, index_constant< i >... > type
Definition: treepath.hh:439
│ │ │ │ -
HybridTreePath< index_constant< i >... > type
Definition: treepath.hh:460
│ │ │ │ -
HybridTreePath< index_constant< i >... > type
Definition: treepath.hh:474
│ │ │ │ -
HybridTreePath< index_constant< i >..., index_constant< k >... > type
Definition: treepath.hh:480
│ │ │ │ +
Base class for all TypeTree exceptions.
Definition: exceptions.hh:19
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,613 +4,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -treepath.hh │ │ │ │ │ +exceptions.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ - 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ - 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17 │ │ │ │ │ - 18 │ │ │ │ │ - 19namespace Dune { │ │ │ │ │ - 20 namespace TypeTree { │ │ │ │ │ - 21 │ │ │ │ │ - 22 template │ │ │ │ │ - 23 class HybridTreePath; │ │ │ │ │ - 24 │ │ │ │ │ - 28 │ │ │ │ │ -29 namespace TreePathType { │ │ │ │ │ -30 enum Type { fullyStatic, dynamic }; │ │ │ │ │ - 31 } │ │ │ │ │ - 32 │ │ │ │ │ - 33 template │ │ │ │ │ -34 struct TreePathSize; │ │ │ │ │ - 35 │ │ │ │ │ - 36 template │ │ │ │ │ -37 struct TreePathPushBack; │ │ │ │ │ - 38 │ │ │ │ │ - 39 template │ │ │ │ │ -40 struct TreePathPushFront; │ │ │ │ │ - 41 │ │ │ │ │ - 42 template │ │ │ │ │ -43 struct TreePathBack; │ │ │ │ │ - 44 │ │ │ │ │ - 45 template │ │ │ │ │ -46 struct TreePathFront; │ │ │ │ │ - 47 │ │ │ │ │ - 48 template │ │ │ │ │ -49 struct TreePathPopBack; │ │ │ │ │ - 50 │ │ │ │ │ - 51 template │ │ │ │ │ -52 struct TreePathPopFront; │ │ │ │ │ - 53 │ │ │ │ │ - 54 template │ │ │ │ │ -55 struct TreePathConcat; │ │ │ │ │ - 56 │ │ │ │ │ - 57 template │ │ │ │ │ -58 void print_tree_path(std::ostream& os) │ │ │ │ │ - 59 {} │ │ │ │ │ - 60 │ │ │ │ │ - 61 template │ │ │ │ │ -62 void print_tree_path(std::ostream& os) │ │ │ │ │ - 63 { │ │ │ │ │ - 64 os << k << " "; │ │ │ │ │ - 65 print_tree_path(os); │ │ │ │ │ - 66 } │ │ │ │ │ - 67 │ │ │ │ │ - 69 │ │ │ │ │ - 77 template │ │ │ │ │ -78 class HybridTreePath │ │ │ │ │ - 79 { │ │ │ │ │ - 80 │ │ │ │ │ - 81 public: │ │ │ │ │ - 82 │ │ │ │ │ -84 using index_sequence = std::index_sequence_for; │ │ │ │ │ - 85 │ │ │ │ │ -87 constexpr HybridTreePath() │ │ │ │ │ - 88 {} │ │ │ │ │ - 89 │ │ │ │ │ -90 constexpr HybridTreePath(const HybridTreePath& tp) = default; │ │ │ │ │ -91 constexpr HybridTreePath(HybridTreePath&& tp) = default; │ │ │ │ │ - 92 │ │ │ │ │ -93 constexpr HybridTreePath& operator=(const HybridTreePath& tp) = default; │ │ │ │ │ -94 constexpr HybridTreePath& operator=(HybridTreePath&& tp) = default; │ │ │ │ │ - 95 │ │ │ │ │ -97 explicit constexpr HybridTreePath(std::tuple t) │ │ │ │ │ - 98 : _data(t) │ │ │ │ │ - 99 {} │ │ │ │ │ - 100 │ │ │ │ │ - 102 template 0 && │ │ │ │ │ -sizeof...(U) == sizeof...(T)),bool>::type = true> │ │ │ │ │ -103 explicit constexpr HybridTreePath(U... t) │ │ │ │ │ - 104 : _data(t...) │ │ │ │ │ - 105 {} │ │ │ │ │ - 106 │ │ │ │ │ -108 constexpr static index_sequence enumerate() │ │ │ │ │ - 109 { │ │ │ │ │ - 110 return {}; │ │ │ │ │ - 111 } │ │ │ │ │ - 112 │ │ │ │ │ -114 constexpr static std::size_t size() │ │ │ │ │ - 115 { │ │ │ │ │ - 116 return sizeof...(T); │ │ │ │ │ - 117 } │ │ │ │ │ - 118 │ │ │ │ │ - 120 template │ │ │ │ │ -121 constexpr auto operator[](Dune::index_constant) const │ │ │ │ │ - 122 { │ │ │ │ │ - 123 return std::get(_data); │ │ │ │ │ - 124 } │ │ │ │ │ - 125 │ │ │ │ │ -127 constexpr std::size_t operator[](std::size_t pos) const │ │ │ │ │ - 128 { │ │ │ │ │ - 129 std::size_t entry = 0; │ │ │ │ │ - 130 Dune::Hybrid::forEach(enumerate(), [&] (auto i) { │ │ │ │ │ - 131 if (i==pos) │ │ │ │ │ - 132 entry = this->element(i); │ │ │ │ │ - 133 }); │ │ │ │ │ - 134 return entry; │ │ │ │ │ - 135 } │ │ │ │ │ - 136 │ │ │ │ │ - 138 template │ │ │ │ │ -139 constexpr auto element(Dune::index_constant pos = {}) const │ │ │ │ │ - 140 { │ │ │ │ │ - 141 return std::get(_data); │ │ │ │ │ - 142 } │ │ │ │ │ - 143 │ │ │ │ │ -145 constexpr std::size_t element(std::size_t pos) const │ │ │ │ │ - 146 { │ │ │ │ │ - 147 std::size_t entry = 0; │ │ │ │ │ - 148 Dune::Hybrid::forEach(enumerate(), [&] (auto i) { │ │ │ │ │ - 149 if (i==pos) │ │ │ │ │ - 150 entry = this->element(i); │ │ │ │ │ - 151 }); │ │ │ │ │ - 152 return entry; │ │ │ │ │ - 153 } │ │ │ │ │ - 154 │ │ │ │ │ -156 auto back() const │ │ │ │ │ - 157 { │ │ │ │ │ - 158 return std::get(_data); │ │ │ │ │ - 159 } │ │ │ │ │ - 160 │ │ │ │ │ - 161#ifndef DOXYGEN │ │ │ │ │ - 162 │ │ │ │ │ - 163 // I can't be bothered to make all the external accessors friends of │ │ │ │ │ -HybridTreePath, │ │ │ │ │ - 164 // so we'll only hide the data tuple from the user in Doxygen. │ │ │ │ │ - 165 │ │ │ │ │ - 166 using Data = std::tuple; │ │ │ │ │ - 167 Data _data; │ │ │ │ │ - 168 │ │ │ │ │ - 169#endif // DOXYGEN │ │ │ │ │ - 170 │ │ │ │ │ - 171 }; │ │ │ │ │ - 172 │ │ │ │ │ - 173 │ │ │ │ │ - 175 │ │ │ │ │ - 179 template │ │ │ │ │ -180 constexpr HybridTreePath hybridTreePath(const T&... t) │ │ │ │ │ - 181 { │ │ │ │ │ - 182 return HybridTreePath(t...); │ │ │ │ │ - 183 } │ │ │ │ │ - 184 │ │ │ │ │ - 186 │ │ │ │ │ - 190 template │ │ │ │ │ -191 constexpr HybridTreePath treePath(const T&... t) │ │ │ │ │ - 192 { │ │ │ │ │ - 193 return HybridTreePath(t...); │ │ │ │ │ - 194 } │ │ │ │ │ - 195 │ │ │ │ │ - 196 │ │ │ │ │ - 198 template │ │ │ │ │ -199 constexpr std::size_t treePathSize(const HybridTreePath&) │ │ │ │ │ - 200 { │ │ │ │ │ - 201 return sizeof...(T); │ │ │ │ │ - 202 } │ │ │ │ │ - 203 │ │ │ │ │ - 205 │ │ │ │ │ - 221 template │ │ │ │ │ -222 constexpr auto treePathEntry(const HybridTreePath& tp, │ │ │ │ │ -index_constant = {}) │ │ │ │ │ - 223 -> typename std::decay(tp._data))>::type │ │ │ │ │ - 224 { │ │ │ │ │ - 225 return std::get(tp._data); │ │ │ │ │ - 226 } │ │ │ │ │ - 227 │ │ │ │ │ - 229 │ │ │ │ │ - 244 template │ │ │ │ │ -245 constexpr std::size_t treePathIndex(const HybridTreePath& tp, │ │ │ │ │ -index_constant = {}) │ │ │ │ │ - 246 { │ │ │ │ │ - 247 return std::get(tp._data); │ │ │ │ │ - 248 } │ │ │ │ │ - 249 │ │ │ │ │ - 251 │ │ │ │ │ - 256 template 0),bool>:: │ │ │ │ │ -type = true> │ │ │ │ │ -257 constexpr auto back(const HybridTreePath& tp) │ │ │ │ │ - 258 -> decltype(treePathEntry(tp)) │ │ │ │ │ - 259 { │ │ │ │ │ - 260 return treePathEntry(tp); │ │ │ │ │ - 261 } │ │ │ │ │ - 262 │ │ │ │ │ - 264 │ │ │ │ │ - 269 template │ │ │ │ │ -270 constexpr auto front(const HybridTreePath& tp) │ │ │ │ │ - 271 -> decltype(treePathEntry<0>(tp)) │ │ │ │ │ - 272 { │ │ │ │ │ - 273 return treePathEntry<0>(tp); │ │ │ │ │ - 274 } │ │ │ │ │ - 275 │ │ │ │ │ - 277 │ │ │ │ │ - 280 template │ │ │ │ │ -281 constexpr HybridTreePath push_back(const │ │ │ │ │ -HybridTreePath& tp, std::size_t i) │ │ │ │ │ - 282 { │ │ │ │ │ - 283 return HybridTreePath(std::tuple_cat(tp._data,std:: │ │ │ │ │ -make_tuple(i))); │ │ │ │ │ - 284 } │ │ │ │ │ - 285 │ │ │ │ │ - 287 │ │ │ │ │ - 301 template │ │ │ │ │ -302 constexpr HybridTreePath> push_back(const │ │ │ │ │ -HybridTreePath& tp, index_constant i_ = {}) │ │ │ │ │ - 303 { │ │ │ │ │ - 304 return HybridTreePath >(std::tuple_cat │ │ │ │ │ -(tp._data,std::make_tuple(i_))); │ │ │ │ │ - 305 } │ │ │ │ │ - 306 │ │ │ │ │ - 308 │ │ │ │ │ - 311 template │ │ │ │ │ -312 constexpr HybridTreePath push_front(const │ │ │ │ │ -HybridTreePath& tp, std::size_t element) │ │ │ │ │ - 313 { │ │ │ │ │ - 314 return HybridTreePath(std::tuple_cat(std::make_tuple │ │ │ │ │ -(element),tp._data)); │ │ │ │ │ - 315 } │ │ │ │ │ - 316 │ │ │ │ │ - 318 │ │ │ │ │ - 332 template │ │ │ │ │ -333 constexpr HybridTreePath,T...> push_front(const │ │ │ │ │ -HybridTreePath& tp, index_constant _i = {}) │ │ │ │ │ - 334 { │ │ │ │ │ - 335 return HybridTreePath,T...>(std::tuple_cat(std:: │ │ │ │ │ -make_tuple(_i),tp._data)); │ │ │ │ │ - 336 } │ │ │ │ │ - 337 │ │ │ │ │ - 339 │ │ │ │ │ - 342 template │ │ │ │ │ -343 constexpr auto pop_front(const HybridTreePath& tp) │ │ │ │ │ - 344 { │ │ │ │ │ - 345 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ - 346 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ - 347 return HybridTreePath{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ - 348 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ - 349 } │ │ │ │ │ - 350 │ │ │ │ │ - 352 │ │ │ │ │ - 355 template │ │ │ │ │ -356 constexpr auto pop_back(const HybridTreePath& tp) │ │ │ │ │ - 357 { │ │ │ │ │ - 358 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ - 359 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ - 360 return HybridTreePath{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ - 361 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ - 362 } │ │ │ │ │ - 363 │ │ │ │ │ - 365 │ │ │ │ │ - 373 template │ │ │ │ │ -374 constexpr bool operator==( │ │ │ │ │ - 375 const HybridTreePath& lhs, │ │ │ │ │ - 376 const HybridTreePath& rhs) │ │ │ │ │ - 377 { │ │ │ │ │ - 378 if constexpr (sizeof...(S) == sizeof...(T)) { │ │ │ │ │ - 379 if constexpr ((Dune::IsInteroperable::value &&...)) { │ │ │ │ │ - 380 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ - 381 return ((std::get(lhs._data) == std::get(rhs._data)) &&...); │ │ │ │ │ - 382 }, std::make_index_sequence<(sizeof...(S))>{}); │ │ │ │ │ - 383 } else { │ │ │ │ │ - 384 return false; │ │ │ │ │ - 385 } │ │ │ │ │ - 386 } else { │ │ │ │ │ - 387 return false; │ │ │ │ │ - 388 } │ │ │ │ │ - 389 } │ │ │ │ │ - 390 │ │ │ │ │ - 392 │ │ │ │ │ - 397 template │ │ │ │ │ -398 constexpr auto operator==( │ │ │ │ │ - 399 const HybridTreePath...>&, │ │ │ │ │ - 400 const HybridTreePath...>&) │ │ │ │ │ - 401 { │ │ │ │ │ - 402 return std::bool_constant{}; │ │ │ │ │ - 403 } │ │ │ │ │ - 404 │ │ │ │ │ - 405 │ │ │ │ │ - 407 template │ │ │ │ │ -408 constexpr auto operator!=( │ │ │ │ │ - 409 const HybridTreePath& lhs, │ │ │ │ │ - 410 const HybridTreePath& rhs) │ │ │ │ │ - 411 { │ │ │ │ │ - 412 return !(lhs == rhs); │ │ │ │ │ - 413 } │ │ │ │ │ - 414 │ │ │ │ │ - 416 template │ │ │ │ │ -417 constexpr auto operator!=( │ │ │ │ │ - 418 const HybridTreePath...>&, │ │ │ │ │ - 419 const HybridTreePath...>&) │ │ │ │ │ - 420 { │ │ │ │ │ - 421 return std::bool_constant{}; │ │ │ │ │ - 422 } │ │ │ │ │ - 423 │ │ │ │ │ - 424 template │ │ │ │ │ -425 struct TreePathSize...> > │ │ │ │ │ - 426 : public index_constant │ │ │ │ │ - 427 {}; │ │ │ │ │ - 428 │ │ │ │ │ - 429 │ │ │ │ │ - 430 template │ │ │ │ │ -431 struct TreePathPushBack...>,k> │ │ │ │ │ - 432 { │ │ │ │ │ -433 typedef HybridTreePath...,index_constant> type; │ │ │ │ │ - 434 }; │ │ │ │ │ - 435 │ │ │ │ │ - 436 template │ │ │ │ │ -437 struct TreePathPushFront...>,k> │ │ │ │ │ - 438 { │ │ │ │ │ -439 typedef HybridTreePath,index_constant...> type; │ │ │ │ │ - 440 }; │ │ │ │ │ - 441 │ │ │ │ │ - 442 template │ │ │ │ │ -443 struct TreePathBack>> │ │ │ │ │ - 444 : public index_constant │ │ │ │ │ - 445 {}; │ │ │ │ │ - 446 │ │ │ │ │ - 447 template │ │ │ │ │ -448 struct │ │ │ │ │ -TreePathBack,index_constant,index_constant...>> │ │ │ │ │ - 449 : public │ │ │ │ │ -TreePathBack,index_constant...>> │ │ │ │ │ - 450 {}; │ │ │ │ │ - 451 │ │ │ │ │ - 452 template │ │ │ │ │ -453 struct │ │ │ │ │ -TreePathFront,index_constant...>> │ │ │ │ │ - 454 : public index_constant │ │ │ │ │ - 455 {}; │ │ │ │ │ - 456 │ │ │ │ │ - 457 template │ │ │ │ │ -458 struct TreePathPopBack>,i...> │ │ │ │ │ - 459 { │ │ │ │ │ -460 typedef HybridTreePath...> type; │ │ │ │ │ - 461 }; │ │ │ │ │ - 462 │ │ │ │ │ - 463 template │ │ │ │ │ -467 struct │ │ │ │ │ -TreePathPopBack,index_constant,index_constant...>,i...> │ │ │ │ │ - 468 : public │ │ │ │ │ -TreePathPopBack,index_constant...>,i...,j> │ │ │ │ │ - 469 {}; │ │ │ │ │ - 470 │ │ │ │ │ - 471 template │ │ │ │ │ -472 struct │ │ │ │ │ -TreePathPopFront,index_constant...> > │ │ │ │ │ - 473 { │ │ │ │ │ -474 typedef HybridTreePath...> type; │ │ │ │ │ - 475 }; │ │ │ │ │ - 476 │ │ │ │ │ - 477 template │ │ │ │ │ -478 struct │ │ │ │ │ -TreePathConcat...>,HybridTreePath...> │ │ │ │ │ -> │ │ │ │ │ - 479 { │ │ │ │ │ -480 typedef HybridTreePath...,index_constant...> type; │ │ │ │ │ - 481 }; │ │ │ │ │ - 482 │ │ │ │ │ - 483#ifndef DOXYGEN │ │ │ │ │ - 484 │ │ │ │ │ - 485 namespace impl { │ │ │ │ │ - 486 │ │ │ │ │ - 487 // end of recursion │ │ │ │ │ - 488 template │ │ │ │ │ - 489 typename std::enable_if< │ │ │ │ │ - 490 (i == sizeof...(T)) │ │ │ │ │ - 491 >::type │ │ │ │ │ - 492 print_hybrid_tree_path(std::ostream& os, const HybridTreePath& tp, │ │ │ │ │ -index_constant _i) │ │ │ │ │ - 493 {} │ │ │ │ │ - 494 │ │ │ │ │ - 495 // print current entry and recurse │ │ │ │ │ - 496 template │ │ │ │ │ - 497 typename std::enable_if< │ │ │ │ │ - 498 (i < sizeof...(T)) │ │ │ │ │ - 499 >::type │ │ │ │ │ - 500 print_hybrid_tree_path(std::ostream& os, const HybridTreePath& tp, │ │ │ │ │ -index_constant _i) │ │ │ │ │ - 501 { │ │ │ │ │ - 502 os << treePathIndex(tp,_i) << " "; │ │ │ │ │ - 503 print_hybrid_tree_path(os,tp,index_constant{}); │ │ │ │ │ - 504 } │ │ │ │ │ - 505 │ │ │ │ │ - 506 } // namespace impl │ │ │ │ │ - 507 │ │ │ │ │ - 508#endif // DOXYGEN │ │ │ │ │ - 509 │ │ │ │ │ - 511 template │ │ │ │ │ -512 std::ostream& operator<<(std::ostream& os, const HybridTreePath& tp) │ │ │ │ │ - 513 { │ │ │ │ │ - 514 os << "HybridTreePath< "; │ │ │ │ │ - 515 impl::print_hybrid_tree_path(os, tp, index_constant<0>{}); │ │ │ │ │ - 516 os << ">"; │ │ │ │ │ - 517 return os; │ │ │ │ │ - 518 } │ │ │ │ │ - 519 │ │ │ │ │ - 520 template │ │ │ │ │ -521 using TreePath [[deprecated("use StaticTreePath, this type will be removed │ │ │ │ │ -after DUNE 2.7")]] = HybridTreePath...>; │ │ │ │ │ - 522 │ │ │ │ │ - 523 template │ │ │ │ │ -524 using StaticTreePath = HybridTreePath...>; │ │ │ │ │ - 525 │ │ │ │ │ - 527 │ │ │ │ │ - 528 } // namespace TypeTree │ │ │ │ │ - 529} //namespace Dune │ │ │ │ │ - 530 │ │ │ │ │ - 531#endif // DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ -fixedcapacitystack.hh │ │ │ │ │ -utility.hh │ │ │ │ │ -Dune::TypeTree::push_back │ │ │ │ │ -constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t i) │ │ │ │ │ -Appends a run time index to a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:281 │ │ │ │ │ -Dune::TypeTree::pop_front │ │ │ │ │ -constexpr auto pop_front(const HybridTreePath< T... > &tp) │ │ │ │ │ -Removes first index on a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:343 │ │ │ │ │ -Dune::TypeTree::operator<< │ │ │ │ │ -std::ostream & operator<<(std::ostream &os, const HybridTreePath< T... > &tp) │ │ │ │ │ -Dumps a HybridTreePath to a stream. │ │ │ │ │ -Definition: treepath.hh:512 │ │ │ │ │ -Dune::TypeTree::back │ │ │ │ │ -constexpr auto back(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ -(treePathEntry< sizeof...(T) -1 >(tp)) │ │ │ │ │ -Returns a copy of the last element of the HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:257 │ │ │ │ │ -Dune::TypeTree::treePathSize │ │ │ │ │ -constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ -Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:199 │ │ │ │ │ -Dune::TypeTree::push_front │ │ │ │ │ -constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t element) │ │ │ │ │ -Prepends a run time index to a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:312 │ │ │ │ │ -Dune::TypeTree::hybridTreePath │ │ │ │ │ -constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:180 │ │ │ │ │ -Dune::TypeTree::front │ │ │ │ │ -constexpr auto front(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ -(treePathEntry< 0 >(tp)) │ │ │ │ │ -Returns a copy of the first element of the HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:270 │ │ │ │ │ -Dune::TypeTree::treePathEntry │ │ │ │ │ -constexpr auto treePathEntry(const HybridTreePath< T... > &tp, index_constant< │ │ │ │ │ -i >={}) -> typename std::decay< decltype(std::get< i >(tp._data))>::type │ │ │ │ │ -Returns a copy of the i-th element of the HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:222 │ │ │ │ │ -Dune::TypeTree::operator!= │ │ │ │ │ -constexpr auto operator!=(const HybridTreePath< S... > &lhs, const │ │ │ │ │ -HybridTreePath< T... > &rhs) │ │ │ │ │ -Compare two HybridTreePaths for unequality. │ │ │ │ │ -Definition: treepath.hh:408 │ │ │ │ │ -Dune::TypeTree::treePathIndex │ │ │ │ │ -constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, │ │ │ │ │ -index_constant< i >={}) │ │ │ │ │ -Returns the index value of the i-th element of the HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:245 │ │ │ │ │ -Dune::TypeTree::pop_back │ │ │ │ │ -constexpr auto pop_back(const HybridTreePath< T... > &tp) │ │ │ │ │ -Removes last index on a HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:356 │ │ │ │ │ -Dune::TypeTree::treePath │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:191 │ │ │ │ │ -Dune::TypeTree::operator== │ │ │ │ │ -constexpr bool operator==(const HybridTreePath< S... > &lhs, const │ │ │ │ │ -HybridTreePath< T... > &rhs) │ │ │ │ │ -Compare two HybridTreePaths for value equality. │ │ │ │ │ -Definition: treepath.hh:374 │ │ │ │ │ -Dune::TypeTree::print_tree_path │ │ │ │ │ -void print_tree_path(std::ostream &os) │ │ │ │ │ -Definition: treepath.hh:58 │ │ │ │ │ + 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ + 3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ + 4#define DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ + 5 │ │ │ │ │ + 6#include │ │ │ │ │ + 7 │ │ │ │ │ + 13namespace Dune { │ │ │ │ │ + 14 namespace TypeTree { │ │ │ │ │ + 15 │ │ │ │ │ +17 class Exception │ │ │ │ │ + 18 : public Dune::Exception │ │ │ │ │ + 19 {}; │ │ │ │ │ + 20 │ │ │ │ │ + 21 } // namespace TypeTree │ │ │ │ │ + 22} // namespace Dune │ │ │ │ │ + 23 │ │ │ │ │ + 24#endif // DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::TreePathType::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::TreePathType::fullyStatic │ │ │ │ │ -@ fullyStatic │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ -@ dynamic │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::HybridTreePath │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: treepath.hh:79 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ -constexpr HybridTreePath(HybridTreePath &&tp)=default │ │ │ │ │ -Dune::TypeTree::HybridTreePath::operator= │ │ │ │ │ -constexpr HybridTreePath & operator=(const HybridTreePath &tp)=default │ │ │ │ │ -Dune::TypeTree::HybridTreePath::element │ │ │ │ │ -constexpr std::size_t element(std::size_t pos) const │ │ │ │ │ -Get the index value at position pos. │ │ │ │ │ -Definition: treepath.hh:145 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ -constexpr HybridTreePath(std::tuple< T... > t) │ │ │ │ │ -Constructor from a std::tuple │ │ │ │ │ -Definition: treepath.hh:97 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::operator= │ │ │ │ │ -constexpr HybridTreePath & operator=(HybridTreePath &&tp)=default │ │ │ │ │ -Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ -constexpr HybridTreePath(U... t) │ │ │ │ │ -Constructor from arguments. │ │ │ │ │ -Definition: treepath.hh:103 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ -constexpr HybridTreePath() │ │ │ │ │ -Default constructor. │ │ │ │ │ -Definition: treepath.hh:87 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::size │ │ │ │ │ -static constexpr std::size_t size() │ │ │ │ │ -Get the size (length) of this path. │ │ │ │ │ -Definition: treepath.hh:114 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::operator[] │ │ │ │ │ -constexpr auto operator[](Dune::index_constant< i >) const │ │ │ │ │ -Get the index value at position pos. │ │ │ │ │ -Definition: treepath.hh:121 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::element │ │ │ │ │ -constexpr auto element(Dune::index_constant< i > pos={}) const │ │ │ │ │ -Get the last index value. │ │ │ │ │ -Definition: treepath.hh:139 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::enumerate │ │ │ │ │ -static constexpr index_sequence enumerate() │ │ │ │ │ -Returns an index_sequence for enumerating the components of this │ │ │ │ │ -HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:108 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::HybridTreePath │ │ │ │ │ -constexpr HybridTreePath(const HybridTreePath &tp)=default │ │ │ │ │ -Dune::TypeTree::HybridTreePath::operator[] │ │ │ │ │ -constexpr std::size_t operator[](std::size_t pos) const │ │ │ │ │ -Get the index value at position pos. │ │ │ │ │ -Definition: treepath.hh:127 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::back │ │ │ │ │ -auto back() const │ │ │ │ │ -Get the last index value. │ │ │ │ │ -Definition: treepath.hh:156 │ │ │ │ │ -Dune::TypeTree::HybridTreePath::index_sequence │ │ │ │ │ -std::index_sequence_for< T... > index_sequence │ │ │ │ │ -An index_sequence for the entries in this HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:84 │ │ │ │ │ -Dune::TypeTree::TreePathSize │ │ │ │ │ -Definition: treepath.hh:34 │ │ │ │ │ -Dune::TypeTree::TreePathPushBack │ │ │ │ │ -Definition: treepath.hh:37 │ │ │ │ │ -Dune::TypeTree::TreePathPushFront │ │ │ │ │ -Definition: treepath.hh:40 │ │ │ │ │ -Dune::TypeTree::TreePathBack │ │ │ │ │ -Definition: treepath.hh:43 │ │ │ │ │ -Dune::TypeTree::TreePathFront │ │ │ │ │ -Definition: treepath.hh:46 │ │ │ │ │ -Dune::TypeTree::TreePathPopBack │ │ │ │ │ -Definition: treepath.hh:49 │ │ │ │ │ -Dune::TypeTree::TreePathPopFront │ │ │ │ │ -Definition: treepath.hh:52 │ │ │ │ │ -Dune::TypeTree::TreePathConcat │ │ │ │ │ -Definition: treepath.hh:55 │ │ │ │ │ -Dune::TypeTree::TreePathPushBack<_HybridTreePath<_index_constant<_i_>..._>,_k │ │ │ │ │ ->::type │ │ │ │ │ -HybridTreePath< index_constant< i >..., index_constant< k > > type │ │ │ │ │ -Definition: treepath.hh:433 │ │ │ │ │ -Dune::TypeTree::TreePathPushFront<_HybridTreePath<_index_constant<_i_>..._>,_k │ │ │ │ │ ->::type │ │ │ │ │ -HybridTreePath< index_constant< k >, index_constant< i >... > type │ │ │ │ │ -Definition: treepath.hh:439 │ │ │ │ │ -Dune::TypeTree::TreePathPopBack<_HybridTreePath<_index_constant<_k_>_>,_i... │ │ │ │ │ ->::type │ │ │ │ │ -HybridTreePath< index_constant< i >... > type │ │ │ │ │ -Definition: treepath.hh:460 │ │ │ │ │ -Dune::TypeTree::TreePathPopFront<_HybridTreePath<_index_constant<_k_>, │ │ │ │ │ -index_constant<_i_>..._>_>::type │ │ │ │ │ -HybridTreePath< index_constant< i >... > type │ │ │ │ │ -Definition: treepath.hh:474 │ │ │ │ │ -Dune::TypeTree::TreePathConcat<_HybridTreePath<_index_constant<_i_>..._>, │ │ │ │ │ -HybridTreePath<_index_constant<_k_>..._>_>::type │ │ │ │ │ -HybridTreePath< index_constant< i >..., index_constant< k >... > type │ │ │ │ │ -Definition: treepath.hh:480 │ │ │ │ │ +Dune::TypeTree::Exception │ │ │ │ │ +Base class for all TypeTree exceptions. │ │ │ │ │ +Definition: exceptions.hh:19 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: traversalutilities.hh File Reference │ │ │ │ +dune-typetree: powernode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,102 +63,48 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
traversalutilities.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
powernode.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/typetree/traversal.hh>
│ │ │ │ +
#include <cassert>
│ │ │ │ +#include <array>
│ │ │ │ +#include <memory>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/common/std/type_traits.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/utility.hh>
│ │ │ │ +#include <dune/typetree/childextraction.hh>
│ │ │ │ +#include <dune/typetree/typetraits.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  Dune::TypeTree::PowerNode< T, k >
 Collect k instances of type T within a dune-typetree. More...
 
struct  Dune::TypeTree::PowerNode< T, k >::Child< i >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Functions

template<typename ResultType , typename Tree , typename F , typename R >
ResultType Dune::TypeTree::reduceOverLeafs (const Tree &tree, F functor, R reduction, ResultType startValue)
 Calculate a quantity as a reduction over the leaf nodes of a TypeTree. More...
 
│ │ │ │ -

Variable Documentation

│ │ │ │ - │ │ │ │ -

◆ _functor

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
F _functor
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -

◆ _reduction

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
R _reduction
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -

◆ _value

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
ResultType _value
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -

◆ treePathType

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
const TreePathType::Type treePathType = TreePathType::dynamic
│ │ │ │ -
│ │ │ │ -static
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,35 +4,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -traversalutilities.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +powernode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ + class  Dune::TypeTree::PowerNode<_T,_k_> │ │ │ │ │ +  Collect k instances of type T within a dune-typetree. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::PowerNode<_T,_k_>::Child<_i_> │ │ │ │ │ +  Access to the type and storage type of the i-th child. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -ResultType Dune::TypeTree::reduceOverLeafs (const Tree &tree, F functor, R │ │ │ │ │ - reduction, ResultType startValue) │ │ │ │ │ -  Calculate a quantity as a reduction over the leaf nodes of a │ │ │ │ │ - TypeTree. More... │ │ │ │ │ -  │ │ │ │ │ -***** Variable Documentation ***** │ │ │ │ │ -***** ◆ _functor ***** │ │ │ │ │ -F _functor │ │ │ │ │ -***** ◆ _reduction ***** │ │ │ │ │ -R _reduction │ │ │ │ │ -***** ◆ _value ***** │ │ │ │ │ -ResultType _value │ │ │ │ │ -***** ◆ treePathType ***** │ │ │ │ │ -const TreePathType::Type treePathType = TreePathType::dynamic static │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: traversalutilities.hh Source File │ │ │ │ +dune-typetree: powernode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,87 +62,355 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
traversalutilities.hh
│ │ │ │ +
powernode.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_POWERNODE_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ -
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ -
10 namespace TypeTree {
│ │ │ │ +
7#include <cassert>
│ │ │ │ +
8#include <array>
│ │ │ │ +
9#include <memory>
│ │ │ │ +
10#include <type_traits>
│ │ │ │
11
│ │ │ │ -
17 namespace {
│ │ │ │ -
18
│ │ │ │ -
20
│ │ │ │ -
25 template<typename F, typename R, typename ResultType>
│ │ │ │ -
26 struct LeafReductionVisitor
│ │ │ │ -
27 : public TypeTree::TreeVisitor
│ │ │ │ -
28 {
│ │ │ │ -
29
│ │ │ │ - │ │ │ │ -
31
│ │ │ │ -
32 template<typename Node, typename TreePath>
│ │ │ │ -
33 void leaf(const Node& node, TreePath treePath)
│ │ │ │ -
34 {
│ │ │ │ - │ │ │ │ -
36 }
│ │ │ │ -
37
│ │ │ │ -
38 LeafReductionVisitor(F functor, R reduction, ResultType startValue)
│ │ │ │ -
39 : _functor(functor)
│ │ │ │ -
40 , _reduction(reduction)
│ │ │ │ -
41 , _value(startValue)
│ │ │ │ -
42 {}
│ │ │ │ -
43
│ │ │ │ -
44 ResultType result() { return _value; }
│ │ │ │ -
45
│ │ │ │ - │ │ │ │ - │ │ │ │ -
48 ResultType _value;
│ │ │ │ -
49
│ │ │ │ -
50 };
│ │ │ │ +
12#include <dune/common/typetraits.hh>
│ │ │ │ +
13#include <dune/common/std/type_traits.hh>
│ │ │ │ +
14
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
19
│ │ │ │ +
20namespace Dune {
│ │ │ │ +
21 namespace TypeTree {
│ │ │ │ +
22
│ │ │ │ +
29#ifndef DOXYGEN
│ │ │ │ +
30
│ │ │ │ +
32 template<typename PowerNode, typename T, std::size_t k>
│ │ │ │ +
33 struct AssertPowerNodeChildCount
│ │ │ │ +
34 : public std::enable_if<std::is_same<
│ │ │ │ +
35 typename PowerNode::ChildType,
│ │ │ │ +
36 T>::value &&
│ │ │ │ +
37 PowerNode::degree() == k,
│ │ │ │ +
38 T>
│ │ │ │ +
39 {};
│ │ │ │ +
40
│ │ │ │ +
41#endif
│ │ │ │ +
42
│ │ │ │ +
48 template<typename T, std::size_t k>
│ │ │ │ + │ │ │ │ +
50 {
│ │ │ │
51
│ │ │ │ -
52 } // anonymous namespace
│ │ │ │ +
52 public:
│ │ │ │
53
│ │ │ │ -
55
│ │ │ │ -
80 template<typename ResultType, typename Tree, typename F, typename R>
│ │ │ │ -
81 ResultType reduceOverLeafs(const Tree& tree, F functor, R reduction, ResultType startValue)
│ │ │ │ -
82 {
│ │ │ │ -
83 LeafReductionVisitor<F,R,ResultType> visitor(functor,reduction,startValue);
│ │ │ │ -
84 TypeTree::applyToTree(tree,visitor);
│ │ │ │ -
85 return visitor.result();
│ │ │ │ -
86 }
│ │ │ │ -
87
│ │ │ │ -
89
│ │ │ │ -
90 } // namespace TypeTree
│ │ │ │ -
91} //namespace Dune
│ │ │ │ -
92
│ │ │ │ -
93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ -
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │ - │ │ │ │ -
R _reduction
Definition: traversalutilities.hh:47
│ │ │ │ -
F _functor
Definition: traversalutilities.hh:46
│ │ │ │ -
static const TreePathType::Type treePathType
Definition: traversalutilities.hh:30
│ │ │ │ -
ResultType _value
Definition: traversalutilities.hh:48
│ │ │ │ -
ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType startValue)
Calculate a quantity as a reduction over the leaf nodes of a TypeTree.
Definition: traversalutilities.hh:81
│ │ │ │ -
void applyToTree(Tree &&tree, Visitor &&visitor)
Apply visitor to TypeTree.
Definition: traversal.hh:237
│ │ │ │ -
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ -
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │ +
55 static const bool isLeaf = false;
│ │ │ │ +
56
│ │ │ │ +
58 static const bool isPower = true;
│ │ │ │ +
59
│ │ │ │ +
61 static const bool isComposite = false;
│ │ │ │ +
62
│ │ │ │ +
64 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ +
65 static const std::size_t CHILDREN = k;
│ │ │ │ +
66
│ │ │ │ +
67 static constexpr auto degree ()
│ │ │ │ +
68 {
│ │ │ │ +
69 return std::integral_constant<std::size_t,k>{};
│ │ │ │ +
70 }
│ │ │ │ +
71
│ │ │ │ + │ │ │ │ +
74
│ │ │ │ +
76 typedef T ChildType;
│ │ │ │ +
77
│ │ │ │ +
79 typedef std::array<std::shared_ptr<T>,k> NodeStorage;
│ │ │ │ +
80
│ │ │ │ +
81
│ │ │ │ +
83 template<std::size_t i>
│ │ │ │ +
84 struct Child
│ │ │ │ +
85 {
│ │ │ │ +
86
│ │ │ │ +
87 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
88
│ │ │ │ +
90 typedef T Type;
│ │ │ │ +
91
│ │ │ │ +
93 typedef T type;
│ │ │ │ +
94 };
│ │ │ │ +
95
│ │ │ │ +
98
│ │ │ │ +
100
│ │ │ │ +
103 template<std::size_t i>
│ │ │ │ +
104 T& child (index_constant<i> = {})
│ │ │ │ +
105 {
│ │ │ │ +
106 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
107 return *_children[i];
│ │ │ │ +
108 }
│ │ │ │ +
109
│ │ │ │ +
111
│ │ │ │ +
114 template<std::size_t i>
│ │ │ │ +
115 const T& child (index_constant<i> = {}) const
│ │ │ │ +
116 {
│ │ │ │ +
117 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
118 return *_children[i];
│ │ │ │ +
119 }
│ │ │ │ +
120
│ │ │ │ +
122
│ │ │ │ +
125 template<std::size_t i>
│ │ │ │ +
126 std::shared_ptr<T> childStorage (index_constant<i> = {})
│ │ │ │ +
127 {
│ │ │ │ +
128 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
129 return _children[i];
│ │ │ │ +
130 }
│ │ │ │ +
131
│ │ │ │ +
133
│ │ │ │ +
136 template<std::size_t i>
│ │ │ │ +
137 std::shared_ptr<const T> childStorage (index_constant<i> = {}) const
│ │ │ │ +
138 {
│ │ │ │ +
139 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
140 return _children[i];
│ │ │ │ +
141 }
│ │ │ │ +
142
│ │ │ │ +
144 template<std::size_t i>
│ │ │ │ +
145 void setChild (T& t, index_constant<i> = {})
│ │ │ │ +
146 {
│ │ │ │ +
147 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
148 _children[i] = stackobject_to_shared_ptr(t);
│ │ │ │ +
149 }
│ │ │ │ +
150
│ │ │ │ +
152 template<std::size_t i>
│ │ │ │ +
153 void setChild (T&& t, index_constant<i> = {})
│ │ │ │ +
154 {
│ │ │ │ +
155 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
156 _children[i] = convert_arg(std::move(t));
│ │ │ │ +
157 }
│ │ │ │ +
158
│ │ │ │ +
160 template<std::size_t i>
│ │ │ │ +
161 void setChild (std::shared_ptr<T> st, index_constant<i> = {})
│ │ │ │ +
162 {
│ │ │ │ +
163 static_assert((i < degree()), "child index out of range");
│ │ │ │ +
164 _children[i] = std::move(st);
│ │ │ │ +
165 }
│ │ │ │ +
166
│ │ │ │ +
168
│ │ │ │ +
169
│ │ │ │ +
172
│ │ │ │ +
174
│ │ │ │ +
177 T& child (std::size_t i)
│ │ │ │ +
178 {
│ │ │ │ +
179 assert(i < degree() && "child index out of range");
│ │ │ │ +
180 return *_children[i];
│ │ │ │ +
181 }
│ │ │ │ +
182
│ │ │ │ +
184
│ │ │ │ +
187 const T& child (std::size_t i) const
│ │ │ │ +
188 {
│ │ │ │ +
189 assert(i < degree() && "child index out of range");
│ │ │ │ +
190 return *_children[i];
│ │ │ │ +
191 }
│ │ │ │ +
192
│ │ │ │ +
194
│ │ │ │ +
197 std::shared_ptr<T> childStorage (std::size_t i)
│ │ │ │ +
198 {
│ │ │ │ +
199 assert(i < degree() && "child index out of range");
│ │ │ │ +
200 return _children[i];
│ │ │ │ +
201 }
│ │ │ │ +
202
│ │ │ │ +
204
│ │ │ │ +
207 std::shared_ptr<const T> childStorage (std::size_t i) const
│ │ │ │ +
208 {
│ │ │ │ +
209 assert(i < degree() && "child index out of range");
│ │ │ │ +
210 return _children[i];
│ │ │ │ +
211 }
│ │ │ │ +
212
│ │ │ │ +
214 void setChild (std::size_t i, T& t)
│ │ │ │ +
215 {
│ │ │ │ +
216 assert(i < degree() && "child index out of range");
│ │ │ │ +
217 _children[i] = stackobject_to_shared_ptr(t);
│ │ │ │ +
218 }
│ │ │ │ +
219
│ │ │ │ +
221 void setChild (std::size_t i, T&& t)
│ │ │ │ +
222 {
│ │ │ │ +
223 assert(i < degree() && "child index out of range");
│ │ │ │ +
224 _children[i] = convert_arg(std::move(t));
│ │ │ │ +
225 }
│ │ │ │ +
226
│ │ │ │ +
228 void setChild (std::size_t i, std::shared_ptr<T> st)
│ │ │ │ +
229 {
│ │ │ │ +
230 assert(i < degree() && "child index out of range");
│ │ │ │ +
231 _children[i] = std::move(st);
│ │ │ │ +
232 }
│ │ │ │ +
233
│ │ │ │ +
234 const NodeStorage& nodeStorage () const
│ │ │ │ +
235 {
│ │ │ │ +
236 return _children;
│ │ │ │ +
237 }
│ │ │ │ +
238
│ │ │ │ +
240
│ │ │ │ +
243
│ │ │ │ +
244 // The following two methods require a little bit of SFINAE trickery to work correctly:
│ │ │ │ +
245 // We have to make sure that they don't shadow the methods for direct child access because
│ │ │ │ +
246 // those get called by the generic child() machinery. If that machinery picks up the methods
│ │ │ │ +
247 // defined below, we have an infinite recursion.
│ │ │ │ +
248 // So the methods make sure that either
│ │ │ │ +
249 //
│ │ │ │ +
250 // * there are more than one argument. In that case, we got multiple indices and can forward
│ │ │ │ +
251 // to the general machine.
│ │ │ │ +
252 //
│ │ │ │ +
253 // * the first argument is not a valid flat index, i.e. either a std::size_t or an index_constant.
│ │ │ │ +
254 // The argument thus has to be some kind of TreePath instance that we can also pass to the
│ │ │ │ +
255 // generic machine.
│ │ │ │ +
256 //
│ │ │ │ +
257 // The above SFINAE logic works, but there is still a problem with the return type deduction.
│ │ │ │ +
258 // We have to do a lazy lookup of the return type after SFINAE has succeeded, otherwise the return
│ │ │ │ +
259 // type deduction will trigger the infinite recursion.
│ │ │ │ +
260
│ │ │ │ +
262
│ │ │ │ +
266#ifdef DOXYGEN
│ │ │ │ +
267 template<typename... Indices>
│ │ │ │ +
268 ImplementationDefined& child (Indices... indices)
│ │ │ │ +
269#else
│ │ │ │ +
270 template<typename I0, typename... I,
│ │ │ │ +
271 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ +
272 decltype(auto) child (I0 i0, I... i)
│ │ │ │ +
273#endif
│ │ │ │ +
274 {
│ │ │ │ +
275 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ +
276 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ +
277 );
│ │ │ │ +
278 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ +
279 }
│ │ │ │ +
280
│ │ │ │ +
282
│ │ │ │ +
286#ifdef DOXYGEN
│ │ │ │ +
287 template<typename... Indices>
│ │ │ │ +
288 const ImplementationDefined& child (Indices... indices)
│ │ │ │ +
289#else
│ │ │ │ +
290 template<typename I0, typename... I,
│ │ │ │ +
291 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ +
292 decltype(auto) child (I0 i0, I... i) const
│ │ │ │ +
293#endif
│ │ │ │ +
294 {
│ │ │ │ +
295 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ +
296 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ +
297 );
│ │ │ │ +
298 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ +
299 }
│ │ │ │ +
300
│ │ │ │ +
302
│ │ │ │ +
305
│ │ │ │ +
306 protected:
│ │ │ │ +
307
│ │ │ │ +
309
│ │ │ │ + │ │ │ │ +
318 {}
│ │ │ │ +
319
│ │ │ │ +
321 explicit PowerNode (const NodeStorage& children)
│ │ │ │ +
322 : _children(children)
│ │ │ │ +
323 {}
│ │ │ │ +
324
│ │ │ │ +
326 explicit PowerNode (T& t, bool distinct_objects = true)
│ │ │ │ +
327 {
│ │ │ │ +
328 if (distinct_objects)
│ │ │ │ +
329 {
│ │ │ │ +
330 for (typename NodeStorage::iterator it = _children.begin(); it != _children.end(); ++it)
│ │ │ │ +
331 *it = std::make_shared<T>(t);
│ │ │ │ +
332 }
│ │ │ │ +
333 else
│ │ │ │ +
334 {
│ │ │ │ +
335 std::shared_ptr<T> sp = stackobject_to_shared_ptr(t);
│ │ │ │ +
336 std::fill(_children.begin(),_children.end(),sp);
│ │ │ │ +
337 }
│ │ │ │ +
338 }
│ │ │ │ +
339
│ │ │ │ +
340#ifdef DOXYGEN
│ │ │ │ +
341
│ │ │ │ +
343 PowerNode(T& t1, T& t2, ...)
│ │ │ │ +
344 {}
│ │ │ │ +
345
│ │ │ │ +
346#else
│ │ │ │ +
347
│ │ │ │ +
348 template<typename... Children,
│ │ │ │ +
349 std::enable_if_t<
│ │ │ │ +
350 std::conjunction<std::is_same<ChildType, std::decay_t<Children>>...>::value
│ │ │ │ +
351 ,int> = 0>
│ │ │ │ +
352 PowerNode (Children&&... children)
│ │ │ │ +
353 {
│ │ │ │ +
354 static_assert(degree() == sizeof...(Children), "PowerNode constructor is called with incorrect number of children");
│ │ │ │ +
355 _children = NodeStorage{convert_arg(std::forward<Children>(children))...};
│ │ │ │ +
356 }
│ │ │ │ +
357
│ │ │ │ +
358 template<typename... Children,
│ │ │ │ +
359 std::enable_if_t<
│ │ │ │ +
360 std::conjunction<std::is_same<ChildType, Children>...>::value
│ │ │ │ +
361 ,int> = 0>
│ │ │ │ +
362 PowerNode (std::shared_ptr<Children>... children)
│ │ │ │ +
363 {
│ │ │ │ +
364 static_assert(degree() == sizeof...(Children), "PowerNode constructor is called with incorrect number of children");
│ │ │ │ +
365 _children = NodeStorage{children...};
│ │ │ │ +
366 }
│ │ │ │ +
367
│ │ │ │ +
368#endif // DOXYGEN
│ │ │ │ +
369
│ │ │ │ +
371
│ │ │ │ +
372 private:
│ │ │ │ +
373 NodeStorage _children;
│ │ │ │ +
374 };
│ │ │ │ +
375
│ │ │ │ +
377
│ │ │ │ +
378 } // namespace TypeTree
│ │ │ │ +
379} //namespace Dune
│ │ │ │ +
380
│ │ │ │ +
381#endif // DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Type
Definition: treepath.hh:30
│ │ │ │ -
@ dynamic
Definition: treepath.hh:30
│ │ │ │ +
Tag designating a power node.
Definition: nodetags.hh:19
│ │ │ │ +
Collect k instances of type T within a dune-typetree.
Definition: powernode.hh:50
│ │ │ │ +
void setChild(T &t, index_constant< i >={})
Sets the i-th child to the passed-in value.
Definition: powernode.hh:145
│ │ │ │ +
T & child(std::size_t i)
Returns the i-th child.
Definition: powernode.hh:177
│ │ │ │ +
const T & child(index_constant< i >={}) const
Returns the i-th child (const version).
Definition: powernode.hh:115
│ │ │ │ +
void setChild(std::shared_ptr< T > st, index_constant< i >={})
Sets the stored value representing the i-th child to the passed-in value.
Definition: powernode.hh:161
│ │ │ │ +
std::shared_ptr< T > childStorage(index_constant< i >={})
Returns the storage of the i-th child.
Definition: powernode.hh:126
│ │ │ │ +
PowerNode(T &t1, T &t2,...)
Initialize all children with the passed-in objects.
Definition: powernode.hh:343
│ │ │ │ +
const NodeStorage & nodeStorage() const
Definition: powernode.hh:234
│ │ │ │ +
std::array< std::shared_ptr< T >, k > NodeStorage
The type used for storing the children.
Definition: powernode.hh:79
│ │ │ │ +
std::shared_ptr< const T > childStorage(index_constant< i >={}) const
Returns the storage of the i-th child (const version).
Definition: powernode.hh:137
│ │ │ │ +
PowerNode(T &t, bool distinct_objects=true)
Initialize all children with copies of a storage object constructed from the parameter t.
Definition: powernode.hh:326
│ │ │ │ +
PowerNodeTag NodeTag
The type tag that describes a PowerNode.
Definition: powernode.hh:73
│ │ │ │ +
const T & child(std::size_t i) const
Returns the i-th child (const version).
Definition: powernode.hh:187
│ │ │ │ +
static constexpr auto degree()
Definition: powernode.hh:67
│ │ │ │ +
std::shared_ptr< const T > childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition: powernode.hh:207
│ │ │ │ +
static const std::size_t CHILDREN
The number of children.
Definition: powernode.hh:65
│ │ │ │ +
void setChild(std::size_t i, std::shared_ptr< T > st)
Sets the stored value representing the i-th child to the passed-in value.
Definition: powernode.hh:228
│ │ │ │ +
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: powernode.hh:61
│ │ │ │ +
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: powernode.hh:55
│ │ │ │ +
static const bool isPower
Mark this class as a power in the dune-typetree.
Definition: powernode.hh:58
│ │ │ │ +
PowerNode(const NodeStorage &children)
Initialize the PowerNode with a copy of the passed-in storage type.
Definition: powernode.hh:321
│ │ │ │ +
T ChildType
The type of each child.
Definition: powernode.hh:76
│ │ │ │ +
T & child(index_constant< i >={})
Returns the i-th child.
Definition: powernode.hh:104
│ │ │ │ +
ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: powernode.hh:268
│ │ │ │ +
void setChild(std::size_t i, T &&t)
Store the passed value in i-th child.
Definition: powernode.hh:221
│ │ │ │ +
void setChild(T &&t, index_constant< i >={})
Store the passed value in i-th child.
Definition: powernode.hh:153
│ │ │ │ +
PowerNode()
Default constructor.
Definition: powernode.hh:317
│ │ │ │ +
const ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: powernode.hh:288
│ │ │ │ +
void setChild(std::size_t i, T &t)
Sets the i-th child to the passed-in value.
Definition: powernode.hh:214
│ │ │ │ +
std::shared_ptr< T > childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition: powernode.hh:197
│ │ │ │ +
Access to the type and storage type of the i-th child.
Definition: powernode.hh:85
│ │ │ │ +
T type
The type of the child.
Definition: powernode.hh:93
│ │ │ │ +
T Type
The type of the child.
Definition: powernode.hh:90
│ │ │ │ +
Check if type represents a tree path.
Definition: typetraits.hh:182
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,110 +4,469 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -traversalutilities.hh │ │ │ │ │ +powernode.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9namespace Dune { │ │ │ │ │ - 10 namespace TypeTree { │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ 11 │ │ │ │ │ - 17 namespace { │ │ │ │ │ - 18 │ │ │ │ │ - 20 │ │ │ │ │ - 25 template │ │ │ │ │ - 26 struct LeafReductionVisitor │ │ │ │ │ - 27 : public TypeTree::TreeVisitor │ │ │ │ │ - 28 { │ │ │ │ │ - 29 │ │ │ │ │ -30 static const TreePathType::Type treePathType = TreePathType::dynamic; │ │ │ │ │ - 31 │ │ │ │ │ - 32 template │ │ │ │ │ - 33 void leaf(const Node& node, TreePath treePath) │ │ │ │ │ - 34 { │ │ │ │ │ - 35 _value = _reduction(_value,_functor(node,treePath)); │ │ │ │ │ - 36 } │ │ │ │ │ - 37 │ │ │ │ │ - 38 LeafReductionVisitor(F functor, R reduction, ResultType startValue) │ │ │ │ │ - 39 : _functor(functor) │ │ │ │ │ - 40 , _reduction(reduction) │ │ │ │ │ - 41 , _value(startValue) │ │ │ │ │ - 42 {} │ │ │ │ │ - 43 │ │ │ │ │ - 44 ResultType result() { return _value; } │ │ │ │ │ - 45 │ │ │ │ │ -46 F _functor; │ │ │ │ │ -47 R _reduction; │ │ │ │ │ -48 ResultType _value; │ │ │ │ │ - 49 │ │ │ │ │ - 50 }; │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19 │ │ │ │ │ + 20namespace Dune { │ │ │ │ │ + 21 namespace TypeTree { │ │ │ │ │ + 22 │ │ │ │ │ + 29#ifndef DOXYGEN │ │ │ │ │ + 30 │ │ │ │ │ + 32 template │ │ │ │ │ + 33 struct AssertPowerNodeChildCount │ │ │ │ │ + 34 : public std::enable_if::value && │ │ │ │ │ + 37 PowerNode::degree() == k, │ │ │ │ │ + 38 T> │ │ │ │ │ + 39 {}; │ │ │ │ │ + 40 │ │ │ │ │ + 41#endif │ │ │ │ │ + 42 │ │ │ │ │ + 48 template │ │ │ │ │ +49 class PowerNode │ │ │ │ │ + 50 { │ │ │ │ │ 51 │ │ │ │ │ - 52 } // anonymous namespace │ │ │ │ │ + 52 public: │ │ │ │ │ 53 │ │ │ │ │ - 55 │ │ │ │ │ - 80 template │ │ │ │ │ -81 ResultType reduceOverLeafs(const Tree& tree, F functor, R reduction, │ │ │ │ │ -ResultType startValue) │ │ │ │ │ - 82 { │ │ │ │ │ - 83 LeafReductionVisitor visitor(functor,reduction,startValue); │ │ │ │ │ - 84 TypeTree::applyToTree(tree,visitor); │ │ │ │ │ - 85 return visitor.result(); │ │ │ │ │ - 86 } │ │ │ │ │ - 87 │ │ │ │ │ - 89 │ │ │ │ │ - 90 } // namespace TypeTree │ │ │ │ │ - 91} //namespace Dune │ │ │ │ │ - 92 │ │ │ │ │ - 93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ -result │ │ │ │ │ -static const result_type result │ │ │ │ │ -Definition: accumulate_static.hh:110 │ │ │ │ │ -traversal.hh │ │ │ │ │ -_reduction │ │ │ │ │ -R _reduction │ │ │ │ │ -Definition: traversalutilities.hh:47 │ │ │ │ │ -_functor │ │ │ │ │ -F _functor │ │ │ │ │ -Definition: traversalutilities.hh:46 │ │ │ │ │ -treePathType │ │ │ │ │ -static const TreePathType::Type treePathType │ │ │ │ │ -Definition: traversalutilities.hh:30 │ │ │ │ │ -_value │ │ │ │ │ -ResultType _value │ │ │ │ │ -Definition: traversalutilities.hh:48 │ │ │ │ │ -Dune::TypeTree::reduceOverLeafs │ │ │ │ │ -ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType │ │ │ │ │ -startValue) │ │ │ │ │ -Calculate a quantity as a reduction over the leaf nodes of a TypeTree. │ │ │ │ │ -Definition: traversalutilities.hh:81 │ │ │ │ │ -Dune::TypeTree::applyToTree │ │ │ │ │ -void applyToTree(Tree &&tree, Visitor &&visitor) │ │ │ │ │ -Apply visitor to TypeTree. │ │ │ │ │ -Definition: traversal.hh:237 │ │ │ │ │ -Dune::TypeTree::treePath │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -Definition: treepath.hh:191 │ │ │ │ │ -Dune::TypeTree::TreePath │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -Definition: treepath.hh:521 │ │ │ │ │ +55 static const bool isLeaf = false; │ │ │ │ │ + 56 │ │ │ │ │ +58 static const bool isPower = true; │ │ │ │ │ + 59 │ │ │ │ │ +61 static const bool isComposite = false; │ │ │ │ │ + 62 │ │ │ │ │ + 64 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +65 static const std::size_t CHILDREN = k; │ │ │ │ │ + 66 │ │ │ │ │ +67 static constexpr auto degree () │ │ │ │ │ + 68 { │ │ │ │ │ + 69 return std::integral_constant{}; │ │ │ │ │ + 70 } │ │ │ │ │ + 71 │ │ │ │ │ +73 typedef PowerNodeTag NodeTag; │ │ │ │ │ + 74 │ │ │ │ │ +76 typedef T ChildType; │ │ │ │ │ + 77 │ │ │ │ │ +79 typedef std::array,k> NodeStorage; │ │ │ │ │ + 80 │ │ │ │ │ + 81 │ │ │ │ │ + 83 template │ │ │ │ │ +84 struct Child │ │ │ │ │ + 85 { │ │ │ │ │ + 86 │ │ │ │ │ + 87 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 88 │ │ │ │ │ +90 typedef T Type; │ │ │ │ │ + 91 │ │ │ │ │ +93 typedef T type; │ │ │ │ │ + 94 }; │ │ │ │ │ + 95 │ │ │ │ │ + 98 │ │ │ │ │ + 100 │ │ │ │ │ + 103 template │ │ │ │ │ +104 T& child (index_constant = {}) │ │ │ │ │ + 105 { │ │ │ │ │ + 106 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 107 return *_children[i]; │ │ │ │ │ + 108 } │ │ │ │ │ + 109 │ │ │ │ │ + 111 │ │ │ │ │ + 114 template │ │ │ │ │ +115 const T& child (index_constant = {}) const │ │ │ │ │ + 116 { │ │ │ │ │ + 117 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 118 return *_children[i]; │ │ │ │ │ + 119 } │ │ │ │ │ + 120 │ │ │ │ │ + 122 │ │ │ │ │ + 125 template │ │ │ │ │ +126 std::shared_ptr childStorage (index_constant = {}) │ │ │ │ │ + 127 { │ │ │ │ │ + 128 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 129 return _children[i]; │ │ │ │ │ + 130 } │ │ │ │ │ + 131 │ │ │ │ │ + 133 │ │ │ │ │ + 136 template │ │ │ │ │ +137 std::shared_ptr childStorage (index_constant = {}) const │ │ │ │ │ + 138 { │ │ │ │ │ + 139 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 140 return _children[i]; │ │ │ │ │ + 141 } │ │ │ │ │ + 142 │ │ │ │ │ + 144 template │ │ │ │ │ +145 void setChild (T& t, index_constant = {}) │ │ │ │ │ + 146 { │ │ │ │ │ + 147 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 148 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ + 149 } │ │ │ │ │ + 150 │ │ │ │ │ + 152 template │ │ │ │ │ +153 void setChild (T&& t, index_constant = {}) │ │ │ │ │ + 154 { │ │ │ │ │ + 155 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 156 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ + 157 } │ │ │ │ │ + 158 │ │ │ │ │ + 160 template │ │ │ │ │ +161 void setChild (std::shared_ptr st, index_constant = {}) │ │ │ │ │ + 162 { │ │ │ │ │ + 163 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ + 164 _children[i] = std::move(st); │ │ │ │ │ + 165 } │ │ │ │ │ + 166 │ │ │ │ │ + 168 │ │ │ │ │ + 169 │ │ │ │ │ + 172 │ │ │ │ │ + 174 │ │ │ │ │ +177 T& child (std::size_t i) │ │ │ │ │ + 178 { │ │ │ │ │ + 179 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 180 return *_children[i]; │ │ │ │ │ + 181 } │ │ │ │ │ + 182 │ │ │ │ │ + 184 │ │ │ │ │ +187 const T& child (std::size_t i) const │ │ │ │ │ + 188 { │ │ │ │ │ + 189 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 190 return *_children[i]; │ │ │ │ │ + 191 } │ │ │ │ │ + 192 │ │ │ │ │ + 194 │ │ │ │ │ +197 std::shared_ptr childStorage (std::size_t i) │ │ │ │ │ + 198 { │ │ │ │ │ + 199 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 200 return _children[i]; │ │ │ │ │ + 201 } │ │ │ │ │ + 202 │ │ │ │ │ + 204 │ │ │ │ │ +207 std::shared_ptr childStorage (std::size_t i) const │ │ │ │ │ + 208 { │ │ │ │ │ + 209 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 210 return _children[i]; │ │ │ │ │ + 211 } │ │ │ │ │ + 212 │ │ │ │ │ +214 void setChild (std::size_t i, T& t) │ │ │ │ │ + 215 { │ │ │ │ │ + 216 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 217 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ + 218 } │ │ │ │ │ + 219 │ │ │ │ │ +221 void setChild (std::size_t i, T&& t) │ │ │ │ │ + 222 { │ │ │ │ │ + 223 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 224 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ + 225 } │ │ │ │ │ + 226 │ │ │ │ │ +228 void setChild (std::size_t i, std::shared_ptr st) │ │ │ │ │ + 229 { │ │ │ │ │ + 230 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 231 _children[i] = std::move(st); │ │ │ │ │ + 232 } │ │ │ │ │ + 233 │ │ │ │ │ +234 const NodeStorage& nodeStorage () const │ │ │ │ │ + 235 { │ │ │ │ │ + 236 return _children; │ │ │ │ │ + 237 } │ │ │ │ │ + 238 │ │ │ │ │ + 240 │ │ │ │ │ + 243 │ │ │ │ │ + 244 // The following two methods require a little bit of SFINAE trickery to │ │ │ │ │ +work correctly: │ │ │ │ │ + 245 // We have to make sure that they don't shadow the methods for direct │ │ │ │ │ +child access because │ │ │ │ │ + 246 // those get called by the generic child() machinery. If that machinery │ │ │ │ │ +picks up the methods │ │ │ │ │ + 247 // defined below, we have an infinite recursion. │ │ │ │ │ + 248 // So the methods make sure that either │ │ │ │ │ + 249 // │ │ │ │ │ + 250 // * there are more than one argument. In that case, we got multiple │ │ │ │ │ +indices and can forward │ │ │ │ │ + 251 // to the general machine. │ │ │ │ │ + 252 // │ │ │ │ │ + 253 // * the first argument is not a valid flat index, i.e. either a std:: │ │ │ │ │ +size_t or an index_constant. │ │ │ │ │ + 254 // The argument thus has to be some kind of TreePath instance that we can │ │ │ │ │ +also pass to the │ │ │ │ │ + 255 // generic machine. │ │ │ │ │ + 256 // │ │ │ │ │ + 257 // The above SFINAE logic works, but there is still a problem with the │ │ │ │ │ +return type deduction. │ │ │ │ │ + 258 // We have to do a lazy lookup of the return type after SFINAE has │ │ │ │ │ +succeeded, otherwise the return │ │ │ │ │ + 259 // type deduction will trigger the infinite recursion. │ │ │ │ │ + 260 │ │ │ │ │ + 262 │ │ │ │ │ + 266#ifdef DOXYGEN │ │ │ │ │ + 267 template │ │ │ │ │ +268 ImplementationDefined& child (Indices... indices) │ │ │ │ │ + 269#else │ │ │ │ │ + 270 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ + 272 decltype(auto) child (I0 i0, I... i) │ │ │ │ │ + 273#endif │ │ │ │ │ + 274 { │ │ │ │ │ + 275 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ + 276 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ +the freestanding version child(node,treePath) instead." │ │ │ │ │ + 277 ); │ │ │ │ │ + 278 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ + 279 } │ │ │ │ │ + 280 │ │ │ │ │ + 282 │ │ │ │ │ + 286#ifdef DOXYGEN │ │ │ │ │ + 287 template │ │ │ │ │ +288 const ImplementationDefined& child (Indices... indices) │ │ │ │ │ + 289#else │ │ │ │ │ + 290 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ + 292 decltype(auto) child (I0 i0, I... i) const │ │ │ │ │ + 293#endif │ │ │ │ │ + 294 { │ │ │ │ │ + 295 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ + 296 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ +the freestanding version child(node,treePath) instead." │ │ │ │ │ + 297 ); │ │ │ │ │ + 298 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ + 299 } │ │ │ │ │ + 300 │ │ │ │ │ + 302 │ │ │ │ │ + 305 │ │ │ │ │ + 306 protected: │ │ │ │ │ + 307 │ │ │ │ │ + 309 │ │ │ │ │ +317 PowerNode () │ │ │ │ │ + 318 {} │ │ │ │ │ + 319 │ │ │ │ │ +321 explicit PowerNode (const NodeStorage& children) │ │ │ │ │ + 322 : _children(children) │ │ │ │ │ + 323 {} │ │ │ │ │ + 324 │ │ │ │ │ +326 explicit PowerNode (T& t, bool distinct_objects = true) │ │ │ │ │ + 327 { │ │ │ │ │ + 328 if (distinct_objects) │ │ │ │ │ + 329 { │ │ │ │ │ + 330 for (typename NodeStorage::iterator it = _children.begin(); it != │ │ │ │ │ +_children.end(); ++it) │ │ │ │ │ + 331 *it = std::make_shared(t); │ │ │ │ │ + 332 } │ │ │ │ │ + 333 else │ │ │ │ │ + 334 { │ │ │ │ │ + 335 std::shared_ptr sp = stackobject_to_shared_ptr(t); │ │ │ │ │ + 336 std::fill(_children.begin(),_children.end(),sp); │ │ │ │ │ + 337 } │ │ │ │ │ + 338 } │ │ │ │ │ + 339 │ │ │ │ │ + 340#ifdef DOXYGEN │ │ │ │ │ + 341 │ │ │ │ │ +343 PowerNode(T& t1, T& t2, ...) │ │ │ │ │ + 344 {} │ │ │ │ │ + 345 │ │ │ │ │ + 346#else │ │ │ │ │ + 347 │ │ │ │ │ + 348 template>...>:: │ │ │ │ │ +value │ │ │ │ │ + 351 ,int> = 0> │ │ │ │ │ + 352 PowerNode (Children&&... children) │ │ │ │ │ + 353 { │ │ │ │ │ + 354 static_assert(degree() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ +called with incorrect number of children"); │ │ │ │ │ + 355 _children = NodeStorage{convert_arg(std::forward(children))...}; │ │ │ │ │ + 356 } │ │ │ │ │ + 357 │ │ │ │ │ + 358 template...>::value │ │ │ │ │ + 361 ,int> = 0> │ │ │ │ │ + 362 PowerNode (std::shared_ptr... children) │ │ │ │ │ + 363 { │ │ │ │ │ + 364 static_assert(degree() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ +called with incorrect number of children"); │ │ │ │ │ + 365 _children = NodeStorage{children...}; │ │ │ │ │ + 366 } │ │ │ │ │ + 367 │ │ │ │ │ + 368#endif // DOXYGEN │ │ │ │ │ + 369 │ │ │ │ │ + 371 │ │ │ │ │ + 372 private: │ │ │ │ │ + 373 NodeStorage _children; │ │ │ │ │ + 374 }; │ │ │ │ │ + 375 │ │ │ │ │ + 377 │ │ │ │ │ + 378 } // namespace TypeTree │ │ │ │ │ + 379} //namespace Dune │ │ │ │ │ + 380 │ │ │ │ │ + 381#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ +childextraction.hh │ │ │ │ │ +utility.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ +typetraits.hh │ │ │ │ │ +Dune::TypeTree::child │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: childextraction.hh:126 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::TreePathType::Type │ │ │ │ │ -Type │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ -Dune::TypeTree::TreePathType::dynamic │ │ │ │ │ -@ dynamic │ │ │ │ │ -Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::PowerNodeTag │ │ │ │ │ +Tag designating a power node. │ │ │ │ │ +Definition: nodetags.hh:19 │ │ │ │ │ +Dune::TypeTree::PowerNode │ │ │ │ │ +Collect k instances of type T within a dune-typetree. │ │ │ │ │ +Definition: powernode.hh:50 │ │ │ │ │ +Dune::TypeTree::PowerNode::setChild │ │ │ │ │ +void setChild(T &t, index_constant< i >={}) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +Definition: powernode.hh:145 │ │ │ │ │ +Dune::TypeTree::PowerNode::child │ │ │ │ │ +T & child(std::size_t i) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +Definition: powernode.hh:177 │ │ │ │ │ +Dune::TypeTree::PowerNode::child │ │ │ │ │ +const T & child(index_constant< i >={}) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +Definition: powernode.hh:115 │ │ │ │ │ +Dune::TypeTree::PowerNode::setChild │ │ │ │ │ +void setChild(std::shared_ptr< T > st, index_constant< i >={}) │ │ │ │ │ +Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ +Definition: powernode.hh:161 │ │ │ │ │ +Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ +std::shared_ptr< T > childStorage(index_constant< i >={}) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +Definition: powernode.hh:126 │ │ │ │ │ +Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ +PowerNode(T &t1, T &t2,...) │ │ │ │ │ +Initialize all children with the passed-in objects. │ │ │ │ │ +Definition: powernode.hh:343 │ │ │ │ │ +Dune::TypeTree::PowerNode::nodeStorage │ │ │ │ │ +const NodeStorage & nodeStorage() const │ │ │ │ │ +Definition: powernode.hh:234 │ │ │ │ │ +Dune::TypeTree::PowerNode::NodeStorage │ │ │ │ │ +std::array< std::shared_ptr< T >, k > NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +Definition: powernode.hh:79 │ │ │ │ │ +Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ +std::shared_ptr< const T > childStorage(index_constant< i >={}) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +Definition: powernode.hh:137 │ │ │ │ │ +Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ +PowerNode(T &t, bool distinct_objects=true) │ │ │ │ │ +Initialize all children with copies of a storage object constructed from the │ │ │ │ │ +parameter t. │ │ │ │ │ +Definition: powernode.hh:326 │ │ │ │ │ +Dune::TypeTree::PowerNode::NodeTag │ │ │ │ │ +PowerNodeTag NodeTag │ │ │ │ │ +The type tag that describes a PowerNode. │ │ │ │ │ +Definition: powernode.hh:73 │ │ │ │ │ +Dune::TypeTree::PowerNode::child │ │ │ │ │ +const T & child(std::size_t i) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +Definition: powernode.hh:187 │ │ │ │ │ +Dune::TypeTree::PowerNode::degree │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +Definition: powernode.hh:67 │ │ │ │ │ +Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ +std::shared_ptr< const T > childStorage(std::size_t i) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +Definition: powernode.hh:207 │ │ │ │ │ +Dune::TypeTree::PowerNode::CHILDREN │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +Definition: powernode.hh:65 │ │ │ │ │ +Dune::TypeTree::PowerNode::setChild │ │ │ │ │ +void setChild(std::size_t i, std::shared_ptr< T > st) │ │ │ │ │ +Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ +Definition: powernode.hh:228 │ │ │ │ │ +Dune::TypeTree::PowerNode::isComposite │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a non composite in the dune-typetree. │ │ │ │ │ +Definition: powernode.hh:61 │ │ │ │ │ +Dune::TypeTree::PowerNode::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +Definition: powernode.hh:55 │ │ │ │ │ +Dune::TypeTree::PowerNode::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a power in the dune-typetree. │ │ │ │ │ +Definition: powernode.hh:58 │ │ │ │ │ +Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ +PowerNode(const NodeStorage &children) │ │ │ │ │ +Initialize the PowerNode with a copy of the passed-in storage type. │ │ │ │ │ +Definition: powernode.hh:321 │ │ │ │ │ +Dune::TypeTree::PowerNode::ChildType │ │ │ │ │ +T ChildType │ │ │ │ │ +The type of each child. │ │ │ │ │ +Definition: powernode.hh:76 │ │ │ │ │ +Dune::TypeTree::PowerNode::child │ │ │ │ │ +T & child(index_constant< i >={}) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +Definition: powernode.hh:104 │ │ │ │ │ +Dune::TypeTree::PowerNode::child │ │ │ │ │ +ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +Definition: powernode.hh:268 │ │ │ │ │ +Dune::TypeTree::PowerNode::setChild │ │ │ │ │ +void setChild(std::size_t i, T &&t) │ │ │ │ │ +Store the passed value in i-th child. │ │ │ │ │ +Definition: powernode.hh:221 │ │ │ │ │ +Dune::TypeTree::PowerNode::setChild │ │ │ │ │ +void setChild(T &&t, index_constant< i >={}) │ │ │ │ │ +Store the passed value in i-th child. │ │ │ │ │ +Definition: powernode.hh:153 │ │ │ │ │ +Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ +PowerNode() │ │ │ │ │ +Default constructor. │ │ │ │ │ +Definition: powernode.hh:317 │ │ │ │ │ +Dune::TypeTree::PowerNode::child │ │ │ │ │ +const ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +Definition: powernode.hh:288 │ │ │ │ │ +Dune::TypeTree::PowerNode::setChild │ │ │ │ │ +void setChild(std::size_t i, T &t) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +Definition: powernode.hh:214 │ │ │ │ │ +Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ +std::shared_ptr< T > childStorage(std::size_t i) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +Definition: powernode.hh:197 │ │ │ │ │ +Dune::TypeTree::PowerNode::Child │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +Definition: powernode.hh:85 │ │ │ │ │ +Dune::TypeTree::PowerNode::Child::type │ │ │ │ │ +T type │ │ │ │ │ +The type of the child. │ │ │ │ │ +Definition: powernode.hh:93 │ │ │ │ │ +Dune::TypeTree::PowerNode::Child::Type │ │ │ │ │ +T Type │ │ │ │ │ +The type of the child. │ │ │ │ │ +Definition: powernode.hh:90 │ │ │ │ │ +Dune::TypeTree::IsTreePath │ │ │ │ │ +Check if type represents a tree path. │ │ │ │ │ +Definition: typetraits.hh:182 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetraits.hh File Reference │ │ │ │ +dune-typetree: pairtraversal.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,101 +63,46 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
typetraits.hh File Reference
│ │ │ │ +
pairtraversal.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +
#include <dune/common/std/type_traits.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/treepath.hh>
│ │ │ │ +#include <dune/typetree/visitor.hh>
│ │ │ │ +#include <dune/typetree/traversal.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

struct  Dune::first_type< T0, T... >
 
struct  Dune::TypeTree::has_node_tag< T >
 
struct  Dune::TypeTree::has_node_tag< T >::yes
 
struct  Dune::TypeTree::has_node_tag< T >::no
 
struct  Dune::TypeTree::has_node_tag_value< T, V >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::maybe< N >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::yes
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::no
 
struct  Dune::TypeTree::has_implementation_tag< T >
 
struct  Dune::TypeTree::has_implementation_tag< T >::yes
 
struct  Dune::TypeTree::has_implementation_tag< T >::no
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >::maybe< N >
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >::yes
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >::no
 
struct  Dune::TypeTree::AlwaysVoid< typename >
 
struct  Dune::TypeTree::meta_function
 Marker tag declaring a meta function. More...
 
struct  Dune::TypeTree::lazy_evaluate< F >
 Helper meta function to delay evaluation of F. More...
 
struct  Dune::TypeTree::lazy_identity< F >
 Identity function. More...
 
struct  Dune::TypeTree::evaluate_if_meta_function< F >
 Meta function that evaluates its argument iff it inherits from meta_function. More...
 
struct  Dune::TypeTree::IsTreePath< T >
 Check if type represents a tree path. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::impl
namespace  Dune::TypeTree::Detail
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<typename T >
T * Dune::TypeTree::declptr ()
 Helper function for generating a pointer to a value of type T in an unevaluated operand setting. More...
 
constexpr auto Dune::TypeTree::impl::isTreePath (void *) -> std::false_type
 
template<class... I>
constexpr auto Dune::TypeTree::impl::isTreePath (const HybridTreePath< I... > *) -> std::true_type
 
template<class T >
constexpr auto Dune::TypeTree::isTreePath (const T &) -> IsTreePath< T >
 Check if given object represents a tree path. More...
 
template<class T1 , class T2 , class TreePath , class V , std::enable_if_t<(std::decay_t< T1 >::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0>
void Dune::TypeTree::Detail::applyToTreePair (T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)
 
template<typename Tree1 , typename Tree2 , typename Visitor >
void Dune::TypeTree::applyToTreePair (Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)
 Apply visitor to a pair of TypeTrees. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,89 +4,37 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -typetraits.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +pairtraversal.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -struct  Dune::first_type<_T0,_T..._> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag<_T_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag<_T_>::yes │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag<_T_>::no │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag_value<_T,_V_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag_value<_T,_V_>::maybe<_N_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag_value<_T,_V_>::yes │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_node_tag_value<_T,_V_>::no │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag<_T_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag<_T_>::yes │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag<_T_>::no │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_>::maybe<_N_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_>::yes │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_>::no │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::AlwaysVoid<_typename_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::meta_function │ │ │ │ │ -  Marker tag declaring a meta function. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::lazy_evaluate<_F_> │ │ │ │ │ -  Helper meta function to delay evaluation of F. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::lazy_identity<_F_> │ │ │ │ │ -  Identity function. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::evaluate_if_meta_function<_F_> │ │ │ │ │ -  Meta function that evaluates its argument iff it inherits from │ │ │ │ │ - meta_function. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::IsTreePath<_T_> │ │ │ │ │ -  Check if type represents a tree path. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ -namespace  Dune::TypeTree::impl │ │ │ │ │ +namespace  Dune::TypeTree::Detail │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ - T * Dune::TypeTree::declptr () │ │ │ │ │ -  Helper function for generating a pointer to a value of type T │ │ │ │ │ - in an unevaluated operand setting. More... │ │ │ │ │ -  │ │ │ │ │ -constexpr auto Dune::TypeTree::impl::isTreePath (void *) -> std::false_type │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto Dune::TypeTree::impl::isTreePath (const HybridTreePath< I... > │ │ │ │ │ - *) -> std::true_type │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto Dune::TypeTree::isTreePath (const T &) -> IsTreePath< T > │ │ │ │ │ -  Check if given object represents a tree path. More... │ │ │ │ │ +template::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0> │ │ │ │ │ +void Dune::TypeTree::Detail::applyToTreePair (T1 &&tree1, T2 &&tree2, TreePath │ │ │ │ │ + treePath, V &&visitor) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::TypeTree::applyToTreePair (Tree1 &&tree1, Tree2 &&tree2, Visitor │ │ │ │ │ + &&visitor) │ │ │ │ │ +  Apply visitor to a pair of TypeTrees. More... │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00071_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetraits.hh Source File │ │ │ │ +dune-typetree: pairtraversal.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,248 +62,146 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
typetraits.hh
│ │ │ │ +
pairtraversal.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │ +
5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │
6
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <dune/common/typetraits.hh>
│ │ │ │ -
9
│ │ │ │ - │ │ │ │ - │ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ +
7#include <dune/common/std/type_traits.hh>
│ │ │ │ +
8
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
14
│ │ │ │ -
15 // Provide some more C++11 TMP helpers.
│ │ │ │ -
16 // These should be upstreamed to dune-common ASAP.
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16 namespace TypeTree {
│ │ │ │
17
│ │ │ │ -
18 template<typename... T>
│ │ │ │ -
19 struct first_type;
│ │ │ │ -
20
│ │ │ │ -
21 template<typename T0, typename... T>
│ │ │ │ -
22 struct first_type<T0,T...>
│ │ │ │ -
23 {
│ │ │ │ -
24 typedef T0 type;
│ │ │ │ -
25 };
│ │ │ │ -
26
│ │ │ │ -
27 namespace TypeTree {
│ │ │ │ -
28
│ │ │ │ -
29 template<typename T>
│ │ │ │ - │ │ │ │ -
31 {
│ │ │ │ -
32 struct yes { char dummy[1]; };
│ │ │ │ -
33 struct no { char dummy[2]; };
│ │ │ │ -
34
│ │ │ │ -
35 template<typename X>
│ │ │ │ -
36 static yes test(NodeTag<X> *);
│ │ │ │ -
37 template<typename X>
│ │ │ │ -
38 static no test(...);
│ │ │ │ -
39
│ │ │ │ -
41 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ -
42 };
│ │ │ │ -
43
│ │ │ │ -
44 template<typename T, typename V>
│ │ │ │ - │ │ │ │ -
46 {
│ │ │ │ -
47 template<int N>
│ │ │ │ -
48 struct maybe { char dummy[N+1]; };
│ │ │ │ -
49 struct yes { char dummy[2]; };
│ │ │ │ -
50 struct no { char dummy[1]; };
│ │ │ │ -
51
│ │ │ │ -
52 template<typename X>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
55 template<typename X>
│ │ │ │ -
56 static no test(...);
│ │ │ │ -
57
│ │ │ │ -
59 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ -
60 };
│ │ │ │ -
61
│ │ │ │ -
62 template<typename T>
│ │ │ │ - │ │ │ │ -
64 {
│ │ │ │ -
65 struct yes { char dummy[1]; };
│ │ │ │ -
66 struct no { char dummy[2]; };
│ │ │ │ +
23 namespace Detail {
│ │ │ │ +
24
│ │ │ │ +
25 /* The signature is the same as for the public applyToTreePair
│ │ │ │ +
26 * function in Dune::Typtree, despite the additionally passed
│ │ │ │ +
27 * treePath argument. The path passed here is associated to
│ │ │ │ +
28 * the tree and the relative paths of the children (wrt. to tree)
│ │ │ │ +
29 * are appended to this. Hence the behavior of the public function
│ │ │ │ +
30 * is resembled by passing an empty treePath.
│ │ │ │ +
31 */
│ │ │ │ +
32
│ │ │ │ +
33 /*
│ │ │ │ +
34 * This is the overload for leaf traversal
│ │ │ │ +
35 */
│ │ │ │ +
36 template<class T1, class T2, class TreePath, class V,
│ │ │ │ +
37 std::enable_if_t<(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
│ │ │ │ +
38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
│ │ │ │ +
39 {
│ │ │ │ +
40 visitor.leaf(tree1, tree2, treePath);
│ │ │ │ +
41 }
│ │ │ │ +
42
│ │ │ │ +
43 /*
│ │ │ │ +
44 * This is the general overload doing static child traversal.
│ │ │ │ +
45 */
│ │ │ │ +
46 template<class T1, class T2, class TreePath, class V,
│ │ │ │ +
47 std::enable_if_t<not(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
│ │ │ │ +
48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
│ │ │ │ +
49 {
│ │ │ │ +
50 // Do we really want to take care for const-ness of the Tree
│ │ │ │ +
51 // when instanciating VisitChild below? I'd rather expect this:
│ │ │ │ +
52 // using Tree1 = std::decay_t<T1>;
│ │ │ │ +
53 // using Tree2 = std::decay_t<T2>;
│ │ │ │ +
54 // using Visitor = std::decay_t<V>;
│ │ │ │ +
55 using Tree1 = std::remove_reference_t<T1>;
│ │ │ │ +
56 using Tree2 = std::remove_reference_t<T2>;
│ │ │ │ +
57 using Visitor = std::remove_reference_t<V>;
│ │ │ │ +
58 visitor.pre(tree1, tree2, treePath);
│ │ │ │ +
59
│ │ │ │ +
60 // check which type of traversal is supported by the trees
│ │ │ │ +
61 using allowDynamicTraversal = std::conjunction<
│ │ │ │ +
62 Dune::Std::is_detected<DynamicTraversalConcept,Tree1>,
│ │ │ │ +
63 Dune::Std::is_detected<DynamicTraversalConcept,Tree2>>;
│ │ │ │ +
64 using allowStaticTraversal = std::conjunction<
│ │ │ │ +
65 Dune::Std::is_detected<StaticTraversalConcept,Tree1>,
│ │ │ │ +
66 Dune::Std::is_detected<StaticTraversalConcept,Tree2>>;
│ │ │ │
67
│ │ │ │ -
68 template<typename X>
│ │ │ │ - │ │ │ │ -
70 template<typename X>
│ │ │ │ -
71 static no test(...);
│ │ │ │ -
72
│ │ │ │ -
74 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ -
75 };
│ │ │ │ -
76
│ │ │ │ -
77 template<typename T, typename V>
│ │ │ │ - │ │ │ │ -
79 {
│ │ │ │ -
80 template<int N>
│ │ │ │ -
81 struct maybe { char dummy[N+1]; };
│ │ │ │ -
82 struct yes { char dummy[2]; };
│ │ │ │ -
83 struct no { char dummy[1]; };
│ │ │ │ -
84
│ │ │ │ -
85 template<typename X>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
88 template<typename X>
│ │ │ │ -
89 static no test(...);
│ │ │ │ +
68 // both trees must support either dynamic or static traversal
│ │ │ │ +
69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ +
70
│ │ │ │ +
71 // the visitor may specify preferred dynamic traversal
│ │ │ │ +
72 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
│ │ │ │ +
73
│ │ │ │ +
74 // create a dynamic or static index range
│ │ │ │ +
75 auto indices = [&]{
│ │ │ │ +
76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
│ │ │ │ +
77 return Dune::range(std::size_t(tree1.degree()));
│ │ │ │ +
78 else
│ │ │ │ +
79 return Dune::range(tree1.degree());
│ │ │ │ +
80 }();
│ │ │ │ +
81
│ │ │ │ +
82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
│ │ │ │ +
83 Dune::Hybrid::forEach(indices, [&](auto i) {
│ │ │ │ +
84 auto&& child1 = tree1.child(i);
│ │ │ │ +
85 auto&& child2 = tree2.child(i);
│ │ │ │ +
86 using Child1 = std::decay_t<decltype(child1)>;
│ │ │ │ +
87 using Child2 = std::decay_t<decltype(child2)>;
│ │ │ │ +
88
│ │ │ │ +
89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i);
│ │ │ │
90
│ │ │ │ -
92 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ -
93 };
│ │ │ │ -
94
│ │ │ │ -
95 template<typename>
│ │ │ │ - │ │ │ │ -
97 {
│ │ │ │ -
98 typedef void type;
│ │ │ │ -
99 };
│ │ │ │ -
100
│ │ │ │ +
91 // This requires that visitor.in(...) can always be instantiated,
│ │ │ │ +
92 // even if there's a single child only.
│ │ │ │ +
93 if (i>0)
│ │ │ │ +
94 visitor.in(tree1, tree2, treePath);
│ │ │ │ +
95
│ │ │ │ +
96 constexpr bool visitChild = Visitor::template VisitChild<Tree1,Child1,Tree2,Child2,TreePath>::value;
│ │ │ │ +
97 if constexpr(visitChild) {
│ │ │ │ +
98 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ +
99 applyToTreePair(child1, child2, childTreePath, visitor);
│ │ │ │ +
100 }
│ │ │ │
101
│ │ │ │ -
103 template<typename T>
│ │ │ │ - │ │ │ │ -
105
│ │ │ │ -
106
│ │ │ │ -
107 // Support for lazy evaluation of meta functions. This is required when doing
│ │ │ │ -
108 // nested tag dispatch without C++11-style typedefs (based on using syntax).
│ │ │ │ -
109 // The standard struct-based meta functions cause premature evaluation in a
│ │ │ │ -
110 // context that is not SFINAE-compatible. We thus have to return the meta function
│ │ │ │ -
111 // without evaluating it, placing that burden on the caller. On the other hand,
│ │ │ │ -
112 // the lookup will often directly be the target type, so here is some helper code
│ │ │ │ -
113 // to automatically do the additional evaluation if necessary.
│ │ │ │ -
114 // Too bad that the new syntax is GCC 4.6+...
│ │ │ │ -
115
│ │ │ │ -
116
│ │ │ │ -
118
│ │ │ │ -
121 struct meta_function {};
│ │ │ │ -
122
│ │ │ │ -
124 template<typename F>
│ │ │ │ - │ │ │ │ -
126 {
│ │ │ │ -
127 typedef typename F::type type;
│ │ │ │ -
128 };
│ │ │ │ -
129
│ │ │ │ -
131 template<typename F>
│ │ │ │ - │ │ │ │ -
133 {
│ │ │ │ -
134 typedef F type;
│ │ │ │ -
135 };
│ │ │ │ -
136
│ │ │ │ -
138 template<typename F>
│ │ │ │ - │ │ │ │ -
140 {
│ │ │ │ -
141 typedef typename std::conditional<
│ │ │ │ -
142 std::is_base_of<meta_function,F>::value,
│ │ │ │ - │ │ │ │ - │ │ │ │ -
145 >::type::type type;
│ │ │ │ -
146 };
│ │ │ │ -
147
│ │ │ │ -
148 namespace impl {
│ │ │ │ -
149
│ │ │ │ -
150 // Check if type is a or is derived from one of the tree path types
│ │ │ │ -
151
│ │ │ │ -
152 // Default overload for types not representing a tree path
│ │ │ │ -
153 constexpr auto isTreePath(void*)
│ │ │ │ -
154 -> std::false_type
│ │ │ │ -
155 {
│ │ │ │ -
156 return std::false_type();
│ │ │ │ -
157 }
│ │ │ │ -
158
│ │ │ │ -
159 // Overload for instances of HybridTreePath<...>
│ │ │ │ -
160 template<class... I>
│ │ │ │ -
161 constexpr auto isTreePath(const HybridTreePath<I...>*)
│ │ │ │ -
162 -> std::true_type
│ │ │ │ -
163 {
│ │ │ │ -
164 return std::true_type();
│ │ │ │ -
165 }
│ │ │ │ -
166
│ │ │ │ -
167 }
│ │ │ │ -
168
│ │ │ │ -
179 template<class T>
│ │ │ │ -
180 struct IsTreePath :
│ │ │ │ -
181 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
│ │ │ │ -
182 {};
│ │ │ │ -
183
│ │ │ │ -
190 template<class T>
│ │ │ │ -
191 constexpr auto isTreePath(const T&)
│ │ │ │ - │ │ │ │ -
193 {
│ │ │ │ -
194 return IsTreePath<T>();
│ │ │ │ -
195 }
│ │ │ │ -
196
│ │ │ │ -
197
│ │ │ │ -
198 } // end namespace TypeTree
│ │ │ │ -
199} // end namespace Dune
│ │ │ │ -
200
│ │ │ │ -
201#endif // DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ -
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition: nodeinterface.hh:80
│ │ │ │ +
102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i);
│ │ │ │ +
103 });
│ │ │ │ +
104 }
│ │ │ │ +
105 visitor.post(tree1, tree2, treePath);
│ │ │ │ +
106 }
│ │ │ │ +
107
│ │ │ │ +
108 } // namespace Detail
│ │ │ │ +
109
│ │ │ │ +
111
│ │ │ │ +
125 template<typename Tree1, typename Tree2, typename Visitor>
│ │ │ │ +
126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor)
│ │ │ │ +
127 {
│ │ │ │ +
128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor);
│ │ │ │ +
129 }
│ │ │ │ +
130
│ │ │ │ +
132
│ │ │ │ +
133 } // namespace TypeTree
│ │ │ │ +
134} //namespace Dune
│ │ │ │ +
135
│ │ │ │ +
136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)
Apply visitor to a pair of TypeTrees.
Definition: pairtraversal.hh:126
│ │ │ │ +
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ +
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ +
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
constexpr auto isTreePath(const T &) -> IsTreePath< T >
Check if given object represents a tree path.
Definition: typetraits.hh:191
│ │ │ │ -
T * declptr()
Helper function for generating a pointer to a value of type T in an unevaluated operand setting.
│ │ │ │ -
constexpr auto isTreePath(void *) -> std::false_type
Definition: typetraits.hh:153
│ │ │ │ +
void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)
Definition: pairtraversal.hh:38
│ │ │ │
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ -
Definition: typetraits.hh:19
│ │ │ │ -
T0 type
Definition: typetraits.hh:24
│ │ │ │ -
Definition: typetraits.hh:31
│ │ │ │ -
static constexpr bool value
True if class T defines a NodeTag.
Definition: typetraits.hh:41
│ │ │ │ -
static yes test(NodeTag< X > *)
│ │ │ │ - │ │ │ │ -
Definition: typetraits.hh:32
│ │ │ │ -
char dummy[1]
Definition: typetraits.hh:32
│ │ │ │ -
Definition: typetraits.hh:33
│ │ │ │ -
char dummy[2]
Definition: typetraits.hh:33
│ │ │ │ -
Definition: typetraits.hh:46
│ │ │ │ -
static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a)
│ │ │ │ -
static constexpr bool value
True if class T defines a NodeTag of type V.
Definition: typetraits.hh:59
│ │ │ │ - │ │ │ │ -
Definition: typetraits.hh:48
│ │ │ │ -
char dummy[N+1]
Definition: typetraits.hh:48
│ │ │ │ -
Definition: typetraits.hh:49
│ │ │ │ -
char dummy[2]
Definition: typetraits.hh:49
│ │ │ │ -
Definition: typetraits.hh:50
│ │ │ │ -
char dummy[1]
Definition: typetraits.hh:50
│ │ │ │ -
Definition: typetraits.hh:64
│ │ │ │ -
static yes test(ImplementationTag< X > *)
│ │ │ │ - │ │ │ │ -
static constexpr bool value
True if class T defines an ImplementationTag.
Definition: typetraits.hh:74
│ │ │ │ - │ │ │ │ -
char dummy[1]
Definition: typetraits.hh:65
│ │ │ │ -
Definition: typetraits.hh:66
│ │ │ │ -
char dummy[2]
Definition: typetraits.hh:66
│ │ │ │ - │ │ │ │ -
static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test(ImplementationTag< X > *a)
│ │ │ │ - │ │ │ │ -
static constexpr bool value
True if class T defines an ImplementationTag of type V.
Definition: typetraits.hh:92
│ │ │ │ - │ │ │ │ -
char dummy[N+1]
Definition: typetraits.hh:81
│ │ │ │ - │ │ │ │ -
char dummy[2]
Definition: typetraits.hh:82
│ │ │ │ - │ │ │ │ -
char dummy[1]
Definition: typetraits.hh:83
│ │ │ │ -
Definition: typetraits.hh:97
│ │ │ │ -
void type
Definition: typetraits.hh:98
│ │ │ │ -
Marker tag declaring a meta function.
Definition: typetraits.hh:121
│ │ │ │ -
Helper meta function to delay evaluation of F.
Definition: typetraits.hh:126
│ │ │ │ -
F::type type
Definition: typetraits.hh:127
│ │ │ │ -
Identity function.
Definition: typetraits.hh:133
│ │ │ │ -
F type
Definition: typetraits.hh:134
│ │ │ │ -
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:140
│ │ │ │ -
std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
Definition: typetraits.hh:145
│ │ │ │ -
Check if type represents a tree path.
Definition: typetraits.hh:182
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,346 +4,167 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -typetraits.hh │ │ │ │ │ +pairtraversal.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12 │ │ │ │ │ - 13namespace Dune { │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ 14 │ │ │ │ │ - 15 // Provide some more C++11 TMP helpers. │ │ │ │ │ - 16 // These should be upstreamed to dune-common ASAP. │ │ │ │ │ + 15namespace Dune { │ │ │ │ │ + 16 namespace TypeTree { │ │ │ │ │ 17 │ │ │ │ │ - 18 template │ │ │ │ │ -19 struct first_type; │ │ │ │ │ - 20 │ │ │ │ │ - 21 template │ │ │ │ │ -22 struct first_type │ │ │ │ │ - 23 { │ │ │ │ │ -24 typedef T0 type; │ │ │ │ │ - 25 }; │ │ │ │ │ - 26 │ │ │ │ │ - 27 namespace TypeTree { │ │ │ │ │ - 28 │ │ │ │ │ - 29 template │ │ │ │ │ -30 struct has_node_tag │ │ │ │ │ - 31 { │ │ │ │ │ -32 struct yes { char dummy[1]; }; │ │ │ │ │ -33 struct no { char dummy[2]; }; │ │ │ │ │ - 34 │ │ │ │ │ - 35 template │ │ │ │ │ -36 static yes test(NodeTag *); │ │ │ │ │ - 37 template │ │ │ │ │ -38 static no test(...); │ │ │ │ │ - 39 │ │ │ │ │ -41 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ - 42 }; │ │ │ │ │ - 43 │ │ │ │ │ - 44 template │ │ │ │ │ -45 struct has_node_tag_value │ │ │ │ │ - 46 { │ │ │ │ │ - 47 template │ │ │ │ │ -48 struct maybe { char dummy[N+1]; }; │ │ │ │ │ -49 struct yes { char dummy[2]; }; │ │ │ │ │ -50 struct no { char dummy[1]; }; │ │ │ │ │ - 51 │ │ │ │ │ - 52 template │ │ │ │ │ - 53 static maybe>::value> │ │ │ │ │ -54 test(NodeTag * a); │ │ │ │ │ - 55 template │ │ │ │ │ -56 static no test(...); │ │ │ │ │ - 57 │ │ │ │ │ -59 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ - 60 }; │ │ │ │ │ - 61 │ │ │ │ │ - 62 template │ │ │ │ │ -63 struct has_implementation_tag │ │ │ │ │ - 64 { │ │ │ │ │ -65 struct yes { char dummy[1]; }; │ │ │ │ │ -66 struct no { char dummy[2]; }; │ │ │ │ │ +23 namespace Detail { │ │ │ │ │ + 24 │ │ │ │ │ + 25 /* The signature is the same as for the public applyToTreePair │ │ │ │ │ + 26 * function in Dune::Typtree, despite the additionally passed │ │ │ │ │ + 27 * treePath argument. The path passed here is associated to │ │ │ │ │ + 28 * the tree and the relative paths of the children (wrt. to tree) │ │ │ │ │ + 29 * are appended to this. Hence the behavior of the public function │ │ │ │ │ + 30 * is resembled by passing an empty treePath. │ │ │ │ │ + 31 */ │ │ │ │ │ + 32 │ │ │ │ │ + 33 /* │ │ │ │ │ + 34 * This is the overload for leaf traversal │ │ │ │ │ + 35 */ │ │ │ │ │ + 36 template::isLeaf or std::decay_t::isLeaf), │ │ │ │ │ +int> = 0> │ │ │ │ │ +38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor) │ │ │ │ │ + 39 { │ │ │ │ │ + 40 visitor.leaf(tree1, tree2, treePath); │ │ │ │ │ + 41 } │ │ │ │ │ + 42 │ │ │ │ │ + 43 /* │ │ │ │ │ + 44 * This is the general overload doing static child traversal. │ │ │ │ │ + 45 */ │ │ │ │ │ + 46 template::isLeaf or std::decay_t::isLeaf), │ │ │ │ │ +int> = 0> │ │ │ │ │ + 48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& │ │ │ │ │ +visitor) │ │ │ │ │ + 49 { │ │ │ │ │ + 50 // Do we really want to take care for const-ness of the Tree │ │ │ │ │ + 51 // when instanciating VisitChild below? I'd rather expect this: │ │ │ │ │ + 52 // using Tree1 = std::decay_t; │ │ │ │ │ + 53 // using Tree2 = std::decay_t; │ │ │ │ │ + 54 // using Visitor = std::decay_t; │ │ │ │ │ + 55 using Tree1 = std::remove_reference_t; │ │ │ │ │ + 56 using Tree2 = std::remove_reference_t; │ │ │ │ │ + 57 using Visitor = std::remove_reference_t; │ │ │ │ │ + 58 visitor.pre(tree1, tree2, treePath); │ │ │ │ │ + 59 │ │ │ │ │ + 60 // check which type of traversal is supported by the trees │ │ │ │ │ + 61 using allowDynamicTraversal = std::conjunction< │ │ │ │ │ + 62 Dune::Std::is_detected, │ │ │ │ │ + 63 Dune::Std::is_detected>; │ │ │ │ │ + 64 using allowStaticTraversal = std::conjunction< │ │ │ │ │ + 65 Dune::Std::is_detected, │ │ │ │ │ + 66 Dune::Std::is_detected>; │ │ │ │ │ 67 │ │ │ │ │ - 68 template │ │ │ │ │ -69 static yes test(ImplementationTag *); │ │ │ │ │ - 70 template │ │ │ │ │ -71 static no test(...); │ │ │ │ │ - 72 │ │ │ │ │ -74 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ - 75 }; │ │ │ │ │ - 76 │ │ │ │ │ - 77 template │ │ │ │ │ -78 struct has_implementation_tag_value │ │ │ │ │ - 79 { │ │ │ │ │ - 80 template │ │ │ │ │ -81 struct maybe { char dummy[N+1]; }; │ │ │ │ │ -82 struct yes { char dummy[2]; }; │ │ │ │ │ -83 struct no { char dummy[1]; }; │ │ │ │ │ - 84 │ │ │ │ │ - 85 template │ │ │ │ │ - 86 static maybe>::value> │ │ │ │ │ -87 test(ImplementationTag * a); │ │ │ │ │ - 88 template │ │ │ │ │ -89 static no test(...); │ │ │ │ │ + 68 // both trees must support either dynamic or static traversal │ │ │ │ │ + 69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value); │ │ │ │ │ + 70 │ │ │ │ │ + 71 // the visitor may specify preferred dynamic traversal │ │ │ │ │ + 72 using preferDynamicTraversal = std::bool_constant; │ │ │ │ │ + 73 │ │ │ │ │ + 74 // create a dynamic or static index range │ │ │ │ │ + 75 auto indices = [&]{ │ │ │ │ │ + 76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value) │ │ │ │ │ + 77 return Dune::range(std::size_t(tree1.degree())); │ │ │ │ │ + 78 else │ │ │ │ │ + 79 return Dune::range(tree1.degree()); │ │ │ │ │ + 80 }(); │ │ │ │ │ + 81 │ │ │ │ │ + 82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) { │ │ │ │ │ + 83 Dune::Hybrid::forEach(indices, [&](auto i) { │ │ │ │ │ + 84 auto&& child1 = tree1.child(i); │ │ │ │ │ + 85 auto&& child2 = tree2.child(i); │ │ │ │ │ + 86 using Child1 = std::decay_t; │ │ │ │ │ + 87 using Child2 = std::decay_t; │ │ │ │ │ + 88 │ │ │ │ │ + 89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i); │ │ │ │ │ 90 │ │ │ │ │ -92 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ - 93 }; │ │ │ │ │ - 94 │ │ │ │ │ - 95 template │ │ │ │ │ -96 struct AlwaysVoid │ │ │ │ │ - 97 { │ │ │ │ │ -98 typedef void type; │ │ │ │ │ - 99 }; │ │ │ │ │ - 100 │ │ │ │ │ + 91 // This requires that visitor.in(...) can always be instantiated, │ │ │ │ │ + 92 // even if there's a single child only. │ │ │ │ │ + 93 if (i>0) │ │ │ │ │ + 94 visitor.in(tree1, tree2, treePath); │ │ │ │ │ + 95 │ │ │ │ │ + 96 constexpr bool visitChild = Visitor::template │ │ │ │ │ +VisitChild::value; │ │ │ │ │ + 97 if constexpr(visitChild) { │ │ │ │ │ + 98 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ + 99 applyToTreePair(child1, child2, childTreePath, visitor); │ │ │ │ │ + 100 } │ │ │ │ │ 101 │ │ │ │ │ - 103 template │ │ │ │ │ -104 T* declptr(); │ │ │ │ │ - 105 │ │ │ │ │ - 106 │ │ │ │ │ - 107 // Support for lazy evaluation of meta functions. This is required when │ │ │ │ │ -doing │ │ │ │ │ - 108 // nested tag dispatch without C++11-style typedefs (based on using │ │ │ │ │ -syntax). │ │ │ │ │ - 109 // The standard struct-based meta functions cause premature evaluation in │ │ │ │ │ -a │ │ │ │ │ - 110 // context that is not SFINAE-compatible. We thus have to return the meta │ │ │ │ │ -function │ │ │ │ │ - 111 // without evaluating it, placing that burden on the caller. On the other │ │ │ │ │ -hand, │ │ │ │ │ - 112 // the lookup will often directly be the target type, so here is some │ │ │ │ │ -helper code │ │ │ │ │ - 113 // to automatically do the additional evaluation if necessary. │ │ │ │ │ - 114 // Too bad that the new syntax is GCC 4.6+... │ │ │ │ │ - 115 │ │ │ │ │ - 116 │ │ │ │ │ - 118 │ │ │ │ │ -121 struct meta_function {}; │ │ │ │ │ - 122 │ │ │ │ │ - 124 template │ │ │ │ │ -125 struct lazy_evaluate │ │ │ │ │ - 126 { │ │ │ │ │ -127 typedef typename F::type type; │ │ │ │ │ - 128 }; │ │ │ │ │ - 129 │ │ │ │ │ - 131 template │ │ │ │ │ -132 struct lazy_identity │ │ │ │ │ - 133 { │ │ │ │ │ -134 typedef F type; │ │ │ │ │ - 135 }; │ │ │ │ │ - 136 │ │ │ │ │ - 138 template │ │ │ │ │ -139 struct evaluate_if_meta_function │ │ │ │ │ - 140 { │ │ │ │ │ - 141 typedef typename std::conditional< │ │ │ │ │ - 142 std::is_base_of::value, │ │ │ │ │ - 143 lazy_evaluate, │ │ │ │ │ - 144 lazy_identity │ │ │ │ │ -145 >::type::type type; │ │ │ │ │ - 146 }; │ │ │ │ │ - 147 │ │ │ │ │ -148 namespace impl { │ │ │ │ │ - 149 │ │ │ │ │ - 150 // Check if type is a or is derived from one of the tree path types │ │ │ │ │ - 151 │ │ │ │ │ - 152 // Default overload for types not representing a tree path │ │ │ │ │ -153 constexpr auto isTreePath(void*) │ │ │ │ │ - 154 -> std::false_type │ │ │ │ │ - 155 { │ │ │ │ │ - 156 return std::false_type(); │ │ │ │ │ - 157 } │ │ │ │ │ - 158 │ │ │ │ │ - 159 // Overload for instances of HybridTreePath<...> │ │ │ │ │ - 160 template │ │ │ │ │ -161 constexpr auto isTreePath(const HybridTreePath*) │ │ │ │ │ - 162 -> std::true_type │ │ │ │ │ - 163 { │ │ │ │ │ - 164 return std::true_type(); │ │ │ │ │ - 165 } │ │ │ │ │ - 166 │ │ │ │ │ - 167 } │ │ │ │ │ - 168 │ │ │ │ │ - 179 template │ │ │ │ │ -180 struct IsTreePath : │ │ │ │ │ - 181 public decltype(impl::isTreePath((typename std::decay::type*) │ │ │ │ │ -(nullptr))) │ │ │ │ │ - 182 {}; │ │ │ │ │ - 183 │ │ │ │ │ - 190 template │ │ │ │ │ -191 constexpr auto isTreePath(const T&) │ │ │ │ │ - 192 -> IsTreePath │ │ │ │ │ - 193 { │ │ │ │ │ - 194 return IsTreePath(); │ │ │ │ │ - 195 } │ │ │ │ │ - 196 │ │ │ │ │ - 197 │ │ │ │ │ - 198 } // end namespace TypeTree │ │ │ │ │ - 199} // end namespace Dune │ │ │ │ │ - 200 │ │ │ │ │ - 201#endif // DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ + 102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i); │ │ │ │ │ + 103 }); │ │ │ │ │ + 104 } │ │ │ │ │ + 105 visitor.post(tree1, tree2, treePath); │ │ │ │ │ + 106 } │ │ │ │ │ + 107 │ │ │ │ │ + 108 } // namespace Detail │ │ │ │ │ + 109 │ │ │ │ │ + 111 │ │ │ │ │ + 125 template │ │ │ │ │ +126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor) │ │ │ │ │ + 127 { │ │ │ │ │ + 128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor); │ │ │ │ │ + 129 } │ │ │ │ │ + 130 │ │ │ │ │ + 132 │ │ │ │ │ + 133 } // namespace TypeTree │ │ │ │ │ + 134} //namespace Dune │ │ │ │ │ + 135 │ │ │ │ │ + 136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ nodeinterface.hh │ │ │ │ │ treepath.hh │ │ │ │ │ -Dune::TypeTree::NodeTag │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -Definition: nodeinterface.hh:76 │ │ │ │ │ -Dune::TypeTree::ImplementationTag │ │ │ │ │ -typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ -Returns the implementation tag of the given Node. │ │ │ │ │ -Definition: nodeinterface.hh:80 │ │ │ │ │ +traversal.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ +visitor.hh │ │ │ │ │ +Dune::TypeTree::applyToTreePair │ │ │ │ │ +void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor) │ │ │ │ │ +Apply visitor to a pair of TypeTrees. │ │ │ │ │ +Definition: pairtraversal.hh:126 │ │ │ │ │ +Dune::TypeTree::push_back │ │ │ │ │ +constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t i) │ │ │ │ │ +Appends a run time index to a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:281 │ │ │ │ │ +Dune::TypeTree::hybridTreePath │ │ │ │ │ +constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:180 │ │ │ │ │ +Dune::TypeTree::treePath │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:191 │ │ │ │ │ +Dune::TypeTree::TreePath │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +Definition: treepath.hh:521 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::isTreePath │ │ │ │ │ -constexpr auto isTreePath(const T &) -> IsTreePath< T > │ │ │ │ │ -Check if given object represents a tree path. │ │ │ │ │ -Definition: typetraits.hh:191 │ │ │ │ │ -Dune::TypeTree::declptr │ │ │ │ │ -T * declptr() │ │ │ │ │ -Helper function for generating a pointer to a value of type T in an unevaluated │ │ │ │ │ -operand setting. │ │ │ │ │ -Dune::TypeTree::impl::isTreePath │ │ │ │ │ -constexpr auto isTreePath(void *) -> std::false_type │ │ │ │ │ -Definition: typetraits.hh:153 │ │ │ │ │ +Dune::TypeTree::Detail::applyToTreePair │ │ │ │ │ +void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor) │ │ │ │ │ +Definition: pairtraversal.hh:38 │ │ │ │ │ Dune::TypeTree::HybridTreePath │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ Definition: treepath.hh:79 │ │ │ │ │ -Dune::first_type │ │ │ │ │ -Definition: typetraits.hh:19 │ │ │ │ │ -Dune::first_type<_T0,_T..._>::type │ │ │ │ │ -T0 type │ │ │ │ │ -Definition: typetraits.hh:24 │ │ │ │ │ -Dune::TypeTree::has_node_tag │ │ │ │ │ -Definition: typetraits.hh:31 │ │ │ │ │ -Dune::TypeTree::has_node_tag::value │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines a NodeTag. │ │ │ │ │ -Definition: typetraits.hh:41 │ │ │ │ │ -Dune::TypeTree::has_node_tag::test │ │ │ │ │ -static yes test(NodeTag< X > *) │ │ │ │ │ -Dune::TypeTree::has_node_tag::test │ │ │ │ │ -static no test(...) │ │ │ │ │ -Dune::TypeTree::has_node_tag::yes │ │ │ │ │ -Definition: typetraits.hh:32 │ │ │ │ │ -Dune::TypeTree::has_node_tag::yes::dummy │ │ │ │ │ -char dummy[1] │ │ │ │ │ -Definition: typetraits.hh:32 │ │ │ │ │ -Dune::TypeTree::has_node_tag::no │ │ │ │ │ -Definition: typetraits.hh:33 │ │ │ │ │ -Dune::TypeTree::has_node_tag::no::dummy │ │ │ │ │ -char dummy[2] │ │ │ │ │ -Definition: typetraits.hh:33 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value │ │ │ │ │ -Definition: typetraits.hh:46 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::test │ │ │ │ │ -static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a) │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::value │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines a NodeTag of type V. │ │ │ │ │ -Definition: typetraits.hh:59 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::test │ │ │ │ │ -static no test(...) │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::maybe │ │ │ │ │ -Definition: typetraits.hh:48 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::maybe::dummy │ │ │ │ │ -char dummy[N+1] │ │ │ │ │ -Definition: typetraits.hh:48 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::yes │ │ │ │ │ -Definition: typetraits.hh:49 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::yes::dummy │ │ │ │ │ -char dummy[2] │ │ │ │ │ -Definition: typetraits.hh:49 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::no │ │ │ │ │ -Definition: typetraits.hh:50 │ │ │ │ │ -Dune::TypeTree::has_node_tag_value::no::dummy │ │ │ │ │ -char dummy[1] │ │ │ │ │ -Definition: typetraits.hh:50 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag │ │ │ │ │ -Definition: typetraits.hh:64 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::test │ │ │ │ │ -static yes test(ImplementationTag< X > *) │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::test │ │ │ │ │ -static no test(...) │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::value │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines an ImplementationTag. │ │ │ │ │ -Definition: typetraits.hh:74 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::yes │ │ │ │ │ -Definition: typetraits.hh:65 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::yes::dummy │ │ │ │ │ -char dummy[1] │ │ │ │ │ -Definition: typetraits.hh:65 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::no │ │ │ │ │ -Definition: typetraits.hh:66 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag::no::dummy │ │ │ │ │ -char dummy[2] │ │ │ │ │ -Definition: typetraits.hh:66 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value │ │ │ │ │ -Definition: typetraits.hh:79 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::test │ │ │ │ │ -static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test │ │ │ │ │ -(ImplementationTag< X > *a) │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::test │ │ │ │ │ -static no test(...) │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::value │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines an ImplementationTag of type V. │ │ │ │ │ -Definition: typetraits.hh:92 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::maybe │ │ │ │ │ -Definition: typetraits.hh:81 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::maybe::dummy │ │ │ │ │ -char dummy[N+1] │ │ │ │ │ -Definition: typetraits.hh:81 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::yes │ │ │ │ │ -Definition: typetraits.hh:82 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::yes::dummy │ │ │ │ │ -char dummy[2] │ │ │ │ │ -Definition: typetraits.hh:82 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::no │ │ │ │ │ -Definition: typetraits.hh:83 │ │ │ │ │ -Dune::TypeTree::has_implementation_tag_value::no::dummy │ │ │ │ │ -char dummy[1] │ │ │ │ │ -Definition: typetraits.hh:83 │ │ │ │ │ -Dune::TypeTree::AlwaysVoid │ │ │ │ │ -Definition: typetraits.hh:97 │ │ │ │ │ -Dune::TypeTree::AlwaysVoid::type │ │ │ │ │ -void type │ │ │ │ │ -Definition: typetraits.hh:98 │ │ │ │ │ -Dune::TypeTree::meta_function │ │ │ │ │ -Marker tag declaring a meta function. │ │ │ │ │ -Definition: typetraits.hh:121 │ │ │ │ │ -Dune::TypeTree::lazy_evaluate │ │ │ │ │ -Helper meta function to delay evaluation of F. │ │ │ │ │ -Definition: typetraits.hh:126 │ │ │ │ │ -Dune::TypeTree::lazy_evaluate::type │ │ │ │ │ -F::type type │ │ │ │ │ -Definition: typetraits.hh:127 │ │ │ │ │ -Dune::TypeTree::lazy_identity │ │ │ │ │ -Identity function. │ │ │ │ │ -Definition: typetraits.hh:133 │ │ │ │ │ -Dune::TypeTree::lazy_identity::type │ │ │ │ │ -F type │ │ │ │ │ -Definition: typetraits.hh:134 │ │ │ │ │ -Dune::TypeTree::evaluate_if_meta_function │ │ │ │ │ -Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ -Definition: typetraits.hh:140 │ │ │ │ │ -Dune::TypeTree::evaluate_if_meta_function::type │ │ │ │ │ -std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F │ │ │ │ │ ->, lazy_identity< F > >::type::type type │ │ │ │ │ -Definition: typetraits.hh:145 │ │ │ │ │ -Dune::TypeTree::IsTreePath │ │ │ │ │ -Check if type represents a tree path. │ │ │ │ │ -Definition: typetraits.hh:182 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: leafnode.hh File Reference │ │ │ │ +dune-typetree: typetree.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,39 +62,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
leafnode.hh File Reference
│ │ │ │ +
typetree.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <cstddef>
│ │ │ │ -#include <type_traits>
│ │ │ │ +
#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/utility.hh>
│ │ │ │ +#include <dune/typetree/leafnode.hh>
│ │ │ │ +#include <dune/typetree/powernode.hh>
│ │ │ │ +#include <dune/typetree/dynamicpowernode.hh>
│ │ │ │ +#include <dune/typetree/compositenode.hh>
│ │ │ │ +#include <dune/typetree/traversal.hh>
│ │ │ │ +#include <dune/typetree/pairtraversal.hh>
│ │ │ │ +#include <dune/typetree/traversalutilities.hh>
│ │ │ │ +#include <dune/typetree/transformation.hh>
│ │ │ │ +#include <dune/typetree/transformationutilities.hh>
│ │ │ │ +#include <dune/typetree/accumulate_static.hh>
│ │ │ │ +#include <dune/typetree/childextraction.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  Dune::TypeTree::LeafNode
 Base class for leaf nodes in a dune-typetree. More...
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,25 +4,25 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -leafnode.hh File Reference │ │ │ │ │ +typetree.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  Dune::TypeTree::LeafNode │ │ │ │ │ -  Base class for leaf nodes in a dune-typetree. More... │ │ │ │ │ -  │ │ │ │ │ - Namespaces │ │ │ │ │ -namespace  Dune │ │ │ │ │ -  │ │ │ │ │ -namespace  Dune::TypeTree │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00074_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: leafnode.hh Source File │ │ │ │ +dune-typetree: typetree.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,73 +62,51 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
leafnode.hh
│ │ │ │ +
typetree.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ -
8#include <cstddef>
│ │ │ │ -
9#include <type_traits>
│ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12 namespace TypeTree {
│ │ │ │ -
13
│ │ │ │ - │ │ │ │ -
26 {
│ │ │ │ -
27
│ │ │ │ -
28 public:
│ │ │ │ -
29
│ │ │ │ -
31 static const bool isLeaf = true;
│ │ │ │ -
32
│ │ │ │ -
34 static const bool isPower = false;
│ │ │ │ -
35
│ │ │ │ -
37 static const bool isComposite = false;
│ │ │ │ -
38
│ │ │ │ -
40 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ -
41 static const std::size_t CHILDREN = 0;
│ │ │ │ -
42
│ │ │ │ - │ │ │ │ -
45
│ │ │ │ -
46 static constexpr auto degree()
│ │ │ │ -
47 {
│ │ │ │ -
48 return std::integral_constant<std::size_t,0>{};
│ │ │ │ -
49 }
│ │ │ │ -
50
│ │ │ │ -
51 protected:
│ │ │ │ -
52
│ │ │ │ -
54
│ │ │ │ - │ │ │ │ -
60 };
│ │ │ │ -
61
│ │ │ │ -
63
│ │ │ │ -
64 } // namespace TypeTree
│ │ │ │ -
65} //namespace Dune
│ │ │ │ -
66
│ │ │ │ -
67#endif // DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ - │ │ │ │ -
Definition: accumulate_static.hh:13
│ │ │ │ -
Base class for leaf nodes in a dune-typetree.
Definition: leafnode.hh:26
│ │ │ │ -
LeafNodeTag NodeTag
The type tag that describes a LeafNode.
Definition: leafnode.hh:44
│ │ │ │ -
static const bool isLeaf
Mark this class as a leaf in a dune-typetree.
Definition: leafnode.hh:31
│ │ │ │ -
static const std::size_t CHILDREN
Leafs have no children.
Definition: leafnode.hh:41
│ │ │ │ -
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: leafnode.hh:34
│ │ │ │ -
LeafNode()
Default constructor.
Definition: leafnode.hh:59
│ │ │ │ -
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: leafnode.hh:37
│ │ │ │ -
static constexpr auto degree()
Definition: leafnode.hh:46
│ │ │ │ -
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
20
│ │ │ │ +
21#endif // DUNE_TYPETREE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,93 +4,46 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -leafnode.hh │ │ │ │ │ +typetree.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_LEAFNODE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_LEAFNODE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_HH │ │ │ │ │ 6 │ │ │ │ │ 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11namespace Dune { │ │ │ │ │ - 12 namespace TypeTree { │ │ │ │ │ - 13 │ │ │ │ │ -25 class LeafNode │ │ │ │ │ - 26 { │ │ │ │ │ - 27 │ │ │ │ │ - 28 public: │ │ │ │ │ - 29 │ │ │ │ │ -31 static const bool isLeaf = true; │ │ │ │ │ - 32 │ │ │ │ │ -34 static const bool isPower = false; │ │ │ │ │ - 35 │ │ │ │ │ -37 static const bool isComposite = false; │ │ │ │ │ - 38 │ │ │ │ │ - 40 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -41 static const std::size_t CHILDREN = 0; │ │ │ │ │ - 42 │ │ │ │ │ -44 typedef LeafNodeTag NodeTag; │ │ │ │ │ - 45 │ │ │ │ │ -46 static constexpr auto degree() │ │ │ │ │ - 47 { │ │ │ │ │ - 48 return std::integral_constant{}; │ │ │ │ │ - 49 } │ │ │ │ │ - 50 │ │ │ │ │ - 51 protected: │ │ │ │ │ - 52 │ │ │ │ │ - 54 │ │ │ │ │ -59 LeafNode() {} │ │ │ │ │ - 60 }; │ │ │ │ │ - 61 │ │ │ │ │ - 63 │ │ │ │ │ - 64 } // namespace TypeTree │ │ │ │ │ - 65} //namespace Dune │ │ │ │ │ - 66 │ │ │ │ │ - 67#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20 │ │ │ │ │ + 21#endif // DUNE_TYPETREE_HH │ │ │ │ │ +compositenode.hh │ │ │ │ │ +leafnode.hh │ │ │ │ │ +transformationutilities.hh │ │ │ │ │ +transformation.hh │ │ │ │ │ +traversalutilities.hh │ │ │ │ │ +childextraction.hh │ │ │ │ │ +traversal.hh │ │ │ │ │ +utility.hh │ │ │ │ │ nodetags.hh │ │ │ │ │ -Dune │ │ │ │ │ -Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::LeafNode │ │ │ │ │ -Base class for leaf nodes in a dune-typetree. │ │ │ │ │ -Definition: leafnode.hh:26 │ │ │ │ │ -Dune::TypeTree::LeafNode::NodeTag │ │ │ │ │ -LeafNodeTag NodeTag │ │ │ │ │ -The type tag that describes a LeafNode. │ │ │ │ │ -Definition: leafnode.hh:44 │ │ │ │ │ -Dune::TypeTree::LeafNode::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as a leaf in a dune-typetree. │ │ │ │ │ -Definition: leafnode.hh:31 │ │ │ │ │ -Dune::TypeTree::LeafNode::CHILDREN │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -Leafs have no children. │ │ │ │ │ -Definition: leafnode.hh:41 │ │ │ │ │ -Dune::TypeTree::LeafNode::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -Definition: leafnode.hh:34 │ │ │ │ │ -Dune::TypeTree::LeafNode::LeafNode │ │ │ │ │ -LeafNode() │ │ │ │ │ -Default constructor. │ │ │ │ │ -Definition: leafnode.hh:59 │ │ │ │ │ -Dune::TypeTree::LeafNode::isComposite │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a non composite in the dune-typetree. │ │ │ │ │ -Definition: leafnode.hh:37 │ │ │ │ │ -Dune::TypeTree::LeafNode::degree │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -Definition: leafnode.hh:46 │ │ │ │ │ -Dune::TypeTree::LeafNodeTag │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -Definition: nodetags.hh:16 │ │ │ │ │ +powernode.hh │ │ │ │ │ +pairtraversal.hh │ │ │ │ │ +dynamicpowernode.hh │ │ │ │ │ +accumulate_static.hh │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: transformationutilities.hh File Reference │ │ │ │ +dune-typetree: typetraits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,21 +62,103 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
transformationutilities.hh File Reference
│ │ │ │ +
│ │ │ │ +Classes | │ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
typetraits.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/typetree/simpletransformationdescriptors.hh>
│ │ │ │ -#include <dune/typetree/generictransformationdescriptors.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/typetree/treepath.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

struct  Dune::first_type< T0, T... >
 
struct  Dune::TypeTree::has_node_tag< T >
 
struct  Dune::TypeTree::has_node_tag< T >::yes
 
struct  Dune::TypeTree::has_node_tag< T >::no
 
struct  Dune::TypeTree::has_node_tag_value< T, V >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::maybe< N >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::yes
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::no
 
struct  Dune::TypeTree::has_implementation_tag< T >
 
struct  Dune::TypeTree::has_implementation_tag< T >::yes
 
struct  Dune::TypeTree::has_implementation_tag< T >::no
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >::maybe< N >
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >::yes
 
struct  Dune::TypeTree::has_implementation_tag_value< T, V >::no
 
struct  Dune::TypeTree::AlwaysVoid< typename >
 
struct  Dune::TypeTree::meta_function
 Marker tag declaring a meta function. More...
 
struct  Dune::TypeTree::lazy_evaluate< F >
 Helper meta function to delay evaluation of F. More...
 
struct  Dune::TypeTree::lazy_identity< F >
 Identity function. More...
 
struct  Dune::TypeTree::evaluate_if_meta_function< F >
 Meta function that evaluates its argument iff it inherits from meta_function. More...
 
struct  Dune::TypeTree::IsTreePath< T >
 Check if type represents a tree path. More...
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::impl
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Functions

template<typename T >
T * Dune::TypeTree::declptr ()
 Helper function for generating a pointer to a value of type T in an unevaluated operand setting. More...
 
constexpr auto Dune::TypeTree::impl::isTreePath (void *) -> std::false_type
 
template<class... I>
constexpr auto Dune::TypeTree::impl::isTreePath (const HybridTreePath< I... > *) -> std::true_type
 
template<class T >
constexpr auto Dune::TypeTree::isTreePath (const T &) -> IsTreePath< T >
 Check if given object represents a tree path. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,14 +4,89 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -transformationutilities.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +typetraits.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +struct  Dune::first_type<_T0,_T..._> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag<_T_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag<_T_>::yes │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag<_T_>::no │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag_value<_T,_V_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag_value<_T,_V_>::maybe<_N_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag_value<_T,_V_>::yes │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_node_tag_value<_T,_V_>::no │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag<_T_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag<_T_>::yes │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag<_T_>::no │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_>::maybe<_N_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_>::yes │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::has_implementation_tag_value<_T,_V_>::no │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::AlwaysVoid<_typename_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::meta_function │ │ │ │ │ +  Marker tag declaring a meta function. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::lazy_evaluate<_F_> │ │ │ │ │ +  Helper meta function to delay evaluation of F. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::lazy_identity<_F_> │ │ │ │ │ +  Identity function. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::evaluate_if_meta_function<_F_> │ │ │ │ │ +  Meta function that evaluates its argument iff it inherits from │ │ │ │ │ + meta_function. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::IsTreePath<_T_> │ │ │ │ │ +  Check if type represents a tree path. More... │ │ │ │ │ +  │ │ │ │ │ + Namespaces │ │ │ │ │ +namespace  Dune │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::TypeTree │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::TypeTree::impl │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ + T * Dune::TypeTree::declptr () │ │ │ │ │ +  Helper function for generating a pointer to a value of type T │ │ │ │ │ + in an unevaluated operand setting. More... │ │ │ │ │ +  │ │ │ │ │ +constexpr auto Dune::TypeTree::impl::isTreePath (void *) -> std::false_type │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto Dune::TypeTree::impl::isTreePath (const HybridTreePath< I... > │ │ │ │ │ + *) -> std::true_type │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto Dune::TypeTree::isTreePath (const T &) -> IsTreePath< T > │ │ │ │ │ +  Check if given object represents a tree path. More... │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: transformationutilities.hh Source File │ │ │ │ +dune-typetree: typetraits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,29 +62,248 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
transformationutilities.hh
│ │ │ │ +
typetraits.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ - │ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <dune/common/typetraits.hh>
│ │ │ │
9
│ │ │ │ -
10#endif // DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ +
12
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14
│ │ │ │ +
15 // Provide some more C++11 TMP helpers.
│ │ │ │ +
16 // These should be upstreamed to dune-common ASAP.
│ │ │ │ +
17
│ │ │ │ +
18 template<typename... T>
│ │ │ │ +
19 struct first_type;
│ │ │ │ +
20
│ │ │ │ +
21 template<typename T0, typename... T>
│ │ │ │ +
22 struct first_type<T0,T...>
│ │ │ │ +
23 {
│ │ │ │ +
24 typedef T0 type;
│ │ │ │ +
25 };
│ │ │ │ +
26
│ │ │ │ +
27 namespace TypeTree {
│ │ │ │ +
28
│ │ │ │ +
29 template<typename T>
│ │ │ │ + │ │ │ │ +
31 {
│ │ │ │ +
32 struct yes { char dummy[1]; };
│ │ │ │ +
33 struct no { char dummy[2]; };
│ │ │ │ +
34
│ │ │ │ +
35 template<typename X>
│ │ │ │ +
36 static yes test(NodeTag<X> *);
│ │ │ │ +
37 template<typename X>
│ │ │ │ +
38 static no test(...);
│ │ │ │ +
39
│ │ │ │ +
41 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ +
42 };
│ │ │ │ +
43
│ │ │ │ +
44 template<typename T, typename V>
│ │ │ │ + │ │ │ │ +
46 {
│ │ │ │ +
47 template<int N>
│ │ │ │ +
48 struct maybe { char dummy[N+1]; };
│ │ │ │ +
49 struct yes { char dummy[2]; };
│ │ │ │ +
50 struct no { char dummy[1]; };
│ │ │ │ +
51
│ │ │ │ +
52 template<typename X>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
55 template<typename X>
│ │ │ │ +
56 static no test(...);
│ │ │ │ +
57
│ │ │ │ +
59 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ +
60 };
│ │ │ │ +
61
│ │ │ │ +
62 template<typename T>
│ │ │ │ + │ │ │ │ +
64 {
│ │ │ │ +
65 struct yes { char dummy[1]; };
│ │ │ │ +
66 struct no { char dummy[2]; };
│ │ │ │ +
67
│ │ │ │ +
68 template<typename X>
│ │ │ │ + │ │ │ │ +
70 template<typename X>
│ │ │ │ +
71 static no test(...);
│ │ │ │ +
72
│ │ │ │ +
74 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ +
75 };
│ │ │ │ +
76
│ │ │ │ +
77 template<typename T, typename V>
│ │ │ │ + │ │ │ │ +
79 {
│ │ │ │ +
80 template<int N>
│ │ │ │ +
81 struct maybe { char dummy[N+1]; };
│ │ │ │ +
82 struct yes { char dummy[2]; };
│ │ │ │ +
83 struct no { char dummy[1]; };
│ │ │ │ +
84
│ │ │ │ +
85 template<typename X>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
88 template<typename X>
│ │ │ │ +
89 static no test(...);
│ │ │ │ +
90
│ │ │ │ +
92 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
│ │ │ │ +
93 };
│ │ │ │ +
94
│ │ │ │ +
95 template<typename>
│ │ │ │ + │ │ │ │ +
97 {
│ │ │ │ +
98 typedef void type;
│ │ │ │ +
99 };
│ │ │ │ +
100
│ │ │ │ +
101
│ │ │ │ +
103 template<typename T>
│ │ │ │ + │ │ │ │ +
105
│ │ │ │ +
106
│ │ │ │ +
107 // Support for lazy evaluation of meta functions. This is required when doing
│ │ │ │ +
108 // nested tag dispatch without C++11-style typedefs (based on using syntax).
│ │ │ │ +
109 // The standard struct-based meta functions cause premature evaluation in a
│ │ │ │ +
110 // context that is not SFINAE-compatible. We thus have to return the meta function
│ │ │ │ +
111 // without evaluating it, placing that burden on the caller. On the other hand,
│ │ │ │ +
112 // the lookup will often directly be the target type, so here is some helper code
│ │ │ │ +
113 // to automatically do the additional evaluation if necessary.
│ │ │ │ +
114 // Too bad that the new syntax is GCC 4.6+...
│ │ │ │ +
115
│ │ │ │ +
116
│ │ │ │ +
118
│ │ │ │ +
121 struct meta_function {};
│ │ │ │ +
122
│ │ │ │ +
124 template<typename F>
│ │ │ │ + │ │ │ │ +
126 {
│ │ │ │ +
127 typedef typename F::type type;
│ │ │ │ +
128 };
│ │ │ │ +
129
│ │ │ │ +
131 template<typename F>
│ │ │ │ + │ │ │ │ +
133 {
│ │ │ │ +
134 typedef F type;
│ │ │ │ +
135 };
│ │ │ │ +
136
│ │ │ │ +
138 template<typename F>
│ │ │ │ + │ │ │ │ +
140 {
│ │ │ │ +
141 typedef typename std::conditional<
│ │ │ │ +
142 std::is_base_of<meta_function,F>::value,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
145 >::type::type type;
│ │ │ │ +
146 };
│ │ │ │ +
147
│ │ │ │ +
148 namespace impl {
│ │ │ │ +
149
│ │ │ │ +
150 // Check if type is a or is derived from one of the tree path types
│ │ │ │ +
151
│ │ │ │ +
152 // Default overload for types not representing a tree path
│ │ │ │ +
153 constexpr auto isTreePath(void*)
│ │ │ │ +
154 -> std::false_type
│ │ │ │ +
155 {
│ │ │ │ +
156 return std::false_type();
│ │ │ │ +
157 }
│ │ │ │ +
158
│ │ │ │ +
159 // Overload for instances of HybridTreePath<...>
│ │ │ │ +
160 template<class... I>
│ │ │ │ +
161 constexpr auto isTreePath(const HybridTreePath<I...>*)
│ │ │ │ +
162 -> std::true_type
│ │ │ │ +
163 {
│ │ │ │ +
164 return std::true_type();
│ │ │ │ +
165 }
│ │ │ │ +
166
│ │ │ │ +
167 }
│ │ │ │ +
168
│ │ │ │ +
179 template<class T>
│ │ │ │ +
180 struct IsTreePath :
│ │ │ │ +
181 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
│ │ │ │ +
182 {};
│ │ │ │ +
183
│ │ │ │ +
190 template<class T>
│ │ │ │ +
191 constexpr auto isTreePath(const T&)
│ │ │ │ + │ │ │ │ +
193 {
│ │ │ │ +
194 return IsTreePath<T>();
│ │ │ │ +
195 }
│ │ │ │ +
196
│ │ │ │ +
197
│ │ │ │ +
198 } // end namespace TypeTree
│ │ │ │ +
199} // end namespace Dune
│ │ │ │ +
200
│ │ │ │ +
201#endif // DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ +
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition: nodeinterface.hh:80
│ │ │ │ +
Definition: accumulate_static.hh:13
│ │ │ │ +
constexpr auto isTreePath(const T &) -> IsTreePath< T >
Check if given object represents a tree path.
Definition: typetraits.hh:191
│ │ │ │ +
T * declptr()
Helper function for generating a pointer to a value of type T in an unevaluated operand setting.
│ │ │ │ +
constexpr auto isTreePath(void *) -> std::false_type
Definition: typetraits.hh:153
│ │ │ │ +
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │ +
Definition: typetraits.hh:19
│ │ │ │ +
T0 type
Definition: typetraits.hh:24
│ │ │ │ +
Definition: typetraits.hh:31
│ │ │ │ +
static constexpr bool value
True if class T defines a NodeTag.
Definition: typetraits.hh:41
│ │ │ │ +
static yes test(NodeTag< X > *)
│ │ │ │ + │ │ │ │ +
Definition: typetraits.hh:32
│ │ │ │ +
char dummy[1]
Definition: typetraits.hh:32
│ │ │ │ +
Definition: typetraits.hh:33
│ │ │ │ +
char dummy[2]
Definition: typetraits.hh:33
│ │ │ │ +
Definition: typetraits.hh:46
│ │ │ │ +
static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a)
│ │ │ │ +
static constexpr bool value
True if class T defines a NodeTag of type V.
Definition: typetraits.hh:59
│ │ │ │ + │ │ │ │ +
Definition: typetraits.hh:48
│ │ │ │ +
char dummy[N+1]
Definition: typetraits.hh:48
│ │ │ │ +
Definition: typetraits.hh:49
│ │ │ │ +
char dummy[2]
Definition: typetraits.hh:49
│ │ │ │ +
Definition: typetraits.hh:50
│ │ │ │ +
char dummy[1]
Definition: typetraits.hh:50
│ │ │ │ +
Definition: typetraits.hh:64
│ │ │ │ +
static yes test(ImplementationTag< X > *)
│ │ │ │ + │ │ │ │ +
static constexpr bool value
True if class T defines an ImplementationTag.
Definition: typetraits.hh:74
│ │ │ │ + │ │ │ │ +
char dummy[1]
Definition: typetraits.hh:65
│ │ │ │ +
Definition: typetraits.hh:66
│ │ │ │ +
char dummy[2]
Definition: typetraits.hh:66
│ │ │ │ + │ │ │ │ +
static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test(ImplementationTag< X > *a)
│ │ │ │ + │ │ │ │ +
static constexpr bool value
True if class T defines an ImplementationTag of type V.
Definition: typetraits.hh:92
│ │ │ │ + │ │ │ │ +
char dummy[N+1]
Definition: typetraits.hh:81
│ │ │ │ + │ │ │ │ +
char dummy[2]
Definition: typetraits.hh:82
│ │ │ │ + │ │ │ │ +
char dummy[1]
Definition: typetraits.hh:83
│ │ │ │ +
Definition: typetraits.hh:97
│ │ │ │ +
void type
Definition: typetraits.hh:98
│ │ │ │ +
Marker tag declaring a meta function.
Definition: typetraits.hh:121
│ │ │ │ +
Helper meta function to delay evaluation of F.
Definition: typetraits.hh:126
│ │ │ │ +
F::type type
Definition: typetraits.hh:127
│ │ │ │ +
Identity function.
Definition: typetraits.hh:133
│ │ │ │ +
F type
Definition: typetraits.hh:134
│ │ │ │ +
Meta function that evaluates its argument iff it inherits from meta_function.
Definition: typetraits.hh:140
│ │ │ │ +
std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
Definition: typetraits.hh:145
│ │ │ │ +
Check if type represents a tree path.
Definition: typetraits.hh:182
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,24 +4,346 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -transformationutilities.hh │ │ │ │ │ +typetraits.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ 9 │ │ │ │ │ - 10#endif // DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH │ │ │ │ │ -simpletransformationdescriptors.hh │ │ │ │ │ -generictransformationdescriptors.hh │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12 │ │ │ │ │ + 13namespace Dune { │ │ │ │ │ + 14 │ │ │ │ │ + 15 // Provide some more C++11 TMP helpers. │ │ │ │ │ + 16 // These should be upstreamed to dune-common ASAP. │ │ │ │ │ + 17 │ │ │ │ │ + 18 template │ │ │ │ │ +19 struct first_type; │ │ │ │ │ + 20 │ │ │ │ │ + 21 template │ │ │ │ │ +22 struct first_type │ │ │ │ │ + 23 { │ │ │ │ │ +24 typedef T0 type; │ │ │ │ │ + 25 }; │ │ │ │ │ + 26 │ │ │ │ │ + 27 namespace TypeTree { │ │ │ │ │ + 28 │ │ │ │ │ + 29 template │ │ │ │ │ +30 struct has_node_tag │ │ │ │ │ + 31 { │ │ │ │ │ +32 struct yes { char dummy[1]; }; │ │ │ │ │ +33 struct no { char dummy[2]; }; │ │ │ │ │ + 34 │ │ │ │ │ + 35 template │ │ │ │ │ +36 static yes test(NodeTag *); │ │ │ │ │ + 37 template │ │ │ │ │ +38 static no test(...); │ │ │ │ │ + 39 │ │ │ │ │ +41 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ + 42 }; │ │ │ │ │ + 43 │ │ │ │ │ + 44 template │ │ │ │ │ +45 struct has_node_tag_value │ │ │ │ │ + 46 { │ │ │ │ │ + 47 template │ │ │ │ │ +48 struct maybe { char dummy[N+1]; }; │ │ │ │ │ +49 struct yes { char dummy[2]; }; │ │ │ │ │ +50 struct no { char dummy[1]; }; │ │ │ │ │ + 51 │ │ │ │ │ + 52 template │ │ │ │ │ + 53 static maybe>::value> │ │ │ │ │ +54 test(NodeTag * a); │ │ │ │ │ + 55 template │ │ │ │ │ +56 static no test(...); │ │ │ │ │ + 57 │ │ │ │ │ +59 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ + 60 }; │ │ │ │ │ + 61 │ │ │ │ │ + 62 template │ │ │ │ │ +63 struct has_implementation_tag │ │ │ │ │ + 64 { │ │ │ │ │ +65 struct yes { char dummy[1]; }; │ │ │ │ │ +66 struct no { char dummy[2]; }; │ │ │ │ │ + 67 │ │ │ │ │ + 68 template │ │ │ │ │ +69 static yes test(ImplementationTag *); │ │ │ │ │ + 70 template │ │ │ │ │ +71 static no test(...); │ │ │ │ │ + 72 │ │ │ │ │ +74 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ + 75 }; │ │ │ │ │ + 76 │ │ │ │ │ + 77 template │ │ │ │ │ +78 struct has_implementation_tag_value │ │ │ │ │ + 79 { │ │ │ │ │ + 80 template │ │ │ │ │ +81 struct maybe { char dummy[N+1]; }; │ │ │ │ │ +82 struct yes { char dummy[2]; }; │ │ │ │ │ +83 struct no { char dummy[1]; }; │ │ │ │ │ + 84 │ │ │ │ │ + 85 template │ │ │ │ │ + 86 static maybe>::value> │ │ │ │ │ +87 test(ImplementationTag * a); │ │ │ │ │ + 88 template │ │ │ │ │ +89 static no test(...); │ │ │ │ │ + 90 │ │ │ │ │ +92 constexpr static bool value = sizeof(test(0)) == sizeof(yes); │ │ │ │ │ + 93 }; │ │ │ │ │ + 94 │ │ │ │ │ + 95 template │ │ │ │ │ +96 struct AlwaysVoid │ │ │ │ │ + 97 { │ │ │ │ │ +98 typedef void type; │ │ │ │ │ + 99 }; │ │ │ │ │ + 100 │ │ │ │ │ + 101 │ │ │ │ │ + 103 template │ │ │ │ │ +104 T* declptr(); │ │ │ │ │ + 105 │ │ │ │ │ + 106 │ │ │ │ │ + 107 // Support for lazy evaluation of meta functions. This is required when │ │ │ │ │ +doing │ │ │ │ │ + 108 // nested tag dispatch without C++11-style typedefs (based on using │ │ │ │ │ +syntax). │ │ │ │ │ + 109 // The standard struct-based meta functions cause premature evaluation in │ │ │ │ │ +a │ │ │ │ │ + 110 // context that is not SFINAE-compatible. We thus have to return the meta │ │ │ │ │ +function │ │ │ │ │ + 111 // without evaluating it, placing that burden on the caller. On the other │ │ │ │ │ +hand, │ │ │ │ │ + 112 // the lookup will often directly be the target type, so here is some │ │ │ │ │ +helper code │ │ │ │ │ + 113 // to automatically do the additional evaluation if necessary. │ │ │ │ │ + 114 // Too bad that the new syntax is GCC 4.6+... │ │ │ │ │ + 115 │ │ │ │ │ + 116 │ │ │ │ │ + 118 │ │ │ │ │ +121 struct meta_function {}; │ │ │ │ │ + 122 │ │ │ │ │ + 124 template │ │ │ │ │ +125 struct lazy_evaluate │ │ │ │ │ + 126 { │ │ │ │ │ +127 typedef typename F::type type; │ │ │ │ │ + 128 }; │ │ │ │ │ + 129 │ │ │ │ │ + 131 template │ │ │ │ │ +132 struct lazy_identity │ │ │ │ │ + 133 { │ │ │ │ │ +134 typedef F type; │ │ │ │ │ + 135 }; │ │ │ │ │ + 136 │ │ │ │ │ + 138 template │ │ │ │ │ +139 struct evaluate_if_meta_function │ │ │ │ │ + 140 { │ │ │ │ │ + 141 typedef typename std::conditional< │ │ │ │ │ + 142 std::is_base_of::value, │ │ │ │ │ + 143 lazy_evaluate, │ │ │ │ │ + 144 lazy_identity │ │ │ │ │ +145 >::type::type type; │ │ │ │ │ + 146 }; │ │ │ │ │ + 147 │ │ │ │ │ +148 namespace impl { │ │ │ │ │ + 149 │ │ │ │ │ + 150 // Check if type is a or is derived from one of the tree path types │ │ │ │ │ + 151 │ │ │ │ │ + 152 // Default overload for types not representing a tree path │ │ │ │ │ +153 constexpr auto isTreePath(void*) │ │ │ │ │ + 154 -> std::false_type │ │ │ │ │ + 155 { │ │ │ │ │ + 156 return std::false_type(); │ │ │ │ │ + 157 } │ │ │ │ │ + 158 │ │ │ │ │ + 159 // Overload for instances of HybridTreePath<...> │ │ │ │ │ + 160 template │ │ │ │ │ +161 constexpr auto isTreePath(const HybridTreePath*) │ │ │ │ │ + 162 -> std::true_type │ │ │ │ │ + 163 { │ │ │ │ │ + 164 return std::true_type(); │ │ │ │ │ + 165 } │ │ │ │ │ + 166 │ │ │ │ │ + 167 } │ │ │ │ │ + 168 │ │ │ │ │ + 179 template │ │ │ │ │ +180 struct IsTreePath : │ │ │ │ │ + 181 public decltype(impl::isTreePath((typename std::decay::type*) │ │ │ │ │ +(nullptr))) │ │ │ │ │ + 182 {}; │ │ │ │ │ + 183 │ │ │ │ │ + 190 template │ │ │ │ │ +191 constexpr auto isTreePath(const T&) │ │ │ │ │ + 192 -> IsTreePath │ │ │ │ │ + 193 { │ │ │ │ │ + 194 return IsTreePath(); │ │ │ │ │ + 195 } │ │ │ │ │ + 196 │ │ │ │ │ + 197 │ │ │ │ │ + 198 } // end namespace TypeTree │ │ │ │ │ + 199} // end namespace Dune │ │ │ │ │ + 200 │ │ │ │ │ + 201#endif // DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ +treepath.hh │ │ │ │ │ +Dune::TypeTree::NodeTag │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +Definition: nodeinterface.hh:76 │ │ │ │ │ +Dune::TypeTree::ImplementationTag │ │ │ │ │ +typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ +Returns the implementation tag of the given Node. │ │ │ │ │ +Definition: nodeinterface.hh:80 │ │ │ │ │ +Dune │ │ │ │ │ +Definition: accumulate_static.hh:13 │ │ │ │ │ +Dune::TypeTree::isTreePath │ │ │ │ │ +constexpr auto isTreePath(const T &) -> IsTreePath< T > │ │ │ │ │ +Check if given object represents a tree path. │ │ │ │ │ +Definition: typetraits.hh:191 │ │ │ │ │ +Dune::TypeTree::declptr │ │ │ │ │ +T * declptr() │ │ │ │ │ +Helper function for generating a pointer to a value of type T in an unevaluated │ │ │ │ │ +operand setting. │ │ │ │ │ +Dune::TypeTree::impl::isTreePath │ │ │ │ │ +constexpr auto isTreePath(void *) -> std::false_type │ │ │ │ │ +Definition: typetraits.hh:153 │ │ │ │ │ +Dune::TypeTree::HybridTreePath │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +Definition: treepath.hh:79 │ │ │ │ │ +Dune::first_type │ │ │ │ │ +Definition: typetraits.hh:19 │ │ │ │ │ +Dune::first_type<_T0,_T..._>::type │ │ │ │ │ +T0 type │ │ │ │ │ +Definition: typetraits.hh:24 │ │ │ │ │ +Dune::TypeTree::has_node_tag │ │ │ │ │ +Definition: typetraits.hh:31 │ │ │ │ │ +Dune::TypeTree::has_node_tag::value │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines a NodeTag. │ │ │ │ │ +Definition: typetraits.hh:41 │ │ │ │ │ +Dune::TypeTree::has_node_tag::test │ │ │ │ │ +static yes test(NodeTag< X > *) │ │ │ │ │ +Dune::TypeTree::has_node_tag::test │ │ │ │ │ +static no test(...) │ │ │ │ │ +Dune::TypeTree::has_node_tag::yes │ │ │ │ │ +Definition: typetraits.hh:32 │ │ │ │ │ +Dune::TypeTree::has_node_tag::yes::dummy │ │ │ │ │ +char dummy[1] │ │ │ │ │ +Definition: typetraits.hh:32 │ │ │ │ │ +Dune::TypeTree::has_node_tag::no │ │ │ │ │ +Definition: typetraits.hh:33 │ │ │ │ │ +Dune::TypeTree::has_node_tag::no::dummy │ │ │ │ │ +char dummy[2] │ │ │ │ │ +Definition: typetraits.hh:33 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value │ │ │ │ │ +Definition: typetraits.hh:46 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::test │ │ │ │ │ +static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a) │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::value │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines a NodeTag of type V. │ │ │ │ │ +Definition: typetraits.hh:59 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::test │ │ │ │ │ +static no test(...) │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::maybe │ │ │ │ │ +Definition: typetraits.hh:48 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::maybe::dummy │ │ │ │ │ +char dummy[N+1] │ │ │ │ │ +Definition: typetraits.hh:48 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::yes │ │ │ │ │ +Definition: typetraits.hh:49 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::yes::dummy │ │ │ │ │ +char dummy[2] │ │ │ │ │ +Definition: typetraits.hh:49 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::no │ │ │ │ │ +Definition: typetraits.hh:50 │ │ │ │ │ +Dune::TypeTree::has_node_tag_value::no::dummy │ │ │ │ │ +char dummy[1] │ │ │ │ │ +Definition: typetraits.hh:50 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag │ │ │ │ │ +Definition: typetraits.hh:64 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::test │ │ │ │ │ +static yes test(ImplementationTag< X > *) │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::test │ │ │ │ │ +static no test(...) │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::value │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines an ImplementationTag. │ │ │ │ │ +Definition: typetraits.hh:74 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::yes │ │ │ │ │ +Definition: typetraits.hh:65 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::yes::dummy │ │ │ │ │ +char dummy[1] │ │ │ │ │ +Definition: typetraits.hh:65 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::no │ │ │ │ │ +Definition: typetraits.hh:66 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag::no::dummy │ │ │ │ │ +char dummy[2] │ │ │ │ │ +Definition: typetraits.hh:66 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value │ │ │ │ │ +Definition: typetraits.hh:79 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::test │ │ │ │ │ +static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test │ │ │ │ │ +(ImplementationTag< X > *a) │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::test │ │ │ │ │ +static no test(...) │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::value │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines an ImplementationTag of type V. │ │ │ │ │ +Definition: typetraits.hh:92 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::maybe │ │ │ │ │ +Definition: typetraits.hh:81 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::maybe::dummy │ │ │ │ │ +char dummy[N+1] │ │ │ │ │ +Definition: typetraits.hh:81 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::yes │ │ │ │ │ +Definition: typetraits.hh:82 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::yes::dummy │ │ │ │ │ +char dummy[2] │ │ │ │ │ +Definition: typetraits.hh:82 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::no │ │ │ │ │ +Definition: typetraits.hh:83 │ │ │ │ │ +Dune::TypeTree::has_implementation_tag_value::no::dummy │ │ │ │ │ +char dummy[1] │ │ │ │ │ +Definition: typetraits.hh:83 │ │ │ │ │ +Dune::TypeTree::AlwaysVoid │ │ │ │ │ +Definition: typetraits.hh:97 │ │ │ │ │ +Dune::TypeTree::AlwaysVoid::type │ │ │ │ │ +void type │ │ │ │ │ +Definition: typetraits.hh:98 │ │ │ │ │ +Dune::TypeTree::meta_function │ │ │ │ │ +Marker tag declaring a meta function. │ │ │ │ │ +Definition: typetraits.hh:121 │ │ │ │ │ +Dune::TypeTree::lazy_evaluate │ │ │ │ │ +Helper meta function to delay evaluation of F. │ │ │ │ │ +Definition: typetraits.hh:126 │ │ │ │ │ +Dune::TypeTree::lazy_evaluate::type │ │ │ │ │ +F::type type │ │ │ │ │ +Definition: typetraits.hh:127 │ │ │ │ │ +Dune::TypeTree::lazy_identity │ │ │ │ │ +Identity function. │ │ │ │ │ +Definition: typetraits.hh:133 │ │ │ │ │ +Dune::TypeTree::lazy_identity::type │ │ │ │ │ +F type │ │ │ │ │ +Definition: typetraits.hh:134 │ │ │ │ │ +Dune::TypeTree::evaluate_if_meta_function │ │ │ │ │ +Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ +Definition: typetraits.hh:140 │ │ │ │ │ +Dune::TypeTree::evaluate_if_meta_function::type │ │ │ │ │ +std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F │ │ │ │ │ +>, lazy_identity< F > >::type::type type │ │ │ │ │ +Definition: typetraits.hh:145 │ │ │ │ │ +Dune::TypeTree::IsTreePath │ │ │ │ │ +Check if type represents a tree path. │ │ │ │ │ +Definition: typetraits.hh:182 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powernode.hh File Reference │ │ │ │ +dune-typetree: dynamicpowernode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,37 +65,33 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
powernode.hh File Reference
│ │ │ │ +
dynamicpowernode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │
#include <cassert>
│ │ │ │ -#include <array>
│ │ │ │ +#include <vector>
│ │ │ │ #include <memory>
│ │ │ │ #include <type_traits>
│ │ │ │ #include <dune/common/typetraits.hh>
│ │ │ │ #include <dune/common/std/type_traits.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/utility.hh>
│ │ │ │ -#include <dune/typetree/childextraction.hh>
│ │ │ │ -#include <dune/typetree/typetraits.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/utility.hh>
│ │ │ │ +#include <dune/typetree/typetraits.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::TypeTree::PowerNode< T, k >
 Collect k instances of type T within a dune-typetree. More...
 
struct  Dune::TypeTree::PowerNode< T, k >::Child< i >
 Access to the type and storage type of the i-th child. More...
class  Dune::TypeTree::DynamicPowerNode< T >
 Collect multiple instances of type T within a dune-typetree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,32 +5,28 @@ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -powernode.hh File Reference │ │ │ │ │ +dynamicpowernode.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ #include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::TypeTree::PowerNode<_T,_k_> │ │ │ │ │ -  Collect k instances of type T within a dune-typetree. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TypeTree::PowerNode<_T,_k_>::Child<_i_> │ │ │ │ │ -  Access to the type and storage type of the i-th child. More... │ │ │ │ │ +class  Dune::TypeTree::DynamicPowerNode<_T_> │ │ │ │ │ +  Collect multiple instances of type T within a dune-typetree. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00080_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powernode.hh Source File │ │ │ │ +dune-typetree: dynamicpowernode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,355 +62,193 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
powernode.hh
│ │ │ │ +
dynamicpowernode.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │
6
│ │ │ │
7#include <cassert>
│ │ │ │ -
8#include <array>
│ │ │ │ +
8#include <vector>
│ │ │ │
9#include <memory>
│ │ │ │
10#include <type_traits>
│ │ │ │
11
│ │ │ │
12#include <dune/common/typetraits.hh>
│ │ │ │
13#include <dune/common/std/type_traits.hh>
│ │ │ │
14
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
19
│ │ │ │ -
20namespace Dune {
│ │ │ │ -
21 namespace TypeTree {
│ │ │ │ -
22
│ │ │ │ -
29#ifndef DOXYGEN
│ │ │ │ -
30
│ │ │ │ -
32 template<typename PowerNode, typename T, std::size_t k>
│ │ │ │ -
33 struct AssertPowerNodeChildCount
│ │ │ │ -
34 : public std::enable_if<std::is_same<
│ │ │ │ -
35 typename PowerNode::ChildType,
│ │ │ │ -
36 T>::value &&
│ │ │ │ -
37 PowerNode::degree() == k,
│ │ │ │ -
38 T>
│ │ │ │ -
39 {};
│ │ │ │ -
40
│ │ │ │ -
41#endif
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20 namespace TypeTree {
│ │ │ │ +
21
│ │ │ │ +
31 template<typename T>
│ │ │ │ + │ │ │ │ +
33 {
│ │ │ │ +
34
│ │ │ │ +
35 public:
│ │ │ │ +
36
│ │ │ │ +
38 static const bool isLeaf = false;
│ │ │ │ +
39
│ │ │ │ +
41 static const bool isPower = true;
│ │ │ │
42
│ │ │ │ -
48 template<typename T, std::size_t k>
│ │ │ │ - │ │ │ │ -
50 {
│ │ │ │ +
44 static const bool isComposite = false;
│ │ │ │ +
45
│ │ │ │ +
47 std::size_t degree() const
│ │ │ │ +
48 {
│ │ │ │ +
49 return _children.size();
│ │ │ │ +
50 }
│ │ │ │
51
│ │ │ │ -
52 public:
│ │ │ │ -
53
│ │ │ │ -
55 static const bool isLeaf = false;
│ │ │ │ -
56
│ │ │ │ -
58 static const bool isPower = true;
│ │ │ │ -
59
│ │ │ │ -
61 static const bool isComposite = false;
│ │ │ │ -
62
│ │ │ │ -
64 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ -
65 static const std::size_t CHILDREN = k;
│ │ │ │ + │ │ │ │ +
54
│ │ │ │ +
56 typedef T ChildType;
│ │ │ │ +
57
│ │ │ │ +
59 typedef std::shared_ptr<T> ChildStorageType;
│ │ │ │ +
60
│ │ │ │ +
62 typedef std::shared_ptr<const T> ChildConstStorageType;
│ │ │ │ +
63
│ │ │ │ +
65 typedef std::vector<ChildStorageType> NodeStorage;
│ │ │ │
66
│ │ │ │ -
67 static constexpr auto degree ()
│ │ │ │ -
68 {
│ │ │ │ -
69 return std::integral_constant<std::size_t,k>{};
│ │ │ │ -
70 }
│ │ │ │ -
71
│ │ │ │ - │ │ │ │ -
74
│ │ │ │ -
76 typedef T ChildType;
│ │ │ │ -
77
│ │ │ │ -
79 typedef std::array<std::shared_ptr<T>,k> NodeStorage;
│ │ │ │ +
67
│ │ │ │ +
70
│ │ │ │ +
72
│ │ │ │ +
75 ChildType& child (std::size_t i)
│ │ │ │ +
76 {
│ │ │ │ +
77 assert(i < degree() && "child index out of range");
│ │ │ │ +
78 return *_children[i];
│ │ │ │ +
79 }
│ │ │ │
80
│ │ │ │ -
81
│ │ │ │ -
83 template<std::size_t i>
│ │ │ │ -
84 struct Child
│ │ │ │ -
85 {
│ │ │ │ -
86
│ │ │ │ -
87 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
88
│ │ │ │ -
90 typedef T Type;
│ │ │ │ -
91
│ │ │ │ -
93 typedef T type;
│ │ │ │ -
94 };
│ │ │ │ -
95
│ │ │ │ -
98
│ │ │ │ +
82
│ │ │ │ +
85 const ChildType& child (std::size_t i) const
│ │ │ │ +
86 {
│ │ │ │ +
87 assert(i < degree() && "child index out of range");
│ │ │ │ +
88 return *_children[i];
│ │ │ │ +
89 }
│ │ │ │ +
90
│ │ │ │ +
92
│ │ │ │ + │ │ │ │ +
96 {
│ │ │ │ +
97 assert(i < degree() && "child index out of range");
│ │ │ │ +
98 return _children[i];
│ │ │ │ +
99 }
│ │ │ │
100
│ │ │ │ -
103 template<std::size_t i>
│ │ │ │ -
104 T& child (index_constant<i> = {})
│ │ │ │ -
105 {
│ │ │ │ -
106 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
107 return *_children[i];
│ │ │ │ -
108 }
│ │ │ │ -
109
│ │ │ │ -
111
│ │ │ │ -
114 template<std::size_t i>
│ │ │ │ -
115 const T& child (index_constant<i> = {}) const
│ │ │ │ +
102
│ │ │ │ + │ │ │ │ +
109 {
│ │ │ │ +
110 assert(i < degree() && "child index out of range");
│ │ │ │ +
111 return _children[i];
│ │ │ │ +
112 }
│ │ │ │ +
113
│ │ │ │ +
115 void setChild (std::size_t i, ChildType& t)
│ │ │ │
116 {
│ │ │ │ -
117 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
118 return *_children[i];
│ │ │ │ +
117 assert(i < degree() && "child index out of range");
│ │ │ │ +
118 _children[i] = stackobject_to_shared_ptr(t);
│ │ │ │
119 }
│ │ │ │
120
│ │ │ │ -
122
│ │ │ │ -
125 template<std::size_t i>
│ │ │ │ -
126 std::shared_ptr<T> childStorage (index_constant<i> = {})
│ │ │ │ -
127 {
│ │ │ │ -
128 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
129 return _children[i];
│ │ │ │ -
130 }
│ │ │ │ -
131
│ │ │ │ -
133
│ │ │ │ -
136 template<std::size_t i>
│ │ │ │ -
137 std::shared_ptr<const T> childStorage (index_constant<i> = {}) const
│ │ │ │ -
138 {
│ │ │ │ -
139 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
140 return _children[i];
│ │ │ │ -
141 }
│ │ │ │ -
142
│ │ │ │ -
144 template<std::size_t i>
│ │ │ │ -
145 void setChild (T& t, index_constant<i> = {})
│ │ │ │ -
146 {
│ │ │ │ -
147 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
148 _children[i] = stackobject_to_shared_ptr(t);
│ │ │ │ -
149 }
│ │ │ │ +
122 void setChild (std::size_t i, ChildType&& t)
│ │ │ │ +
123 {
│ │ │ │ +
124 assert(i < degree() && "child index out of range");
│ │ │ │ +
125 _children[i] = convert_arg(std::move(t));
│ │ │ │ +
126 }
│ │ │ │ +
127
│ │ │ │ +
129 void setChild (std::size_t i, ChildStorageType st)
│ │ │ │ +
130 {
│ │ │ │ +
131 assert(i < degree() && "child index out of range");
│ │ │ │ +
132 _children[i] = std::move(st);
│ │ │ │ +
133 }
│ │ │ │ +
134
│ │ │ │ +
135 const NodeStorage& nodeStorage () const
│ │ │ │ +
136 {
│ │ │ │ +
137 return _children;
│ │ │ │ +
138 }
│ │ │ │ +
139
│ │ │ │ +
141
│ │ │ │ +
144
│ │ │ │ +
145 protected:
│ │ │ │ +
146
│ │ │ │ +
149 DynamicPowerNode () = delete;
│ │ │ │
150
│ │ │ │ -
152 template<std::size_t i>
│ │ │ │ -
153 void setChild (T&& t, index_constant<i> = {})
│ │ │ │ -
154 {
│ │ │ │ -
155 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
156 _children[i] = convert_arg(std::move(t));
│ │ │ │ -
157 }
│ │ │ │ -
158
│ │ │ │ -
160 template<std::size_t i>
│ │ │ │ -
161 void setChild (std::shared_ptr<T> st, index_constant<i> = {})
│ │ │ │ -
162 {
│ │ │ │ -
163 static_assert((i < degree()), "child index out of range");
│ │ │ │ -
164 _children[i] = std::move(st);
│ │ │ │ -
165 }
│ │ │ │ -
166
│ │ │ │ +
152
│ │ │ │ +
160 explicit DynamicPowerNode (std::size_t size)
│ │ │ │ +
161 : _children(size)
│ │ │ │ +
162 {}
│ │ │ │ +
163
│ │ │ │ +
165 explicit DynamicPowerNode (NodeStorage children)
│ │ │ │ +
166 : _children(std::move(children))
│ │ │ │ +
167 {}
│ │ │ │
168
│ │ │ │ -
169
│ │ │ │ -
172
│ │ │ │ +
169#ifdef DOXYGEN
│ │ │ │ +
170
│ │ │ │ +
172 DynamicPowerNode (T& t1, T& t2, ...)
│ │ │ │ +
173 {}
│ │ │ │
174
│ │ │ │ -
177 T& child (std::size_t i)
│ │ │ │ -
178 {
│ │ │ │ -
179 assert(i < degree() && "child index out of range");
│ │ │ │ -
180 return *_children[i];
│ │ │ │ -
181 }
│ │ │ │ -
182
│ │ │ │ -
184
│ │ │ │ -
187 const T& child (std::size_t i) const
│ │ │ │ -
188 {
│ │ │ │ -
189 assert(i < degree() && "child index out of range");
│ │ │ │ -
190 return *_children[i];
│ │ │ │ -
191 }
│ │ │ │ +
175#else
│ │ │ │ +
176
│ │ │ │ +
177 template<typename... Children,
│ │ │ │ +
178 std::enable_if_t<(std::is_same_v<ChildType, std::decay_t<Children>> &&...), bool> = true>
│ │ │ │ +
179 DynamicPowerNode (Children&&... children)
│ │ │ │ +
180 {
│ │ │ │ +
181 _children = NodeStorage{convert_arg(std::forward<Children>(children))...};
│ │ │ │ +
182 }
│ │ │ │ +
183
│ │ │ │ +
184 template<typename... Children,
│ │ │ │ +
185 std::enable_if_t<(std::is_same_v<ChildType, std::decay_t<Children>> &&...), bool> = true>
│ │ │ │ +
186 DynamicPowerNode (std::shared_ptr<Children>... children)
│ │ │ │ +
187 {
│ │ │ │ +
188 _children = NodeStorage{std::move(children)...};
│ │ │ │ +
189 }
│ │ │ │ +
190
│ │ │ │ +
191#endif // DOXYGEN
│ │ │ │
192
│ │ │ │
194
│ │ │ │ -
197 std::shared_ptr<T> childStorage (std::size_t i)
│ │ │ │ -
198 {
│ │ │ │ -
199 assert(i < degree() && "child index out of range");
│ │ │ │ -
200 return _children[i];
│ │ │ │ -
201 }
│ │ │ │ -
202
│ │ │ │ -
204
│ │ │ │ -
207 std::shared_ptr<const T> childStorage (std::size_t i) const
│ │ │ │ -
208 {
│ │ │ │ -
209 assert(i < degree() && "child index out of range");
│ │ │ │ -
210 return _children[i];
│ │ │ │ -
211 }
│ │ │ │ -
212
│ │ │ │ -
214 void setChild (std::size_t i, T& t)
│ │ │ │ -
215 {
│ │ │ │ -
216 assert(i < degree() && "child index out of range");
│ │ │ │ -
217 _children[i] = stackobject_to_shared_ptr(t);
│ │ │ │ -
218 }
│ │ │ │ -
219
│ │ │ │ -
221 void setChild (std::size_t i, T&& t)
│ │ │ │ -
222 {
│ │ │ │ -
223 assert(i < degree() && "child index out of range");
│ │ │ │ -
224 _children[i] = convert_arg(std::move(t));
│ │ │ │ -
225 }
│ │ │ │ -
226
│ │ │ │ -
228 void setChild (std::size_t i, std::shared_ptr<T> st)
│ │ │ │ -
229 {
│ │ │ │ -
230 assert(i < degree() && "child index out of range");
│ │ │ │ -
231 _children[i] = std::move(st);
│ │ │ │ -
232 }
│ │ │ │ -
233
│ │ │ │ -
234 const NodeStorage& nodeStorage () const
│ │ │ │ -
235 {
│ │ │ │ -
236 return _children;
│ │ │ │ -
237 }
│ │ │ │ -
238
│ │ │ │ -
240
│ │ │ │ -
243
│ │ │ │ -
244 // The following two methods require a little bit of SFINAE trickery to work correctly:
│ │ │ │ -
245 // We have to make sure that they don't shadow the methods for direct child access because
│ │ │ │ -
246 // those get called by the generic child() machinery. If that machinery picks up the methods
│ │ │ │ -
247 // defined below, we have an infinite recursion.
│ │ │ │ -
248 // So the methods make sure that either
│ │ │ │ -
249 //
│ │ │ │ -
250 // * there are more than one argument. In that case, we got multiple indices and can forward
│ │ │ │ -
251 // to the general machine.
│ │ │ │ -
252 //
│ │ │ │ -
253 // * the first argument is not a valid flat index, i.e. either a std::size_t or an index_constant.
│ │ │ │ -
254 // The argument thus has to be some kind of TreePath instance that we can also pass to the
│ │ │ │ -
255 // generic machine.
│ │ │ │ -
256 //
│ │ │ │ -
257 // The above SFINAE logic works, but there is still a problem with the return type deduction.
│ │ │ │ -
258 // We have to do a lazy lookup of the return type after SFINAE has succeeded, otherwise the return
│ │ │ │ -
259 // type deduction will trigger the infinite recursion.
│ │ │ │ -
260
│ │ │ │ -
262
│ │ │ │ -
266#ifdef DOXYGEN
│ │ │ │ -
267 template<typename... Indices>
│ │ │ │ -
268 ImplementationDefined& child (Indices... indices)
│ │ │ │ -
269#else
│ │ │ │ -
270 template<typename I0, typename... I,
│ │ │ │ -
271 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ -
272 decltype(auto) child (I0 i0, I... i)
│ │ │ │ -
273#endif
│ │ │ │ -
274 {
│ │ │ │ -
275 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ -
276 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ -
277 );
│ │ │ │ -
278 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ -
279 }
│ │ │ │ -
280
│ │ │ │ -
282
│ │ │ │ -
286#ifdef DOXYGEN
│ │ │ │ -
287 template<typename... Indices>
│ │ │ │ -
288 const ImplementationDefined& child (Indices... indices)
│ │ │ │ -
289#else
│ │ │ │ -
290 template<typename I0, typename... I,
│ │ │ │ -
291 std::enable_if_t<(sizeof...(I) > 0) || IsTreePath<I0>::value, int > = 0>
│ │ │ │ -
292 decltype(auto) child (I0 i0, I... i) const
│ │ │ │ -
293#endif
│ │ │ │ -
294 {
│ │ │ │ -
295 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}),
│ │ │ │ -
296 "You cannot use the member function child() with an empty TreePath, use the freestanding version child(node,treePath) instead."
│ │ │ │ -
297 );
│ │ │ │ -
298 return Dune::TypeTree::child(*this,i0,i...);
│ │ │ │ -
299 }
│ │ │ │ -
300
│ │ │ │ -
302
│ │ │ │ -
305
│ │ │ │ -
306 protected:
│ │ │ │ -
307
│ │ │ │ -
309
│ │ │ │ - │ │ │ │ -
318 {}
│ │ │ │ -
319
│ │ │ │ -
321 explicit PowerNode (const NodeStorage& children)
│ │ │ │ -
322 : _children(children)
│ │ │ │ -
323 {}
│ │ │ │ -
324
│ │ │ │ -
326 explicit PowerNode (T& t, bool distinct_objects = true)
│ │ │ │ -
327 {
│ │ │ │ -
328 if (distinct_objects)
│ │ │ │ -
329 {
│ │ │ │ -
330 for (typename NodeStorage::iterator it = _children.begin(); it != _children.end(); ++it)
│ │ │ │ -
331 *it = std::make_shared<T>(t);
│ │ │ │ -
332 }
│ │ │ │ -
333 else
│ │ │ │ -
334 {
│ │ │ │ -
335 std::shared_ptr<T> sp = stackobject_to_shared_ptr(t);
│ │ │ │ -
336 std::fill(_children.begin(),_children.end(),sp);
│ │ │ │ -
337 }
│ │ │ │ -
338 }
│ │ │ │ -
339
│ │ │ │ -
340#ifdef DOXYGEN
│ │ │ │ -
341
│ │ │ │ -
343 PowerNode(T& t1, T& t2, ...)
│ │ │ │ -
344 {}
│ │ │ │ -
345
│ │ │ │ -
346#else
│ │ │ │ -
347
│ │ │ │ -
348 template<typename... Children,
│ │ │ │ -
349 std::enable_if_t<
│ │ │ │ -
350 std::conjunction<std::is_same<ChildType, std::decay_t<Children>>...>::value
│ │ │ │ -
351 ,int> = 0>
│ │ │ │ -
352 PowerNode (Children&&... children)
│ │ │ │ -
353 {
│ │ │ │ -
354 static_assert(degree() == sizeof...(Children), "PowerNode constructor is called with incorrect number of children");
│ │ │ │ -
355 _children = NodeStorage{convert_arg(std::forward<Children>(children))...};
│ │ │ │ -
356 }
│ │ │ │ -
357
│ │ │ │ -
358 template<typename... Children,
│ │ │ │ -
359 std::enable_if_t<
│ │ │ │ -
360 std::conjunction<std::is_same<ChildType, Children>...>::value
│ │ │ │ -
361 ,int> = 0>
│ │ │ │ -
362 PowerNode (std::shared_ptr<Children>... children)
│ │ │ │ -
363 {
│ │ │ │ -
364 static_assert(degree() == sizeof...(Children), "PowerNode constructor is called with incorrect number of children");
│ │ │ │ -
365 _children = NodeStorage{children...};
│ │ │ │ -
366 }
│ │ │ │ -
367
│ │ │ │ -
368#endif // DOXYGEN
│ │ │ │ -
369
│ │ │ │ -
371
│ │ │ │ -
372 private:
│ │ │ │ -
373 NodeStorage _children;
│ │ │ │ -
374 };
│ │ │ │ -
375
│ │ │ │ -
377
│ │ │ │ -
378 } // namespace TypeTree
│ │ │ │ -
379} //namespace Dune
│ │ │ │ -
380
│ │ │ │ -
381#endif // DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ +
195 private:
│ │ │ │ +
196 NodeStorage _children;
│ │ │ │ +
197 };
│ │ │ │ +
198
│ │ │ │ +
200
│ │ │ │ +
201 } // namespace TypeTree
│ │ │ │ +
202} //namespace Dune
│ │ │ │ +
203
│ │ │ │ +
204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Tag designating a power node.
Definition: nodetags.hh:19
│ │ │ │ -
Collect k instances of type T within a dune-typetree.
Definition: powernode.hh:50
│ │ │ │ -
void setChild(T &t, index_constant< i >={})
Sets the i-th child to the passed-in value.
Definition: powernode.hh:145
│ │ │ │ -
T & child(std::size_t i)
Returns the i-th child.
Definition: powernode.hh:177
│ │ │ │ -
const T & child(index_constant< i >={}) const
Returns the i-th child (const version).
Definition: powernode.hh:115
│ │ │ │ -
void setChild(std::shared_ptr< T > st, index_constant< i >={})
Sets the stored value representing the i-th child to the passed-in value.
Definition: powernode.hh:161
│ │ │ │ -
std::shared_ptr< T > childStorage(index_constant< i >={})
Returns the storage of the i-th child.
Definition: powernode.hh:126
│ │ │ │ -
PowerNode(T &t1, T &t2,...)
Initialize all children with the passed-in objects.
Definition: powernode.hh:343
│ │ │ │ -
const NodeStorage & nodeStorage() const
Definition: powernode.hh:234
│ │ │ │ -
std::array< std::shared_ptr< T >, k > NodeStorage
The type used for storing the children.
Definition: powernode.hh:79
│ │ │ │ -
std::shared_ptr< const T > childStorage(index_constant< i >={}) const
Returns the storage of the i-th child (const version).
Definition: powernode.hh:137
│ │ │ │ -
PowerNode(T &t, bool distinct_objects=true)
Initialize all children with copies of a storage object constructed from the parameter t.
Definition: powernode.hh:326
│ │ │ │ -
PowerNodeTag NodeTag
The type tag that describes a PowerNode.
Definition: powernode.hh:73
│ │ │ │ -
const T & child(std::size_t i) const
Returns the i-th child (const version).
Definition: powernode.hh:187
│ │ │ │ -
static constexpr auto degree()
Definition: powernode.hh:67
│ │ │ │ -
std::shared_ptr< const T > childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition: powernode.hh:207
│ │ │ │ -
static const std::size_t CHILDREN
The number of children.
Definition: powernode.hh:65
│ │ │ │ -
void setChild(std::size_t i, std::shared_ptr< T > st)
Sets the stored value representing the i-th child to the passed-in value.
Definition: powernode.hh:228
│ │ │ │ -
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: powernode.hh:61
│ │ │ │ -
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: powernode.hh:55
│ │ │ │ -
static const bool isPower
Mark this class as a power in the dune-typetree.
Definition: powernode.hh:58
│ │ │ │ -
PowerNode(const NodeStorage &children)
Initialize the PowerNode with a copy of the passed-in storage type.
Definition: powernode.hh:321
│ │ │ │ -
T ChildType
The type of each child.
Definition: powernode.hh:76
│ │ │ │ -
T & child(index_constant< i >={})
Returns the i-th child.
Definition: powernode.hh:104
│ │ │ │ -
ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: powernode.hh:268
│ │ │ │ -
void setChild(std::size_t i, T &&t)
Store the passed value in i-th child.
Definition: powernode.hh:221
│ │ │ │ -
void setChild(T &&t, index_constant< i >={})
Store the passed value in i-th child.
Definition: powernode.hh:153
│ │ │ │ -
PowerNode()
Default constructor.
Definition: powernode.hh:317
│ │ │ │ -
const ImplementationDefined & child(Indices... indices)
Returns the child given by the list of indices.
Definition: powernode.hh:288
│ │ │ │ -
void setChild(std::size_t i, T &t)
Sets the i-th child to the passed-in value.
Definition: powernode.hh:214
│ │ │ │ -
std::shared_ptr< T > childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition: powernode.hh:197
│ │ │ │ -
Access to the type and storage type of the i-th child.
Definition: powernode.hh:85
│ │ │ │ -
T type
The type of the child.
Definition: powernode.hh:93
│ │ │ │ -
T Type
The type of the child.
Definition: powernode.hh:90
│ │ │ │ -
Check if type represents a tree path.
Definition: typetraits.hh:182
│ │ │ │ +
Collect multiple instances of type T within a dune-typetree.
Definition: dynamicpowernode.hh:33
│ │ │ │ +
static const bool isPower
Mark this class as a power in the dune-typetree.
Definition: dynamicpowernode.hh:41
│ │ │ │ +
std::vector< ChildStorageType > NodeStorage
The type used for storing the children.
Definition: dynamicpowernode.hh:65
│ │ │ │ +
const NodeStorage & nodeStorage() const
Definition: dynamicpowernode.hh:135
│ │ │ │ +
ChildConstStorageType childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition: dynamicpowernode.hh:108
│ │ │ │ +
const ChildType & child(std::size_t i) const
Returns the i-th child (const version).
Definition: dynamicpowernode.hh:85
│ │ │ │ +
std::shared_ptr< T > ChildStorageType
The storage type of each child.
Definition: dynamicpowernode.hh:59
│ │ │ │ +
DynamicPowerNode(T &t1, T &t2,...)
Initialize all children with the passed-in objects.
Definition: dynamicpowernode.hh:172
│ │ │ │ +
std::shared_ptr< const T > ChildConstStorageType
The const version of the storage type of each child.
Definition: dynamicpowernode.hh:62
│ │ │ │ +
DynamicPowerNode(NodeStorage children)
Initialize the DynamicPowerNode with a copy of the passed-in storage type.
Definition: dynamicpowernode.hh:165
│ │ │ │ +
DynamicPowerNodeTag NodeTag
The type tag that describes the node.
Definition: dynamicpowernode.hh:53
│ │ │ │ +
T ChildType
The type of each child.
Definition: dynamicpowernode.hh:56
│ │ │ │ +
void setChild(std::size_t i, ChildType &t)
Sets the i-th child to the passed-in value.
Definition: dynamicpowernode.hh:115
│ │ │ │ +
void setChild(std::size_t i, ChildStorageType st)
Sets the stored value representing the i-th child to the passed-in value.
Definition: dynamicpowernode.hh:129
│ │ │ │ +
DynamicPowerNode(std::size_t size)
Construct a node with the given number of children.
Definition: dynamicpowernode.hh:160
│ │ │ │ +
static const bool isComposite
Mark this class as a non composite in the dune-typetree.
Definition: dynamicpowernode.hh:44
│ │ │ │ +
void setChild(std::size_t i, ChildType &&t)
Store the passed value in i-th child.
Definition: dynamicpowernode.hh:122
│ │ │ │ +
ChildType & child(std::size_t i)
Returns the i-th child.
Definition: dynamicpowernode.hh:75
│ │ │ │ +
std::size_t degree() const
The number of children.
Definition: dynamicpowernode.hh:47
│ │ │ │ +
ChildStorageType childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition: dynamicpowernode.hh:95
│ │ │ │ +
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: dynamicpowernode.hh:38
│ │ │ │ + │ │ │ │ +
Tag designating a power node with runtime degree.
Definition: nodetags.hh:22
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,469 +4,255 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -powernode.hh │ │ │ │ │ +dynamicpowernode.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ 6 │ │ │ │ │ 7#include │ │ │ │ │ - 8#include │ │ │ │ │ + 8#include │ │ │ │ │ 9#include │ │ │ │ │ 10#include │ │ │ │ │ 11 │ │ │ │ │ 12#include │ │ │ │ │ 13#include │ │ │ │ │ 14 │ │ │ │ │ 15#include │ │ │ │ │ 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19 │ │ │ │ │ - 20namespace Dune { │ │ │ │ │ - 21 namespace TypeTree { │ │ │ │ │ - 22 │ │ │ │ │ - 29#ifndef DOXYGEN │ │ │ │ │ - 30 │ │ │ │ │ - 32 template │ │ │ │ │ - 33 struct AssertPowerNodeChildCount │ │ │ │ │ - 34 : public std::enable_if::value && │ │ │ │ │ - 37 PowerNode::degree() == k, │ │ │ │ │ - 38 T> │ │ │ │ │ - 39 {}; │ │ │ │ │ - 40 │ │ │ │ │ - 41#endif │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19namespace Dune { │ │ │ │ │ + 20 namespace TypeTree { │ │ │ │ │ + 21 │ │ │ │ │ + 31 template │ │ │ │ │ +32 class DynamicPowerNode │ │ │ │ │ + 33 { │ │ │ │ │ + 34 │ │ │ │ │ + 35 public: │ │ │ │ │ + 36 │ │ │ │ │ +38 static const bool isLeaf = false; │ │ │ │ │ + 39 │ │ │ │ │ +41 static const bool isPower = true; │ │ │ │ │ 42 │ │ │ │ │ - 48 template │ │ │ │ │ -49 class PowerNode │ │ │ │ │ - 50 { │ │ │ │ │ +44 static const bool isComposite = false; │ │ │ │ │ + 45 │ │ │ │ │ +47 std::size_t degree() const │ │ │ │ │ + 48 { │ │ │ │ │ + 49 return _children.size(); │ │ │ │ │ + 50 } │ │ │ │ │ 51 │ │ │ │ │ - 52 public: │ │ │ │ │ - 53 │ │ │ │ │ -55 static const bool isLeaf = false; │ │ │ │ │ - 56 │ │ │ │ │ -58 static const bool isPower = true; │ │ │ │ │ - 59 │ │ │ │ │ -61 static const bool isComposite = false; │ │ │ │ │ - 62 │ │ │ │ │ - 64 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -65 static const std::size_t CHILDREN = k; │ │ │ │ │ +53 typedef DynamicPowerNodeTag NodeTag; │ │ │ │ │ + 54 │ │ │ │ │ +56 typedef T ChildType; │ │ │ │ │ + 57 │ │ │ │ │ +59 typedef std::shared_ptr ChildStorageType; │ │ │ │ │ + 60 │ │ │ │ │ +62 typedef std::shared_ptr ChildConstStorageType; │ │ │ │ │ + 63 │ │ │ │ │ +65 typedef std::vector NodeStorage; │ │ │ │ │ 66 │ │ │ │ │ -67 static constexpr auto degree () │ │ │ │ │ - 68 { │ │ │ │ │ - 69 return std::integral_constant{}; │ │ │ │ │ - 70 } │ │ │ │ │ - 71 │ │ │ │ │ -73 typedef PowerNodeTag NodeTag; │ │ │ │ │ - 74 │ │ │ │ │ -76 typedef T ChildType; │ │ │ │ │ - 77 │ │ │ │ │ -79 typedef std::array,k> NodeStorage; │ │ │ │ │ + 67 │ │ │ │ │ + 70 │ │ │ │ │ + 72 │ │ │ │ │ +75 ChildType& child (std::size_t i) │ │ │ │ │ + 76 { │ │ │ │ │ + 77 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 78 return *_children[i]; │ │ │ │ │ + 79 } │ │ │ │ │ 80 │ │ │ │ │ - 81 │ │ │ │ │ - 83 template │ │ │ │ │ -84 struct Child │ │ │ │ │ - 85 { │ │ │ │ │ - 86 │ │ │ │ │ - 87 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 88 │ │ │ │ │ -90 typedef T Type; │ │ │ │ │ - 91 │ │ │ │ │ -93 typedef T type; │ │ │ │ │ - 94 }; │ │ │ │ │ - 95 │ │ │ │ │ - 98 │ │ │ │ │ + 82 │ │ │ │ │ +85 const ChildType& child (std::size_t i) const │ │ │ │ │ + 86 { │ │ │ │ │ + 87 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 88 return *_children[i]; │ │ │ │ │ + 89 } │ │ │ │ │ + 90 │ │ │ │ │ + 92 │ │ │ │ │ +95 ChildStorageType childStorage (std::size_t i) │ │ │ │ │ + 96 { │ │ │ │ │ + 97 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 98 return _children[i]; │ │ │ │ │ + 99 } │ │ │ │ │ 100 │ │ │ │ │ - 103 template │ │ │ │ │ -104 T& child (index_constant = {}) │ │ │ │ │ - 105 { │ │ │ │ │ - 106 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 107 return *_children[i]; │ │ │ │ │ - 108 } │ │ │ │ │ - 109 │ │ │ │ │ - 111 │ │ │ │ │ - 114 template │ │ │ │ │ -115 const T& child (index_constant = {}) const │ │ │ │ │ + 102 │ │ │ │ │ +108 ChildConstStorageType childStorage (std::size_t i) const │ │ │ │ │ + 109 { │ │ │ │ │ + 110 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 111 return _children[i]; │ │ │ │ │ + 112 } │ │ │ │ │ + 113 │ │ │ │ │ +115 void setChild (std::size_t i, ChildType& t) │ │ │ │ │ 116 { │ │ │ │ │ - 117 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 118 return *_children[i]; │ │ │ │ │ + 117 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 118 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ 119 } │ │ │ │ │ 120 │ │ │ │ │ - 122 │ │ │ │ │ - 125 template │ │ │ │ │ -126 std::shared_ptr childStorage (index_constant = {}) │ │ │ │ │ - 127 { │ │ │ │ │ - 128 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 129 return _children[i]; │ │ │ │ │ - 130 } │ │ │ │ │ - 131 │ │ │ │ │ - 133 │ │ │ │ │ - 136 template │ │ │ │ │ -137 std::shared_ptr childStorage (index_constant = {}) const │ │ │ │ │ - 138 { │ │ │ │ │ - 139 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 140 return _children[i]; │ │ │ │ │ - 141 } │ │ │ │ │ - 142 │ │ │ │ │ - 144 template │ │ │ │ │ -145 void setChild (T& t, index_constant = {}) │ │ │ │ │ - 146 { │ │ │ │ │ - 147 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 148 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ - 149 } │ │ │ │ │ +122 void setChild (std::size_t i, ChildType&& t) │ │ │ │ │ + 123 { │ │ │ │ │ + 124 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 125 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ + 126 } │ │ │ │ │ + 127 │ │ │ │ │ +129 void setChild (std::size_t i, ChildStorageType st) │ │ │ │ │ + 130 { │ │ │ │ │ + 131 assert(i < degree() && "child index out of range"); │ │ │ │ │ + 132 _children[i] = std::move(st); │ │ │ │ │ + 133 } │ │ │ │ │ + 134 │ │ │ │ │ +135 const NodeStorage& nodeStorage () const │ │ │ │ │ + 136 { │ │ │ │ │ + 137 return _children; │ │ │ │ │ + 138 } │ │ │ │ │ + 139 │ │ │ │ │ + 141 │ │ │ │ │ + 144 │ │ │ │ │ + 145 protected: │ │ │ │ │ + 146 │ │ │ │ │ +149 DynamicPowerNode () = delete; │ │ │ │ │ 150 │ │ │ │ │ - 152 template │ │ │ │ │ -153 void setChild (T&& t, index_constant = {}) │ │ │ │ │ - 154 { │ │ │ │ │ - 155 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 156 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ - 157 } │ │ │ │ │ - 158 │ │ │ │ │ - 160 template │ │ │ │ │ -161 void setChild (std::shared_ptr st, index_constant = {}) │ │ │ │ │ - 162 { │ │ │ │ │ - 163 static_assert((i < degree()), "child index out of range"); │ │ │ │ │ - 164 _children[i] = std::move(st); │ │ │ │ │ - 165 } │ │ │ │ │ - 166 │ │ │ │ │ + 152 │ │ │ │ │ +160 explicit DynamicPowerNode (std::size_t size) │ │ │ │ │ + 161 : _children(size) │ │ │ │ │ + 162 {} │ │ │ │ │ + 163 │ │ │ │ │ +165 explicit DynamicPowerNode (NodeStorage children) │ │ │ │ │ + 166 : _children(std::move(children)) │ │ │ │ │ + 167 {} │ │ │ │ │ 168 │ │ │ │ │ - 169 │ │ │ │ │ - 172 │ │ │ │ │ + 169#ifdef DOXYGEN │ │ │ │ │ + 170 │ │ │ │ │ +172 DynamicPowerNode (T& t1, T& t2, ...) │ │ │ │ │ + 173 {} │ │ │ │ │ 174 │ │ │ │ │ -177 T& child (std::size_t i) │ │ │ │ │ - 178 { │ │ │ │ │ - 179 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 180 return *_children[i]; │ │ │ │ │ - 181 } │ │ │ │ │ - 182 │ │ │ │ │ - 184 │ │ │ │ │ -187 const T& child (std::size_t i) const │ │ │ │ │ - 188 { │ │ │ │ │ - 189 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 190 return *_children[i]; │ │ │ │ │ - 191 } │ │ │ │ │ + 175#else │ │ │ │ │ + 176 │ │ │ │ │ + 177 template> │ │ │ │ │ +&&...), bool> = true> │ │ │ │ │ + 179 DynamicPowerNode (Children&&... children) │ │ │ │ │ + 180 { │ │ │ │ │ + 181 _children = NodeStorage{convert_arg(std::forward(children))...}; │ │ │ │ │ + 182 } │ │ │ │ │ + 183 │ │ │ │ │ + 184 template> │ │ │ │ │ +&&...), bool> = true> │ │ │ │ │ + 186 DynamicPowerNode (std::shared_ptr... children) │ │ │ │ │ + 187 { │ │ │ │ │ + 188 _children = NodeStorage{std::move(children)...}; │ │ │ │ │ + 189 } │ │ │ │ │ + 190 │ │ │ │ │ + 191#endif // DOXYGEN │ │ │ │ │ 192 │ │ │ │ │ 194 │ │ │ │ │ -197 std::shared_ptr childStorage (std::size_t i) │ │ │ │ │ - 198 { │ │ │ │ │ - 199 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 200 return _children[i]; │ │ │ │ │ - 201 } │ │ │ │ │ - 202 │ │ │ │ │ - 204 │ │ │ │ │ -207 std::shared_ptr childStorage (std::size_t i) const │ │ │ │ │ - 208 { │ │ │ │ │ - 209 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 210 return _children[i]; │ │ │ │ │ - 211 } │ │ │ │ │ - 212 │ │ │ │ │ -214 void setChild (std::size_t i, T& t) │ │ │ │ │ - 215 { │ │ │ │ │ - 216 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 217 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ - 218 } │ │ │ │ │ - 219 │ │ │ │ │ -221 void setChild (std::size_t i, T&& t) │ │ │ │ │ - 222 { │ │ │ │ │ - 223 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 224 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ - 225 } │ │ │ │ │ - 226 │ │ │ │ │ -228 void setChild (std::size_t i, std::shared_ptr st) │ │ │ │ │ - 229 { │ │ │ │ │ - 230 assert(i < degree() && "child index out of range"); │ │ │ │ │ - 231 _children[i] = std::move(st); │ │ │ │ │ - 232 } │ │ │ │ │ - 233 │ │ │ │ │ -234 const NodeStorage& nodeStorage () const │ │ │ │ │ - 235 { │ │ │ │ │ - 236 return _children; │ │ │ │ │ - 237 } │ │ │ │ │ - 238 │ │ │ │ │ - 240 │ │ │ │ │ - 243 │ │ │ │ │ - 244 // The following two methods require a little bit of SFINAE trickery to │ │ │ │ │ -work correctly: │ │ │ │ │ - 245 // We have to make sure that they don't shadow the methods for direct │ │ │ │ │ -child access because │ │ │ │ │ - 246 // those get called by the generic child() machinery. If that machinery │ │ │ │ │ -picks up the methods │ │ │ │ │ - 247 // defined below, we have an infinite recursion. │ │ │ │ │ - 248 // So the methods make sure that either │ │ │ │ │ - 249 // │ │ │ │ │ - 250 // * there are more than one argument. In that case, we got multiple │ │ │ │ │ -indices and can forward │ │ │ │ │ - 251 // to the general machine. │ │ │ │ │ - 252 // │ │ │ │ │ - 253 // * the first argument is not a valid flat index, i.e. either a std:: │ │ │ │ │ -size_t or an index_constant. │ │ │ │ │ - 254 // The argument thus has to be some kind of TreePath instance that we can │ │ │ │ │ -also pass to the │ │ │ │ │ - 255 // generic machine. │ │ │ │ │ - 256 // │ │ │ │ │ - 257 // The above SFINAE logic works, but there is still a problem with the │ │ │ │ │ -return type deduction. │ │ │ │ │ - 258 // We have to do a lazy lookup of the return type after SFINAE has │ │ │ │ │ -succeeded, otherwise the return │ │ │ │ │ - 259 // type deduction will trigger the infinite recursion. │ │ │ │ │ - 260 │ │ │ │ │ - 262 │ │ │ │ │ - 266#ifdef DOXYGEN │ │ │ │ │ - 267 template │ │ │ │ │ -268 ImplementationDefined& child (Indices... indices) │ │ │ │ │ - 269#else │ │ │ │ │ - 270 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ - 272 decltype(auto) child (I0 i0, I... i) │ │ │ │ │ - 273#endif │ │ │ │ │ - 274 { │ │ │ │ │ - 275 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ - 276 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ -the freestanding version child(node,treePath) instead." │ │ │ │ │ - 277 ); │ │ │ │ │ - 278 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ - 279 } │ │ │ │ │ - 280 │ │ │ │ │ - 282 │ │ │ │ │ - 286#ifdef DOXYGEN │ │ │ │ │ - 287 template │ │ │ │ │ -288 const ImplementationDefined& child (Indices... indices) │ │ │ │ │ - 289#else │ │ │ │ │ - 290 template 0) || IsTreePath::value, int > = 0> │ │ │ │ │ - 292 decltype(auto) child (I0 i0, I... i) const │ │ │ │ │ - 293#endif │ │ │ │ │ - 294 { │ │ │ │ │ - 295 static_assert(sizeof...(I) > 0 || impl::_non_empty_tree_path(I0{}), │ │ │ │ │ - 296 "You cannot use the member function child() with an empty TreePath, use │ │ │ │ │ -the freestanding version child(node,treePath) instead." │ │ │ │ │ - 297 ); │ │ │ │ │ - 298 return Dune::TypeTree::child(*this,i0,i...); │ │ │ │ │ - 299 } │ │ │ │ │ - 300 │ │ │ │ │ - 302 │ │ │ │ │ - 305 │ │ │ │ │ - 306 protected: │ │ │ │ │ - 307 │ │ │ │ │ - 309 │ │ │ │ │ -317 PowerNode () │ │ │ │ │ - 318 {} │ │ │ │ │ - 319 │ │ │ │ │ -321 explicit PowerNode (const NodeStorage& children) │ │ │ │ │ - 322 : _children(children) │ │ │ │ │ - 323 {} │ │ │ │ │ - 324 │ │ │ │ │ -326 explicit PowerNode (T& t, bool distinct_objects = true) │ │ │ │ │ - 327 { │ │ │ │ │ - 328 if (distinct_objects) │ │ │ │ │ - 329 { │ │ │ │ │ - 330 for (typename NodeStorage::iterator it = _children.begin(); it != │ │ │ │ │ -_children.end(); ++it) │ │ │ │ │ - 331 *it = std::make_shared(t); │ │ │ │ │ - 332 } │ │ │ │ │ - 333 else │ │ │ │ │ - 334 { │ │ │ │ │ - 335 std::shared_ptr sp = stackobject_to_shared_ptr(t); │ │ │ │ │ - 336 std::fill(_children.begin(),_children.end(),sp); │ │ │ │ │ - 337 } │ │ │ │ │ - 338 } │ │ │ │ │ - 339 │ │ │ │ │ - 340#ifdef DOXYGEN │ │ │ │ │ - 341 │ │ │ │ │ -343 PowerNode(T& t1, T& t2, ...) │ │ │ │ │ - 344 {} │ │ │ │ │ - 345 │ │ │ │ │ - 346#else │ │ │ │ │ - 347 │ │ │ │ │ - 348 template>...>:: │ │ │ │ │ -value │ │ │ │ │ - 351 ,int> = 0> │ │ │ │ │ - 352 PowerNode (Children&&... children) │ │ │ │ │ - 353 { │ │ │ │ │ - 354 static_assert(degree() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ -called with incorrect number of children"); │ │ │ │ │ - 355 _children = NodeStorage{convert_arg(std::forward(children))...}; │ │ │ │ │ - 356 } │ │ │ │ │ - 357 │ │ │ │ │ - 358 template...>::value │ │ │ │ │ - 361 ,int> = 0> │ │ │ │ │ - 362 PowerNode (std::shared_ptr... children) │ │ │ │ │ - 363 { │ │ │ │ │ - 364 static_assert(degree() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ -called with incorrect number of children"); │ │ │ │ │ - 365 _children = NodeStorage{children...}; │ │ │ │ │ - 366 } │ │ │ │ │ - 367 │ │ │ │ │ - 368#endif // DOXYGEN │ │ │ │ │ - 369 │ │ │ │ │ - 371 │ │ │ │ │ - 372 private: │ │ │ │ │ - 373 NodeStorage _children; │ │ │ │ │ - 374 }; │ │ │ │ │ - 375 │ │ │ │ │ - 377 │ │ │ │ │ - 378 } // namespace TypeTree │ │ │ │ │ - 379} //namespace Dune │ │ │ │ │ - 380 │ │ │ │ │ - 381#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ + 195 private: │ │ │ │ │ + 196 NodeStorage _children; │ │ │ │ │ + 197 }; │ │ │ │ │ + 198 │ │ │ │ │ + 200 │ │ │ │ │ + 201 } // namespace TypeTree │ │ │ │ │ + 202} //namespace Dune │ │ │ │ │ + 203 │ │ │ │ │ + 204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ utility.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ typetraits.hh │ │ │ │ │ -childextraction.hh │ │ │ │ │ -Dune::TypeTree::child │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -Definition: childextraction.hh:126 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::PowerNodeTag │ │ │ │ │ -Tag designating a power node. │ │ │ │ │ -Definition: nodetags.hh:19 │ │ │ │ │ -Dune::TypeTree::PowerNode │ │ │ │ │ -Collect k instances of type T within a dune-typetree. │ │ │ │ │ -Definition: powernode.hh:50 │ │ │ │ │ -Dune::TypeTree::PowerNode::setChild │ │ │ │ │ -void setChild(T &t, index_constant< i >={}) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -Definition: powernode.hh:145 │ │ │ │ │ -Dune::TypeTree::PowerNode::child │ │ │ │ │ -T & child(std::size_t i) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -Definition: powernode.hh:177 │ │ │ │ │ -Dune::TypeTree::PowerNode::child │ │ │ │ │ -const T & child(index_constant< i >={}) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -Definition: powernode.hh:115 │ │ │ │ │ -Dune::TypeTree::PowerNode::setChild │ │ │ │ │ -void setChild(std::shared_ptr< T > st, index_constant< i >={}) │ │ │ │ │ -Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ -Definition: powernode.hh:161 │ │ │ │ │ -Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ -std::shared_ptr< T > childStorage(index_constant< i >={}) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -Definition: powernode.hh:126 │ │ │ │ │ -Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ -PowerNode(T &t1, T &t2,...) │ │ │ │ │ -Initialize all children with the passed-in objects. │ │ │ │ │ -Definition: powernode.hh:343 │ │ │ │ │ -Dune::TypeTree::PowerNode::nodeStorage │ │ │ │ │ -const NodeStorage & nodeStorage() const │ │ │ │ │ -Definition: powernode.hh:234 │ │ │ │ │ -Dune::TypeTree::PowerNode::NodeStorage │ │ │ │ │ -std::array< std::shared_ptr< T >, k > NodeStorage │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode │ │ │ │ │ +Collect multiple instances of type T within a dune-typetree. │ │ │ │ │ +Definition: dynamicpowernode.hh:33 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::isPower │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a power in the dune-typetree. │ │ │ │ │ +Definition: dynamicpowernode.hh:41 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::NodeStorage │ │ │ │ │ +std::vector< ChildStorageType > NodeStorage │ │ │ │ │ The type used for storing the children. │ │ │ │ │ -Definition: powernode.hh:79 │ │ │ │ │ -Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ -std::shared_ptr< const T > childStorage(index_constant< i >={}) const │ │ │ │ │ +Definition: dynamicpowernode.hh:65 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::nodeStorage │ │ │ │ │ +const NodeStorage & nodeStorage() const │ │ │ │ │ +Definition: dynamicpowernode.hh:135 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::childStorage │ │ │ │ │ +ChildConstStorageType childStorage(std::size_t i) const │ │ │ │ │ Returns the storage of the i-th child (const version). │ │ │ │ │ -Definition: powernode.hh:137 │ │ │ │ │ -Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ -PowerNode(T &t, bool distinct_objects=true) │ │ │ │ │ -Initialize all children with copies of a storage object constructed from the │ │ │ │ │ -parameter t. │ │ │ │ │ -Definition: powernode.hh:326 │ │ │ │ │ -Dune::TypeTree::PowerNode::NodeTag │ │ │ │ │ -PowerNodeTag NodeTag │ │ │ │ │ -The type tag that describes a PowerNode. │ │ │ │ │ -Definition: powernode.hh:73 │ │ │ │ │ -Dune::TypeTree::PowerNode::child │ │ │ │ │ -const T & child(std::size_t i) const │ │ │ │ │ +Definition: dynamicpowernode.hh:108 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::child │ │ │ │ │ +const ChildType & child(std::size_t i) const │ │ │ │ │ Returns the i-th child (const version). │ │ │ │ │ -Definition: powernode.hh:187 │ │ │ │ │ -Dune::TypeTree::PowerNode::degree │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -Definition: powernode.hh:67 │ │ │ │ │ -Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ -std::shared_ptr< const T > childStorage(std::size_t i) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -Definition: powernode.hh:207 │ │ │ │ │ -Dune::TypeTree::PowerNode::CHILDREN │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -Definition: powernode.hh:65 │ │ │ │ │ -Dune::TypeTree::PowerNode::setChild │ │ │ │ │ -void setChild(std::size_t i, std::shared_ptr< T > st) │ │ │ │ │ +Definition: dynamicpowernode.hh:85 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::ChildStorageType │ │ │ │ │ +std::shared_ptr< T > ChildStorageType │ │ │ │ │ +The storage type of each child. │ │ │ │ │ +Definition: dynamicpowernode.hh:59 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ +DynamicPowerNode(T &t1, T &t2,...) │ │ │ │ │ +Initialize all children with the passed-in objects. │ │ │ │ │ +Definition: dynamicpowernode.hh:172 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::ChildConstStorageType │ │ │ │ │ +std::shared_ptr< const T > ChildConstStorageType │ │ │ │ │ +The const version of the storage type of each child. │ │ │ │ │ +Definition: dynamicpowernode.hh:62 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ +DynamicPowerNode(NodeStorage children) │ │ │ │ │ +Initialize the DynamicPowerNode with a copy of the passed-in storage type. │ │ │ │ │ +Definition: dynamicpowernode.hh:165 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::NodeTag │ │ │ │ │ +DynamicPowerNodeTag NodeTag │ │ │ │ │ +The type tag that describes the node. │ │ │ │ │ +Definition: dynamicpowernode.hh:53 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::ChildType │ │ │ │ │ +T ChildType │ │ │ │ │ +The type of each child. │ │ │ │ │ +Definition: dynamicpowernode.hh:56 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::setChild │ │ │ │ │ +void setChild(std::size_t i, ChildType &t) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +Definition: dynamicpowernode.hh:115 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::setChild │ │ │ │ │ +void setChild(std::size_t i, ChildStorageType st) │ │ │ │ │ Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ -Definition: powernode.hh:228 │ │ │ │ │ -Dune::TypeTree::PowerNode::isComposite │ │ │ │ │ +Definition: dynamicpowernode.hh:129 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ +DynamicPowerNode(std::size_t size) │ │ │ │ │ +Construct a node with the given number of children. │ │ │ │ │ +Definition: dynamicpowernode.hh:160 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::isComposite │ │ │ │ │ static const bool isComposite │ │ │ │ │ Mark this class as a non composite in the dune-typetree. │ │ │ │ │ -Definition: powernode.hh:61 │ │ │ │ │ -Dune::TypeTree::PowerNode::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -Definition: powernode.hh:55 │ │ │ │ │ -Dune::TypeTree::PowerNode::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a power in the dune-typetree. │ │ │ │ │ -Definition: powernode.hh:58 │ │ │ │ │ -Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ -PowerNode(const NodeStorage &children) │ │ │ │ │ -Initialize the PowerNode with a copy of the passed-in storage type. │ │ │ │ │ -Definition: powernode.hh:321 │ │ │ │ │ -Dune::TypeTree::PowerNode::ChildType │ │ │ │ │ -T ChildType │ │ │ │ │ -The type of each child. │ │ │ │ │ -Definition: powernode.hh:76 │ │ │ │ │ -Dune::TypeTree::PowerNode::child │ │ │ │ │ -T & child(index_constant< i >={}) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -Definition: powernode.hh:104 │ │ │ │ │ -Dune::TypeTree::PowerNode::child │ │ │ │ │ -ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -Definition: powernode.hh:268 │ │ │ │ │ -Dune::TypeTree::PowerNode::setChild │ │ │ │ │ -void setChild(std::size_t i, T &&t) │ │ │ │ │ -Store the passed value in i-th child. │ │ │ │ │ -Definition: powernode.hh:221 │ │ │ │ │ -Dune::TypeTree::PowerNode::setChild │ │ │ │ │ -void setChild(T &&t, index_constant< i >={}) │ │ │ │ │ +Definition: dynamicpowernode.hh:44 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::setChild │ │ │ │ │ +void setChild(std::size_t i, ChildType &&t) │ │ │ │ │ Store the passed value in i-th child. │ │ │ │ │ -Definition: powernode.hh:153 │ │ │ │ │ -Dune::TypeTree::PowerNode::PowerNode │ │ │ │ │ -PowerNode() │ │ │ │ │ -Default constructor. │ │ │ │ │ -Definition: powernode.hh:317 │ │ │ │ │ -Dune::TypeTree::PowerNode::child │ │ │ │ │ -const ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -Definition: powernode.hh:288 │ │ │ │ │ -Dune::TypeTree::PowerNode::setChild │ │ │ │ │ -void setChild(std::size_t i, T &t) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -Definition: powernode.hh:214 │ │ │ │ │ -Dune::TypeTree::PowerNode::childStorage │ │ │ │ │ -std::shared_ptr< T > childStorage(std::size_t i) │ │ │ │ │ +Definition: dynamicpowernode.hh:122 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::child │ │ │ │ │ +ChildType & child(std::size_t i) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +Definition: dynamicpowernode.hh:75 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::degree │ │ │ │ │ +std::size_t degree() const │ │ │ │ │ +The number of children. │ │ │ │ │ +Definition: dynamicpowernode.hh:47 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::childStorage │ │ │ │ │ +ChildStorageType childStorage(std::size_t i) │ │ │ │ │ Returns the storage of the i-th child. │ │ │ │ │ -Definition: powernode.hh:197 │ │ │ │ │ -Dune::TypeTree::PowerNode::Child │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -Definition: powernode.hh:85 │ │ │ │ │ -Dune::TypeTree::PowerNode::Child::type │ │ │ │ │ -T type │ │ │ │ │ -The type of the child. │ │ │ │ │ -Definition: powernode.hh:93 │ │ │ │ │ -Dune::TypeTree::PowerNode::Child::Type │ │ │ │ │ -T Type │ │ │ │ │ -The type of the child. │ │ │ │ │ -Definition: powernode.hh:90 │ │ │ │ │ -Dune::TypeTree::IsTreePath │ │ │ │ │ -Check if type represents a tree path. │ │ │ │ │ -Definition: typetraits.hh:182 │ │ │ │ │ +Definition: dynamicpowernode.hh:95 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::isLeaf │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +Definition: dynamicpowernode.hh:38 │ │ │ │ │ +Dune::TypeTree::DynamicPowerNode::DynamicPowerNode │ │ │ │ │ +DynamicPowerNode()=delete │ │ │ │ │ +Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ +Tag designating a power node with runtime degree. │ │ │ │ │ +Definition: nodetags.hh:22 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: childextraction.hh File Reference │ │ │ │ +dune-typetree: accumulate_static.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,67 +63,134 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ Functions
│ │ │ │ -
childextraction.hh File Reference
│ │ │ │ +
accumulate_static.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/concept.hh>
│ │ │ │ -#include <dune/common/documentation.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ +
#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/typetree/treepath.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

struct  Dune::TypeTree::or_< result_type >
 Statically combine two values of type result_type using ||. More...
 
struct  Dune::TypeTree::or_< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::and_< result_type >
 Statically combine two values of type result_type using &&. More...
 
struct  Dune::TypeTree::and_< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::plus< result_type >
 Statically combine two values of type result_type using +. More...
 
struct  Dune::TypeTree::plus< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::minus< result_type >
 Statically combine two values of type result_type using -. More...
 
struct  Dune::TypeTree::minus< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::multiply< result_type >
 Statically combine two values of type result_type using *. More...
 
struct  Dune::TypeTree::multiply< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::min< result_type >
 Statically combine two values of type result_type by returning their minimum. More...
 
struct  Dune::TypeTree::min< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::max< result_type >
 Statically combine two values of type result_type by returning their maximum. More...
 
struct  Dune::TypeTree::max< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction >
 Statically accumulate a value over the nodes of a TypeTree. More...
 
struct  Dune::TypeTree::TypeAccumulationPolicy< Functor, Reduction, StartType, ParentChildReduction, ReductionAlgorithm >
 
struct  Dune::TypeTree::AccumulateType< Tree, Policy >
 Statically accumulate a type over the nodes of a TypeTree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ -Typedefs

template<typename Node , std::size_t... indices>
using Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type
 Template alias for the type of a child node given by a list of child indices. More...
 
template<typename Node , typename TreePath >
using Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath< Node, TreePath >::type
 Template alias for the type of a child node given by a TreePath or a HybridTreePath type. More...
 
template<typename T >
using Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std::decay_t< T > >::type
 Type trait that determines whether T is a flat index in the context of child extraction. More...
 
namespace  Dune::TypeTree::Experimental
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Functions

template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child (Node &&node, Indices... indices)
 Extracts the child of a node given by a sequence of compile-time and run-time indices. More...
 
template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::childStorage (Node &&node, Indices... indices)
 
template<typename Node , typename... Indices>
ImplementationDefined Dune::TypeTree::child (Node &&node, HybridTreePath< Indices... > treePath)
 Extracts the child of a node given by a HybridTreePath object. More...
 
template<typename Tree , typename Visitor , typename Init >
auto Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor &&visitor, Init &&init)
 Apply hybrid visitor to TypeTree. More...
 
│ │ │ │ +

Variable Documentation

│ │ │ │ + │ │ │ │ +

◆ child_result

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result
│ │ │ │ +
│ │ │ │ +static
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ +

◆ result

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
const result_type result = current_value
│ │ │ │ +
│ │ │ │ +static
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,60 +4,85 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -Namespaces | Typedefs | Functions │ │ │ │ │ -childextraction.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +accumulate_static.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +struct  Dune::TypeTree::or_<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type using ||. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::or_<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::and_<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type using &&. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::and_<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::plus<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type using +. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::plus<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::minus<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type using -. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::minus<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::multiply<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type using *. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::multiply<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::min<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type by returning their │ │ │ │ │ + minimum. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::min<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::max<_result_type_> │ │ │ │ │ +  Statically combine two values of type result_type by returning their │ │ │ │ │ + maximum. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::max<_result_type_>::reduce<_r1,_r2_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::AccumulateValue<_Tree,_Functor,_Reduction,_startValue, │ │ │ │ │ + ParentChildReduction_> │ │ │ │ │ +  Statically accumulate a value over the nodes of a TypeTree. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::TypeAccumulationPolicy<_Functor,_Reduction,_StartType, │ │ │ │ │ + ParentChildReduction,_ReductionAlgorithm_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::TypeTree::AccumulateType<_Tree,_Policy_> │ │ │ │ │ +  Statically accumulate a type over the nodes of a TypeTree. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type │ │ │ │ │ -  Template alias for the type of a child node given by a list of child │ │ │ │ │ - indices. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath< │ │ │ │ │ - Node, TreePath >::type │ │ │ │ │ -  Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ - HybridTreePath type. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std:: │ │ │ │ │ - decay_t< T > >::type │ │ │ │ │ -  Type trait that determines whether T is a flat index in the context of │ │ │ │ │ - child extraction. More... │ │ │ │ │ +namespace  Dune::TypeTree::Experimental │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -ImplementationDefined Dune::TypeTree::child (Node &&node, Indices... indices) │ │ │ │ │ -  Extracts the child of a node given by a sequence of │ │ │ │ │ - compile-time and run-time indices. More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -ImplementationDefined Dune::TypeTree::childStorage (Node &&node, Indices... │ │ │ │ │ - indices) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -ImplementationDefined Dune::TypeTree::child (Node &&node, HybridTreePath< │ │ │ │ │ - Indices... > treePath) │ │ │ │ │ -  Extracts the child of a node given by a HybridTreePath │ │ │ │ │ - object. More... │ │ │ │ │ -  │ │ │ │ │ +template │ │ │ │ │ +auto Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor │ │ │ │ │ + &&visitor, Init &&init) │ │ │ │ │ +  Apply hybrid visitor to TypeTree. More... │ │ │ │ │ +  │ │ │ │ │ +***** Variable Documentation ***** │ │ │ │ │ +***** ◆ child_result ***** │ │ │ │ │ +const result_type child_result = │ │ │ │ │ +accumulate_value>:: static │ │ │ │ │ +result │ │ │ │ │ +***** ◆ result ***** │ │ │ │ │ +const result_type result = current_value static │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: childextraction.hh Source File │ │ │ │ +dune-typetree: accumulate_static.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,283 +62,552 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
childextraction.hh
│ │ │ │ +
accumulate_static.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ -
2// vi: set et ts=8 sw=2 sts=2:
│ │ │ │ +Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │ +
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ -
5#define DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ +
5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │
6
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <utility>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/concept.hh>
│ │ │ │ -
11#include <dune/common/documentation.hh>
│ │ │ │ -
12#include <dune/common/typetraits.hh>
│ │ │ │ -
13#include <dune/common/shared_ptr.hh>
│ │ │ │ -
14
│ │ │ │ - │ │ │ │ - │ │ │ │ -
17
│ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20 namespace TypeTree {
│ │ │ │ -
21
│ │ │ │ -
26
│ │ │ │ -
27#ifndef DOXYGEN
│ │ │ │ -
28
│ │ │ │ -
29 namespace Impl {
│ │ │ │ -
30
│ │ │ │ -
31 // check at run time whether index is a valid child index
│ │ │ │ -
32 template <class Node, class Index>
│ │ │ │ -
33 std::true_type checkChildIndex (Node const& node, Index i)
│ │ │ │ -
34 {
│ │ │ │ -
35 assert(std::size_t(i) < node.degree() && "Child index out of range");
│ │ │ │ -
36 return {};
│ │ │ │ -
37 }
│ │ │ │ -
38
│ │ │ │ -
39 // check at compile time whether index is a valid index
│ │ │ │ -
40 template <class Node, std::size_t i>
│ │ │ │ -
41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node, index_constant<i>)
│ │ │ │ -
42 {
│ │ │ │ -
43 static_assert(i < Node::degree(), "Child index out of range");
│ │ │ │ -
44 return {};
│ │ │ │ -
45 }
│ │ │ │ -
46
│ │ │ │ -
47 // finally return the node itself if no further indices are provided. Break condition
│ │ │ │ -
48 // for the recursion over the node childs.
│ │ │ │ -
49 template<class Node>
│ │ │ │ -
50 decltype(auto) childImpl (Node&& node)
│ │ │ │ -
51 {
│ │ │ │ -
52 return std::forward<Node>(node);
│ │ │ │ -
53 }
│ │ │ │ -
54
│ │ │ │ -
55 template<class NodePtr>
│ │ │ │ -
56 auto childStorageImpl (NodePtr&& nodePtr)
│ │ │ │ -
57 {
│ │ │ │ -
58 return std::forward<NodePtr>(nodePtr);
│ │ │ │ -
59 }
│ │ │ │ -
60
│ │ │ │ -
61 // recursively call `node.child(...)` with the given indices
│ │ │ │ -
62 template<class Node, class I0, class... I>
│ │ │ │ -
63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i)
│ │ │ │ -
64 {
│ │ │ │ -
65 auto valid = checkChildIndex(node,i0);
│ │ │ │ -
66 if constexpr (valid)
│ │ │ │ -
67 return childImpl(node.child(i0),i...);
│ │ │ │ -
68 else
│ │ │ │ -
69 return;
│ │ │ │ -
70 }
│ │ │ │ -
71
│ │ │ │ -
72 // recursively call `node.childStorage(...)` with the given indices
│ │ │ │ -
73 template<class NodePtr, class I0, class... I>
│ │ │ │ -
74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]] I... i)
│ │ │ │ -
75 {
│ │ │ │ -
76 auto valid = checkChildIndex(*nodePtr,i0);
│ │ │ │ -
77 if constexpr (valid)
│ │ │ │ -
78 return childStorageImpl(nodePtr->childStorage(i0),i...);
│ │ │ │ -
79 else
│ │ │ │ -
80 return;
│ │ │ │ -
81 }
│ │ │ │ -
82
│ │ │ │ -
83 // forward to the impl methods by extracting the indices from the treepath
│ │ │ │ -
84 template<class Node, class... Indices, std::size_t... i>
│ │ │ │ -
85 decltype(auto) child (Node&& node, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
│ │ │ │ -
86 {
│ │ │ │ -
87 return childImpl(std::forward<Node>(node),treePathEntry<i>(tp)...);
│ │ │ │ -
88 }
│ │ │ │ -
89
│ │ │ │ -
90 // forward to the impl methods by extracting the indices from the treepath
│ │ │ │ -
91 template<class NodePtr, class... Indices, std::size_t... i>
│ │ │ │ -
92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
│ │ │ │ +
7#include <dune/common/typetraits.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
11
│ │ │ │ +
12
│ │ │ │ +
13namespace Dune {
│ │ │ │ +
14 namespace TypeTree {
│ │ │ │ +
15
│ │ │ │ +
22 template<typename result_type>
│ │ │ │ +
23 struct or_
│ │ │ │ +
24 {
│ │ │ │ +
25 template<result_type r1, result_type r2>
│ │ │ │ +
26 struct reduce
│ │ │ │ +
27 {
│ │ │ │ +
28 static const result_type result = r1 || r2;
│ │ │ │ +
29 };
│ │ │ │ +
30 };
│ │ │ │ +
31
│ │ │ │ +
33 template<typename result_type>
│ │ │ │ +
34 struct and_
│ │ │ │ +
35 {
│ │ │ │ +
36 template<result_type r1, result_type r2>
│ │ │ │ +
37 struct reduce
│ │ │ │ +
38 {
│ │ │ │ +
39 static const result_type result = r1 && r2;
│ │ │ │ +
40 };
│ │ │ │ +
41 };
│ │ │ │ +
42
│ │ │ │ +
44 template<typename result_type>
│ │ │ │ +
45 struct plus
│ │ │ │ +
46 {
│ │ │ │ +
47 template<result_type r1, result_type r2>
│ │ │ │ +
48 struct reduce
│ │ │ │ +
49 {
│ │ │ │ +
50 static const result_type result = r1 + r2;
│ │ │ │ +
51 };
│ │ │ │ +
52 };
│ │ │ │ +
53
│ │ │ │ +
55 template<typename result_type>
│ │ │ │ +
56 struct minus
│ │ │ │ +
57 {
│ │ │ │ +
58 template<result_type r1, result_type r2>
│ │ │ │ +
59 struct reduce
│ │ │ │ +
60 {
│ │ │ │ +
61 static const result_type result = r1 - r2;
│ │ │ │ +
62 };
│ │ │ │ +
63 };
│ │ │ │ +
64
│ │ │ │ +
66 template<typename result_type>
│ │ │ │ +
67 struct multiply
│ │ │ │ +
68 {
│ │ │ │ +
69 template<result_type r1, result_type r2>
│ │ │ │ +
70 struct reduce
│ │ │ │ +
71 {
│ │ │ │ +
72 static const result_type result = r1 * r2;
│ │ │ │ +
73 };
│ │ │ │ +
74 };
│ │ │ │ +
75
│ │ │ │ +
77 template<typename result_type>
│ │ │ │ +
78 struct min
│ │ │ │ +
79 {
│ │ │ │ +
80 template<result_type r1, result_type r2>
│ │ │ │ +
81 struct reduce
│ │ │ │ +
82 {
│ │ │ │ +
83 static const result_type result = r1 < r2 ? r1 : r2;
│ │ │ │ +
84 };
│ │ │ │ +
85 };
│ │ │ │ +
86
│ │ │ │ +
88 template<typename result_type>
│ │ │ │ +
89 struct max
│ │ │ │ +
90 {
│ │ │ │ +
91 template<result_type r1, result_type r2>
│ │ │ │ +
92 struct reduce
│ │ │ │
93 {
│ │ │ │ -
94 return childStorageImpl(std::forward<NodePtr>(nodePtr),treePathEntry<i>(tp)...);
│ │ │ │ -
95 }
│ │ │ │ -
96
│ │ │ │ -
97 } // end namespace Impl
│ │ │ │ +
94 static const result_type result = r1 > r2 ? r1 : r2;
│ │ │ │ +
95 };
│ │ │ │ +
96 };
│ │ │ │ +
97
│ │ │ │
98
│ │ │ │ -
99#endif // DOXYGEN
│ │ │ │ +
99 namespace {
│ │ │ │
100
│ │ │ │ +
101 // implementation of the traversal algorithm
│ │ │ │
102
│ │ │ │ -
124 template<typename Node, typename... Indices>
│ │ │ │ -
125#ifdef DOXYGEN
│ │ │ │ -
126 ImplementationDefined child (Node&& node, Indices... indices)
│ │ │ │ -
127#else
│ │ │ │ -
128 decltype(auto) child (Node&& node, Indices... indices)
│ │ │ │ -
129#endif
│ │ │ │ -
130 {
│ │ │ │ -
131 return Impl::childImpl(std::forward<Node>(node),indices...);
│ │ │ │ -
132 }
│ │ │ │ +
104 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath, bool doVisit>
│ │ │ │ +
105 struct accumulate_node_helper
│ │ │ │ +
106 {
│ │ │ │ +
107
│ │ │ │ +
108 typedef typename Functor::result_type result_type;
│ │ │ │ +
109
│ │ │ │ +
110 static const result_type result = current_value;
│ │ │ │ +
111
│ │ │ │ +
112 };
│ │ │ │ +
113
│ │ │ │ +
115 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ +
116 struct accumulate_node_helper<Node,Functor,Reduction,current_value,TreePath,true>
│ │ │ │ +
117 {
│ │ │ │ +
118
│ │ │ │ +
119 typedef typename Functor::result_type result_type;
│ │ │ │ +
120
│ │ │ │ +
121 static const result_type result = Reduction::template reduce<current_value,Functor::template visit<Node,TreePath>::result>::result;
│ │ │ │ +
122
│ │ │ │ +
123 };
│ │ │ │ +
124
│ │ │ │ +
126 template<typename Tree, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, typename Tag>
│ │ │ │ +
127 struct accumulate_value;
│ │ │ │ +
128
│ │ │ │ +
130 template<typename LeafNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ +
131 struct accumulate_value<LeafNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,LeafNodeTag>
│ │ │ │ +
132 {
│ │ │ │
133
│ │ │ │ -
134 template<typename Node, typename... Indices>
│ │ │ │ -
135#ifdef DOXYGEN
│ │ │ │ -
136 ImplementationDefined childStorage (Node&& node, Indices... indices)
│ │ │ │ -
137#else
│ │ │ │ -
138 auto childStorage (Node&& node, Indices... indices)
│ │ │ │ -
139#endif
│ │ │ │ -
140 {
│ │ │ │ -
141 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty list of child indices");
│ │ │ │ -
142 return Impl::childStorageImpl(&node,indices...);
│ │ │ │ -
143 }
│ │ │ │ -
144
│ │ │ │ +
134 typedef typename Functor::result_type result_type;
│ │ │ │ +
135
│ │ │ │ +
136 static const result_type result =
│ │ │ │ +
137
│ │ │ │ +
138 accumulate_node_helper<LeafNode,Functor,Reduction,current_value,TreePath,Functor::template doVisit<LeafNode,TreePath>::value>::result;
│ │ │ │ +
139
│ │ │ │ +
140 };
│ │ │ │ +
141
│ │ │ │ +
143 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t i, std::size_t n>
│ │ │ │ +
144 struct accumulate_over_children
│ │ │ │ +
145 {
│ │ │ │
146
│ │ │ │ -
169 template<typename Node, typename... Indices>
│ │ │ │ -
170#ifdef DOXYGEN
│ │ │ │ -
171 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
│ │ │ │ -
172#else
│ │ │ │ -
173 decltype(auto) child (Node&& node, HybridTreePath<Indices...> tp)
│ │ │ │ -
174#endif
│ │ │ │ -
175 {
│ │ │ │ -
176 return Impl::child(std::forward<Node>(node),tp,std::index_sequence_for<Indices...>{});
│ │ │ │ -
177 }
│ │ │ │ -
178
│ │ │ │ -
179 template<typename Node, typename... Indices>
│ │ │ │ -
180#ifdef DOXYGEN
│ │ │ │ -
181 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
│ │ │ │ -
182#else
│ │ │ │ -
183 auto childStorage (Node&& node, HybridTreePath<Indices...> tp)
│ │ │ │ -
184#endif
│ │ │ │ -
185 {
│ │ │ │ -
186 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty TreePath");
│ │ │ │ -
187 return Impl::childStorage(&node,tp,std::index_sequence_for<Indices...>{});
│ │ │ │ -
188 }
│ │ │ │ -
189
│ │ │ │ -
190
│ │ │ │ -
191#ifndef DOXYGEN
│ │ │ │ -
192
│ │ │ │ -
193 namespace impl {
│ │ │ │ -
194
│ │ │ │ -
195 template<typename T>
│ │ │ │ -
196 struct filter_void
│ │ │ │ -
197 {
│ │ │ │ -
198 using type = T;
│ │ │ │ -
199 };
│ │ │ │ -
200
│ │ │ │ -
201 template<>
│ │ │ │ -
202 struct filter_void<void>
│ │ │ │ -
203 {};
│ │ │ │ -
204
│ │ │ │ -
205 template<typename Node, std::size_t... indices>
│ │ │ │ -
206 struct _Child
│ │ │ │ -
207 : public filter_void<std::decay_t<decltype(child(std::declval<Node>(),index_constant<indices>{}...))>>
│ │ │ │ -
208 {};
│ │ │ │ -
209
│ │ │ │ -
210 }
│ │ │ │ -
211
│ │ │ │ -
212#endif // DOXYGEN
│ │ │ │ -
213
│ │ │ │ -
215
│ │ │ │ -
222 template<typename Node, std::size_t... indices>
│ │ │ │ -
223 using Child = typename impl::_Child<Node,indices...>::type;
│ │ │ │ -
224
│ │ │ │ -
225
│ │ │ │ -
226#ifndef DOXYGEN
│ │ │ │ -
227
│ │ │ │ -
228 namespace impl {
│ │ │ │ -
229
│ │ │ │ -
230 template<typename Node, typename TreePath>
│ │ │ │ -
231 struct _ChildForTreePath
│ │ │ │ -
232 {
│ │ │ │ -
233 using type = typename std::decay<decltype(child(std::declval<Node>(),std::declval<TreePath>()))>::type;
│ │ │ │ -
234 };
│ │ │ │ -
235
│ │ │ │ -
236 }
│ │ │ │ -
237
│ │ │ │ -
238#endif // DOXYGEN
│ │ │ │ -
239
│ │ │ │ -
241
│ │ │ │ -
249 template<typename Node, typename TreePath>
│ │ │ │ -
250 using ChildForTreePath = typename impl::_ChildForTreePath<Node,TreePath>::type;
│ │ │ │ -
251
│ │ │ │ -
252
│ │ │ │ -
253#ifndef DOXYGEN
│ │ │ │ -
254
│ │ │ │ -
255 namespace impl {
│ │ │ │ -
256
│ │ │ │ -
257 // By default, types are flat indices if they are integral
│ │ │ │ -
258 template<typename T>
│ │ │ │ -
259 struct _is_flat_index
│ │ │ │ -
260 {
│ │ │ │ -
261 using type = std::is_integral<T>;
│ │ │ │ -
262 };
│ │ │ │ +
147 typedef typename Functor::result_type result_type;
│ │ │ │ +
148
│ │ │ │ +
149 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
│ │ │ │ +
150
│ │ │ │ +
151 typedef typename Node::template Child<i>::Type child;
│ │ │ │ +
152
│ │ │ │ +
153 static const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result;
│ │ │ │ +
154
│ │ │ │ +
155 static const result_type result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,child_result,TreePath,i+1,n>::result;
│ │ │ │ +
156
│ │ │ │ +
157 };
│ │ │ │ +
158
│ │ │ │ +
160 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t n>
│ │ │ │ +
161 struct accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,n,n>
│ │ │ │ +
162 {
│ │ │ │ +
163
│ │ │ │ +
164 typedef typename Functor::result_type result_type;
│ │ │ │ +
165
│ │ │ │ +
166 static const result_type result = current_value;
│ │ │ │ +
167
│ │ │ │ +
168 };
│ │ │ │ +
169
│ │ │ │ +
172 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ +
173 struct accumulate_value_generic_composite_node
│ │ │ │ +
174 {
│ │ │ │ +
175
│ │ │ │ +
176 typedef typename Functor::result_type result_type;
│ │ │ │ +
177
│ │ │ │ +
178 static const result_type child_result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,0,StaticDegree<Node>::value>::result;
│ │ │ │ +
179
│ │ │ │ +
180 static const result_type result =
│ │ │ │ +
181 accumulate_node_helper<Node,Functor,ParentChildReduction,child_result,TreePath,Functor::template doVisit<Node,TreePath>::value>::result;
│ │ │ │ +
182
│ │ │ │ +
183
│ │ │ │ +
184 };
│ │ │ │ +
185
│ │ │ │ +
187 template<typename PowerNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ +
188 struct accumulate_value<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,PowerNodeTag>
│ │ │ │ +
189 : public accumulate_value_generic_composite_node<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
│ │ │ │ +
190 {};
│ │ │ │ +
191
│ │ │ │ +
193 template<typename CompositeNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
│ │ │ │ +
194 struct accumulate_value<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,CompositeNodeTag>
│ │ │ │ +
195 : public accumulate_value_generic_composite_node<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
│ │ │ │ +
196 {};
│ │ │ │ +
197
│ │ │ │ +
198 } // anonymous namespace
│ │ │ │ +
199
│ │ │ │ +
201
│ │ │ │ +
257 template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>
│ │ │ │ + │ │ │ │ +
259 {
│ │ │ │ +
260
│ │ │ │ +
262 typedef typename Functor::result_type result_type;
│ │ │ │
263
│ │ │ │ -
264 // And so is any index_constant
│ │ │ │ -
265 template<std::size_t i>
│ │ │ │ -
266 struct _is_flat_index<index_constant<i>>
│ │ │ │ -
267 {
│ │ │ │ -
268 using type = std::true_type;
│ │ │ │ -
269 };
│ │ │ │ -
270
│ │ │ │ -
271 }
│ │ │ │ +
265 static const result_type result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result;
│ │ │ │ +
266
│ │ │ │ +
267 };
│ │ │ │ +
268
│ │ │ │ +
271 struct flattened_reduction;
│ │ │ │
272
│ │ │ │ -
273#endif // DOXYGEN
│ │ │ │ -
274
│ │ │ │ -
276 /*
│ │ │ │ -
277 * This type trait can be used to check whether T is a flat index (i.e. either `std::size_t`
│ │ │ │ -
278 * or `index_constant`). The type trait normalizes T before doing the check, so it will also
│ │ │ │ -
279 * work correctly for references and cv-qualified types.
│ │ │ │ -
280 */
│ │ │ │ -
281 template<typename T>
│ │ │ │ -
282 using is_flat_index = typename impl::_is_flat_index<std::decay_t<T>>::type;
│ │ │ │ -
283
│ │ │ │ -
284#ifndef DOXYGEN
│ │ │ │ -
285
│ │ │ │ -
286 namespace impl {
│ │ │ │ -
287
│ │ │ │ -
288 // helper function for check in member child() functions that tolerates being passed something that
│ │ │ │ -
289 // isn't a TreePath. It will just return 0 in that case
│ │ │ │ +
275 struct bottom_up_reduction;
│ │ │ │ +
276
│ │ │ │ +
277 namespace {
│ │ │ │ +
278
│ │ │ │ +
279 // implementation of the traversal algorithm
│ │ │ │ +
280
│ │ │ │ +
283 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath, bool doVisit>
│ │ │ │ +
284 struct accumulate_type_node_helper
│ │ │ │ +
285 {
│ │ │ │ +
286
│ │ │ │ +
287 typedef current_type type;
│ │ │ │ +
288
│ │ │ │ +
289 };
│ │ │ │
290
│ │ │ │ -
291 template<typename T>
│ │ │ │ -
292 constexpr typename std::enable_if<
│ │ │ │ - │ │ │ │ -
294 bool
│ │ │ │ -
295 >::type
│ │ │ │ -
296 _non_empty_tree_path (T)
│ │ │ │ -
297 {
│ │ │ │ -
298 return false;
│ │ │ │ -
299 }
│ │ │ │ -
300
│ │ │ │ -
301 template<typename T>
│ │ │ │ -
302 constexpr typename std::enable_if<
│ │ │ │ - │ │ │ │ -
304 bool
│ │ │ │ -
305 >::type
│ │ │ │ -
306 _non_empty_tree_path (T t)
│ │ │ │ -
307 {
│ │ │ │ -
308 return treePathSize(t) > 0;
│ │ │ │ -
309 }
│ │ │ │ -
310
│ │ │ │ -
311 }
│ │ │ │ -
312
│ │ │ │ -
313#endif // DOXYGEN
│ │ │ │ +
292 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath>
│ │ │ │ +
293 struct accumulate_type_node_helper<Node,Functor,Reduction,current_type,TreePath,true>
│ │ │ │ +
294 {
│ │ │ │ +
295
│ │ │ │ +
296 typedef typename Reduction::template reduce<
│ │ │ │ +
297 current_type,
│ │ │ │ +
298 typename Functor::template visit<
│ │ │ │ +
299 Node,
│ │ │ │ + │ │ │ │ +
301 >::type
│ │ │ │ +
302 >::type type;
│ │ │ │ +
303
│ │ │ │ +
304 };
│ │ │ │ +
305
│ │ │ │ +
307 template<typename Tree, typename Policy, typename current_type, typename TreePath, typename Tag>
│ │ │ │ +
308 struct accumulate_type;
│ │ │ │ +
309
│ │ │ │ +
311 template<typename LeafNode, typename Policy, typename current_type, typename TreePath>
│ │ │ │ +
312 struct accumulate_type<LeafNode,Policy,current_type,TreePath,LeafNodeTag>
│ │ │ │ +
313 {
│ │ │ │
314
│ │ │ │ -
316
│ │ │ │ -
317 } // namespace TypeTree
│ │ │ │ -
318} //namespace Dune
│ │ │ │ -
319
│ │ │ │ -
320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
typename impl::_is_flat_index< std::decay_t< T > >::type is_flat_index
Type trait that determines whether T is a flat index in the context of child extraction.
Definition: childextraction.hh:282
│ │ │ │ -
ImplementationDefined childStorage(Node &&node, Indices... indices)
Definition: childextraction.hh:136
│ │ │ │ +
315 typedef typename accumulate_type_node_helper<
│ │ │ │ +
316 LeafNode,
│ │ │ │ +
317 typename Policy::functor,
│ │ │ │ +
318 typename Policy::sibling_reduction,
│ │ │ │ +
319 current_type,
│ │ │ │ +
320 TreePath,
│ │ │ │ +
321 Policy::functor::template doVisit<
│ │ │ │ +
322 LeafNode,
│ │ │ │ +
323 TreePath>::value
│ │ │ │ +
324 >::type type;
│ │ │ │ +
325
│ │ │ │ +
326 };
│ │ │ │ +
327
│ │ │ │ +
328
│ │ │ │ +
331 template<typename current_type, typename tree_path, typename start_type, typename reduction_strategy>
│ │ │ │ +
332 struct propagate_type_down_tree;
│ │ │ │ +
333
│ │ │ │ +
335 template<typename current_type, typename tree_path, typename start_type>
│ │ │ │ +
336 struct propagate_type_down_tree<
│ │ │ │ +
337 current_type,
│ │ │ │ +
338 tree_path,
│ │ │ │ +
339 start_type,
│ │ │ │ +
340 bottom_up_reduction
│ │ │ │ +
341 >
│ │ │ │ +
342 {
│ │ │ │ +
343 typedef current_type type;
│ │ │ │ +
344 };
│ │ │ │ +
345
│ │ │ │ +
347 template<typename current_type, typename tree_path, typename start_type>
│ │ │ │ +
348 struct propagate_type_down_tree<
│ │ │ │ +
349 current_type,
│ │ │ │ +
350 tree_path,
│ │ │ │ +
351 start_type,
│ │ │ │ +
352 flattened_reduction
│ │ │ │ +
353 >
│ │ │ │ +
354 {
│ │ │ │ +
355 typedef typename std::conditional<
│ │ │ │ +
356 TreePathBack<tree_path>::value == 0,
│ │ │ │ +
357 start_type,
│ │ │ │ +
358 current_type
│ │ │ │ +
359 >::type type;
│ │ │ │ +
360 };
│ │ │ │ +
361
│ │ │ │ +
362
│ │ │ │ +
364 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t i, std::size_t n>
│ │ │ │ +
365 struct accumulate_type_over_children
│ │ │ │ +
366 {
│ │ │ │ +
367
│ │ │ │ +
368 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
│ │ │ │ +
369
│ │ │ │ +
370 typedef typename Node::template Child<i>::Type child;
│ │ │ │ +
371
│ │ │ │ +
372 typedef typename accumulate_type<
│ │ │ │ +
373 child,
│ │ │ │ +
374 Policy,
│ │ │ │ +
375 // apply reduction choice (flat / hierarchic)
│ │ │ │ +
376 typename propagate_type_down_tree<
│ │ │ │ +
377 current_type,
│ │ │ │ +
378 child_tree_path,
│ │ │ │ +
379 typename Policy::start_type,
│ │ │ │ +
380 typename Policy::reduction_strategy
│ │ │ │ +
381 >::type,
│ │ │ │ +
382 child_tree_path,
│ │ │ │ + │ │ │ │ +
384 >::type child_result_type;
│ │ │ │ +
385
│ │ │ │ +
386 typedef typename accumulate_type_over_children<
│ │ │ │ +
387 Node,
│ │ │ │ +
388 Policy,
│ │ │ │ +
389 child_result_type,
│ │ │ │ +
390 TreePath,
│ │ │ │ +
391 i+1,
│ │ │ │ +
392 n
│ │ │ │ +
393 >::type type;
│ │ │ │ +
394
│ │ │ │ +
395 };
│ │ │ │ +
396
│ │ │ │ +
398 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t n>
│ │ │ │ +
399 struct accumulate_type_over_children<Node,Policy,current_type,TreePath,n,n>
│ │ │ │ +
400 {
│ │ │ │ +
401
│ │ │ │ +
402 typedef current_type type;
│ │ │ │ +
403
│ │ │ │ +
404 };
│ │ │ │ +
405
│ │ │ │ +
406
│ │ │ │ +
409 template<typename Node, typename Policy, typename current_type, typename TreePath>
│ │ │ │ +
410 struct accumulate_type_generic_composite_node
│ │ │ │ +
411 {
│ │ │ │ +
412
│ │ │ │ +
413 typedef typename accumulate_type_over_children<
│ │ │ │ +
414 Node,
│ │ │ │ +
415 Policy,
│ │ │ │ +
416 current_type,
│ │ │ │ +
417 TreePath,
│ │ │ │ +
418 0,
│ │ │ │ +
419 StaticDegree<Node>::value
│ │ │ │ +
420 >::type children_result_type;
│ │ │ │ +
421
│ │ │ │ +
422 typedef typename accumulate_type_node_helper<
│ │ │ │ +
423 Node,
│ │ │ │ +
424 typename Policy::functor,
│ │ │ │ +
425 typename Policy::parent_child_reduction,
│ │ │ │ +
426 children_result_type,
│ │ │ │ +
427 TreePath,
│ │ │ │ +
428 Policy::functor::template doVisit<
│ │ │ │ +
429 Node,
│ │ │ │ + │ │ │ │ +
431 >::value
│ │ │ │ +
432 >::type type;
│ │ │ │ +
433
│ │ │ │ +
434 };
│ │ │ │ +
435
│ │ │ │ +
437 template<typename PowerNode, typename Policy, typename current_type, typename TreePath>
│ │ │ │ +
438 struct accumulate_type<PowerNode,Policy,current_type,TreePath,PowerNodeTag>
│ │ │ │ +
439 : public accumulate_type_generic_composite_node<PowerNode,Policy,current_type,TreePath>
│ │ │ │ +
440 {};
│ │ │ │ +
441
│ │ │ │ +
443 template<typename CompositeNode, typename Policy, typename current_type, typename TreePath>
│ │ │ │ +
444 struct accumulate_type<CompositeNode,Policy,current_type,TreePath,CompositeNodeTag>
│ │ │ │ +
445 : public accumulate_type_generic_composite_node<CompositeNode,Policy,current_type,TreePath>
│ │ │ │ +
446 {};
│ │ │ │ +
447
│ │ │ │ +
448 } // anonymous namespace
│ │ │ │ +
449
│ │ │ │ +
450
│ │ │ │ +
458 template<
│ │ │ │ +
459 typename Functor,
│ │ │ │ +
460 typename Reduction,
│ │ │ │ +
461 typename StartType,
│ │ │ │ +
462 typename ParentChildReduction = Reduction,
│ │ │ │ +
463 typename ReductionAlgorithm = flattened_reduction
│ │ │ │ +
464 >
│ │ │ │ + │ │ │ │ +
466 {
│ │ │ │ +
467
│ │ │ │ +
495 typedef Functor functor;
│ │ │ │ +
496
│ │ │ │ +
516 typedef Reduction sibling_reduction;
│ │ │ │ +
517
│ │ │ │ +
524 typedef ParentChildReduction parent_child_reduction;
│ │ │ │ +
525
│ │ │ │ +
532 typedef StartType start_type;
│ │ │ │ +
533
│ │ │ │ +
538 typedef ReductionAlgorithm reduction_strategy;
│ │ │ │ +
539 };
│ │ │ │ +
540
│ │ │ │ +
541
│ │ │ │ +
543
│ │ │ │ +
551 template<typename Tree, typename Policy>
│ │ │ │ + │ │ │ │ +
553 {
│ │ │ │ +
554
│ │ │ │ +
556 typedef typename accumulate_type<
│ │ │ │ +
557 Tree,
│ │ │ │ +
558 Policy,
│ │ │ │ +
559 typename Policy::start_type,
│ │ │ │ + │ │ │ │ + │ │ │ │ +
562 >::type type;
│ │ │ │ +
563
│ │ │ │ +
564 };
│ │ │ │ +
565
│ │ │ │ +
566
│ │ │ │ +
567
│ │ │ │ +
568
│ │ │ │ +
569
│ │ │ │ +
570 /***************************************************/
│ │ │ │ +
571
│ │ │ │ +
572 namespace Experimental {
│ │ │ │ +
573 namespace Impl {
│ │ │ │ +
574
│ │ │ │ +
576 template<class T, class TreePath, class V, class U,
│ │ │ │ +
577 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ +
578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
│ │ │ │ +
579 {
│ │ │ │ +
580 return visitor.leaf(tree, treePath, std::forward<U>(current_val));
│ │ │ │ +
581 }
│ │ │ │ +
582
│ │ │ │ +
584 template<class T, class TreePath, class V, class U,
│ │ │ │ +
585 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
│ │ │ │ +
586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
│ │ │ │ +
587 {
│ │ │ │ +
588 using Tree = std::remove_reference_t<T>;
│ │ │ │ +
589 using Visitor = std::remove_reference_t<V>;
│ │ │ │ +
590 auto pre_val = visitor.pre(tree, treePath, std::forward<U>(current_val));
│ │ │ │ +
591
│ │ │ │ +
592 // check which type of traversal is supported by the tree
│ │ │ │ +
593 using allowDynamicTraversal = Dune::Std::is_detected<Detail::DynamicTraversalConcept,Tree>;
│ │ │ │ +
594 using allowStaticTraversal = Dune::Std::is_detected<Detail::StaticTraversalConcept,Tree>;
│ │ │ │ +
595
│ │ │ │ +
596 // the tree must support either dynamic or static traversal
│ │ │ │ +
597 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
│ │ │ │ +
598
│ │ │ │ +
599 // the visitor may specify preferred dynamic traversal
│ │ │ │ +
600 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
│ │ │ │ +
601
│ │ │ │ +
602 // declare rule that applies visitor and current value to a child i. Returns next value
│ │ │ │ +
603 auto apply_i = [&](auto&& value, const auto& i){
│ │ │ │ +
604 auto&& child = tree.child(i);
│ │ │ │ +
605 using Child = std::decay_t<decltype(child)>;
│ │ │ │ +
606
│ │ │ │ +
607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move(value));
│ │ │ │ +
608
│ │ │ │ +
609 // visits between children
│ │ │ │ +
610 auto val_in = Hybrid::ifElse(
│ │ │ │ +
611 Hybrid::equals(i,Indices::_0),
│ │ │ │ +
612 [&](auto id){return std::move(val_before);},
│ │ │ │ +
613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));}
│ │ │ │ +
614 );
│ │ │ │ +
615
│ │ │ │ +
616 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
│ │ │ │ +
617 auto val_visit = [&](){
│ │ │ │ +
618 if constexpr (visitChild) {
│ │ │ │ +
619 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
│ │ │ │ +
620 return hybridApplyToTree(child, childTreePath, visitor, std::move(val_in));
│ │ │ │ +
621 }
│ │ │ │ +
622 else
│ │ │ │ +
623 return std::move(val_in);
│ │ │ │ +
624 }();
│ │ │ │ +
625
│ │ │ │ +
626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit));
│ │ │ │ +
627 };
│ │ │ │ +
628
│ │ │ │ +
629 // apply visitor to children
│ │ │ │ +
630 auto in_val = [&](){
│ │ │ │ +
631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal::value) {
│ │ │ │ +
632 // get list of static indices
│ │ │ │ +
633 auto indices = std::make_index_sequence<Tree::degree()>{};
│ │ │ │ +
634
│ │ │ │ +
635 // unfold apply_i left to right
│ │ │ │ +
636 return unpackIntegerSequence([&](auto... i) {
│ │ │ │ +
656 return left_fold(std::move(apply_i),std::move(pre_val), i...);
│ │ │ │ +
657 }, indices);
│ │ │ │ +
658
│ │ │ │ +
659 } else {
│ │ │ │ +
660 // unfold first child to get type
│ │ │ │ +
661 auto i_val = apply_i(std::move(pre_val),std::size_t{0});
│ │ │ │ +
662 // dynamically loop rest of the children to accumulate remindng values
│ │ │ │ +
663 for(std::size_t i = 1; i < tree.degree(); i++)
│ │ │ │ +
664 i_val = apply_i(i_val,i);
│ │ │ │ +
665 return i_val;
│ │ │ │ +
666 }
│ │ │ │ +
667 }();
│ │ │ │ +
668
│ │ │ │ +
669 return visitor.post(tree, treePath, in_val);
│ │ │ │ +
670 }
│ │ │ │ +
671
│ │ │ │ +
672 }
│ │ │ │ +
673
│ │ │ │ +
697 template<typename Tree, typename Visitor, typename Init>
│ │ │ │ +
698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init)
│ │ │ │ +
699 {
│ │ │ │ +
700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init);
│ │ │ │ +
701 }
│ │ │ │ +
702
│ │ │ │ +
703 } // namespace Experimental
│ │ │ │ +
704
│ │ │ │ +
706 } // namespace TypeTree
│ │ │ │ +
707} //namespace Dune
│ │ │ │ +
708
│ │ │ │ +
709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
static const result_type child_result
Definition: accumulate_static.hh:153
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:110
│ │ │ │
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition: childextraction.hh:223
│ │ │ │
ImplementationDefined child(Node &&node, Indices... indices)
Extracts the child of a node given by a sequence of compile-time and run-time indices.
Definition: childextraction.hh:126
│ │ │ │ -
typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath
Template alias for the type of a child node given by a TreePath or a HybridTreePath type.
Definition: childextraction.hh:250
│ │ │ │ -
ImplementationDefined child(Node &&node, HybridTreePath< Indices... > treePath)
Extracts the child of a node given by a HybridTreePath object.
Definition: childextraction.hh:171
│ │ │ │
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition: treepath.hh:199
│ │ │ │ +
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ +
constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< T... > &tp, std::size_t i)
Appends a run time index to a HybridTreePath.
Definition: treepath.hh:281
│ │ │ │ +
constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:180
│ │ │ │
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition: treepath.hh:191
│ │ │ │ +
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition: treepath.hh:521
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ +
auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
Apply hybrid visitor to TypeTree.
Definition: accumulate_static.hh:698
│ │ │ │ +
Type
Definition: treepath.hh:30
│ │ │ │ +
Statically combine two values of type result_type using ||.
Definition: accumulate_static.hh:24
│ │ │ │ +
Definition: accumulate_static.hh:27
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:28
│ │ │ │ +
Statically combine two values of type result_type using &&.
Definition: accumulate_static.hh:35
│ │ │ │ +
Definition: accumulate_static.hh:38
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:39
│ │ │ │ +
Statically combine two values of type result_type using +.
Definition: accumulate_static.hh:46
│ │ │ │ +
Definition: accumulate_static.hh:49
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:50
│ │ │ │ +
Statically combine two values of type result_type using -.
Definition: accumulate_static.hh:57
│ │ │ │ +
Definition: accumulate_static.hh:60
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:61
│ │ │ │ +
Statically combine two values of type result_type using *.
Definition: accumulate_static.hh:68
│ │ │ │ +
Definition: accumulate_static.hh:71
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:72
│ │ │ │ +
Statically combine two values of type result_type by returning their minimum.
Definition: accumulate_static.hh:79
│ │ │ │ +
Definition: accumulate_static.hh:82
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:83
│ │ │ │ +
Statically combine two values of type result_type by returning their maximum.
Definition: accumulate_static.hh:90
│ │ │ │ +
Definition: accumulate_static.hh:93
│ │ │ │ +
static const result_type result
Definition: accumulate_static.hh:94
│ │ │ │ +
Statically accumulate a value over the nodes of a TypeTree.
Definition: accumulate_static.hh:259
│ │ │ │ +
Functor::result_type result_type
The result type of the computation.
Definition: accumulate_static.hh:262
│ │ │ │ +
static const result_type result
The accumulated result of the computation.
Definition: accumulate_static.hh:265
│ │ │ │ +
Definition: accumulate_static.hh:466
│ │ │ │ +
ParentChildReduction parent_child_reduction
Definition: accumulate_static.hh:524
│ │ │ │ +
Functor functor
Definition: accumulate_static.hh:495
│ │ │ │ +
StartType start_type
Definition: accumulate_static.hh:532
│ │ │ │ +
ReductionAlgorithm reduction_strategy
Definition: accumulate_static.hh:538
│ │ │ │ +
Reduction sibling_reduction
Definition: accumulate_static.hh:516
│ │ │ │ +
Statically accumulate a type over the nodes of a TypeTree.
Definition: accumulate_static.hh:553
│ │ │ │ +
accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, NodeTag< Tree > >::type type
The accumulated result of the computation.
Definition: accumulate_static.hh:562
│ │ │ │
A hybrid version of TreePath that supports both compile time and run time indices.
Definition: treepath.hh:79
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,329 +4,712 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -childextraction.hh │ │ │ │ │ +accumulate_static.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ - 2// vi: set et ts=8 sw=2 sts=2: │ │ │ │ │ + 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ + 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17 │ │ │ │ │ - 18 │ │ │ │ │ - 19namespace Dune { │ │ │ │ │ - 20 namespace TypeTree { │ │ │ │ │ - 21 │ │ │ │ │ - 26 │ │ │ │ │ - 27#ifndef DOXYGEN │ │ │ │ │ - 28 │ │ │ │ │ - 29 namespace Impl { │ │ │ │ │ - 30 │ │ │ │ │ - 31 // check at run time whether index is a valid child index │ │ │ │ │ - 32 template │ │ │ │ │ - 33 std::true_type checkChildIndex (Node const& node, Index i) │ │ │ │ │ - 34 { │ │ │ │ │ - 35 assert(std::size_t(i) < node.degree() && "Child index out of range"); │ │ │ │ │ - 36 return {}; │ │ │ │ │ - 37 } │ │ │ │ │ - 38 │ │ │ │ │ - 39 // check at compile time whether index is a valid index │ │ │ │ │ - 40 template │ │ │ │ │ - 41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node, │ │ │ │ │ -index_constant) │ │ │ │ │ - 42 { │ │ │ │ │ - 43 static_assert(i < Node::degree(), "Child index out of range"); │ │ │ │ │ - 44 return {}; │ │ │ │ │ - 45 } │ │ │ │ │ - 46 │ │ │ │ │ - 47 // finally return the node itself if no further indices are provided. Break │ │ │ │ │ -condition │ │ │ │ │ - 48 // for the recursion over the node childs. │ │ │ │ │ - 49 template │ │ │ │ │ - 50 decltype(auto) childImpl (Node&& node) │ │ │ │ │ - 51 { │ │ │ │ │ - 52 return std::forward(node); │ │ │ │ │ - 53 } │ │ │ │ │ - 54 │ │ │ │ │ - 55 template │ │ │ │ │ - 56 auto childStorageImpl (NodePtr&& nodePtr) │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11 │ │ │ │ │ + 12 │ │ │ │ │ +13namespace Dune { │ │ │ │ │ +14 namespace TypeTree { │ │ │ │ │ + 15 │ │ │ │ │ + 22 template │ │ │ │ │ +23 struct or_ │ │ │ │ │ + 24 { │ │ │ │ │ + 25 template │ │ │ │ │ +26 struct reduce │ │ │ │ │ + 27 { │ │ │ │ │ +28 static const result_type result = r1 || r2; │ │ │ │ │ + 29 }; │ │ │ │ │ + 30 }; │ │ │ │ │ + 31 │ │ │ │ │ + 33 template │ │ │ │ │ +34 struct and_ │ │ │ │ │ + 35 { │ │ │ │ │ + 36 template │ │ │ │ │ +37 struct reduce │ │ │ │ │ + 38 { │ │ │ │ │ +39 static const result_type result = r1 && r2; │ │ │ │ │ + 40 }; │ │ │ │ │ + 41 }; │ │ │ │ │ + 42 │ │ │ │ │ + 44 template │ │ │ │ │ +45 struct plus │ │ │ │ │ + 46 { │ │ │ │ │ + 47 template │ │ │ │ │ +48 struct reduce │ │ │ │ │ + 49 { │ │ │ │ │ +50 static const result_type result = r1 + r2; │ │ │ │ │ + 51 }; │ │ │ │ │ + 52 }; │ │ │ │ │ + 53 │ │ │ │ │ + 55 template │ │ │ │ │ +56 struct minus │ │ │ │ │ 57 { │ │ │ │ │ - 58 return std::forward(nodePtr); │ │ │ │ │ - 59 } │ │ │ │ │ - 60 │ │ │ │ │ - 61 // recursively call `node.child(...)` with the given indices │ │ │ │ │ - 62 template │ │ │ │ │ - 63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i) │ │ │ │ │ - 64 { │ │ │ │ │ - 65 auto valid = checkChildIndex(node,i0); │ │ │ │ │ - 66 if constexpr (valid) │ │ │ │ │ - 67 return childImpl(node.child(i0),i...); │ │ │ │ │ - 68 else │ │ │ │ │ - 69 return; │ │ │ │ │ - 70 } │ │ │ │ │ - 71 │ │ │ │ │ - 72 // recursively call `node.childStorage(...)` with the given indices │ │ │ │ │ - 73 template │ │ │ │ │ - 74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]] │ │ │ │ │ -I... i) │ │ │ │ │ - 75 { │ │ │ │ │ - 76 auto valid = checkChildIndex(*nodePtr,i0); │ │ │ │ │ - 77 if constexpr (valid) │ │ │ │ │ - 78 return childStorageImpl(nodePtr->childStorage(i0),i...); │ │ │ │ │ - 79 else │ │ │ │ │ - 80 return; │ │ │ │ │ - 81 } │ │ │ │ │ - 82 │ │ │ │ │ - 83 // forward to the impl methods by extracting the indices from the treepath │ │ │ │ │ - 84 template │ │ │ │ │ - 85 decltype(auto) child (Node&& node, [[maybe_unused]] │ │ │ │ │ -HybridTreePath tp, std::index_sequence) │ │ │ │ │ - 86 { │ │ │ │ │ - 87 return childImpl(std::forward(node),treePathEntry(tp)...); │ │ │ │ │ - 88 } │ │ │ │ │ - 89 │ │ │ │ │ - 90 // forward to the impl methods by extracting the indices from the treepath │ │ │ │ │ - 91 template │ │ │ │ │ - 92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]] │ │ │ │ │ -HybridTreePath tp, std::index_sequence) │ │ │ │ │ + 58 template │ │ │ │ │ +59 struct reduce │ │ │ │ │ + 60 { │ │ │ │ │ +61 static const result_type result = r1 - r2; │ │ │ │ │ + 62 }; │ │ │ │ │ + 63 }; │ │ │ │ │ + 64 │ │ │ │ │ + 66 template │ │ │ │ │ +67 struct multiply │ │ │ │ │ + 68 { │ │ │ │ │ + 69 template │ │ │ │ │ +70 struct reduce │ │ │ │ │ + 71 { │ │ │ │ │ +72 static const result_type result = r1 * r2; │ │ │ │ │ + 73 }; │ │ │ │ │ + 74 }; │ │ │ │ │ + 75 │ │ │ │ │ + 77 template │ │ │ │ │ +78 struct min │ │ │ │ │ + 79 { │ │ │ │ │ + 80 template │ │ │ │ │ +81 struct reduce │ │ │ │ │ + 82 { │ │ │ │ │ +83 static const result_type result = r1 < r2 ? r1 : r2; │ │ │ │ │ + 84 }; │ │ │ │ │ + 85 }; │ │ │ │ │ + 86 │ │ │ │ │ + 88 template │ │ │ │ │ +89 struct max │ │ │ │ │ + 90 { │ │ │ │ │ + 91 template │ │ │ │ │ +92 struct reduce │ │ │ │ │ 93 { │ │ │ │ │ - 94 return childStorageImpl(std::forward(nodePtr),treePathEntry │ │ │ │ │ -(tp)...); │ │ │ │ │ - 95 } │ │ │ │ │ - 96 │ │ │ │ │ - 97 } // end namespace Impl │ │ │ │ │ +94 static const result_type result = r1 > r2 ? r1 : r2; │ │ │ │ │ + 95 }; │ │ │ │ │ + 96 }; │ │ │ │ │ + 97 │ │ │ │ │ 98 │ │ │ │ │ - 99#endif // DOXYGEN │ │ │ │ │ + 99 namespace { │ │ │ │ │ 100 │ │ │ │ │ + 101 // implementation of the traversal algorithm │ │ │ │ │ 102 │ │ │ │ │ - 124 template │ │ │ │ │ - 125#ifdef DOXYGEN │ │ │ │ │ -126 ImplementationDefined child (Node&& node, Indices... indices) │ │ │ │ │ - 127#else │ │ │ │ │ - 128 decltype(auto) child (Node&& node, Indices... indices) │ │ │ │ │ - 129#endif │ │ │ │ │ - 130 { │ │ │ │ │ - 131 return Impl::childImpl(std::forward(node),indices...); │ │ │ │ │ - 132 } │ │ │ │ │ + 104 template │ │ │ │ │ + 105 struct accumulate_node_helper │ │ │ │ │ + 106 { │ │ │ │ │ + 107 │ │ │ │ │ + 108 typedef typename Functor::result_type result_type; │ │ │ │ │ + 109 │ │ │ │ │ +110 static const result_type result = current_value; │ │ │ │ │ + 111 │ │ │ │ │ + 112 }; │ │ │ │ │ + 113 │ │ │ │ │ + 115 template │ │ │ │ │ + 116 struct │ │ │ │ │ +accumulate_node_helper │ │ │ │ │ + 117 { │ │ │ │ │ + 118 │ │ │ │ │ + 119 typedef typename Functor::result_type result_type; │ │ │ │ │ + 120 │ │ │ │ │ + 121 static const result_type result = Reduction::template │ │ │ │ │ +reduce::result>::result; │ │ │ │ │ + 122 │ │ │ │ │ + 123 }; │ │ │ │ │ + 124 │ │ │ │ │ + 126 template │ │ │ │ │ + 127 struct accumulate_value; │ │ │ │ │ + 128 │ │ │ │ │ + 130 template │ │ │ │ │ + 131 struct │ │ │ │ │ +accumulate_value │ │ │ │ │ + 132 { │ │ │ │ │ 133 │ │ │ │ │ - 134 template │ │ │ │ │ - 135#ifdef DOXYGEN │ │ │ │ │ -136 ImplementationDefined childStorage (Node&& node, Indices... indices) │ │ │ │ │ - 137#else │ │ │ │ │ - 138 auto childStorage (Node&& node, Indices... indices) │ │ │ │ │ - 139#endif │ │ │ │ │ - 140 { │ │ │ │ │ - 141 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called │ │ │ │ │ -with an empty list of child indices"); │ │ │ │ │ - 142 return Impl::childStorageImpl(&node,indices...); │ │ │ │ │ - 143 } │ │ │ │ │ - 144 │ │ │ │ │ + 134 typedef typename Functor::result_type result_type; │ │ │ │ │ + 135 │ │ │ │ │ + 136 static const result_type result = │ │ │ │ │ + 137 │ │ │ │ │ + 138 │ │ │ │ │ +accumulate_node_helper::value>::result; │ │ │ │ │ + 139 │ │ │ │ │ + 140 }; │ │ │ │ │ + 141 │ │ │ │ │ + 143 template │ │ │ │ │ + 144 struct accumulate_over_children │ │ │ │ │ + 145 { │ │ │ │ │ 146 │ │ │ │ │ - 169 template │ │ │ │ │ - 170#ifdef DOXYGEN │ │ │ │ │ -171 ImplementationDefined child (Node&& node, HybridTreePath │ │ │ │ │ -treePath) │ │ │ │ │ - 172#else │ │ │ │ │ - 173 decltype(auto) child (Node&& node, HybridTreePath tp) │ │ │ │ │ - 174#endif │ │ │ │ │ - 175 { │ │ │ │ │ - 176 return Impl::child(std::forward(node),tp,std:: │ │ │ │ │ -index_sequence_for{}); │ │ │ │ │ - 177 } │ │ │ │ │ - 178 │ │ │ │ │ - 179 template │ │ │ │ │ - 180#ifdef DOXYGEN │ │ │ │ │ - 181 ImplementationDefined child (Node&& node, HybridTreePath │ │ │ │ │ -treePath) │ │ │ │ │ - 182#else │ │ │ │ │ - 183 auto childStorage (Node&& node, HybridTreePath tp) │ │ │ │ │ - 184#endif │ │ │ │ │ - 185 { │ │ │ │ │ - 186 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called │ │ │ │ │ -with an empty TreePath"); │ │ │ │ │ - 187 return Impl::childStorage(&node,tp,std::index_sequence_for{}); │ │ │ │ │ - 188 } │ │ │ │ │ - 189 │ │ │ │ │ - 190 │ │ │ │ │ - 191#ifndef DOXYGEN │ │ │ │ │ - 192 │ │ │ │ │ - 193 namespace impl { │ │ │ │ │ - 194 │ │ │ │ │ - 195 template │ │ │ │ │ - 196 struct filter_void │ │ │ │ │ - 197 { │ │ │ │ │ - 198 using type = T; │ │ │ │ │ - 199 }; │ │ │ │ │ - 200 │ │ │ │ │ - 201 template<> │ │ │ │ │ - 202 struct filter_void │ │ │ │ │ - 203 {}; │ │ │ │ │ - 204 │ │ │ │ │ - 205 template │ │ │ │ │ - 206 struct _Child │ │ │ │ │ - 207 : public filter_void │ │ │ │ │ -(),index_constant{}...))>> │ │ │ │ │ - 208 {}; │ │ │ │ │ - 209 │ │ │ │ │ - 210 } │ │ │ │ │ - 211 │ │ │ │ │ - 212#endif // DOXYGEN │ │ │ │ │ - 213 │ │ │ │ │ - 215 │ │ │ │ │ - 222 template │ │ │ │ │ -223 using Child = typename impl::_Child::type; │ │ │ │ │ - 224 │ │ │ │ │ - 225 │ │ │ │ │ - 226#ifndef DOXYGEN │ │ │ │ │ - 227 │ │ │ │ │ - 228 namespace impl { │ │ │ │ │ - 229 │ │ │ │ │ - 230 template │ │ │ │ │ - 231 struct _ChildForTreePath │ │ │ │ │ - 232 { │ │ │ │ │ - 233 using type = typename std::decay(),std:: │ │ │ │ │ -declval()))>::type; │ │ │ │ │ - 234 }; │ │ │ │ │ - 235 │ │ │ │ │ - 236 } │ │ │ │ │ - 237 │ │ │ │ │ - 238#endif // DOXYGEN │ │ │ │ │ - 239 │ │ │ │ │ - 241 │ │ │ │ │ - 249 template │ │ │ │ │ -250 using ChildForTreePath = typename impl::_ChildForTreePath:: │ │ │ │ │ -type; │ │ │ │ │ - 251 │ │ │ │ │ - 252 │ │ │ │ │ - 253#ifndef DOXYGEN │ │ │ │ │ - 254 │ │ │ │ │ - 255 namespace impl { │ │ │ │ │ - 256 │ │ │ │ │ - 257 // By default, types are flat indices if they are integral │ │ │ │ │ - 258 template │ │ │ │ │ - 259 struct _is_flat_index │ │ │ │ │ - 260 { │ │ │ │ │ - 261 using type = std::is_integral; │ │ │ │ │ - 262 }; │ │ │ │ │ + 147 typedef typename Functor::result_type result_type; │ │ │ │ │ + 148 │ │ │ │ │ + 149 typedef decltype(push_back(TreePath{},index_constant{})) │ │ │ │ │ +child_tree_path; │ │ │ │ │ + 150 │ │ │ │ │ + 151 typedef typename Node::template Child::Type child; │ │ │ │ │ + 152 │ │ │ │ │ +153 static const result_type child_result = │ │ │ │ │ +accumulate_value>:: │ │ │ │ │ +result; │ │ │ │ │ + 154 │ │ │ │ │ + 155 static const result_type result = │ │ │ │ │ +accumulate_over_children:: │ │ │ │ │ +result; │ │ │ │ │ + 156 │ │ │ │ │ + 157 }; │ │ │ │ │ + 158 │ │ │ │ │ + 160 template │ │ │ │ │ + 161 struct │ │ │ │ │ +accumulate_over_children │ │ │ │ │ + 162 { │ │ │ │ │ + 163 │ │ │ │ │ + 164 typedef typename Functor::result_type result_type; │ │ │ │ │ + 165 │ │ │ │ │ + 166 static const result_type result = current_value; │ │ │ │ │ + 167 │ │ │ │ │ + 168 }; │ │ │ │ │ + 169 │ │ │ │ │ + 172 template │ │ │ │ │ + 173 struct accumulate_value_generic_composite_node │ │ │ │ │ + 174 { │ │ │ │ │ + 175 │ │ │ │ │ + 176 typedef typename Functor::result_type result_type; │ │ │ │ │ + 177 │ │ │ │ │ + 178 static const result_type child_result = │ │ │ │ │ +accumulate_over_children:: │ │ │ │ │ +value>::result; │ │ │ │ │ + 179 │ │ │ │ │ + 180 static const result_type result = │ │ │ │ │ + 181 │ │ │ │ │ +accumulate_node_helper::value>::result; │ │ │ │ │ + 182 │ │ │ │ │ + 183 │ │ │ │ │ + 184 }; │ │ │ │ │ + 185 │ │ │ │ │ + 187 template │ │ │ │ │ + 188 struct │ │ │ │ │ +accumulate_value │ │ │ │ │ + 189 : public │ │ │ │ │ +accumulate_value_generic_composite_node │ │ │ │ │ + 190 {}; │ │ │ │ │ + 191 │ │ │ │ │ + 193 template │ │ │ │ │ + 194 struct │ │ │ │ │ +accumulate_value │ │ │ │ │ + 195 : public │ │ │ │ │ +accumulate_value_generic_composite_node │ │ │ │ │ + 196 {}; │ │ │ │ │ + 197 │ │ │ │ │ + 198 } // anonymous namespace │ │ │ │ │ + 199 │ │ │ │ │ + 201 │ │ │ │ │ + 257 template │ │ │ │ │ +258 struct AccumulateValue │ │ │ │ │ + 259 { │ │ │ │ │ + 260 │ │ │ │ │ +262 typedef typename Functor::result_type result_type; │ │ │ │ │ 263 │ │ │ │ │ - 264 // And so is any index_constant │ │ │ │ │ - 265 template │ │ │ │ │ - 266 struct _is_flat_index> │ │ │ │ │ - 267 { │ │ │ │ │ - 268 using type = std::true_type; │ │ │ │ │ - 269 }; │ │ │ │ │ - 270 │ │ │ │ │ - 271 } │ │ │ │ │ +265 static const result_type result = │ │ │ │ │ +accumulate_value,NodeTag>:: │ │ │ │ │ +result; │ │ │ │ │ + 266 │ │ │ │ │ + 267 }; │ │ │ │ │ + 268 │ │ │ │ │ + 271 struct flattened_reduction; │ │ │ │ │ 272 │ │ │ │ │ - 273#endif // DOXYGEN │ │ │ │ │ - 274 │ │ │ │ │ - 276 /* │ │ │ │ │ - 277 * This type trait can be used to check whether T is a flat index (i.e. │ │ │ │ │ -either `std::size_t` │ │ │ │ │ - 278 * or `index_constant`). The type trait normalizes T before doing the │ │ │ │ │ -check, so it will also │ │ │ │ │ - 279 * work correctly for references and cv-qualified types. │ │ │ │ │ - 280 */ │ │ │ │ │ - 281 template │ │ │ │ │ -282 using is_flat_index = typename impl::_is_flat_index>::type; │ │ │ │ │ - 283 │ │ │ │ │ - 284#ifndef DOXYGEN │ │ │ │ │ - 285 │ │ │ │ │ - 286 namespace impl { │ │ │ │ │ - 287 │ │ │ │ │ - 288 // helper function for check in member child() functions that tolerates │ │ │ │ │ -being passed something that │ │ │ │ │ - 289 // isn't a TreePath. It will just return 0 in that case │ │ │ │ │ + 275 struct bottom_up_reduction; │ │ │ │ │ + 276 │ │ │ │ │ + 277 namespace { │ │ │ │ │ + 278 │ │ │ │ │ + 279 // implementation of the traversal algorithm │ │ │ │ │ + 280 │ │ │ │ │ + 283 template │ │ │ │ │ + 284 struct accumulate_type_node_helper │ │ │ │ │ + 285 { │ │ │ │ │ + 286 │ │ │ │ │ + 287 typedef current_type type; │ │ │ │ │ + 288 │ │ │ │ │ + 289 }; │ │ │ │ │ 290 │ │ │ │ │ - 291 template │ │ │ │ │ - 292 constexpr typename std::enable_if< │ │ │ │ │ - 293 Dune::TypeTree::is_flat_index::value, │ │ │ │ │ - 294 bool │ │ │ │ │ - 295 >::type │ │ │ │ │ - 296 _non_empty_tree_path (T) │ │ │ │ │ - 297 { │ │ │ │ │ - 298 return false; │ │ │ │ │ - 299 } │ │ │ │ │ - 300 │ │ │ │ │ - 301 template │ │ │ │ │ - 302 constexpr typename std::enable_if< │ │ │ │ │ - 303 !Dune::TypeTree::is_flat_index::value, │ │ │ │ │ - 304 bool │ │ │ │ │ - 305 >::type │ │ │ │ │ - 306 _non_empty_tree_path (T t) │ │ │ │ │ - 307 { │ │ │ │ │ - 308 return treePathSize(t) > 0; │ │ │ │ │ - 309 } │ │ │ │ │ - 310 │ │ │ │ │ - 311 } │ │ │ │ │ - 312 │ │ │ │ │ - 313#endif // DOXYGEN │ │ │ │ │ + 292 template │ │ │ │ │ + 293 struct │ │ │ │ │ +accumulate_type_node_helper │ │ │ │ │ + 294 { │ │ │ │ │ + 295 │ │ │ │ │ + 296 typedef typename Reduction::template reduce< │ │ │ │ │ + 297 current_type, │ │ │ │ │ + 298 typename Functor::template visit< │ │ │ │ │ + 299 Node, │ │ │ │ │ + 300 TreePath │ │ │ │ │ + 301 >::type │ │ │ │ │ + 302 >::type type; │ │ │ │ │ + 303 │ │ │ │ │ + 304 }; │ │ │ │ │ + 305 │ │ │ │ │ + 307 template │ │ │ │ │ + 308 struct accumulate_type; │ │ │ │ │ + 309 │ │ │ │ │ + 311 template │ │ │ │ │ + 312 struct accumulate_type │ │ │ │ │ + 313 { │ │ │ │ │ 314 │ │ │ │ │ - 316 │ │ │ │ │ - 317 } // namespace TypeTree │ │ │ │ │ - 318} //namespace Dune │ │ │ │ │ - 319 │ │ │ │ │ - 320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ + 315 typedef typename accumulate_type_node_helper< │ │ │ │ │ + 316 LeafNode, │ │ │ │ │ + 317 typename Policy::functor, │ │ │ │ │ + 318 typename Policy::sibling_reduction, │ │ │ │ │ + 319 current_type, │ │ │ │ │ + 320 TreePath, │ │ │ │ │ + 321 Policy::functor::template doVisit< │ │ │ │ │ + 322 LeafNode, │ │ │ │ │ + 323 TreePath>::value │ │ │ │ │ + 324 >::type type; │ │ │ │ │ + 325 │ │ │ │ │ + 326 }; │ │ │ │ │ + 327 │ │ │ │ │ + 328 │ │ │ │ │ + 331 template │ │ │ │ │ + 332 struct propagate_type_down_tree; │ │ │ │ │ + 333 │ │ │ │ │ + 335 template │ │ │ │ │ + 336 struct propagate_type_down_tree< │ │ │ │ │ + 337 current_type, │ │ │ │ │ + 338 tree_path, │ │ │ │ │ + 339 start_type, │ │ │ │ │ + 340 bottom_up_reduction │ │ │ │ │ + 341 > │ │ │ │ │ + 342 { │ │ │ │ │ + 343 typedef current_type type; │ │ │ │ │ + 344 }; │ │ │ │ │ + 345 │ │ │ │ │ + 347 template │ │ │ │ │ + 348 struct propagate_type_down_tree< │ │ │ │ │ + 349 current_type, │ │ │ │ │ + 350 tree_path, │ │ │ │ │ + 351 start_type, │ │ │ │ │ + 352 flattened_reduction │ │ │ │ │ + 353 > │ │ │ │ │ + 354 { │ │ │ │ │ + 355 typedef typename std::conditional< │ │ │ │ │ + 356 TreePathBack::value == 0, │ │ │ │ │ + 357 start_type, │ │ │ │ │ + 358 current_type │ │ │ │ │ + 359 >::type type; │ │ │ │ │ + 360 }; │ │ │ │ │ + 361 │ │ │ │ │ + 362 │ │ │ │ │ + 364 template │ │ │ │ │ + 365 struct accumulate_type_over_children │ │ │ │ │ + 366 { │ │ │ │ │ + 367 │ │ │ │ │ + 368 typedef decltype(push_back(TreePath{},index_constant{})) │ │ │ │ │ +child_tree_path; │ │ │ │ │ + 369 │ │ │ │ │ + 370 typedef typename Node::template Child::Type child; │ │ │ │ │ + 371 │ │ │ │ │ + 372 typedef typename accumulate_type< │ │ │ │ │ + 373 child, │ │ │ │ │ + 374 Policy, │ │ │ │ │ + 375 // apply reduction choice (flat / hierarchic) │ │ │ │ │ + 376 typename propagate_type_down_tree< │ │ │ │ │ + 377 current_type, │ │ │ │ │ + 378 child_tree_path, │ │ │ │ │ + 379 typename Policy::start_type, │ │ │ │ │ + 380 typename Policy::reduction_strategy │ │ │ │ │ + 381 >::type, │ │ │ │ │ + 382 child_tree_path, │ │ │ │ │ + 383 NodeTag │ │ │ │ │ + 384 >::type child_result_type; │ │ │ │ │ + 385 │ │ │ │ │ + 386 typedef typename accumulate_type_over_children< │ │ │ │ │ + 387 Node, │ │ │ │ │ + 388 Policy, │ │ │ │ │ + 389 child_result_type, │ │ │ │ │ + 390 TreePath, │ │ │ │ │ + 391 i+1, │ │ │ │ │ + 392 n │ │ │ │ │ + 393 >::type type; │ │ │ │ │ + 394 │ │ │ │ │ + 395 }; │ │ │ │ │ + 396 │ │ │ │ │ + 398 template │ │ │ │ │ + 399 struct │ │ │ │ │ +accumulate_type_over_children │ │ │ │ │ + 400 { │ │ │ │ │ + 401 │ │ │ │ │ + 402 typedef current_type type; │ │ │ │ │ + 403 │ │ │ │ │ + 404 }; │ │ │ │ │ + 405 │ │ │ │ │ + 406 │ │ │ │ │ + 409 template │ │ │ │ │ + 410 struct accumulate_type_generic_composite_node │ │ │ │ │ + 411 { │ │ │ │ │ + 412 │ │ │ │ │ + 413 typedef typename accumulate_type_over_children< │ │ │ │ │ + 414 Node, │ │ │ │ │ + 415 Policy, │ │ │ │ │ + 416 current_type, │ │ │ │ │ + 417 TreePath, │ │ │ │ │ + 418 0, │ │ │ │ │ + 419 StaticDegree::value │ │ │ │ │ + 420 >::type children_result_type; │ │ │ │ │ + 421 │ │ │ │ │ + 422 typedef typename accumulate_type_node_helper< │ │ │ │ │ + 423 Node, │ │ │ │ │ + 424 typename Policy::functor, │ │ │ │ │ + 425 typename Policy::parent_child_reduction, │ │ │ │ │ + 426 children_result_type, │ │ │ │ │ + 427 TreePath, │ │ │ │ │ + 428 Policy::functor::template doVisit< │ │ │ │ │ + 429 Node, │ │ │ │ │ + 430 TreePath │ │ │ │ │ + 431 >::value │ │ │ │ │ + 432 >::type type; │ │ │ │ │ + 433 │ │ │ │ │ + 434 }; │ │ │ │ │ + 435 │ │ │ │ │ + 437 template │ │ │ │ │ + 438 struct │ │ │ │ │ +accumulate_type │ │ │ │ │ + 439 : public │ │ │ │ │ +accumulate_type_generic_composite_node │ │ │ │ │ + 440 {}; │ │ │ │ │ + 441 │ │ │ │ │ + 443 template │ │ │ │ │ + 444 struct │ │ │ │ │ +accumulate_type │ │ │ │ │ + 445 : public │ │ │ │ │ +accumulate_type_generic_composite_node │ │ │ │ │ + 446 {}; │ │ │ │ │ + 447 │ │ │ │ │ + 448 } // anonymous namespace │ │ │ │ │ + 449 │ │ │ │ │ + 450 │ │ │ │ │ + 458 template< │ │ │ │ │ + 459 typename Functor, │ │ │ │ │ + 460 typename Reduction, │ │ │ │ │ + 461 typename StartType, │ │ │ │ │ + 462 typename ParentChildReduction = Reduction, │ │ │ │ │ + 463 typename ReductionAlgorithm = flattened_reduction │ │ │ │ │ + 464 > │ │ │ │ │ +465 struct TypeAccumulationPolicy │ │ │ │ │ + 466 { │ │ │ │ │ + 467 │ │ │ │ │ +495 typedef Functor functor; │ │ │ │ │ + 496 │ │ │ │ │ +516 typedef Reduction sibling_reduction; │ │ │ │ │ + 517 │ │ │ │ │ +524 typedef ParentChildReduction parent_child_reduction; │ │ │ │ │ + 525 │ │ │ │ │ +532 typedef StartType start_type; │ │ │ │ │ + 533 │ │ │ │ │ +538 typedef ReductionAlgorithm reduction_strategy; │ │ │ │ │ + 539 }; │ │ │ │ │ + 540 │ │ │ │ │ + 541 │ │ │ │ │ + 543 │ │ │ │ │ + 551 template │ │ │ │ │ +552 struct AccumulateType │ │ │ │ │ + 553 { │ │ │ │ │ + 554 │ │ │ │ │ + 556 typedef typename accumulate_type< │ │ │ │ │ + 557 Tree, │ │ │ │ │ + 558 Policy, │ │ │ │ │ + 559 typename Policy::start_type, │ │ │ │ │ + 560 HybridTreePath<>, │ │ │ │ │ + 561 NodeTag │ │ │ │ │ +562 >::type type; │ │ │ │ │ + 563 │ │ │ │ │ + 564 }; │ │ │ │ │ + 565 │ │ │ │ │ + 566 │ │ │ │ │ + 567 │ │ │ │ │ + 568 │ │ │ │ │ + 569 │ │ │ │ │ + 570 /***************************************************/ │ │ │ │ │ + 571 │ │ │ │ │ +572 namespace Experimental { │ │ │ │ │ + 573 namespace Impl { │ │ │ │ │ + 574 │ │ │ │ │ + 576 template::isLeaf, int> = 0> │ │ │ │ │ + 578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& │ │ │ │ │ +current_val) │ │ │ │ │ + 579 { │ │ │ │ │ + 580 return visitor.leaf(tree, treePath, std::forward(current_val)); │ │ │ │ │ + 581 } │ │ │ │ │ + 582 │ │ │ │ │ + 584 template::isLeaf, int> = 0> │ │ │ │ │ + 586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& │ │ │ │ │ +current_val) │ │ │ │ │ + 587 { │ │ │ │ │ + 588 using Tree = std::remove_reference_t; │ │ │ │ │ + 589 using Visitor = std::remove_reference_t; │ │ │ │ │ + 590 auto pre_val = visitor.pre(tree, treePath, std::forward(current_val)); │ │ │ │ │ + 591 │ │ │ │ │ + 592 // check which type of traversal is supported by the tree │ │ │ │ │ + 593 using allowDynamicTraversal = Dune::Std::is_detected; │ │ │ │ │ + 594 using allowStaticTraversal = Dune::Std::is_detected; │ │ │ │ │ + 595 │ │ │ │ │ + 596 // the tree must support either dynamic or static traversal │ │ │ │ │ + 597 static_assert(allowDynamicTraversal::value || allowStaticTraversal:: │ │ │ │ │ +value); │ │ │ │ │ + 598 │ │ │ │ │ + 599 // the visitor may specify preferred dynamic traversal │ │ │ │ │ + 600 using preferDynamicTraversal = std::bool_constant; │ │ │ │ │ + 601 │ │ │ │ │ + 602 // declare rule that applies visitor and current value to a child i. │ │ │ │ │ +Returns next value │ │ │ │ │ + 603 auto apply_i = [&](auto&& value, const auto& i){ │ │ │ │ │ + 604 auto&& child = tree.child(i); │ │ │ │ │ + 605 using Child = std::decay_t; │ │ │ │ │ + 606 │ │ │ │ │ + 607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move │ │ │ │ │ +(value)); │ │ │ │ │ + 608 │ │ │ │ │ + 609 // visits between children │ │ │ │ │ + 610 auto val_in = Hybrid::ifElse( │ │ │ │ │ + 611 Hybrid::equals(i,Indices::_0), │ │ │ │ │ + 612 [&](auto id){return std::move(val_before);}, │ │ │ │ │ + 613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));} │ │ │ │ │ + 614 ); │ │ │ │ │ + 615 │ │ │ │ │ + 616 constexpr bool visitChild = Visitor::template │ │ │ │ │ +VisitChild::value; │ │ │ │ │ + 617 auto val_visit = [&](){ │ │ │ │ │ + 618 if constexpr (visitChild) { │ │ │ │ │ + 619 auto childTreePath = Dune::TypeTree::push_back(treePath, i); │ │ │ │ │ + 620 return hybridApplyToTree(child, childTreePath, visitor, std::move │ │ │ │ │ +(val_in)); │ │ │ │ │ + 621 } │ │ │ │ │ + 622 else │ │ │ │ │ + 623 return std::move(val_in); │ │ │ │ │ + 624 }(); │ │ │ │ │ + 625 │ │ │ │ │ + 626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit)); │ │ │ │ │ + 627 }; │ │ │ │ │ + 628 │ │ │ │ │ + 629 // apply visitor to children │ │ │ │ │ + 630 auto in_val = [&](){ │ │ │ │ │ + 631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal:: │ │ │ │ │ +value) { │ │ │ │ │ + 632 // get list of static indices │ │ │ │ │ + 633 auto indices = std::make_index_sequence{}; │ │ │ │ │ + 634 │ │ │ │ │ + 635 // unfold apply_i left to right │ │ │ │ │ + 636 return unpackIntegerSequence([&](auto... i) { │ │ │ │ │ + 656 return left_fold(std::move(apply_i),std::move(pre_val), i...); │ │ │ │ │ + 657 }, indices); │ │ │ │ │ + 658 │ │ │ │ │ + 659 } else { │ │ │ │ │ + 660 // unfold first child to get type │ │ │ │ │ + 661 auto i_val = apply_i(std::move(pre_val),std::size_t{0}); │ │ │ │ │ + 662 // dynamically loop rest of the children to accumulate remindng values │ │ │ │ │ + 663 for(std::size_t i = 1; i < tree.degree(); i++) │ │ │ │ │ + 664 i_val = apply_i(i_val,i); │ │ │ │ │ + 665 return i_val; │ │ │ │ │ + 666 } │ │ │ │ │ + 667 }(); │ │ │ │ │ + 668 │ │ │ │ │ + 669 return visitor.post(tree, treePath, in_val); │ │ │ │ │ + 670 } │ │ │ │ │ + 671 │ │ │ │ │ + 672 } │ │ │ │ │ + 673 │ │ │ │ │ + 697 template │ │ │ │ │ +698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init) │ │ │ │ │ + 699 { │ │ │ │ │ + 700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init); │ │ │ │ │ + 701 } │ │ │ │ │ + 702 │ │ │ │ │ + 703 } // namespace Experimental │ │ │ │ │ + 704 │ │ │ │ │ + 706 } // namespace TypeTree │ │ │ │ │ + 707} //namespace Dune │ │ │ │ │ + 708 │ │ │ │ │ + 709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ nodeinterface.hh │ │ │ │ │ treepath.hh │ │ │ │ │ -Dune::TypeTree::is_flat_index │ │ │ │ │ -typename impl::_is_flat_index< std::decay_t< T > >::type is_flat_index │ │ │ │ │ -Type trait that determines whether T is a flat index in the context of child │ │ │ │ │ -extraction. │ │ │ │ │ -Definition: childextraction.hh:282 │ │ │ │ │ -Dune::TypeTree::childStorage │ │ │ │ │ -ImplementationDefined childStorage(Node &&node, Indices... indices) │ │ │ │ │ -Definition: childextraction.hh:136 │ │ │ │ │ +nodetags.hh │ │ │ │ │ +child_result │ │ │ │ │ +static const result_type child_result │ │ │ │ │ +Definition: accumulate_static.hh:153 │ │ │ │ │ +result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:110 │ │ │ │ │ Dune::TypeTree::Child │ │ │ │ │ typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ Definition: childextraction.hh:223 │ │ │ │ │ Dune::TypeTree::child │ │ │ │ │ ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ indices. │ │ │ │ │ Definition: childextraction.hh:126 │ │ │ │ │ -Dune::TypeTree::ChildForTreePath │ │ │ │ │ -typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath │ │ │ │ │ -Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ -HybridTreePath type. │ │ │ │ │ -Definition: childextraction.hh:250 │ │ │ │ │ -Dune::TypeTree::child │ │ │ │ │ -ImplementationDefined child(Node &&node, HybridTreePath< Indices... > treePath) │ │ │ │ │ -Extracts the child of a node given by a HybridTreePath object. │ │ │ │ │ -Definition: childextraction.hh:171 │ │ │ │ │ Dune::TypeTree::degree │ │ │ │ │ std::size_t degree(const Node &node) │ │ │ │ │ Returns the degree of node as run time information. │ │ │ │ │ Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::treePathSize │ │ │ │ │ -constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ -Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ -Definition: treepath.hh:199 │ │ │ │ │ +Dune::TypeTree::NodeTag │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +Definition: nodeinterface.hh:76 │ │ │ │ │ +Dune::TypeTree::push_back │ │ │ │ │ +constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t i) │ │ │ │ │ +Appends a run time index to a HybridTreePath. │ │ │ │ │ +Definition: treepath.hh:281 │ │ │ │ │ +Dune::TypeTree::hybridTreePath │ │ │ │ │ +constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +Definition: treepath.hh:180 │ │ │ │ │ Dune::TypeTree::treePath │ │ │ │ │ constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ Constructs a new HybridTreePath from the given indices. │ │ │ │ │ Definition: treepath.hh:191 │ │ │ │ │ +Dune::TypeTree::TreePath │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +Definition: treepath.hh:521 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ +Dune::TypeTree::Experimental::hybridApplyToTree │ │ │ │ │ +auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ +Apply hybrid visitor to TypeTree. │ │ │ │ │ +Definition: accumulate_static.hh:698 │ │ │ │ │ +Dune::TypeTree::TreePathType::Type │ │ │ │ │ +Type │ │ │ │ │ +Definition: treepath.hh:30 │ │ │ │ │ +Dune::TypeTree::or_ │ │ │ │ │ +Statically combine two values of type result_type using ||. │ │ │ │ │ +Definition: accumulate_static.hh:24 │ │ │ │ │ +Dune::TypeTree::or_::reduce │ │ │ │ │ +Definition: accumulate_static.hh:27 │ │ │ │ │ +Dune::TypeTree::or_::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:28 │ │ │ │ │ +Dune::TypeTree::and_ │ │ │ │ │ +Statically combine two values of type result_type using &&. │ │ │ │ │ +Definition: accumulate_static.hh:35 │ │ │ │ │ +Dune::TypeTree::and_::reduce │ │ │ │ │ +Definition: accumulate_static.hh:38 │ │ │ │ │ +Dune::TypeTree::and_::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:39 │ │ │ │ │ +Dune::TypeTree::plus │ │ │ │ │ +Statically combine two values of type result_type using +. │ │ │ │ │ +Definition: accumulate_static.hh:46 │ │ │ │ │ +Dune::TypeTree::plus::reduce │ │ │ │ │ +Definition: accumulate_static.hh:49 │ │ │ │ │ +Dune::TypeTree::plus::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:50 │ │ │ │ │ +Dune::TypeTree::minus │ │ │ │ │ +Statically combine two values of type result_type using -. │ │ │ │ │ +Definition: accumulate_static.hh:57 │ │ │ │ │ +Dune::TypeTree::minus::reduce │ │ │ │ │ +Definition: accumulate_static.hh:60 │ │ │ │ │ +Dune::TypeTree::minus::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:61 │ │ │ │ │ +Dune::TypeTree::multiply │ │ │ │ │ +Statically combine two values of type result_type using *. │ │ │ │ │ +Definition: accumulate_static.hh:68 │ │ │ │ │ +Dune::TypeTree::multiply::reduce │ │ │ │ │ +Definition: accumulate_static.hh:71 │ │ │ │ │ +Dune::TypeTree::multiply::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:72 │ │ │ │ │ +Dune::TypeTree::min │ │ │ │ │ +Statically combine two values of type result_type by returning their minimum. │ │ │ │ │ +Definition: accumulate_static.hh:79 │ │ │ │ │ +Dune::TypeTree::min::reduce │ │ │ │ │ +Definition: accumulate_static.hh:82 │ │ │ │ │ +Dune::TypeTree::min::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:83 │ │ │ │ │ +Dune::TypeTree::max │ │ │ │ │ +Statically combine two values of type result_type by returning their maximum. │ │ │ │ │ +Definition: accumulate_static.hh:90 │ │ │ │ │ +Dune::TypeTree::max::reduce │ │ │ │ │ +Definition: accumulate_static.hh:93 │ │ │ │ │ +Dune::TypeTree::max::reduce::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +Definition: accumulate_static.hh:94 │ │ │ │ │ +Dune::TypeTree::AccumulateValue │ │ │ │ │ +Statically accumulate a value over the nodes of a TypeTree. │ │ │ │ │ +Definition: accumulate_static.hh:259 │ │ │ │ │ +Dune::TypeTree::AccumulateValue::result_type │ │ │ │ │ +Functor::result_type result_type │ │ │ │ │ +The result type of the computation. │ │ │ │ │ +Definition: accumulate_static.hh:262 │ │ │ │ │ +Dune::TypeTree::AccumulateValue::result │ │ │ │ │ +static const result_type result │ │ │ │ │ +The accumulated result of the computation. │ │ │ │ │ +Definition: accumulate_static.hh:265 │ │ │ │ │ +Dune::TypeTree::TypeAccumulationPolicy │ │ │ │ │ +Definition: accumulate_static.hh:466 │ │ │ │ │ +Dune::TypeTree::TypeAccumulationPolicy::parent_child_reduction │ │ │ │ │ +ParentChildReduction parent_child_reduction │ │ │ │ │ +Definition: accumulate_static.hh:524 │ │ │ │ │ +Dune::TypeTree::TypeAccumulationPolicy::functor │ │ │ │ │ +Functor functor │ │ │ │ │ +Definition: accumulate_static.hh:495 │ │ │ │ │ +Dune::TypeTree::TypeAccumulationPolicy::start_type │ │ │ │ │ +StartType start_type │ │ │ │ │ +Definition: accumulate_static.hh:532 │ │ │ │ │ +Dune::TypeTree::TypeAccumulationPolicy::reduction_strategy │ │ │ │ │ +ReductionAlgorithm reduction_strategy │ │ │ │ │ +Definition: accumulate_static.hh:538 │ │ │ │ │ +Dune::TypeTree::TypeAccumulationPolicy::sibling_reduction │ │ │ │ │ +Reduction sibling_reduction │ │ │ │ │ +Definition: accumulate_static.hh:516 │ │ │ │ │ +Dune::TypeTree::AccumulateType │ │ │ │ │ +Statically accumulate a type over the nodes of a TypeTree. │ │ │ │ │ +Definition: accumulate_static.hh:553 │ │ │ │ │ +Dune::TypeTree::AccumulateType::type │ │ │ │ │ +accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, │ │ │ │ │ +NodeTag< Tree > >::type type │ │ │ │ │ +The accumulated result of the computation. │ │ │ │ │ +Definition: accumulate_static.hh:562 │ │ │ │ │ Dune::TypeTree::HybridTreePath │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ Definition: treepath.hh:79 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: proxynode.hh File Reference │ │ │ │ +dune-typetree: simpletransformationdescriptors.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,51 +65,40 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
proxynode.hh File Reference
│ │ │ │ +
simpletransformationdescriptors.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/common/shared_ptr.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/common/std/type_traits.hh>
│ │ │ │ +
#include <array>
│ │ │ │ +#include <memory>
│ │ │ │ +#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::TypeTree::StaticChildAccessors< ProxiedNode >
 Mixin class providing methods for child access with compile-time parameter. More...
struct  Dune::TypeTree::SimpleLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k >
 Access to the type and storage type of the i-th child. More...
struct  Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
class  Dune::TypeTree::DynamicChildAccessors< ProxiedNode >
 Mixin class providing methods for child access with run-time parameter. More...
struct  Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
 
struct  Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag >
 ProxyNode base class for LeafNode. More...
struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag >
 ProxyNode base class for CompositeNode. More...
struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
 
struct  Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag >
 ProxyNode base class for PowerNode. More...
struct  Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag >
 ProxyNode base class for DynamicPowerNode. More...
 
class  Dune::TypeTree::ProxyNode< Node >
 Base class for nodes acting as a proxy for an existing node. More...
struct  Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,48 +5,42 @@ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -proxynode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +simpletransformationdescriptors.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::TypeTree::StaticChildAccessors<_ProxiedNode_> │ │ │ │ │ -  Mixin class providing methods for child access with compile-time │ │ │ │ │ - parameter. More... │ │ │ │ │ +struct  Dune::TypeTree::SimpleLeafNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::StaticChildAccessors<_ProxiedNode_>::Child<_k_> │ │ │ │ │ -  Access to the type and storage type of the i-th child. More... │ │ │ │ │ +struct  Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_> │ │ │ │ │   │ │ │ │ │ - class  Dune::TypeTree::DynamicChildAccessors<_ProxiedNode_> │ │ │ │ │ -  Mixin class providing methods for child access with run-time │ │ │ │ │ - parameter. More... │ │ │ │ │ +struct  Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::ProxyNodeBase<_Node,_LeafNodeTag_> │ │ │ │ │ -  ProxyNode base class for LeafNode. More... │ │ │ │ │ +struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_> │ │ │ │ │ -  ProxyNode base class for CompositeNode. More... │ │ │ │ │ +struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_> │ │ │ │ │ -  ProxyNode base class for PowerNode. More... │ │ │ │ │ +struct  Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_> │ │ │ │ │   │ │ │ │ │ -struct  Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_> │ │ │ │ │ -  ProxyNode base class for DynamicPowerNode. More... │ │ │ │ │ -  │ │ │ │ │ - class  Dune::TypeTree::ProxyNode<_Node_> │ │ │ │ │ -  Base class for nodes acting as a proxy for an existing node. More... │ │ │ │ │ +struct  Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode, │ │ │ │ │ + Transformation,_TransformedNode_>::result<_TC_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::TypeTree │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00086_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: proxynode.hh Source File │ │ │ │ +dune-typetree: simpletransformationdescriptors.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,351 +62,177 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
proxynode.hh
│ │ │ │ +
simpletransformationdescriptors.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3
│ │ │ │ -
4#ifndef DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │
6
│ │ │ │ -
7#include <type_traits>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
10#include <dune/common/shared_ptr.hh>
│ │ │ │ -
11#include <dune/common/indices.hh>
│ │ │ │ -
12#include <dune/common/std/type_traits.hh>
│ │ │ │ +
7#include <array>
│ │ │ │ +
8#include <memory>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ +
12#include <dune/common/exceptions.hh>
│ │ │ │
13
│ │ │ │ -
14namespace Dune {
│ │ │ │ -
15 namespace TypeTree {
│ │ │ │ -
16
│ │ │ │ -
22 template<typename Node>
│ │ │ │ -
23 class ProxyNode;
│ │ │ │ -
24
│ │ │ │ -
26 template<typename ProxiedNode>
│ │ │ │ - │ │ │ │ -
28 {
│ │ │ │ -
29
│ │ │ │ -
30 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
│ │ │ │ +
14
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16 namespace TypeTree {
│ │ │ │ +
17
│ │ │ │ +
23 template<typename SourceNode, typename Transformation, typename TransformedNode>
│ │ │ │ + │ │ │ │ +
25 {
│ │ │ │ +
26
│ │ │ │ +
27 static const bool recursive = false;
│ │ │ │ +
28
│ │ │ │ +
29 typedef TransformedNode transformed_type;
│ │ │ │ +
30 typedef std::shared_ptr<transformed_type> transformed_storage_type;
│ │ │ │
31
│ │ │ │ -
32 template<std::size_t k>
│ │ │ │ -
33 struct lazy_enabled
│ │ │ │ -
34 {
│ │ │ │ -
35 static const bool value = !proxiedNodeIsConst;
│ │ │ │ -
36 };
│ │ │ │ -
37
│ │ │ │ - │ │ │ │ -
39
│ │ │ │ -
40 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ -
41 typename std::enable_if<enabled,Node&>::type
│ │ │ │ -
42 node ()
│ │ │ │ -
43 {
│ │ │ │ -
44 return static_cast<Node&>(*this);
│ │ │ │ -
45 }
│ │ │ │ -
46
│ │ │ │ -
47 const Node& node () const
│ │ │ │ -
48 {
│ │ │ │ -
49 return static_cast<const Node&>(*this);
│ │ │ │ -
50 }
│ │ │ │ -
51
│ │ │ │ -
52 public:
│ │ │ │ -
53
│ │ │ │ -
55 template<std::size_t k>
│ │ │ │ -
56 struct Child
│ │ │ │ -
57 : public ProxiedNode::template Child<k>
│ │ │ │ -
58 {};
│ │ │ │ -
59
│ │ │ │ -
62
│ │ │ │ +
32 static transformed_type transform(const SourceNode& s, const Transformation& t)
│ │ │ │ +
33 {
│ │ │ │ +
34 return transformed_type();
│ │ │ │ +
35 }
│ │ │ │ +
36
│ │ │ │ +
37 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
│ │ │ │ +
38 {
│ │ │ │ +
39 return std::make_shared<transformed_type>();
│ │ │ │ +
40 }
│ │ │ │ +
41
│ │ │ │ +
42 };
│ │ │ │ +
43
│ │ │ │ +
44
│ │ │ │ +
45 template<typename SourceNode, typename Transformation, template<typename Child, std::size_t> class TransformedNode>
│ │ │ │ + │ │ │ │ +
47 {
│ │ │ │ +
48
│ │ │ │ +
49 static const bool recursive = true;
│ │ │ │ +
50
│ │ │ │ +
51 template<typename TC>
│ │ │ │ +
52 struct result
│ │ │ │ +
53 {
│ │ │ │ +
54 typedef TransformedNode<TC, StaticDegree<SourceNode>::value> type;
│ │ │ │ +
55 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
56 static const std::size_t degree = StaticDegree<type>::value;
│ │ │ │ +
57 };
│ │ │ │ +
58
│ │ │ │ +
59 template<typename TC>
│ │ │ │ +
60 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ +
61 {
│ │ │ │ +
62 return typename result<TC>::type(children);
│ │ │ │ +
63 }
│ │ │ │
64
│ │ │ │ -
67 template<std::size_t k,
│ │ │ │ -
68 typename std::enable_if<lazy_enabled<k>::value, int>::type = 0>
│ │ │ │ -
69 auto& child (index_constant<k> = {})
│ │ │ │ -
70 {
│ │ │ │ -
71 return node().proxiedNode().template child<k>();
│ │ │ │ -
72 }
│ │ │ │ +
65 template<typename TC>
│ │ │ │ +
66 static typename result<TC>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ +
67 {
│ │ │ │ +
68 return std::make_shared<typename result<TC>::type>(children);
│ │ │ │ +
69 }
│ │ │ │ +
70
│ │ │ │ +
71 };
│ │ │ │ +
72
│ │ │ │
73
│ │ │ │ -
75
│ │ │ │ -
78 template<std::size_t k>
│ │ │ │ -
79 const auto& child (index_constant<k> = {}) const
│ │ │ │ -
80 {
│ │ │ │ -
81 return node().proxiedNode().template child<k>();
│ │ │ │ -
82 }
│ │ │ │ -
83
│ │ │ │ -
85
│ │ │ │ -
88 template<std::size_t k,
│ │ │ │ -
89 typename std::enable_if<lazy_enabled<k>::value, int>::type = 0>
│ │ │ │ -
90 auto childStorage (index_constant<k> = {})
│ │ │ │ -
91 {
│ │ │ │ -
92 return node().proxiedNode().template childStorage<k>();
│ │ │ │ -
93 }
│ │ │ │ -
94
│ │ │ │ -
96
│ │ │ │ -
102 template<std::size_t k>
│ │ │ │ -
103 auto childStorage (index_constant<k> = {}) const
│ │ │ │ -
104 {
│ │ │ │ -
105 return node().proxiedNode().template childStorage<k>();
│ │ │ │ -
106 }
│ │ │ │ +
74 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNode>
│ │ │ │ + │ │ │ │ +
76 {
│ │ │ │ +
77
│ │ │ │ +
78 static const bool recursive = true;
│ │ │ │ +
79
│ │ │ │ +
80 template<typename TC>
│ │ │ │ +
81 struct result
│ │ │ │ +
82 {
│ │ │ │ +
83 typedef TransformedNode<TC> type;
│ │ │ │ +
84 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
85 };
│ │ │ │ +
86
│ │ │ │ +
87 template<typename TC>
│ │ │ │ +
88 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ +
89 {
│ │ │ │ +
90 return typename result<TC>::type(children);
│ │ │ │ +
91 }
│ │ │ │ +
92
│ │ │ │ +
93 template<typename TC>
│ │ │ │ +
94 static typename result<TC>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ +
95 {
│ │ │ │ +
96 return std::make_shared<typename result<TC>::type>(children);
│ │ │ │ +
97 }
│ │ │ │ +
98
│ │ │ │ +
99 };
│ │ │ │ +
100
│ │ │ │ +
101
│ │ │ │ +
102 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNode>
│ │ │ │ + │ │ │ │ +
104 {
│ │ │ │ +
105
│ │ │ │ +
106 static const bool recursive = true;
│ │ │ │
107
│ │ │ │ -
109 template<std::size_t k, class ProxyChild>
│ │ │ │ -
110 void setChild (ProxyChild&& child, typename std::enable_if<lazy_enabled<k>::value,void*>::type = 0)
│ │ │ │ -
111 {
│ │ │ │ -
112 node().proxiedNode().template setChild<k>(std::forward<ProxyChild>(child));
│ │ │ │ -
113 }
│ │ │ │ +
108 template<typename... TC>
│ │ │ │ +
109 struct result
│ │ │ │ +
110 {
│ │ │ │ +
111 typedef TransformedNode<TC...> type;
│ │ │ │ +
112 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
113 };
│ │ │ │
114
│ │ │ │ -
115 const typename ProxiedNode::NodeStorage& nodeStorage () const
│ │ │ │ -
116 {
│ │ │ │ -
117 return node().proxiedNode().nodeStorage();
│ │ │ │ -
118 }
│ │ │ │ -
119
│ │ │ │ -
120 };
│ │ │ │ -
121
│ │ │ │ -
123
│ │ │ │ -
128 template<typename ProxiedNode>
│ │ │ │ - │ │ │ │ -
130 : public StaticChildAccessors<ProxiedNode>
│ │ │ │ -
131 {
│ │ │ │ -
132
│ │ │ │ - │ │ │ │ -
134
│ │ │ │ -
135 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
│ │ │ │ -
136
│ │ │ │ -
137 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ -
138 typename std::enable_if<enabled,Node&>::type
│ │ │ │ -
139 node ()
│ │ │ │ -
140 {
│ │ │ │ -
141 return static_cast<Node&>(*this);
│ │ │ │ -
142 }
│ │ │ │ -
143
│ │ │ │ -
144 const Node& node () const
│ │ │ │ -
145 {
│ │ │ │ -
146 return static_cast<const Node&>(*this);
│ │ │ │ -
147 }
│ │ │ │ -
148
│ │ │ │ -
149 public:
│ │ │ │ -
150
│ │ │ │ -
153
│ │ │ │ -
155
│ │ │ │ -
158 template<bool enabled = !proxiedNodeIsConst,
│ │ │ │ -
159 typename std::enable_if<enabled, int>::type = 0>
│ │ │ │ -
160 auto& child (std::size_t i)
│ │ │ │ -
161 {
│ │ │ │ -
162 return node().proxiedNode().child(i);
│ │ │ │ -
163 }
│ │ │ │ -
164
│ │ │ │ -
166
│ │ │ │ -
169 const auto& child (std::size_t i) const
│ │ │ │ -
170 {
│ │ │ │ -
171 return node().proxiedNode().child(i);
│ │ │ │ -
172 }
│ │ │ │ -
173
│ │ │ │ -
175
│ │ │ │ -
178 template<bool enabled = !proxiedNodeIsConst,
│ │ │ │ -
179 typename std::enable_if<enabled, int>::type = 0>
│ │ │ │ -
180 auto childStorage (std::size_t i)
│ │ │ │ -
181 {
│ │ │ │ -
182 return node().proxiedNode().childStorage(i);
│ │ │ │ -
183 }
│ │ │ │ -
184
│ │ │ │ -
186
│ │ │ │ -
192 auto childStorage (std::size_t i) const
│ │ │ │ -
193 {
│ │ │ │ -
194 return node().proxiedNode().childStorage(i);
│ │ │ │ -
195 }
│ │ │ │ -
196
│ │ │ │ -
198 template<class ProxyChild, bool enabled = !proxiedNodeIsConst>
│ │ │ │ -
199 void setChild (std::size_t i, ProxyChild&& child, typename std::enable_if<enabled,void*>::type = 0)
│ │ │ │ -
200 {
│ │ │ │ -
201 node().proxiedNode().setChild(i, std::forward<ProxyChild>(child));
│ │ │ │ -
202 }
│ │ │ │ -
203
│ │ │ │ -
204 };
│ │ │ │ -
205
│ │ │ │ -
207 template<typename Node, typename NodeTag>
│ │ │ │ - │ │ │ │ -
209
│ │ │ │ -
211 template<typename Node>
│ │ │ │ - │ │ │ │ -
213 {
│ │ │ │ -
214 };
│ │ │ │ -
215
│ │ │ │ -
217 template<typename Node>
│ │ │ │ - │ │ │ │ -
219 : public StaticChildAccessors<Node>
│ │ │ │ -
220 {
│ │ │ │ -
221 typedef typename Node::ChildTypes ChildTypes;
│ │ │ │ -
222 typedef typename Node::NodeStorage NodeStorage;
│ │ │ │ -
223 };
│ │ │ │ -
224
│ │ │ │ -
226 template<typename Node>
│ │ │ │ - │ │ │ │ -
228 : public DynamicChildAccessors<Node>
│ │ │ │ -
229 {
│ │ │ │ -
230 typedef typename Node::ChildType ChildType;
│ │ │ │ -
231 typedef typename Node::NodeStorage NodeStorage;
│ │ │ │ -
232 };
│ │ │ │ -
233
│ │ │ │ -
235 template<typename Node>
│ │ │ │ - │ │ │ │ -
237 : public DynamicChildAccessors<Node>
│ │ │ │ -
238 {
│ │ │ │ -
239 typedef typename Node::ChildType ChildType;
│ │ │ │ -
240 typedef typename Node::NodeStorage NodeStorage;
│ │ │ │ -
241 };
│ │ │ │ -
242
│ │ │ │ -
244
│ │ │ │ -
250 template<typename Node>
│ │ │ │ - │ │ │ │ -
252 : public ProxyNodeBase<Node,NodeTag<Node>>
│ │ │ │ -
253 {
│ │ │ │ -
254 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
│ │ │ │ -
255
│ │ │ │ -
256 template <class N>
│ │ │ │ -
257 using HasStaticDegree = index_constant<N::degree()>;
│ │ │ │ -
258
│ │ │ │ -
259 template <class N>
│ │ │ │ -
260 static constexpr bool hasStaticDegree = Std::is_detected<HasStaticDegree, N>::value;
│ │ │ │ -
261
│ │ │ │ -
262 // accessor mixins need to be friends for access to proxiedNode()
│ │ │ │ -
263 friend class StaticChildAccessors<Node>;
│ │ │ │ -
264 friend class DynamicChildAccessors<Node>;
│ │ │ │ -
265
│ │ │ │ -
266 public:
│ │ │ │ -
267
│ │ │ │ -
268 typedef Node ProxiedNode;
│ │ │ │ -
269
│ │ │ │ - │ │ │ │ -
271
│ │ │ │ -
273 static const bool isLeaf = Node::isLeaf;
│ │ │ │ -
274
│ │ │ │ -
276 static const bool isPower = Node::isPower;
│ │ │ │ -
277
│ │ │ │ -
279 static const bool isComposite = Node::isComposite;
│ │ │ │ -
280
│ │ │ │ -
282 [[deprecated("Will be removed after release 2.9. Use degree()")]]
│ │ │ │ -
283 static const std::size_t CHILDREN = Dune::Std::detected_or_t<
│ │ │ │ -
284 std::integral_constant<std::size_t,std::numeric_limits<std::size_t>::max()>,
│ │ │ │ - │ │ │ │ -
286 Node
│ │ │ │ -
287 >::value;
│ │ │ │ -
288
│ │ │ │ -
289 template <class N = Node,
│ │ │ │ -
290 std::enable_if_t<hasStaticDegree<N>, int> = 0>
│ │ │ │ -
291 static constexpr auto degree ()
│ │ │ │ -
292 {
│ │ │ │ -
293 return N::degree();
│ │ │ │ -
294 }
│ │ │ │ -
295
│ │ │ │ -
296 template <class N = Node,
│ │ │ │ -
297 std::enable_if_t<not hasStaticDegree<N>, int> = 0>
│ │ │ │ -
298 auto degree () const
│ │ │ │ -
299 {
│ │ │ │ -
300 return proxiedNode().degree();
│ │ │ │ -
301 }
│ │ │ │ -
302
│ │ │ │ -
303
│ │ │ │ -
304 protected:
│ │ │ │ -
305
│ │ │ │ -
308
│ │ │ │ -
310 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ -
311 typename std::enable_if<enabled,Node&>::type
│ │ │ │ - │ │ │ │ -
313 {
│ │ │ │ -
314 return *_node;
│ │ │ │ -
315 }
│ │ │ │ -
316
│ │ │ │ -
318 const Node& proxiedNode () const
│ │ │ │ -
319 {
│ │ │ │ -
320 return *_node;
│ │ │ │ -
321 }
│ │ │ │ -
322
│ │ │ │ -
324 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ -
325 typename std::enable_if<enabled,std::shared_ptr<Node> >::type
│ │ │ │ - │ │ │ │ -
327 {
│ │ │ │ -
328 return _node;
│ │ │ │ -
329 }
│ │ │ │ -
330
│ │ │ │ -
332 std::shared_ptr<const Node> proxiedNodeStorage () const
│ │ │ │ -
333 {
│ │ │ │ -
334 return _node;
│ │ │ │ -
335 }
│ │ │ │ -
336
│ │ │ │ -
338
│ │ │ │ -
341
│ │ │ │ -
342 ProxyNode (Node& node)
│ │ │ │ -
343 : _node(stackobject_to_shared_ptr(node))
│ │ │ │ -
344 {}
│ │ │ │ -
345
│ │ │ │ -
346 ProxyNode (std::shared_ptr<Node> node)
│ │ │ │ -
347 : _node(std::move(node))
│ │ │ │ -
348 {}
│ │ │ │ -
349
│ │ │ │ -
351
│ │ │ │ -
352 private:
│ │ │ │ -
353
│ │ │ │ -
354 std::shared_ptr<Node> _node;
│ │ │ │ -
355 };
│ │ │ │ -
356
│ │ │ │ -
358
│ │ │ │ -
359 } // namespace TypeTree
│ │ │ │ -
360} //namespace Dune
│ │ │ │ -
361
│ │ │ │ -
362#endif // DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ -
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition: nodeinterface.hh:85
│ │ │ │ -
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition: nodeinterface.hh:76
│ │ │ │ +
115 template<typename... TC>
│ │ │ │ +
116 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ +
117 {
│ │ │ │ +
118 return typename result<TC...>::type(children...);
│ │ │ │ +
119 }
│ │ │ │ +
120
│ │ │ │ +
121 template<typename... TC>
│ │ │ │ +
122 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ +
123 {
│ │ │ │ +
124 return std::make_shared<typename result<TC...>::type>(children...);
│ │ │ │ +
125 }
│ │ │ │ +
126
│ │ │ │ +
127 };
│ │ │ │ +
128
│ │ │ │ +
130
│ │ │ │ +
131 } // namespace TypeTree
│ │ │ │ +
132} //namespace Dune
│ │ │ │ +
133
│ │ │ │ +
134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition: nodeinterface.hh:113
│ │ │ │
Definition: accumulate_static.hh:13
│ │ │ │ -
Tag designating a leaf node.
Definition: nodetags.hh:16
│ │ │ │ -
Tag designating a power node.
Definition: nodetags.hh:19
│ │ │ │ -
Tag designating a power node with runtime degree.
Definition: nodetags.hh:22
│ │ │ │ -
Tag designating a composite node.
Definition: nodetags.hh:25
│ │ │ │ -
Base class for nodes acting as a proxy for an existing node.
Definition: proxynode.hh:253
│ │ │ │ -
ProxyNode(Node &node)
Definition: proxynode.hh:342
│ │ │ │ -
Dune::TypeTree::NodeTag< Node > NodeTag
Definition: proxynode.hh:270
│ │ │ │ -
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition: proxynode.hh:279
│ │ │ │ -
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition: proxynode.hh:273
│ │ │ │ -
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition: proxynode.hh:276
│ │ │ │ -
auto degree() const
Definition: proxynode.hh:298
│ │ │ │ -
std::enable_if< enabled, Node & >::type proxiedNode()
Returns the proxied node.
Definition: proxynode.hh:312
│ │ │ │ -
static const std::size_t CHILDREN
The number of children.
Definition: proxynode.hh:283
│ │ │ │ -
std::shared_ptr< const Node > proxiedNodeStorage() const
Returns the storage of the proxied node (const version).
Definition: proxynode.hh:332
│ │ │ │ -
Node ProxiedNode
Definition: proxynode.hh:268
│ │ │ │ -
std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage()
Returns the storage of the proxied node.
Definition: proxynode.hh:326
│ │ │ │ -
static constexpr auto degree()
Definition: proxynode.hh:291
│ │ │ │ -
ProxyNode(std::shared_ptr< Node > node)
Definition: proxynode.hh:346
│ │ │ │ -
const Node & proxiedNode() const
Returns the proxied node (const version).
Definition: proxynode.hh:318
│ │ │ │ -
Mixin class providing methods for child access with compile-time parameter.
Definition: proxynode.hh:28
│ │ │ │ -
auto & child(index_constant< k >={})
Returns the i-th child.
Definition: proxynode.hh:69
│ │ │ │ -
void setChild(ProxyChild &&child, typename std::enable_if< lazy_enabled< k >::value, void * >::type=0)
Sets the i-th child to the passed-in value.
Definition: proxynode.hh:110
│ │ │ │ -
const ProxiedNode::NodeStorage & nodeStorage() const
Definition: proxynode.hh:115
│ │ │ │ -
auto childStorage(index_constant< k >={})
Returns the storage of the i-th child.
Definition: proxynode.hh:90
│ │ │ │ -
const auto & child(index_constant< k >={}) const
Returns the i-th child (const version).
Definition: proxynode.hh:79
│ │ │ │ -
auto childStorage(index_constant< k >={}) const
Returns the storage of the i-th child (const version).
Definition: proxynode.hh:103
│ │ │ │ -
Access to the type and storage type of the i-th child.
Definition: proxynode.hh:58
│ │ │ │ -
Mixin class providing methods for child access with run-time parameter.
Definition: proxynode.hh:131
│ │ │ │ -
auto & child(std::size_t i)
Returns the i-th child.
Definition: proxynode.hh:160
│ │ │ │ -
auto childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition: proxynode.hh:192
│ │ │ │ -
void setChild(std::size_t i, ProxyChild &&child, typename std::enable_if< enabled, void * >::type=0)
Sets the i-th child to the passed-in value.
Definition: proxynode.hh:199
│ │ │ │ -
const auto & child(std::size_t i) const
Returns the i-th child (const version).
Definition: proxynode.hh:169
│ │ │ │ -
auto childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition: proxynode.hh:180
│ │ │ │ -
Tag-based dispatch to appropriate base class that provides necessary functionality.
Definition: proxynode.hh:208
│ │ │ │ -
Node::NodeStorage NodeStorage
Definition: proxynode.hh:222
│ │ │ │ -
Node::ChildTypes ChildTypes
Definition: proxynode.hh:221
│ │ │ │ -
Node::NodeStorage NodeStorage
Definition: proxynode.hh:231
│ │ │ │ -
Node::ChildType ChildType
Definition: proxynode.hh:230
│ │ │ │ -
Node::NodeStorage NodeStorage
Definition: proxynode.hh:240
│ │ │ │ -
Node::ChildType ChildType
Definition: proxynode.hh:239
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:25
│ │ │ │ +
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:32
│ │ │ │ +
static const bool recursive
Definition: simpletransformationdescriptors.hh:27
│ │ │ │ +
std::shared_ptr< transformed_type > transformed_storage_type
Definition: simpletransformationdescriptors.hh:30
│ │ │ │ +
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition: simpletransformationdescriptors.hh:37
│ │ │ │ +
TransformedNode transformed_type
Definition: simpletransformationdescriptors.hh:29
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:47
│ │ │ │ +
static result< TC >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: simpletransformationdescriptors.hh:66
│ │ │ │ +
static const bool recursive
Definition: simpletransformationdescriptors.hh:49
│ │ │ │ +
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition: simpletransformationdescriptors.hh:60
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:53
│ │ │ │ +
TransformedNode< TC, StaticDegree< SourceNode >::value > type
Definition: simpletransformationdescriptors.hh:54
│ │ │ │ +
static const std::size_t degree
Definition: simpletransformationdescriptors.hh:56
│ │ │ │ +
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:55
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:76
│ │ │ │ +
static const bool recursive
Definition: simpletransformationdescriptors.hh:78
│ │ │ │ +
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition: simpletransformationdescriptors.hh:88
│ │ │ │ +
static result< TC >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition: simpletransformationdescriptors.hh:94
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:82
│ │ │ │ +
TransformedNode< TC > type
Definition: simpletransformationdescriptors.hh:83
│ │ │ │ +
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:84
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:104
│ │ │ │ +
static const bool recursive
Definition: simpletransformationdescriptors.hh:106
│ │ │ │ +
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: simpletransformationdescriptors.hh:122
│ │ │ │ +
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition: simpletransformationdescriptors.hh:116
│ │ │ │ +
Definition: simpletransformationdescriptors.hh:110
│ │ │ │ +
std::shared_ptr< type > storage_type
Definition: simpletransformationdescriptors.hh:112
│ │ │ │ +
TransformedNode< TC... > type
Definition: simpletransformationdescriptors.hh:111
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -4,466 +4,251 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * typetree │ │ │ │ │ -proxynode.hh │ │ │ │ │ +simpletransformationdescriptors.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3 │ │ │ │ │ - 4#ifndef DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ - 5#define DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ + 4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ + 5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ 6 │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ 13 │ │ │ │ │ - 14namespace Dune { │ │ │ │ │ - 15 namespace TypeTree { │ │ │ │ │ - 16 │ │ │ │ │ - 22 template │ │ │ │ │ - 23 class ProxyNode; │ │ │ │ │ - 24 │ │ │ │ │ - 26 template │ │ │ │ │ -27 class StaticChildAccessors │ │ │ │ │ - 28 { │ │ │ │ │ - 29 │ │ │ │ │ - 30 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ + 14 │ │ │ │ │ + 15namespace Dune { │ │ │ │ │ + 16 namespace TypeTree { │ │ │ │ │ + 17 │ │ │ │ │ + 23 template │ │ │ │ │ +24 struct SimpleLeafNodeTransformation │ │ │ │ │ + 25 { │ │ │ │ │ + 26 │ │ │ │ │ +27 static const bool recursive = false; │ │ │ │ │ + 28 │ │ │ │ │ +29 typedef TransformedNode transformed_type; │ │ │ │ │ +30 typedef std::shared_ptr transformed_storage_type; │ │ │ │ │ 31 │ │ │ │ │ - 32 template │ │ │ │ │ - 33 struct lazy_enabled │ │ │ │ │ - 34 { │ │ │ │ │ - 35 static const bool value = !proxiedNodeIsConst; │ │ │ │ │ - 36 }; │ │ │ │ │ - 37 │ │ │ │ │ - 38 typedef ProxyNode Node; │ │ │ │ │ - 39 │ │ │ │ │ - 40 template │ │ │ │ │ - 41 typename std::enable_if::type │ │ │ │ │ - 42 node () │ │ │ │ │ - 43 { │ │ │ │ │ - 44 return static_cast(*this); │ │ │ │ │ - 45 } │ │ │ │ │ - 46 │ │ │ │ │ - 47 const Node& node () const │ │ │ │ │ - 48 { │ │ │ │ │ - 49 return static_cast(*this); │ │ │ │ │ - 50 } │ │ │ │ │ - 51 │ │ │ │ │ - 52 public: │ │ │ │ │ - 53 │ │ │ │ │ - 55 template │ │ │ │ │ -56 struct Child │ │ │ │ │ - 57 : public ProxiedNode::template Child │ │ │ │ │ - 58 {}; │ │ │ │ │ - 59 │ │ │ │ │ - 62 │ │ │ │ │ +32 static transformed_type transform(const SourceNode& s, const Transformation& │ │ │ │ │ +t) │ │ │ │ │ + 33 { │ │ │ │ │ + 34 return transformed_type(); │ │ │ │ │ + 35 } │ │ │ │ │ + 36 │ │ │ │ │ +37 static transformed_storage_type transform_storage(std::shared_ptr s, const Transformation& t) │ │ │ │ │ + 38 { │ │ │ │ │ + 39 return std::make_shared(); │ │ │ │ │ + 40 } │ │ │ │ │ + 41 │ │ │ │ │ + 42 }; │ │ │ │ │ + 43 │ │ │ │ │ + 44 │ │ │ │ │ + 45 template class TransformedNode> │ │ │ │ │ +46 struct SimplePowerNodeTransformation │ │ │ │ │ + 47 { │ │ │ │ │ + 48 │ │ │ │ │ +49 static const bool recursive = true; │ │ │ │ │ + 50 │ │ │ │ │ + 51 template │ │ │ │ │ +52 struct result │ │ │ │ │ + 53 { │ │ │ │ │ +54 typedef TransformedNode::value> type; │ │ │ │ │ +55 typedef std::shared_ptr storage_type; │ │ │ │ │ +56 static const std::size_t degree = StaticDegree::value; │ │ │ │ │ + 57 }; │ │ │ │ │ + 58 │ │ │ │ │ + 59 template │ │ │ │ │ +60 static typename result::type transform(const SourceNode& s, const │ │ │ │ │ +Transformation& t, const std::array,result::degree>& │ │ │ │ │ +children) │ │ │ │ │ + 61 { │ │ │ │ │ + 62 return typename result::type(children); │ │ │ │ │ + 63 } │ │ │ │ │ 64 │ │ │ │ │ - 67 template::value, int>::type = 0> │ │ │ │ │ -69 auto& child (index_constant = {}) │ │ │ │ │ - 70 { │ │ │ │ │ - 71 return node().proxiedNode().template child(); │ │ │ │ │ - 72 } │ │ │ │ │ + 65 template │ │ │ │ │ +66 static typename result::storage_type transform_storage(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, const std::array,result::degree>& children) │ │ │ │ │ + 67 { │ │ │ │ │ + 68 return std::make_shared::type>(children); │ │ │ │ │ + 69 } │ │ │ │ │ + 70 │ │ │ │ │ + 71 }; │ │ │ │ │ + 72 │ │ │ │ │ 73 │ │ │ │ │ - 75 │ │ │ │ │ - 78 template │ │ │ │ │ -79 const auto& child (index_constant = {}) const │ │ │ │ │ - 80 { │ │ │ │ │ - 81 return node().proxiedNode().template child(); │ │ │ │ │ - 82 } │ │ │ │ │ - 83 │ │ │ │ │ - 85 │ │ │ │ │ - 88 template::value, int>::type = 0> │ │ │ │ │ -90 auto childStorage (index_constant = {}) │ │ │ │ │ - 91 { │ │ │ │ │ - 92 return node().proxiedNode().template childStorage(); │ │ │ │ │ - 93 } │ │ │ │ │ - 94 │ │ │ │ │ - 96 │ │ │ │ │ - 102 template │ │ │ │ │ -103 auto childStorage (index_constant = {}) const │ │ │ │ │ + 74 template class TransformedNode> │ │ │ │ │ +75 struct SimpleDynamicPowerNodeTransformation │ │ │ │ │ + 76 { │ │ │ │ │ + 77 │ │ │ │ │ +78 static const bool recursive = true; │ │ │ │ │ + 79 │ │ │ │ │ + 80 template │ │ │ │ │ +81 struct result │ │ │ │ │ + 82 { │ │ │ │ │ +83 typedef TransformedNode type; │ │ │ │ │ +84 typedef std::shared_ptr storage_type; │ │ │ │ │ + 85 }; │ │ │ │ │ + 86 │ │ │ │ │ + 87 template │ │ │ │ │ +88 static typename result::type transform(const SourceNode& s, const │ │ │ │ │ +Transformation& t, const std::vector>& children) │ │ │ │ │ + 89 { │ │ │ │ │ + 90 return typename result::type(children); │ │ │ │ │ + 91 } │ │ │ │ │ + 92 │ │ │ │ │ + 93 template │ │ │ │ │ +94 static typename result::storage_type transform_storage(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, const std:: │ │ │ │ │ +vector>& children) │ │ │ │ │ + 95 { │ │ │ │ │ + 96 return std::make_shared::type>(children); │ │ │ │ │ + 97 } │ │ │ │ │ + 98 │ │ │ │ │ + 99 }; │ │ │ │ │ + 100 │ │ │ │ │ + 101 │ │ │ │ │ + 102 template class TransformedNode> │ │ │ │ │ +103 struct SimpleCompositeNodeTransformation │ │ │ │ │ 104 { │ │ │ │ │ - 105 return node().proxiedNode().template childStorage(); │ │ │ │ │ - 106 } │ │ │ │ │ + 105 │ │ │ │ │ +106 static const bool recursive = true; │ │ │ │ │ 107 │ │ │ │ │ - 109 template │ │ │ │ │ -110 void setChild (ProxyChild&& child, typename std:: │ │ │ │ │ -enable_if::value,void*>::type = 0) │ │ │ │ │ - 111 { │ │ │ │ │ - 112 node().proxiedNode().template setChild(std::forward │ │ │ │ │ -(child)); │ │ │ │ │ - 113 } │ │ │ │ │ + 108 template │ │ │ │ │ +109 struct result │ │ │ │ │ + 110 { │ │ │ │ │ +111 typedef TransformedNode type; │ │ │ │ │ +112 typedef std::shared_ptr storage_type; │ │ │ │ │ + 113 }; │ │ │ │ │ 114 │ │ │ │ │ -115 const typename ProxiedNode::NodeStorage& nodeStorage () const │ │ │ │ │ - 116 { │ │ │ │ │ - 117 return node().proxiedNode().nodeStorage(); │ │ │ │ │ - 118 } │ │ │ │ │ - 119 │ │ │ │ │ - 120 }; │ │ │ │ │ - 121 │ │ │ │ │ - 123 │ │ │ │ │ - 128 template │ │ │ │ │ -129 class DynamicChildAccessors │ │ │ │ │ - 130 : public StaticChildAccessors │ │ │ │ │ - 131 { │ │ │ │ │ - 132 │ │ │ │ │ - 133 typedef ProxyNode Node; │ │ │ │ │ - 134 │ │ │ │ │ - 135 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ - 136 │ │ │ │ │ - 137 template │ │ │ │ │ - 138 typename std::enable_if::type │ │ │ │ │ - 139 node () │ │ │ │ │ - 140 { │ │ │ │ │ - 141 return static_cast(*this); │ │ │ │ │ - 142 } │ │ │ │ │ - 143 │ │ │ │ │ - 144 const Node& node () const │ │ │ │ │ - 145 { │ │ │ │ │ - 146 return static_cast(*this); │ │ │ │ │ - 147 } │ │ │ │ │ - 148 │ │ │ │ │ - 149 public: │ │ │ │ │ - 150 │ │ │ │ │ - 153 │ │ │ │ │ - 155 │ │ │ │ │ - 158 template::type = 0> │ │ │ │ │ -160 auto& child (std::size_t i) │ │ │ │ │ - 161 { │ │ │ │ │ - 162 return node().proxiedNode().child(i); │ │ │ │ │ - 163 } │ │ │ │ │ - 164 │ │ │ │ │ - 166 │ │ │ │ │ -169 const auto& child (std::size_t i) const │ │ │ │ │ - 170 { │ │ │ │ │ - 171 return node().proxiedNode().child(i); │ │ │ │ │ - 172 } │ │ │ │ │ - 173 │ │ │ │ │ - 175 │ │ │ │ │ - 178 template::type = 0> │ │ │ │ │ -180 auto childStorage (std::size_t i) │ │ │ │ │ - 181 { │ │ │ │ │ - 182 return node().proxiedNode().childStorage(i); │ │ │ │ │ - 183 } │ │ │ │ │ - 184 │ │ │ │ │ - 186 │ │ │ │ │ -192 auto childStorage (std::size_t i) const │ │ │ │ │ - 193 { │ │ │ │ │ - 194 return node().proxiedNode().childStorage(i); │ │ │ │ │ - 195 } │ │ │ │ │ - 196 │ │ │ │ │ - 198 template │ │ │ │ │ -199 void setChild (std::size_t i, ProxyChild&& child, typename std:: │ │ │ │ │ -enable_if::type = 0) │ │ │ │ │ - 200 { │ │ │ │ │ - 201 node().proxiedNode().setChild(i, std::forward(child)); │ │ │ │ │ - 202 } │ │ │ │ │ - 203 │ │ │ │ │ - 204 }; │ │ │ │ │ - 205 │ │ │ │ │ - 207 template │ │ │ │ │ -208 struct ProxyNodeBase; │ │ │ │ │ - 209 │ │ │ │ │ - 211 template │ │ │ │ │ -212 struct ProxyNodeBase │ │ │ │ │ - 213 { │ │ │ │ │ - 214 }; │ │ │ │ │ - 215 │ │ │ │ │ - 217 template │ │ │ │ │ -218 struct ProxyNodeBase │ │ │ │ │ - 219 : public StaticChildAccessors │ │ │ │ │ - 220 { │ │ │ │ │ -221 typedef typename Node::ChildTypes ChildTypes; │ │ │ │ │ -222 typedef typename Node::NodeStorage NodeStorage; │ │ │ │ │ - 223 }; │ │ │ │ │ - 224 │ │ │ │ │ - 226 template │ │ │ │ │ -227 struct ProxyNodeBase │ │ │ │ │ - 228 : public DynamicChildAccessors │ │ │ │ │ - 229 { │ │ │ │ │ -230 typedef typename Node::ChildType ChildType; │ │ │ │ │ -231 typedef typename Node::NodeStorage NodeStorage; │ │ │ │ │ - 232 }; │ │ │ │ │ - 233 │ │ │ │ │ - 235 template │ │ │ │ │ -236 struct ProxyNodeBase │ │ │ │ │ - 237 : public DynamicChildAccessors │ │ │ │ │ - 238 { │ │ │ │ │ -239 typedef typename Node::ChildType ChildType; │ │ │ │ │ -240 typedef typename Node::NodeStorage NodeStorage; │ │ │ │ │ - 241 }; │ │ │ │ │ - 242 │ │ │ │ │ - 244 │ │ │ │ │ - 250 template │ │ │ │ │ -251 class ProxyNode │ │ │ │ │ - 252 : public ProxyNodeBase> │ │ │ │ │ - 253 { │ │ │ │ │ - 254 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ - 255 │ │ │ │ │ - 256 template │ │ │ │ │ - 257 using HasStaticDegree = index_constant; │ │ │ │ │ - 258 │ │ │ │ │ - 259 template │ │ │ │ │ -260 static constexpr bool hasStaticDegree = Std::is_detected::value; │ │ │ │ │ - 261 │ │ │ │ │ - 262 // accessor mixins need to be friends for access to proxiedNode() │ │ │ │ │ - 263 friend class StaticChildAccessors; │ │ │ │ │ - 264 friend class DynamicChildAccessors; │ │ │ │ │ - 265 │ │ │ │ │ - 266 public: │ │ │ │ │ - 267 │ │ │ │ │ -268 typedef Node ProxiedNode; │ │ │ │ │ - 269 │ │ │ │ │ -270 typedef Dune::TypeTree::NodeTag NodeTag; │ │ │ │ │ - 271 │ │ │ │ │ -273 static const bool isLeaf = Node::isLeaf; │ │ │ │ │ - 274 │ │ │ │ │ -276 static const bool isPower = Node::isPower; │ │ │ │ │ - 277 │ │ │ │ │ -279 static const bool isComposite = Node::isComposite; │ │ │ │ │ - 280 │ │ │ │ │ - 282 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -283 static const std::size_t CHILDREN = Dune::Std::detected_or_t< │ │ │ │ │ - 284 std::integral_constant::max │ │ │ │ │ -()>, │ │ │ │ │ - 285 StaticDegree, │ │ │ │ │ - 286 Node │ │ │ │ │ - 287 >::value; │ │ │ │ │ - 288 │ │ │ │ │ - 289 template , int> = 0> │ │ │ │ │ -291 static constexpr auto degree () │ │ │ │ │ - 292 { │ │ │ │ │ - 293 return N::degree(); │ │ │ │ │ - 294 } │ │ │ │ │ - 295 │ │ │ │ │ - 296 template , int> = 0> │ │ │ │ │ -298 auto degree () const │ │ │ │ │ - 299 { │ │ │ │ │ - 300 return proxiedNode().degree(); │ │ │ │ │ - 301 } │ │ │ │ │ - 302 │ │ │ │ │ - 303 │ │ │ │ │ - 304 protected: │ │ │ │ │ - 305 │ │ │ │ │ - 308 │ │ │ │ │ - 310 template │ │ │ │ │ - 311 typename std::enable_if::type │ │ │ │ │ -312 proxiedNode () │ │ │ │ │ - 313 { │ │ │ │ │ - 314 return *_node; │ │ │ │ │ - 315 } │ │ │ │ │ - 316 │ │ │ │ │ -318 const Node& proxiedNode () const │ │ │ │ │ - 319 { │ │ │ │ │ - 320 return *_node; │ │ │ │ │ - 321 } │ │ │ │ │ - 322 │ │ │ │ │ - 324 template │ │ │ │ │ - 325 typename std::enable_if >::type │ │ │ │ │ -326 proxiedNodeStorage () │ │ │ │ │ - 327 { │ │ │ │ │ - 328 return _node; │ │ │ │ │ - 329 } │ │ │ │ │ - 330 │ │ │ │ │ -332 std::shared_ptr proxiedNodeStorage () const │ │ │ │ │ - 333 { │ │ │ │ │ - 334 return _node; │ │ │ │ │ - 335 } │ │ │ │ │ - 336 │ │ │ │ │ - 338 │ │ │ │ │ - 341 │ │ │ │ │ -342 ProxyNode (Node& node) │ │ │ │ │ - 343 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ - 344 {} │ │ │ │ │ - 345 │ │ │ │ │ -346 ProxyNode (std::shared_ptr node) │ │ │ │ │ - 347 : _node(std::move(node)) │ │ │ │ │ - 348 {} │ │ │ │ │ - 349 │ │ │ │ │ - 351 │ │ │ │ │ - 352 private: │ │ │ │ │ - 353 │ │ │ │ │ - 354 std::shared_ptr _node; │ │ │ │ │ - 355 }; │ │ │ │ │ - 356 │ │ │ │ │ - 358 │ │ │ │ │ - 359 } // namespace TypeTree │ │ │ │ │ - 360} //namespace Dune │ │ │ │ │ - 361 │ │ │ │ │ - 362#endif // DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ -nodetags.hh │ │ │ │ │ + 115 template │ │ │ │ │ +116 static typename result::type transform(const SourceNode& s, const │ │ │ │ │ +Transformation& t, std::shared_ptr... children) │ │ │ │ │ + 117 { │ │ │ │ │ + 118 return typename result::type(children...); │ │ │ │ │ + 119 } │ │ │ │ │ + 120 │ │ │ │ │ + 121 template │ │ │ │ │ +122 static typename result::storage_type transform_storage(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, std::shared_ptr... │ │ │ │ │ +children) │ │ │ │ │ + 123 { │ │ │ │ │ + 124 return std::make_shared::type>(children...); │ │ │ │ │ + 125 } │ │ │ │ │ + 126 │ │ │ │ │ + 127 }; │ │ │ │ │ + 128 │ │ │ │ │ + 130 │ │ │ │ │ + 131 } // namespace TypeTree │ │ │ │ │ + 132} //namespace Dune │ │ │ │ │ + 133 │ │ │ │ │ + 134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ nodeinterface.hh │ │ │ │ │ -Dune::TypeTree::degree │ │ │ │ │ -std::size_t degree(const Node &node) │ │ │ │ │ -Returns the degree of node as run time information. │ │ │ │ │ -Definition: nodeinterface.hh:85 │ │ │ │ │ -Dune::TypeTree::NodeTag │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -Definition: nodeinterface.hh:76 │ │ │ │ │ +nodetags.hh │ │ │ │ │ Dune::TypeTree::StaticDegree │ │ │ │ │ decltype(Node::degree()) StaticDegree │ │ │ │ │ Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ integral_constant. │ │ │ │ │ Definition: nodeinterface.hh:113 │ │ │ │ │ Dune │ │ │ │ │ Definition: accumulate_static.hh:13 │ │ │ │ │ -Dune::TypeTree::LeafNodeTag │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -Definition: nodetags.hh:16 │ │ │ │ │ -Dune::TypeTree::PowerNodeTag │ │ │ │ │ -Tag designating a power node. │ │ │ │ │ -Definition: nodetags.hh:19 │ │ │ │ │ -Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ -Tag designating a power node with runtime degree. │ │ │ │ │ -Definition: nodetags.hh:22 │ │ │ │ │ -Dune::TypeTree::CompositeNodeTag │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -Definition: nodetags.hh:25 │ │ │ │ │ -Dune::TypeTree::ProxyNode │ │ │ │ │ -Base class for nodes acting as a proxy for an existing node. │ │ │ │ │ -Definition: proxynode.hh:253 │ │ │ │ │ -Dune::TypeTree::ProxyNode::ProxyNode │ │ │ │ │ -ProxyNode(Node &node) │ │ │ │ │ -Definition: proxynode.hh:342 │ │ │ │ │ -Dune::TypeTree::ProxyNode::NodeTag │ │ │ │ │ -Dune::TypeTree::NodeTag< Node > NodeTag │ │ │ │ │ -Definition: proxynode.hh:270 │ │ │ │ │ -Dune::TypeTree::ProxyNode::isComposite │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a composite in the dune-typetree. │ │ │ │ │ -Definition: proxynode.hh:279 │ │ │ │ │ -Dune::TypeTree::ProxyNode::isLeaf │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -Definition: proxynode.hh:273 │ │ │ │ │ -Dune::TypeTree::ProxyNode::isPower │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -Definition: proxynode.hh:276 │ │ │ │ │ -Dune::TypeTree::ProxyNode::degree │ │ │ │ │ -auto degree() const │ │ │ │ │ -Definition: proxynode.hh:298 │ │ │ │ │ -Dune::TypeTree::ProxyNode::proxiedNode │ │ │ │ │ -std::enable_if< enabled, Node & >::type proxiedNode() │ │ │ │ │ -Returns the proxied node. │ │ │ │ │ -Definition: proxynode.hh:312 │ │ │ │ │ -Dune::TypeTree::ProxyNode::CHILDREN │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -Definition: proxynode.hh:283 │ │ │ │ │ -Dune::TypeTree::ProxyNode::proxiedNodeStorage │ │ │ │ │ -std::shared_ptr< const Node > proxiedNodeStorage() const │ │ │ │ │ -Returns the storage of the proxied node (const version). │ │ │ │ │ -Definition: proxynode.hh:332 │ │ │ │ │ -Dune::TypeTree::ProxyNode::ProxiedNode │ │ │ │ │ -Node ProxiedNode │ │ │ │ │ -Definition: proxynode.hh:268 │ │ │ │ │ -Dune::TypeTree::ProxyNode::proxiedNodeStorage │ │ │ │ │ -std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage() │ │ │ │ │ -Returns the storage of the proxied node. │ │ │ │ │ -Definition: proxynode.hh:326 │ │ │ │ │ -Dune::TypeTree::ProxyNode::degree │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -Definition: proxynode.hh:291 │ │ │ │ │ -Dune::TypeTree::ProxyNode::ProxyNode │ │ │ │ │ -ProxyNode(std::shared_ptr< Node > node) │ │ │ │ │ -Definition: proxynode.hh:346 │ │ │ │ │ -Dune::TypeTree::ProxyNode::proxiedNode │ │ │ │ │ -const Node & proxiedNode() const │ │ │ │ │ -Returns the proxied node (const version). │ │ │ │ │ -Definition: proxynode.hh:318 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors │ │ │ │ │ -Mixin class providing methods for child access with compile-time parameter. │ │ │ │ │ -Definition: proxynode.hh:28 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::child │ │ │ │ │ -auto & child(index_constant< k >={}) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -Definition: proxynode.hh:69 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::setChild │ │ │ │ │ -void setChild(ProxyChild &&child, typename std::enable_if< lazy_enabled< k >:: │ │ │ │ │ -value, void * >::type=0) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -Definition: proxynode.hh:110 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::nodeStorage │ │ │ │ │ -const ProxiedNode::NodeStorage & nodeStorage() const │ │ │ │ │ -Definition: proxynode.hh:115 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::childStorage │ │ │ │ │ -auto childStorage(index_constant< k >={}) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -Definition: proxynode.hh:90 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::child │ │ │ │ │ -const auto & child(index_constant< k >={}) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -Definition: proxynode.hh:79 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::childStorage │ │ │ │ │ -auto childStorage(index_constant< k >={}) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -Definition: proxynode.hh:103 │ │ │ │ │ -Dune::TypeTree::StaticChildAccessors::Child │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -Definition: proxynode.hh:58 │ │ │ │ │ -Dune::TypeTree::DynamicChildAccessors │ │ │ │ │ -Mixin class providing methods for child access with run-time parameter. │ │ │ │ │ -Definition: proxynode.hh:131 │ │ │ │ │ -Dune::TypeTree::DynamicChildAccessors::child │ │ │ │ │ -auto & child(std::size_t i) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -Definition: proxynode.hh:160 │ │ │ │ │ -Dune::TypeTree::DynamicChildAccessors::childStorage │ │ │ │ │ -auto childStorage(std::size_t i) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -Definition: proxynode.hh:192 │ │ │ │ │ -Dune::TypeTree::DynamicChildAccessors::setChild │ │ │ │ │ -void setChild(std::size_t i, ProxyChild &&child, typename std::enable_if< │ │ │ │ │ -enabled, void * >::type=0) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -Definition: proxynode.hh:199 │ │ │ │ │ -Dune::TypeTree::DynamicChildAccessors::child │ │ │ │ │ -const auto & child(std::size_t i) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -Definition: proxynode.hh:169 │ │ │ │ │ -Dune::TypeTree::DynamicChildAccessors::childStorage │ │ │ │ │ -auto childStorage(std::size_t i) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -Definition: proxynode.hh:180 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase │ │ │ │ │ -Tag-based dispatch to appropriate base class that provides necessary │ │ │ │ │ -functionality. │ │ │ │ │ -Definition: proxynode.hh:208 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>::NodeStorage │ │ │ │ │ -Node::NodeStorage NodeStorage │ │ │ │ │ -Definition: proxynode.hh:222 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>::ChildTypes │ │ │ │ │ -Node::ChildTypes ChildTypes │ │ │ │ │ -Definition: proxynode.hh:221 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>::NodeStorage │ │ │ │ │ -Node::NodeStorage NodeStorage │ │ │ │ │ -Definition: proxynode.hh:231 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>::ChildType │ │ │ │ │ -Node::ChildType ChildType │ │ │ │ │ -Definition: proxynode.hh:230 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>::NodeStorage │ │ │ │ │ -Node::NodeStorage NodeStorage │ │ │ │ │ -Definition: proxynode.hh:240 │ │ │ │ │ -Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>::ChildType │ │ │ │ │ -Node::ChildType ChildType │ │ │ │ │ -Definition: proxynode.hh:239 │ │ │ │ │ +Dune::TypeTree::SimpleLeafNodeTransformation │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:25 │ │ │ │ │ +Dune::TypeTree::SimpleLeafNodeTransformation::transform │ │ │ │ │ +static transformed_type transform(const SourceNode &s, const Transformation &t) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:32 │ │ │ │ │ +Dune::TypeTree::SimpleLeafNodeTransformation::recursive │ │ │ │ │ +static const bool recursive │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:27 │ │ │ │ │ +Dune::TypeTree::SimpleLeafNodeTransformation::transformed_storage_type │ │ │ │ │ +std::shared_ptr< transformed_type > transformed_storage_type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:30 │ │ │ │ │ +Dune::TypeTree::SimpleLeafNodeTransformation::transform_storage │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:37 │ │ │ │ │ +Dune::TypeTree::SimpleLeafNodeTransformation::transformed_type │ │ │ │ │ +TransformedNode transformed_type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:29 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:47 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::transform_storage │ │ │ │ │ +static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC │ │ │ │ │ +>, result< TC >::degree > &children) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:66 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::recursive │ │ │ │ │ +static const bool recursive │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:49 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::transform │ │ │ │ │ +static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ +&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:60 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::result │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:53 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::result::type │ │ │ │ │ +TransformedNode< TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:54 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::result::degree │ │ │ │ │ +static const std::size_t degree │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:56 │ │ │ │ │ +Dune::TypeTree::SimplePowerNodeTransformation::result::storage_type │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:55 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:76 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation::recursive │ │ │ │ │ +static const bool recursive │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:78 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform │ │ │ │ │ +static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ +&t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:88 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform_storage │ │ │ │ │ +static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC │ │ │ │ │ +> > &children) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:94 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:82 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::type │ │ │ │ │ +TransformedNode< TC > type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:83 │ │ │ │ │ +Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::storage_type │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:84 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:104 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation::recursive │ │ │ │ │ +static const bool recursive │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:106 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation::transform_storage │ │ │ │ │ +static result< TC... >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:122 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation::transform │ │ │ │ │ +static result< TC... >::type transform(const SourceNode &s, const │ │ │ │ │ +Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:116 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation::result │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:110 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation::result::storage_type │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:112 │ │ │ │ │ +Dune::TypeTree::SimpleCompositeNodeTransformation::result::type │ │ │ │ │ +TransformedNode< TC... > type │ │ │ │ │ +Definition: simpletransformationdescriptors.hh:111 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00091.html │ │ │ │ @@ -215,16 +215,16 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
)
│ │ │ │
│ │ │ │ │ │ │ │

Apply visitor to TypeTree.

│ │ │ │ -
│ │ │ │ - │ │ │ │ +
│ │ │ │ + │ │ │ │

This function applies the given visitor to the given tree. Both visitor and tree may be const or non-const (if the compiler supports rvalue references, they may even be a non-const temporary).

│ │ │ │
Note
The visitor must implement the interface laid out by DefaultVisitor (most easily achieved by inheriting from it) and specify the required type of tree traversal (static or dynamic) by inheriting from either StaticTraversal or DynamicTraversal.
│ │ │ │
Parameters
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
treeThe tree the visitor will be applied to.
visitorThe visitor to apply to the tree.
│ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00923.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::or_< result_type > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type using ||. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::or_< result_type >

Statically combine two values of type result_type using ||.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00927.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::or_< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 || r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00931.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::and_< result_type > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type using &&. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::and_< result_type >

Statically combine two values of type result_type using &&.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00935.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::and_< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 && r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00939.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::plus< result_type > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type using +. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::plus< result_type >

Statically combine two values of type result_type using +.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00943.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::plus< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 + r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00947.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::minus< result_type > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type using -. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::minus< result_type >

Statically combine two values of type result_type using -.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00951.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::minus< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 - r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00955.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::multiply< result_type > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type using *. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::multiply< result_type >

Statically combine two values of type result_type using *.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00959.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::multiply< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 * r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00963.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::min< result_type > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type by returning their minimum. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::min< result_type >

Statically combine two values of type result_type by returning their minimum.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00967.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::min< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 < r2 ? r1 : r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00971.html │ │ │ │ @@ -71,26 +71,26 @@ │ │ │ │
Dune::TypeTree::max< result_type > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically combine two values of type result_type by returning their maximum. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  reduce
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename result_type>
│ │ │ │ struct Dune::TypeTree::max< result_type >

Statically combine two values of type result_type by returning their maximum.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00975.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Static Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::max< result_type >::reduce< r1, r2 > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const result_type result = r1 > r2 ? r1 : r2
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01015.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically accumulate a value over the nodes of a TypeTree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef Functor::result_type result_type
 The result type of the computation. More...
 
│ │ │ │ @@ -195,15 +195,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

The accumulated result of the computation.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01067.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::TypeAccumulationPolicy< Functor, Reduction, StartType, ParentChildReduction, ReductionAlgorithm > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -213,15 +213,15 @@ │ │ │ │

│ │ │ │ Public Types

typedef Functor functor
 
typedef Reduction sibling_reduction
 
│ │ │ │
│ │ │ │

The initial result type. This type will be feed as first operand to the reduction operators when doing the first accumulation (and there is no calculated result to accumulate with yet).

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01071.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::AccumulateType< Tree, Policy > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Statically accumulate a type over the nodes of a TypeTree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ +

#include <dune/typetree/accumulate_static.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, NodeTag< Tree > >::type type
 The accumulated result of the computation. More...
 
│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

The accumulated result of the computation.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01075.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │
Dune::TypeTree::CompositeNode< Children > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class for composite nodes based on variadic templates. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/compositenode.hh>

│ │ │ │ +

#include <dune/typetree/compositenode.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Child
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ @@ -841,15 +841,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Mark this class as a non power in the dune-typetree.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01079.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::CompositeNode< Children >::Child< k > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Access to the type and storage type of the i-th child. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/compositenode.hh>

│ │ │ │ +

#include <dune/typetree/compositenode.hh>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

The type of the child.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01083.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
Dune::TypeTree::DynamicPowerNode< T > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Collect multiple instances of type T within a dune-typetree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/dynamicpowernode.hh>

│ │ │ │ +

#include <dune/typetree/dynamicpowernode.hh>

│ │ │ │

│ │ │ │ Public Types

typedef std::tuple_element< k, ChildTypes >::type Type
 The type of the child. More...
 
typedef std::tuple_element< k, ChildTypes >::type type
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -769,15 +769,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Mark this class as a power in the dune-typetree.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01087.html │ │ │ │ @@ -69,28 +69,28 @@ │ │ │ │
Dune::TypeTree::Exception Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class for all TypeTree exceptions. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/exceptions.hh>

│ │ │ │ +

#include <dune/typetree/exceptions.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::Exception:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Detailed Description

│ │ │ │

Base class for all TypeTree exceptions.

│ │ │ │

The documentation for this class was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01091.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │
Dune::TypeTree::FilteredCompositeNode< Node, Filter > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class for composite nodes representing a filtered view on an underlying composite node. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filteredcompositenode.hh>

│ │ │ │ +

#include <dune/typetree/filteredcompositenode.hh>

│ │ │ │

│ │ │ │ Public Types

typedef DynamicPowerNodeTag NodeTag
 The type tag that describes the node. More...
 
typedef T ChildType
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Child
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ @@ -715,15 +715,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Mark this class as a non power in the dune-typetree.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01099.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::FilteredCompositeNode< Node, Filter >::Child< k > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Access to the type and storage type of the i-th child. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filteredcompositenode.hh>

│ │ │ │ +

#include <dune/typetree/filteredcompositenode.hh>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

The type of the child.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01103.html │ │ │ │ @@ -69,20 +69,20 @@ │ │ │ │
Dune::TypeTree::FilterEntry< new_k, old_k > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

A filter entry describing the mapping of one child in the filtered node. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │

Detailed Description

│ │ │ │
template<std::size_t new_k, std::size_t old_k>
│ │ │ │ struct Dune::TypeTree::FilterEntry< new_k, old_k >

A filter entry describing the mapping of one child in the filtered node.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01107.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
Dune::TypeTree::FilterResult< FilterEntries > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

The result of a filter. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │

│ │ │ │ Public Types

typedef OriginalChild::Type Type
 The type of the child. More...
 
typedef OriginalChild::type type
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  apply
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -137,15 +137,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01111.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::FilterResult< FilterEntries >::apply< Node > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef std::tuple< typename Node::template Child< FilterEntries::original_index >... > Children
 
typedef std::tuple< typename Node::template Child< FilterEntries::original_index >::Type... > ChildTypes
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01115.html │ │ │ │ @@ -69,19 +69,19 @@ │ │ │ │
Dune::TypeTree::SimpleFilterTag Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Tag describing a simple filter that can only decide whether or not to include a single given child. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │

Detailed Description

│ │ │ │

Tag describing a simple filter that can only decide whether or not to include a single given child.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01119.html │ │ │ │ @@ -69,19 +69,19 @@ │ │ │ │
Dune::TypeTree::AdvancedFilterTag Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Tag describing an advanced filter that has full control over the construction of the list of FilterEntries. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │

Detailed Description

│ │ │ │

Tag describing an advanced filter that has full control over the construction of the list of FilterEntries.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01123.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::TypeTree::AdvancedFilter Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Base class for advanced filters. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::AdvancedFilter:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Filter tag for deciding on filter application mechanism.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01127.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::AdvancedFilter::apply< Node, Children > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Apply this filter to the given node and children. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef implementation defined type
 The result of the filtering process. More...
 
│ │ │ │ @@ -104,15 +104,15 @@ │ │ │ │ │ │ │ │

The result of the filtering process.

│ │ │ │

This type must be a model of FilterResult.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01131.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::TypeTree::SimpleFilter Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Default simple filter that accepts any node and leaves its child structure unchanged. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Filter tag for deciding on filter application mechanism.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01135.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::SimpleFilter::validate< Node > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Validates the combination of filter and node. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │

│ │ │ │ Classes

struct  apply
 Applies the filter to the given child node. More...
 
struct  validate
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const bool value = true
 True if the combination of filter and node is valid. More...
 
│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

True if the combination of filter and node is valid.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01139.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::SimpleFilter::apply< Child, new_index, old_index > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Applies the filter to the given child node. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const bool value = true
 True if the child will be included in the filtered node. More...
 
│ │ │ │ @@ -120,15 +120,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

True if the child will be included in the filtered node.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01159.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::IndexFilter< indices > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Filter class for FilteredCompositeNode that selects the children with the given indices. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::IndexFilter< indices >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -118,15 +118,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Filter tag for deciding on filter application mechanism.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01179.html │ │ │ │ @@ -71,27 +71,27 @@ │ │ │ │
Dune::TypeTree::filter< Filter > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Adapter class that takes a SimpleFilter, validated it and turns it into an AdvancedFilter. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  apply
 Apply the filter. More...
 
│ │ │ │

Detailed Description

│ │ │ │
template<typename Filter>
│ │ │ │ struct Dune::TypeTree::filter< Filter >

Adapter class that takes a SimpleFilter, validated it and turns it into an AdvancedFilter.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01183.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::filter< Filter >::apply< Node, Children > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Apply the filter. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/filters.hh>

│ │ │ │ +

#include <dune/typetree/filters.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef filter_helper< Filter, 0, 0, Children... >::template apply ::type type
 
│ │ │ │

Detailed Description

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01187.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Classes | │ │ │ │ Public Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::FixedCapacityStackView< T > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/fixedcapacitystack.hh>

│ │ │ │ +

#include <dune/typetree/fixedcapacitystack.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::FixedCapacityStackView< T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -473,15 +473,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01195.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Member Functions | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::FixedCapacityStack< T, capacity > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/fixedcapacitystack.hh>

│ │ │ │ +

#include <dune/typetree/fixedcapacitystack.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::FixedCapacityStack< T, capacity >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -468,15 +468,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01207.html │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child > class TransformedNodeTemplate>
│ │ │ │
│ │ │ │ template<typename TC >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
typedef std::shared_ptr<type> Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::storage_typetypedef std::shared_ptr<type> Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::storage_type
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ @@ -114,15 +114,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child > class TransformedNodeTemplate>
│ │ │ │
│ │ │ │ template<typename TC >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
typedef TransformedNodeTemplate<TC>::type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::typetypedef TransformedNodeTemplate<TC>::type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::type
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Member Data Documentation

│ │ │ │ @@ -136,15 +136,15 @@ │ │ │ │
│ │ │ │ template<typename TC >
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
const std::size_t Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::degree = StaticDegree<type>::valueconst std::size_t Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::degree = StaticDegree<type>::value
│ │ │ │
│ │ │ │ static
│ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01211.html │ │ │ │ @@ -84,19 +84,19 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

static result< TC >::type transform (const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
static result< TC >::type transform (const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
 
static result< TC >::type transform (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
static result< TC >::type transform (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
 
static result< TC >::storage_type transform_storage (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
static result< TC >::storage_type transform_storage (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const bool recursive
 
│ │ │ │ @@ -107,29 +107,29 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -149,29 +149,29 @@ │ │ │ │
│ │ │ │
│ │ │ │
static result< TC >::type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform static result< TC >::type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform (const SourceNode & s,
const Transformation & t,
const std::array< std::shared_ptr< TC >, result< TC >::degree > & const std::array< std::shared_ptr< TC >, result< TC >::degree > & children 
)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -191,29 +191,29 @@ │ │ │ │
│ │ │ │
│ │ │ │
static result< TC >::type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform static result< TC >::type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform (std::shared_ptr< const SourceNode > s,
const Transformation & t,
const std::array< std::shared_ptr< TC >, result< TC >::degree > & const std::array< std::shared_ptr< TC >, result< TC >::degree > & children 
)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -234,15 +234,15 @@ │ │ │ │
│ │ │ │
│ │ │ │
static result< TC >::storage_type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform_storage static result< TC >::storage_type Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform_storage (std::shared_ptr< const SourceNode > s,
const Transformation & t,
const std::array< std::shared_ptr< TC >, result< TC >::degree > & const std::array< std::shared_ptr< TC >, result< TC >::degree > & children 
)
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
const bool Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::recursiveconst bool Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::recursive
│ │ │ │
│ │ │ │ staticinherited
│ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01219.html │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child > class TransformedNodeTemplate>
│ │ │ │
│ │ │ │ template<typename TC >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
typedef std::shared_ptr<type> Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::storage_typetypedef std::shared_ptr<type> Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::storage_type
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ @@ -108,15 +108,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child > class TransformedNodeTemplate>
│ │ │ │
│ │ │ │ template<typename TC >
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
typedef TransformedNodeTemplate<TC>::type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::typetypedef TransformedNodeTemplate<TC>::type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::type
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file:
    │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01223.html │ │ │ │ @@ -84,19 +84,19 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

    │ │ │ │ Static Public Member Functions

    static result< TC >::type transform (const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
    static result< TC >::type transform (const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
     
    static result< TC >::type transform (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
    static result< TC >::type transform (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
     
    static result< TC >::storage_type transform_storage (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
    static result< TC >::storage_type transform_storage (std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
     
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    │ │ │ │ Static Public Attributes

    static const bool recursive
     
    │ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -149,15 +149,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │
    static result< TC >::type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform static result< TC >::type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform (const SourceNode & s,
    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -191,15 +191,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │
    static result< TC >::type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform static result< TC >::type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform (std::shared_ptr< const SourceNode > s,
    │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -234,15 +234,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │
    static result< TC >::storage_type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform_storage static result< TC >::storage_type Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform_storage (std::shared_ptr< const SourceNode > s,
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
    const bool Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::recursiveconst bool Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::recursive
    │ │ │ │
    │ │ │ │ staticinherited
    │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01231.html │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ template<typename SourceNode , typename Transformation , template< typename... > class TransformedNodeTemplate>
    │ │ │ │
    │ │ │ │ template<typename... TC>
    │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
    typedef std::shared_ptr<type> Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::storage_typetypedef std::shared_ptr<type> Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::storage_type
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ @@ -108,15 +108,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ template<typename SourceNode , typename Transformation , template< typename... > class TransformedNodeTemplate>
    │ │ │ │
    │ │ │ │ template<typename... TC>
    │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
    typedef TransformedNodeTemplate<TC...>::type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::typetypedef TransformedNodeTemplate<TC...>::type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >::type
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file:
      │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01235.html │ │ │ │ @@ -84,19 +84,19 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

      │ │ │ │ Static Public Member Functions

      static result< TC... >::type transform (const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
      static result< TC... >::type transform (const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
       
      static result< TC... >::type transform (std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
      static result< TC... >::type transform (std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
       
      static result< TC... >::storage_type transform_storage (std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
      static result< TC... >::storage_type transform_storage (std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
       
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Static Public Attributes

      static const bool recursive
       
      │ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -149,15 +149,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │
      static result< TC... >::type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform static result< TC... >::type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform (const SourceNode & s,
      │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -191,15 +191,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │
      static result< TC... >::type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform static result< TC... >::type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform (std::shared_ptr< const SourceNode > s,
      │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -234,15 +234,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │
      static result< TC... >::storage_type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform_storage static result< TC... >::storage_type Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::transform_storage (std::shared_ptr< const SourceNode > s,
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      const bool Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::recursiveconst bool Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::template result >::recursive
      │ │ │ │
      │ │ │ │ staticinherited
      │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01239.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │
      Dune::TypeTree::LeafNode Class Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Base class for leaf nodes in a dune-typetree. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/leafnode.hh>

      │ │ │ │ +

      #include <dune/typetree/leafnode.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef LeafNodeTag NodeTag
       The type tag that describes a LeafNode. More...
       
      │ │ │ │ @@ -282,15 +282,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Mark this class as a non power in the dune-typetree.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01243.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
      Dune::TypeTree::NodeInterface Struct Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Interface for nodes in a dune-typetree. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/nodeinterface.hh>

      │ │ │ │ +

      #include <dune/typetree/nodeinterface.hh>

      │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -277,15 +277,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Whether this is a power node in the dune-typetree.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01247.html │ │ │ │ @@ -69,19 +69,19 @@ │ │ │ │
      Dune::TypeTree::LeafNodeTag Struct Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Tag designating a leaf node. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/nodetags.hh>

      │ │ │ │ +

      #include <dune/typetree/nodetags.hh>

      │ │ │ │

      Detailed Description

      │ │ │ │

      Tag designating a leaf node.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01251.html │ │ │ │ @@ -69,19 +69,19 @@ │ │ │ │
      Dune::TypeTree::PowerNodeTag Struct Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Tag designating a power node. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/nodetags.hh>

      │ │ │ │ +

      #include <dune/typetree/nodetags.hh>

      │ │ │ │

      Detailed Description

      │ │ │ │

      Tag designating a power node.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01255.html │ │ │ │ @@ -69,19 +69,19 @@ │ │ │ │
      Dune::TypeTree::DynamicPowerNodeTag Struct Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Tag designating a power node with runtime degree. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/nodetags.hh>

      │ │ │ │ +

      #include <dune/typetree/nodetags.hh>

      │ │ │ │

      Detailed Description

      │ │ │ │

      Tag designating a power node with runtime degree.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01259.html │ │ │ │ @@ -69,19 +69,19 @@ │ │ │ │
      Dune::TypeTree::CompositeNodeTag Struct Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Tag designating a composite node. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/nodetags.hh>

      │ │ │ │ +

      #include <dune/typetree/nodetags.hh>

      │ │ │ │

      Detailed Description

      │ │ │ │

      Tag designating a composite node.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01263.html │ │ │ │ @@ -68,23 +68,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ Classes
      │ │ │ │
      Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ +

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │

      │ │ │ │ Public Types

      typedef ImplementationDefined NodeTag
       The type tag that describes what kind of node this is. More...
       
      typedef ImplementationDefined NodeStorage
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  result
       
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01267.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ +

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type
       
      │ │ │ │

      Member Typedef Documentation

      │ │ │ │ @@ -88,23 +88,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename, typename, std::size_t > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef TransformedNode<SourceNode,TC,StaticDegree<SourceNode>::value> Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >::typetypedef TransformedNode<SourceNode,TC,StaticDegree<SourceNode>::value> Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >::type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01271.html │ │ │ │ @@ -68,23 +68,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ Classes
      │ │ │ │
      Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ +

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  result
       
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01275.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ +

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode< SourceNode, TC > type
       
      │ │ │ │

      Member Typedef Documentation

      │ │ │ │ @@ -88,23 +88,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename, typename > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef TransformedNode<SourceNode,TC> Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >::typetypedef TransformedNode<SourceNode,TC> Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >::type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01279.html │ │ │ │ @@ -68,23 +68,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ Classes
      │ │ │ │
      Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ +

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  result
       
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01283.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ +

      #include <dune/typetree/powercompositenodetransformationtemplates.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode< SourceNode, TC... > type
       
      │ │ │ │

      Member Typedef Documentation

      │ │ │ │ @@ -88,23 +88,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename, typename... > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename... TC>
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef TransformedNode<SourceNode,TC...> Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >::typetypedef TransformedNode<SourceNode,TC...> Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC >::type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01287.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │
      Dune::TypeTree::PowerNode< T, k > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Collect k instances of type T within a dune-typetree. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powernode.hh>

      │ │ │ │ +

      #include <dune/typetree/powernode.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  Child
       Access to the type and storage type of the i-th child. More...
       
      │ │ │ │ @@ -1138,15 +1138,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Mark this class as a power in the dune-typetree.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01291.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
      Dune::TypeTree::PowerNode< T, k >::Child< i > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Access to the type and storage type of the i-th child. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/powernode.hh>

      │ │ │ │ +

      #include <dune/typetree/powernode.hh>

      │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -129,15 +129,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      The type of the child.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01295.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │
      Dune::TypeTree::ProxyNode< Node > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Base class for nodes acting as a proxy for an existing node. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::ProxyNode< Node >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -529,15 +529,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Mark this class as a non power in the dune-typetree.

      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01299.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
      Dune::TypeTree::StaticChildAccessors< ProxiedNode > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Mixin class providing methods for child access with compile-time parameter. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::StaticChildAccessors< ProxiedNode >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -326,15 +326,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Sets the i-th child to the passed-in value.

      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01307.html │ │ │ │ @@ -69,30 +69,30 @@ │ │ │ │
      Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Access to the type and storage type of the i-th child. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │

      Detailed Description

      │ │ │ │
      template<typename ProxiedNode>
      │ │ │ │ template<std::size_t k>
      │ │ │ │ struct Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k >

      Access to the type and storage type of the i-th child.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01311.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │
      Dune::TypeTree::DynamicChildAccessors< ProxiedNode > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Mixin class providing methods for child access with run-time parameter. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::DynamicChildAccessors< ProxiedNode >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -513,15 +513,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Sets the i-th child to the passed-in value.

      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01315.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      Detailed Description

      │ │ │ │
      template<typename Node, typename NodeTag>
      │ │ │ │ struct Dune::TypeTree::ProxyNodeBase< Node, NodeTag >

      Tag-based dispatch to appropriate base class that provides necessary functionality.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01319.html │ │ │ │ @@ -69,20 +69,20 @@ │ │ │ │
      Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      ProxyNode base class for LeafNode. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │

      Detailed Description

      │ │ │ │
      template<typename Node>
      │ │ │ │ struct Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag >

      ProxyNode base class for LeafNode.

      │ │ │ │

      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01323.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
      Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      ProxyNode base class for CompositeNode. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -329,15 +329,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Sets the i-th child to the passed-in value.

      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01327.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
      Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      ProxyNode base class for PowerNode. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -508,15 +508,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Sets the i-th child to the passed-in value.

      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01331.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
      Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      ProxyNode base class for DynamicPowerNode. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/proxynode.hh>

      │ │ │ │ +

      #include <dune/typetree/proxynode.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -508,15 +508,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Sets the i-th child to the passed-in value.

      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01335.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
      Dune::TypeTree::SimpleLeafNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │

      │ │ │ │ Public Types

      typedef T Type
       The type of the child. More...
       
      typedef T type
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -228,15 +228,15 @@ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode transformed_type
       
      typedef std::shared_ptr< transformed_typetransformed_storage_type
       
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01339.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
      Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  result
       
      │ │ │ │ │ │ │ │

      │ │ │ │ @@ -211,15 +211,15 @@ │ │ │ │

      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01343.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Types | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
      Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child, std::size_t > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode< TC, StaticDegree< SourceNode >::value > type
       
      typedef std::shared_ptr< typestorage_type
       
      │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef std::shared_ptr<type> Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::storage_typetypedef std::shared_ptr<type> Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::storage_type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ @@ -114,15 +114,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child, std::size_t > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef TransformedNode<TC, StaticDegree<SourceNode>::value> Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::typetypedef TransformedNode<TC, StaticDegree<SourceNode>::value> Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Member Data Documentation

      │ │ │ │ @@ -136,28 +136,28 @@ │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      const std::size_t Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::degree = StaticDegree<type>::valueconst std::size_t Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::degree = StaticDegree<type>::value
      │ │ │ │
      │ │ │ │ static
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01347.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
      Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  result
       
      │ │ │ │ │ │ │ │

      │ │ │ │ @@ -211,15 +211,15 @@ │ │ │ │

      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01351.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode< TC > type
       
      typedef std::shared_ptr< typestorage_type
       
      │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef std::shared_ptr<type> Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::storage_typetypedef std::shared_ptr<type> Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::storage_type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ @@ -108,23 +108,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename Child > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename TC >
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef TransformedNode<TC> Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::typetypedef TransformedNode<TC> Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01355.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
      Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Classes

      struct  result
       
      │ │ │ │ │ │ │ │

      │ │ │ │ @@ -211,15 +211,15 @@ │ │ │ │

      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01359.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ +

      #include <dune/typetree/simpletransformationdescriptors.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename... > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename... TC>
      │ │ │ │

      │ │ │ │ Public Types

      typedef TransformedNode< TC... > type
       
      typedef std::shared_ptr< typestorage_type
       
      │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef std::shared_ptr<type> Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::storage_typetypedef std::shared_ptr<type> Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::storage_type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ @@ -108,23 +108,23 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ template<typename SourceNode , typename Transformation , template< typename... > class TransformedNode>
      │ │ │ │
      │ │ │ │ template<typename... TC>
      │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
      typedef TransformedNode<TC...> Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::typetypedef TransformedNode<TC...> Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >::type
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01363.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
      Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      Transform a TypeTree. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/transformation.hh>

      │ │ │ │ +

      #include <dune/typetree/transformation.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -390,15 +390,15 @@ │ │ │ │

      │ │ │ │ Public Types

      typedef transformed_type type
       The type of the transformed tree. More...
       
      typedef type Type
      │ │ │ │
      │ │ │ │

      Apply transformation to storage type of an existing tree, returning a heap-allocated storage type instance of the transformed tree.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01371.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Member Functions | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::Detail::ContainerFactory< LeafToValue > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treecontainer.hh>

      │ │ │ │ +

      #include <dune/typetree/treecontainer.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -150,15 +150,15 @@ │ │ │ │ │ │ │ │

      │ │ │ │ Public Member Functions

       ContainerFactory (LeafToValue leafToValue)
       Create ContainerFactory. More...
       
      template<class Node >
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01375.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Member Functions | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::Detail::TreeContainerVectorBackend< Container > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treecontainer.hh>

      │ │ │ │ +

      #include <dune/typetree/treecontainer.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -341,15 +341,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Resize the (nested) container depending on the degree of the tree nodes.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01379.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Member Functions | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treecontainer.hh>

      │ │ │ │ +

      #include <dune/typetree/treecontainer.hh>

      │ │ │ │

      │ │ │ │ Public Member Functions

       TreeContainerVectorBackend (Container &&container)
       Move the passed container into the internal storage. More...
       
      template<class Tree , TypeTreeConcept< Tree > = true>
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Member Functions

      template<class Node >
      auto operator() (const Node &node) const
       
      │ │ │ │ @@ -109,15 +109,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01383.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
      Dune::TypeTree::HybridTreePath< T > Class Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │

      A hybrid version of TreePath that supports both compile time and run time indices. │ │ │ │ More...

      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      using index_sequence = std::index_sequence_for< T... >
       An index_sequence for the entries in this HybridTreePath. More...
       
      │ │ │ │ @@ -569,15 +569,15 @@ │ │ │ │
      │ │ │ │ │ │ │ │

      Get the size (length) of this path.

      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01387.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathSize< typename > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01391.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathPushBack< typename, size_t > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01395.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathPushFront< typename, size_t > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01399.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01403.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathFront< typename > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01407.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01411.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathPopFront< typename > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01415.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathConcat< typename, typename > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01419.html │ │ │ │ @@ -66,26 +66,26 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01423.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef HybridTreePath< index_constant< i >..., index_constant< k > > type
       
      │ │ │ │

      Member Typedef Documentation

      │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01427.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef HybridTreePath< index_constant< k >, index_constant< i >... > type
       
      │ │ │ │

      Member Typedef Documentation

      │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │
      │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01431.html │ │ │ │ @@ -66,26 +66,26 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01435.html │ │ │ │ @@ -66,27 +66,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01439.html │ │ │ │ @@ -66,26 +66,26 @@ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > > Struct Template Reference
      │ │ │ │
      │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │
      │ │ │ │ Inheritance diagram for Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >:
      │ │ │ │
      │ │ │ │
      Inheritance graph
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
      │ │ │ │
      The documentation for this struct was generated from the following file: │ │ │ │
      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01443.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
      │ │ │ │ Public Types | │ │ │ │ List of all members
      │ │ │ │
      Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... > Struct Template Reference
      │ │ │ │ │ │ │ │
      │ │ │ │ │ │ │ │ -

      #include <dune/typetree/treepath.hh>

      │ │ │ │ +

      #include <dune/typetree/treepath.hh>

      │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

      │ │ │ │ Public Types

      typedef HybridTreePath< index_constant< i >... > type
       
      │ │ │ │

      Member Typedef Documentation

      │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01447.html │ │ │ │ @@ -66,27 +66,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... > Struct Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/typetree/treepath.hh>

    │ │ │ │ +

    #include <dune/typetree/treepath.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01451.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
    │ │ │ │ Public Types | │ │ │ │ List of all members
    │ │ │ │
    Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/typetree/treepath.hh>

    │ │ │ │ +

    #include <dune/typetree/treepath.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef HybridTreePath< index_constant< i >... > type
     
    │ │ │ │

    Member Typedef Documentation

    │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01455.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
    │ │ │ │ Public Types | │ │ │ │ List of all members
    │ │ │ │
    Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/typetree/treepath.hh>

    │ │ │ │ +

    #include <dune/typetree/treepath.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef HybridTreePath< index_constant< i >..., index_constant< k >... > type
     
    │ │ │ │

    Member Typedef Documentation

    │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01459.html │ │ │ │ @@ -66,15 +66,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    Dune::first_type< T > Struct Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01463.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
    │ │ │ │ Public Types | │ │ │ │ List of all members
    │ │ │ │
    Dune::first_type< T0, T... > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/typetree/typetraits.hh>

    │ │ │ │ +

    #include <dune/typetree/typetraits.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef T0 type
     
    │ │ │ │

    Member Typedef Documentation

    │ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01467.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::has_node_tag< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -184,15 +184,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

True if class T defines a NodeTag.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01471.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_node_tag< T >::yes Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │

│ │ │ │ Classes

struct  no
 
struct  yes
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [1]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01475.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_node_tag< T >::no Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [2]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01479.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::has_node_tag_value< T, V > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -186,15 +186,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

True if class T defines a NodeTag of type V.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01483.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_node_tag_value< T, V >::maybe< N > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │

│ │ │ │ Classes

struct  maybe
 
struct  no
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [N+1]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01487.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_node_tag_value< T, V >::yes Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [2]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01491.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_node_tag_value< T, V >::no Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [1]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01495.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::has_implementation_tag< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -184,15 +184,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

True if class T defines an ImplementationTag.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01499.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_implementation_tag< T >::yes Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │

│ │ │ │ Classes

struct  no
 
struct  yes
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [1]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01503.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_implementation_tag< T >::no Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [2]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01507.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::has_implementation_tag_value< T, V > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -186,15 +186,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

True if class T defines an ImplementationTag of type V.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01511.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_implementation_tag_value< T, V >::maybe< N > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │

│ │ │ │ Classes

struct  maybe
 
struct  no
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [N+1]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01515.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_implementation_tag_value< T, V >::yes Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [2]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01519.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Attributes | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::has_implementation_tag_value< T, V >::no Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Attributes

char dummy [1]
 
│ │ │ │

Member Data Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01523.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::AlwaysVoid< typename > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef void type
 
│ │ │ │

Member Typedef Documentation

│ │ │ │ @@ -94,15 +94,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01527.html │ │ │ │ @@ -69,20 +69,20 @@ │ │ │ │
Dune::TypeTree::meta_function Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Marker tag declaring a meta function. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │

Detailed Description

│ │ │ │

Marker tag declaring a meta function.

│ │ │ │

Just inherit from this type to cause lazy evaluation

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01531.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::lazy_evaluate< F > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Helper meta function to delay evaluation of F. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef F::type type
 
│ │ │ │

Detailed Description

│ │ │ │ @@ -100,15 +100,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01535.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::lazy_identity< F > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Identity function. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef F type
 
│ │ │ │

Detailed Description

│ │ │ │ @@ -100,15 +100,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01539.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::evaluate_if_meta_function< F > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
 
│ │ │ │

Detailed Description

│ │ │ │ @@ -100,15 +100,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01543.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
Dune::TypeTree::IsTreePath< T > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Check if type represents a tree path. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/typetraits.hh>

│ │ │ │ +

#include <dune/typetree/typetraits.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::IsTreePath< T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -90,15 +90,15 @@ │ │ │ │
Template Parameters
│ │ │ │ │ │ │ │ │ │ │ │
TCheck if this type represents a tree path
│ │ │ │
│ │ │ │
│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01547.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::TreeInfo< Tree, Tag > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Struct for obtaining some basic structural information about a TypeTree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/utility.hh>

│ │ │ │ +

#include <dune/typetree/utility.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -177,15 +177,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

The total number of nodes in the TypeTree.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01551.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::DefaultVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Visitor interface and base class for TypeTree visitors. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::DefaultVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -442,15 +442,15 @@ │ │ │ │

│ │ │ │ Static Public Attributes

static const std::size_t depth = NodeInfo::depth
 The depth of the TypeTree. More...
 
static const std::size_t nodeCount = NodeInfo::nodeCount
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01555.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::DefaultPairVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::DefaultPairVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -506,15 +506,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01559.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::Experimental::DefaultHybridVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::Experimental::DefaultHybridVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -491,15 +491,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
Returns
The result of applying this visitor to u.
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01563.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │
Dune::TypeTree::VisitDirectChildren Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Mixin base class for visitors that only want to visit the direct children of a node. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::VisitDirectChildren:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -93,15 +93,15 @@ │ │ │ │  Template struct for determining whether or not to visit a given child. More...
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Mixin base class for visitors that only want to visit the direct children of a node.

│ │ │ │

This mixin class will reject all children presented to it, causing the algorithm to only visit the root node and call DefaultVisitor::beforeChild() and DefaultVisitor::afterChild() for its direct children.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01567.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::VisitDirectChildren::VisitChild< Node1, Child1, Node2, Child2, TreePath > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Template struct for determining whether or not to visit a given child. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const bool value = false
 Do not visit any child. More...
 
│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Do not visit any child.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01571.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │
Dune::TypeTree::VisitTree Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Mixin base class for visitors that want to visit the complete tree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::VisitTree:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -96,15 +96,15 @@ │ │ │ │  Template struct for determining whether or not to visit a given child. More...
│ │ │ │   │ │ │ │ │ │ │ │

Detailed Description

│ │ │ │

Mixin base class for visitors that want to visit the complete tree.

│ │ │ │

This mixin class will accept all children presented to it and thus make the iterator traverse the entire tree.

│ │ │ │

The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01575.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::VisitTree::VisitChild< Node1, Child1, Node2, Child2, TreePath > Struct Template Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │

Template struct for determining whether or not to visit a given child. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const bool value = true
 Visit any child. More...
 
│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Visit any child.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01579.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::StaticTraversal Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Mixin base class for visitors that require a static TreePath during traversal. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::StaticTraversal:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Use the static tree traversal algorithm.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01583.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::DynamicTraversal Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Mixin base class for visitors that only need a dynamic TreePath during traversal. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Attributes

static const TreePathType::Type treePathType = TreePathType::dynamic
 Use the dynamic tree traversal algorithm. More...
 
│ │ │ │ @@ -110,15 +110,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Use the dynamic tree traversal algorithm.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01587.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::TreeVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Convenience base class for visiting the entire tree. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::TreeVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -433,15 +433,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01591.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::DirectChildrenVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Convenience base class for visiting the direct children of a node. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::DirectChildrenVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -433,15 +433,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01595.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::TreePairVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Convenience base class for visiting an entire tree pair. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::TreePairVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -490,15 +490,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01599.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::TypeTree::DirectChildrenPairVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Convenience base class for visiting the direct children of a node pair. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::DirectChildrenPairVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -490,15 +490,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01603.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::Experimental::Info::LeafCounterVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::Experimental::Info::LeafCounterVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -675,15 +675,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Use the static tree traversal algorithm.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01607.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::Experimental::Info::NodeCounterVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::Experimental::Info::NodeCounterVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -722,15 +722,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Use the static tree traversal algorithm.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01611.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::Experimental::Info::DepthVisitor Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/visitor.hh>

│ │ │ │ +

#include <dune/typetree/visitor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::Experimental::Info::DepthVisitor:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -556,15 +556,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Use the static tree traversal algorithm.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e74c06688912037f4b476b8dc05fab9.html │ │ │ │ @@ -77,68 +77,68 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

file  accumulate_static.hh [code]
file  accumulate_static.hh [code]
 
file  childextraction.hh [code]
file  childextraction.hh [code]
 
file  compositenode.hh [code]
file  compositenode.hh [code]
 
file  dynamicpowernode.hh [code]
file  dynamicpowernode.hh [code]
 
file  exceptions.hh [code]
 TypeTree-specific exceptions.
file  exceptions.hh [code]
 TypeTree-specific exceptions.
 
file  filteredcompositenode.hh [code]
file  filteredcompositenode.hh [code]
 
file  filters.hh [code]
file  filters.hh [code]
 
file  fixedcapacitystack.hh [code]
file  fixedcapacitystack.hh [code]
 
file  generictransformationdescriptors.hh [code]
 
file  leafnode.hh [code]
file  leafnode.hh [code]
 
file  nodeinterface.hh [code]
file  nodeinterface.hh [code]
 
file  nodetags.hh [code]
file  nodetags.hh [code]
 
file  pairtraversal.hh [code]
file  pairtraversal.hh [code]
 
file  powercompositenodetransformationtemplates.hh [code]
file  powercompositenodetransformationtemplates.hh [code]
 
file  powernode.hh [code]
file  powernode.hh [code]
 
file  proxynode.hh [code]
file  proxynode.hh [code]
 
file  simpletransformationdescriptors.hh [code]
file  simpletransformationdescriptors.hh [code]
 
file  transformation.hh [code]
file  transformation.hh [code]
 
file  transformationutilities.hh [code]
file  transformationutilities.hh [code]
 
file  traversal.hh [code]
file  traversal.hh [code]
 
file  traversalutilities.hh [code]
file  traversalutilities.hh [code]
 
file  treecontainer.hh [code]
file  treecontainer.hh [code]
 
file  treepath.hh [code]
file  treepath.hh [code]
 
file  typetraits.hh [code]
file  typetraits.hh [code]
 
file  typetree.hh [code]
file  typetree.hh [code]
 
file  utility.hh [code]
file  utility.hh [code]
 
file  visitor.hh [code]
file  visitor.hh [code]
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz │ │ │ │ ├── dune-typetree.tag │ │ │ │ │ ├── dune-typetree.tag │ │ │ │ │ │ @@ -9,18 +9,18 @@ │ │ │ │ │ │ modules.txt │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/doc/doxygen/ │ │ │ │ │ │ a00005.html │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ accumulate_static.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00038.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ + a00083.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ Dune::TypeTree::or_ │ │ │ │ │ │ Dune::TypeTree::or_::reduce │ │ │ │ │ │ Dune::TypeTree::and_ │ │ │ │ │ │ Dune::TypeTree::and_::reduce │ │ │ │ │ │ Dune::TypeTree::plus │ │ │ │ │ │ Dune::TypeTree::plus::reduce │ │ │ │ │ │ Dune::TypeTree::minus │ │ │ │ │ │ @@ -43,32 +43,32 @@ │ │ │ │ │ │ a00100.html │ │ │ │ │ │ a470e7e00fc4aa26e0bf46ea22a8cf2e2 │ │ │ │ │ │ (Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ static const result_type │ │ │ │ │ │ result │ │ │ │ │ │ - a00038.html │ │ │ │ │ │ + a00083.html │ │ │ │ │ │ acd23380b12c1509b3b3f31b893af75c8 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ static const result_type │ │ │ │ │ │ child_result │ │ │ │ │ │ - a00038.html │ │ │ │ │ │ + a00083.html │ │ │ │ │ │ a5c902ae13e1b03f88e252f9fd9f85952 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ childextraction.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00083.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ + a00041.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ typename impl::_Child< Node, indices... >::type │ │ │ │ │ │ Child │ │ │ │ │ │ a00092.html │ │ │ │ │ │ ga8136d392450f4308b90a04a143e20feb │ │ │ │ │ │ @@ -109,57 +109,57 @@ │ │ │ │ │ │ gae4133f4dba113143455fcab49d8a103e │ │ │ │ │ │ (Node &&node, HybridTreePath< Indices... > treePath) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ compositenode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00032.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ + a00011.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/childextraction.hh │ │ │ │ │ │ + dune/typetree/typetraits.hh │ │ │ │ │ │ Dune::TypeTree::CompositeNode │ │ │ │ │ │ Dune::TypeTree::CompositeNode::Child │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ dynamicpowernode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00050.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ + a00080.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ + dune/typetree/typetraits.hh │ │ │ │ │ │ Dune::TypeTree::DynamicPowerNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ exceptions.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00008.html │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ Dune::TypeTree::Exception │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ filteredcompositenode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00041.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/filters.hh │ │ │ │ │ │ + a00056.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/filters.hh │ │ │ │ │ │ Dune::TypeTree::FilteredCompositeNode │ │ │ │ │ │ Dune::TypeTree::FilteredCompositeNode::Child │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ filters.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00017.html │ │ │ │ │ │ + a00038.html │ │ │ │ │ │ Dune::TypeTree::FilterEntry │ │ │ │ │ │ Dune::TypeTree::FilterResult │ │ │ │ │ │ Dune::TypeTree::FilterResult::apply │ │ │ │ │ │ Dune::TypeTree::SimpleFilterTag │ │ │ │ │ │ Dune::TypeTree::AdvancedFilterTag │ │ │ │ │ │ Dune::TypeTree::AdvancedFilter │ │ │ │ │ │ Dune::TypeTree::AdvancedFilter::apply │ │ │ │ │ │ @@ -171,27 +171,27 @@ │ │ │ │ │ │ Dune::TypeTree::filter::apply │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ fixedcapacitystack.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00047.html │ │ │ │ │ │ + a00023.html │ │ │ │ │ │ Dune::TypeTree::FixedCapacityStackView │ │ │ │ │ │ Dune::TypeTree::FixedCapacityStack │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ generictransformationdescriptors.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ a00035.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/powercompositenodetransformationtemplates.hh │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/powercompositenodetransformationtemplates.hh │ │ │ │ │ │ Dune::TypeTree::GenericLeafNodeTransformation │ │ │ │ │ │ Dune::TypeTree::TemplatizedGenericPowerNodeTransformation │ │ │ │ │ │ Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::result │ │ │ │ │ │ Dune::TypeTree::GenericPowerNodeTransformation │ │ │ │ │ │ Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation │ │ │ │ │ │ Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::result │ │ │ │ │ │ Dune::TypeTree::GenericDynamicPowerNodeTransformation │ │ │ │ │ │ @@ -200,24 +200,24 @@ │ │ │ │ │ │ Dune::TypeTree::GenericCompositeNodeTransformation │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ leafnode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00074.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00014.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ Dune::TypeTree::LeafNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ nodeinterface.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ Dune::TypeTree::NodeInterface │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ typename std::decay_t< Node >::NodeTag │ │ │ │ │ │ NodeTag │ │ │ │ │ │ a00093.html │ │ │ │ │ │ @@ -245,31 +245,31 @@ │ │ │ │ │ │ ga56ec139aa8b8af4e8fd25d3b31b970cd │ │ │ │ │ │ (const Node &node) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ nodetags.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00020.html │ │ │ │ │ │ + a00053.html │ │ │ │ │ │ Dune::TypeTree::LeafNodeTag │ │ │ │ │ │ Dune::TypeTree::PowerNodeTag │ │ │ │ │ │ Dune::TypeTree::DynamicPowerNodeTag │ │ │ │ │ │ Dune::TypeTree::CompositeNodeTag │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ pairtraversal.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00011.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/visitor.hh │ │ │ │ │ │ - dune/typetree/traversal.hh │ │ │ │ │ │ + a00071.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ + dune/typetree/visitor.hh │ │ │ │ │ │ + dune/typetree/traversal.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::Detail │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ applyToTreePair │ │ │ │ │ │ a00103.html │ │ │ │ │ │ @@ -283,105 +283,105 @@ │ │ │ │ │ │ ga677ef3ed3418747507fd30687854f5c4 │ │ │ │ │ │ (Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ powercompositenodetransformationtemplates.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00026.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ + a00062.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ Dune::TypeTree::GenericPowerNodeTransformationTemplate │ │ │ │ │ │ Dune::TypeTree::GenericPowerNodeTransformationTemplate::result │ │ │ │ │ │ Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate │ │ │ │ │ │ Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result │ │ │ │ │ │ Dune::TypeTree::GenericCompositeNodeTransformationTemplate │ │ │ │ │ │ Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ powernode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00080.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ + a00068.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ + dune/typetree/childextraction.hh │ │ │ │ │ │ + dune/typetree/typetraits.hh │ │ │ │ │ │ Dune::TypeTree::PowerNode │ │ │ │ │ │ Dune::TypeTree::PowerNode::Child │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ proxynode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00086.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00008.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ Dune::TypeTree::StaticChildAccessors │ │ │ │ │ │ Dune::TypeTree::StaticChildAccessors::Child │ │ │ │ │ │ Dune::TypeTree::DynamicChildAccessors │ │ │ │ │ │ Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag > │ │ │ │ │ │ Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag > │ │ │ │ │ │ Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag > │ │ │ │ │ │ Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag > │ │ │ │ │ │ Dune::TypeTree::ProxyNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ simpletransformationdescriptors.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00023.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00086.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ Dune::TypeTree::SimpleLeafNodeTransformation │ │ │ │ │ │ Dune::TypeTree::SimplePowerNodeTransformation │ │ │ │ │ │ Dune::TypeTree::SimplePowerNodeTransformation::result │ │ │ │ │ │ Dune::TypeTree::SimpleDynamicPowerNodeTransformation │ │ │ │ │ │ Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result │ │ │ │ │ │ Dune::TypeTree::SimpleCompositeNodeTransformation │ │ │ │ │ │ Dune::TypeTree::SimpleCompositeNodeTransformation::result │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ transformation.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00014.html │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ + a00029.html │ │ │ │ │ │ + dune/typetree/typetraits.hh │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ Dune::TypeTree::TransformTree │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ registerNodeTransformation │ │ │ │ │ │ a00095.html │ │ │ │ │ │ ga48cffe31075a96776d284a184097a2aa │ │ │ │ │ │ (SourceNode *, Transformation *, Tag *) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ transformationutilities.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00077.html │ │ │ │ │ │ - dune/typetree/simpletransformationdescriptors.hh │ │ │ │ │ │ + a00017.html │ │ │ │ │ │ + dune/typetree/simpletransformationdescriptors.hh │ │ │ │ │ │ dune/typetree/generictransformationdescriptors.hh │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ traversal.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00059.html │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/visitor.hh │ │ │ │ │ │ + a00047.html │ │ │ │ │ │ + dune/typetree/childextraction.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ + dune/typetree/visitor.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::Detail │ │ │ │ │ │ │ │ │ │ │ │ decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) │ │ │ │ │ │ DynamicTraversalConcept │ │ │ │ │ │ a00103.html │ │ │ │ │ │ @@ -465,59 +465,59 @@ │ │ │ │ │ │ gad2f9c441b6882fcd11419500df8a56ec │ │ │ │ │ │ (Tree &&tree, LeafFunc &&leafFunc) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ traversalutilities.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ - dune/typetree/traversal.hh │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ + dune/typetree/traversal.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ ResultType │ │ │ │ │ │ reduceOverLeafs │ │ │ │ │ │ a00091.html │ │ │ │ │ │ gab407f8e914f8fa3fee78d35a102e2693 │ │ │ │ │ │ (const Tree &tree, F functor, R reduction, ResultType startValue) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ static const TreePathType::Type │ │ │ │ │ │ treePathType │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ ac933f134e17da9e8dbf18be15134df40 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ F │ │ │ │ │ │ _functor │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ a925ce4fb47f35dbaf1550d896578184f │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ R │ │ │ │ │ │ _reduction │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ a3399305aa17d4bcec74944e962ff3a12 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ResultType │ │ │ │ │ │ _value │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ ad4dc401736cbecb52f1afd1c8c8d359f │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ treecontainer.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00029.html │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ + a00044.html │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ Dune::TypeTree::Detail::ContainerFactory │ │ │ │ │ │ Dune::TypeTree::Detail::TreeContainerVectorBackend │ │ │ │ │ │ Dune::TypeTree::Detail::LeafToDefaultConstructibleValue │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::Detail │ │ │ │ │ │ │ │ │ │ │ │ @@ -555,17 +555,17 @@ │ │ │ │ │ │ gaeba09096f7d6149b08123f545eaccc85 │ │ │ │ │ │ (const Tree &tree) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ treepath.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00065.html │ │ │ │ │ │ - dune/typetree/fixedcapacitystack.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ + a00026.html │ │ │ │ │ │ + dune/typetree/fixedcapacitystack.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ Dune::TypeTree::HybridTreePath │ │ │ │ │ │ Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > > │ │ │ │ │ │ Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k > │ │ │ │ │ │ Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k > │ │ │ │ │ │ Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > > │ │ │ │ │ │ Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > > │ │ │ │ │ │ Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > > │ │ │ │ │ │ @@ -749,17 +749,17 @@ │ │ │ │ │ │ ga0c1ac60b62c3a74db546b04368f319a2 │ │ │ │ │ │ (std::ostream &os, const HybridTreePath< T... > &tp) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ typetraits.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00071.html │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ + a00077.html │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ Dune::first_type< T0, T... > │ │ │ │ │ │ Dune::TypeTree::has_node_tag │ │ │ │ │ │ Dune::TypeTree::has_node_tag::yes │ │ │ │ │ │ Dune::TypeTree::has_node_tag::no │ │ │ │ │ │ Dune::TypeTree::has_node_tag_value │ │ │ │ │ │ Dune::TypeTree::has_node_tag_value::maybe │ │ │ │ │ │ Dune::TypeTree::has_node_tag_value::yes │ │ │ │ │ │ @@ -808,45 +808,45 @@ │ │ │ │ │ │ a9f06f53488df709cddad40051120e058 │ │ │ │ │ │ (const T &) -> IsTreePath< T > │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ typetree.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00056.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ - dune/typetree/leafnode.hh │ │ │ │ │ │ - dune/typetree/powernode.hh │ │ │ │ │ │ - dune/typetree/dynamicpowernode.hh │ │ │ │ │ │ - dune/typetree/compositenode.hh │ │ │ │ │ │ - dune/typetree/traversal.hh │ │ │ │ │ │ - dune/typetree/pairtraversal.hh │ │ │ │ │ │ - dune/typetree/traversalutilities.hh │ │ │ │ │ │ - dune/typetree/transformation.hh │ │ │ │ │ │ - dune/typetree/transformationutilities.hh │ │ │ │ │ │ - dune/typetree/accumulate_static.hh │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ + a00074.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ + dune/typetree/leafnode.hh │ │ │ │ │ │ + dune/typetree/powernode.hh │ │ │ │ │ │ + dune/typetree/dynamicpowernode.hh │ │ │ │ │ │ + dune/typetree/compositenode.hh │ │ │ │ │ │ + dune/typetree/traversal.hh │ │ │ │ │ │ + dune/typetree/pairtraversal.hh │ │ │ │ │ │ + dune/typetree/traversalutilities.hh │ │ │ │ │ │ + dune/typetree/transformation.hh │ │ │ │ │ │ + dune/typetree/transformationutilities.hh │ │ │ │ │ │ + dune/typetree/accumulate_static.hh │ │ │ │ │ │ + dune/typetree/childextraction.hh │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ utility.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00062.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00050.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ Dune::TypeTree::TreeInfo │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ visitor.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00044.html │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ + a00059.html │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ Dune::TypeTree::DefaultVisitor │ │ │ │ │ │ Dune::TypeTree::DefaultPairVisitor │ │ │ │ │ │ Dune::TypeTree::Experimental::DefaultHybridVisitor │ │ │ │ │ │ Dune::TypeTree::VisitDirectChildren │ │ │ │ │ │ Dune::TypeTree::VisitDirectChildren::VisitChild │ │ │ │ │ │ Dune::TypeTree::VisitTree │ │ │ │ │ │ Dune::TypeTree::VisitTree::VisitChild │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/files.html │ │ │ │ @@ -67,41 +67,41 @@ │ │ │ │
│ │ │ │
Here is a list of all files with brief descriptions:
│ │ │ │
[detail level 123]
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
  doc
 doxygen
  dune
  typetree
 accumulate_static.hh
 childextraction.hh
 compositenode.hh
 dynamicpowernode.hh
 exceptions.hhTypeTree-specific exceptions
 filteredcompositenode.hh
 filters.hh
 fixedcapacitystack.hh
 accumulate_static.hh
 childextraction.hh
 compositenode.hh
 dynamicpowernode.hh
 exceptions.hhTypeTree-specific exceptions
 filteredcompositenode.hh
 filters.hh
 fixedcapacitystack.hh
 generictransformationdescriptors.hh
 leafnode.hh
 nodeinterface.hh
 nodetags.hh
 pairtraversal.hh
 powercompositenodetransformationtemplates.hh
 powernode.hh
 proxynode.hh
 simpletransformationdescriptors.hh
 transformation.hh
 transformationutilities.hh
 traversal.hh
 traversalutilities.hh
 treecontainer.hh
 treepath.hh
 typetraits.hh
 typetree.hh
 utility.hh
 visitor.hh
 leafnode.hh
 nodeinterface.hh
 nodetags.hh
 pairtraversal.hh
 powercompositenodetransformationtemplates.hh
 powernode.hh
 proxynode.hh
 simpletransformationdescriptors.hh
 transformation.hh
 transformationutilities.hh
 traversal.hh
 traversalutilities.hh
 treecontainer.hh
 treepath.hh
 typetraits.hh
 typetree.hh
 utility.hh
 visitor.hh
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/globals.html │ │ │ │ @@ -59,20 +59,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Here is a list of all file members with links to the files they belong to:
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/globals_vars.html │ │ │ │ @@ -59,20 +59,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │   │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │