--- /srv/reproducible-results/rbuild-debian/r-b-build.0PnZFqKh/b1/dune-typetree_2.9.0-2_amd64.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.0PnZFqKh/b2/dune-typetree_2.9.0-2_amd64.changes ├── Files │ @@ -1,3 +1,3 @@ │ │ 5294a4a8cde743547667b34620b8794b 38696 libdevel optional libdune-typetree-dev_2.9.0-2_amd64.deb │ - 5e53b36b70068fde60831c25e3a79016 989748 doc optional libdune-typetree-doc_2.9.0-2_all.deb │ + 7e103f1db704336fa936d40abef9d853 989744 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 9664 2023-01-12 22:23:12.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 979892 2023-01-12 22:23:12.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 9648 2023-01-12 22:23:12.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 979904 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) 3047 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00002.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3045 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00005.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5909 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49270 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) 17252 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 74924 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) 6194 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69306 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) 9727 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 69137 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) 5600 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46149 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) 5149 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 32272 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) 10695 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 46415 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) 5211 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6649 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) 15004 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 98929 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) 6859 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 87085 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) 11110 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 55685 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) 8736 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 57016 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) 6910 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 15552 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) 7208 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27369 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) 6049 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49440 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) 6859 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 87085 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) 7478 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 17536 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) 15417 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 53082 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) 6233 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8874 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) 5600 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46149 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) 4849 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8864 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) 11230 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 43051 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) 5125 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14382 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) 10695 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 46415 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) 3694 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5507 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) 6233 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8874 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) 5603 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 39037 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) 7478 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 17536 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) 7398 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41083 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) 11230 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 43051 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) 8711 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 19928 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) 32652 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 96059 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) 6049 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49440 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) 6194 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69306 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) 8736 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 57016 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) 7398 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41083 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) 5149 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 32272 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) 8711 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 19928 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) 11110 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 55685 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) 15004 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 98929 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) 17252 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 74924 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) 15770 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 56207 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) 15417 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 53082 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) 5125 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14382 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) 7208 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27369 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) 6910 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 15552 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) 4849 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8864 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) 32652 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 96059 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) 9727 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 69137 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) 5211 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6649 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) 5603 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 39037 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) 5909 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49270 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) 4235 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00089.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 16499 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00090.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 11643 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00090.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 40169 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00091.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4364 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00091.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 21433 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00092.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3530 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00092.png │ │ │ │ @@ -372,15 +372,15 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3902 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_04f2ecc425faf0d475a3caf484e551f3.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2300 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) 3675 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) 13066 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) 2125 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) 3671 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) 45631 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/doxygen.css │ │ │ │ --rw-r--r-- 0 root (0) root (0) 23465 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) 23461 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) 7704 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dynsections.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12258 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/files.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3440 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3959 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) 7406 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions_c.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6084 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions_d.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3514 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/functions_e.html │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: compositenode.hh File Reference │ │ │ │ +dune-typetree: powercompositenodetransformationtemplates.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,33 +72,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
compositenode.hh File Reference
│ │ │ │ +
powercompositenodetransformationtemplates.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 <cstddef>
│ │ │ │ +#include <dune/typetree/nodeinterface.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::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::CompositeNode< Children >::Child< k >
 Access to the type and storage type of the i-th child. More...
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 {} │ │ │ │ │ @@ -1,28 +1,36 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -compositenode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +powercompositenodetransformationtemplates.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _C_h_i_l_d_r_e_n_ _> │ │ │ │ │ -  Base class for composite nodes based on variadic templates. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _C_h_i_l_d_r_e_n_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ │ -  Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: compositenode.hh Source File │ │ │ │ +dune-typetree: powercompositenodetransformationtemplates.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,270 +74,89 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
compositenode.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_COMPOSITENODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ +
5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │
6
│ │ │ │ -
7#include <tuple>
│ │ │ │ -
8#include <memory>
│ │ │ │ -
9#include <type_traits>
│ │ │ │ +
7#include <cstddef>
│ │ │ │ +
8
│ │ │ │ + │ │ │ │
10
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16 namespace TypeTree {
│ │ │ │ -
17
│ │ │ │ -
24 template<typename... Children>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
26 {
│ │ │ │ -
27
│ │ │ │ -
28 public:
│ │ │ │ +
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
│ │ │ │ - │ │ │ │ -
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);
│ │ │ │ +
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 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>
│ │ │ │ -
│ │ │ │ -
98 std::shared_ptr<typename Child<k>::Type> childStorage (index_constant<k> = {})
│ │ │ │ -
99 {
│ │ │ │ -
100 return std::get<k>(_children);
│ │ │ │ -
101 }
│ │ │ │ -
│ │ │ │ -
102
│ │ │ │ -
104
│ │ │ │ -
107 template<std::size_t k>
│ │ │ │ -
│ │ │ │ -
108 std::shared_ptr<const typename Child<k>::Type> childStorage (index_constant<k> = {}) const
│ │ │ │ -
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
│ │ │ │ +
52 } // namespace TypeTree
│ │ │ │ +
53} //namespace Dune
│ │ │ │ +
54
│ │ │ │ +
55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ + │ │ │ │
Definition accumulate_static.hh:13
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,326 +1,86 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -compositenode.hh │ │ │ │ │ +powercompositenodetransformationtemplates.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ +5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ 10 │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ -13#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ -14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16 namespace TypeTree { │ │ │ │ │ -17 │ │ │ │ │ -24 template │ │ │ │ │ -_2_5 class _C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -26 { │ │ │ │ │ -27 │ │ │ │ │ -28 public: │ │ │ │ │ +11namespace _D_u_n_e { │ │ │ │ │ +12 namespace TypeTree { │ │ │ │ │ +13 │ │ │ │ │ +19 template class TransformedNode> │ │ │ │ │ +_2_0 struct _G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ +21 { │ │ │ │ │ +22 template │ │ │ │ │ +_2_3 struct _r_e_s_u_l_t │ │ │ │ │ +24 { │ │ │ │ │ +_2_5 typedef TransformedNode::value> _t_y_p_e; │ │ │ │ │ +26 }; │ │ │ │ │ +27 }; │ │ │ │ │ +28 │ │ │ │ │ 29 │ │ │ │ │ -_3_1 typedef _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ -32 │ │ │ │ │ -_3_4 typedef std::tuple... > _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -35 │ │ │ │ │ -_3_7 typedef std::tuple _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ -38 │ │ │ │ │ -_4_0 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ -41 │ │ │ │ │ -_4_3 static const bool _i_s_P_o_w_e_r = false; │ │ │ │ │ -44 │ │ │ │ │ -_4_6 static const bool _i_s_C_o_m_p_o_s_i_t_e = true; │ │ │ │ │ -47 │ │ │ │ │ -49 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -_5_0 static const std::size_t _C_H_I_L_D_R_E_N = sizeof...(Children); │ │ │ │ │ +30 template class TransformedNode> │ │ │ │ │ +_3_1 struct _G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ +32 { │ │ │ │ │ +33 template │ │ │ │ │ +_3_4 struct _r_e_s_u_l_t │ │ │ │ │ +35 { │ │ │ │ │ +_3_6 typedef TransformedNode _t_y_p_e; │ │ │ │ │ +37 }; │ │ │ │ │ +38 }; │ │ │ │ │ +39 │ │ │ │ │ +40 template class TransformedNode> │ │ │ │ │ +_4_1 struct _G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ +42 { │ │ │ │ │ +43 template │ │ │ │ │ +_4_4 struct _r_e_s_u_l_t │ │ │ │ │ +45 { │ │ │ │ │ +_4_6 typedef TransformedNode _t_y_p_e; │ │ │ │ │ +47 }; │ │ │ │ │ +48 }; │ │ │ │ │ +49 │ │ │ │ │ 51 │ │ │ │ │ -_5_2 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ -53 { │ │ │ │ │ -54 return std::integral_constant{}; │ │ │ │ │ -55 } │ │ │ │ │ -56 │ │ │ │ │ -58 template │ │ │ │ │ -_5_9 struct _C_h_i_l_d { │ │ │ │ │ -60 │ │ │ │ │ -61 static_assert((k < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -62 │ │ │ │ │ -_6_4 typedef typename std::tuple_element::type _T_y_p_e; │ │ │ │ │ -65 │ │ │ │ │ -_6_7 typedef typename std::tuple_element::type _t_y_p_e; │ │ │ │ │ -68 }; │ │ │ │ │ -69 │ │ │ │ │ -72 │ │ │ │ │ -74 │ │ │ │ │ -77 template │ │ │ │ │ -_7_8 typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ -79 { │ │ │ │ │ -80 return *std::get(_children); │ │ │ │ │ -81 } │ │ │ │ │ -82 │ │ │ │ │ -84 │ │ │ │ │ -87 template │ │ │ │ │ -_8_8 const typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ -89 { │ │ │ │ │ -90 return *std::get(_children); │ │ │ │ │ -91 } │ │ │ │ │ -92 │ │ │ │ │ -94 │ │ │ │ │ -97 template │ │ │ │ │ -_9_8 std::shared_ptr::Type> _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = │ │ │ │ │ -{}) │ │ │ │ │ -99 { │ │ │ │ │ -100 return std::get(_children); │ │ │ │ │ -101 } │ │ │ │ │ -102 │ │ │ │ │ -104 │ │ │ │ │ -107 template │ │ │ │ │ -_1_0_8 std::shared_ptr::Type> _c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -(index_constant = {}) const │ │ │ │ │ -109 { │ │ │ │ │ -110 return std::get(_children); │ │ │ │ │ -111 } │ │ │ │ │ -112 │ │ │ │ │ -114 template │ │ │ │ │ -_1_1_5 void _s_e_t_C_h_i_l_d (typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e& _c_h_i_l_d, index_constant = {}) │ │ │ │ │ -116 { │ │ │ │ │ -117 std::get(_children) = stackobject_to_shared_ptr(_c_h_i_l_d); │ │ │ │ │ -118 } │ │ │ │ │ -119 │ │ │ │ │ -121 template │ │ │ │ │ -_1_2_2 void _s_e_t_C_h_i_l_d (typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e&& _c_h_i_l_d, index_constant = {}) │ │ │ │ │ -123 { │ │ │ │ │ -124 std::get(_children) = convert_arg(std::move(_c_h_i_l_d)); │ │ │ │ │ -125 } │ │ │ │ │ -126 │ │ │ │ │ -128 template │ │ │ │ │ -_1_2_9 void _s_e_t_C_h_i_l_d (std::shared_ptr_:_:_T_y_p_e> _c_h_i_l_d, │ │ │ │ │ -index_constant = {}) │ │ │ │ │ -130 { │ │ │ │ │ -131 std::get(_children) = std::move(_c_h_i_l_d); │ │ │ │ │ -132 } │ │ │ │ │ -133 │ │ │ │ │ -_1_3_4 const _N_o_d_e_S_t_o_r_a_g_e& _n_o_d_e_S_t_o_r_a_g_e () 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 │ │ │ │ │ -_1_6_8 ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ -169#else │ │ │ │ │ -170 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ -172 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ -179 } │ │ │ │ │ -180 │ │ │ │ │ -182 │ │ │ │ │ -186#ifdef DOXYGEN │ │ │ │ │ -187 template │ │ │ │ │ -_1_8_8 const ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ -189#else │ │ │ │ │ -190 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ -192 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ -199 } │ │ │ │ │ -200 │ │ │ │ │ -202 │ │ │ │ │ -203 protected: │ │ │ │ │ -204 │ │ │ │ │ -207 │ │ │ │ │ -209 │ │ │ │ │ -_2_1_6 _C_o_m_p_o_s_i_t_e_N_o_d_e () │ │ │ │ │ -217 {} │ │ │ │ │ -218 │ │ │ │ │ -220 template::type> │ │ │ │ │ -_2_2_1 _C_o_m_p_o_s_i_t_e_N_o_d_e (Args&&... args) │ │ │ │ │ -222 : _children(convert_arg(std::forward(args))...) │ │ │ │ │ -223 {} │ │ │ │ │ -224 │ │ │ │ │ -_2_2_6 _C_o_m_p_o_s_i_t_e_N_o_d_e (std::shared_ptr... children) │ │ │ │ │ -227 : _children(std::move(children)...) │ │ │ │ │ -228 {} │ │ │ │ │ -229 │ │ │ │ │ -_2_3_1 _C_o_m_p_o_s_i_t_e_N_o_d_e (const _N_o_d_e_S_t_o_r_a_g_e& children) │ │ │ │ │ -232 : _children(children) │ │ │ │ │ -233 {} │ │ │ │ │ -234 │ │ │ │ │ -236 │ │ │ │ │ -237 private: │ │ │ │ │ -238 _N_o_d_e_S_t_o_r_a_g_e _children; │ │ │ │ │ -239 }; │ │ │ │ │ -240 │ │ │ │ │ -242 │ │ │ │ │ -243 } // namespace TypeTree │ │ │ │ │ -244} //namespace Dune │ │ │ │ │ -245 │ │ │ │ │ -246#endif // DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ -_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ +52 } // namespace TypeTree │ │ │ │ │ +53} //namespace Dune │ │ │ │ │ +54 │ │ │ │ │ +55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -Base class for composite nodes based on variadic templates. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:26 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:40 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:168 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a composite in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -CompositeNode() │ │ │ │ │ -Default constructor. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:216 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -CompositeNodeTag NodeTag │ │ │ │ │ -The type tag that describes a CompositeNode. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:31 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(typename Child< k >::Type &child, index_constant< k >={}) │ │ │ │ │ -Sets the k-th child to the passed-in value. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:115 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(typename Child< k >::Type &&child, index_constant< k >={}) │ │ │ │ │ -Store the passed value in k-th child. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:122 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:52 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -const NodeStorage & nodeStorage() const │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:134 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -CompositeNode(std::shared_ptr< Children >... children) │ │ │ │ │ -Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:226 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< typename Child< k >::Type > childStorage(index_constant< k >= │ │ │ │ │ -{}) │ │ │ │ │ -Returns the storage of the k-th child. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:98 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ -std::tuple< Children... > ChildTypes │ │ │ │ │ -A tuple storing the types of all children. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:37 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:129 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:188 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:43 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< const typename Child< k >::Type > childStorage(index_constant< │ │ │ │ │ -k >={}) const │ │ │ │ │ -Returns the storage of the k-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:108 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -Child< k >::Type & child(index_constant< k >={}) │ │ │ │ │ -Returns the k-th child. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:78 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -CompositeNode(const NodeStorage &children) │ │ │ │ │ -Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:231 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -std::tuple< std::shared_ptr< Children >... > NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:34 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const Child< k >::Type & child(index_constant< k >={}) const │ │ │ │ │ -Returns the k-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:88 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:59 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ │ -std::tuple_element< k, ChildTypes >::type Type │ │ │ │ │ -The type of the child. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:64 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ │ -std::tuple_element< k, ChildTypes >::type type │ │ │ │ │ -The type of the child. │ │ │ │ │ -DDeeffiinniittiioonn compositenode.hh:67 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h │ │ │ │ │ -Check if type represents a tree path. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:182 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:21 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:24 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:32 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:35 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNode< SourceNode, TC > type │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:36 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:42 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:45 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNode< SourceNode, TC... > type │ │ │ │ │ +DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:46 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: visitor.hh File Reference │ │ │ │ +dune-typetree: pairtraversal.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,110 +70,46 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ -Functions | │ │ │ │ -Variables
│ │ │ │ -
visitor.hh File Reference
│ │ │ │ +Functions
│ │ │ │ +
pairtraversal.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/typetree/treepath.hh>
│ │ │ │ -#include <dune/typetree/utility.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.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ -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::Experimental
 
namespace  Dune::TypeTree::Experimental::Info
namespace  Dune::TypeTree::Detail
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Functions

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

│ │ │ │ -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.
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,106 +1,35 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s | _V_a_r_i_a_b_l_e_s │ │ │ │ │ -visitor.hh File Reference │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +pairtraversal.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_v_i_s_i_t_o_r_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ -  Visitor interface and base class for _T_y_p_e_T_r_e_e visitors. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -  Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ -  Hybrid visitor interface and base class for _T_y_p_e_T_r_e_e hybrid visitors. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ -  Mixin base class for visitors that only want to visit the direct │ │ │ │ │ - children of a node. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n_:_:_V_i_s_i_t_C_h_i_l_d_<_ _N_o_d_e_1_,_ _C_h_i_l_d_1_,_ _N_o_d_e_2_, │ │ │ │ │ - _C_h_i_l_d_2_,_ _T_r_e_e_P_a_t_h_ _> │ │ │ │ │ -  Template struct for determining whether or not to visit a given child. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e │ │ │ │ │ -  Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e_:_:_V_i_s_i_t_C_h_i_l_d_<_ _N_o_d_e_1_,_ _C_h_i_l_d_1_,_ _N_o_d_e_2_,_ _C_h_i_l_d_2_, │ │ │ │ │ - _T_r_e_e_P_a_t_h_ _> │ │ │ │ │ -  Template struct for determining whether or not to visit a given child. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -  Mixin base class for visitors that require a static TreePath during │ │ │ │ │ - traversal. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -  Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ - traversal. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_V_i_s_i_t_o_r │ │ │ │ │ -  Convenience base class for visiting the entire tree. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_V_i_s_i_t_o_r │ │ │ │ │ -  Convenience base class for visiting the direct children of a node. │ │ │ │ │ - _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -  Convenience base class for visiting an entire tree pair. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -  Convenience base class for visiting the direct children of a node │ │ │ │ │ - pair. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ -  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ │ -  │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l │ │ │ │ │   │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ - auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h (const Tree &tree) │ │ │ │ │ -  The depth of the _T_y_p_e_T_r_e_e. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h () │ │ │ │ │ -  The depth of the Tree. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t (const Tree │ │ │ │ │ - &tree) │ │ │ │ │ -  The total number of nodes in the Tree. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t (const Tree │ │ │ │ │ - &tree) │ │ │ │ │ -  The number of leaf nodes in the Tree. │ │ │ │ │ -  │ │ │ │ │ -VVaarriiaabblleess │ │ │ │ │ -template │ │ │ │ │ -constexpr bool  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_i_s_D_y_n_a_m_i_c = std:: │ │ │ │ │ - is_same()))> │ │ │ │ │ - {} │ │ │ │ │ -  true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ +template::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0> │ │ │ │ │ +void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r (T1 &&tree1, T2 &&tree2, _T_r_e_e_P_a_t_h │ │ │ │ │ + _t_r_e_e_P_a_t_h, V &&visitor) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r (Tree1 &&tree1, Tree2 &&tree2, Visitor │ │ │ │ │ + &&visitor) │ │ │ │ │ +  Apply visitor to a pair of TypeTrees. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: visitor.hh Source File │ │ │ │ +dune-typetree: pairtraversal.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,385 +74,152 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
visitor.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_VISITOR_HH
│ │ │ │ -
5#define DUNE_TYPETREE_VISITOR_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │ +
5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ - │ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11 namespace TypeTree {
│ │ │ │ -
12
│ │ │ │ -
19
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
47 {
│ │ │ │ -
48
│ │ │ │ -
50
│ │ │ │ -
57 template<typename T, typename TreePath>
│ │ │ │ -
58 void pre(T&&, TreePath) const {}
│ │ │ │ +
7#include <dune/common/std/type_traits.hh>
│ │ │ │ +
8
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
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 */
│ │ │ │ +
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
│ │ │ │ -
61
│ │ │ │ -
69 template<typename T, typename TreePath>
│ │ │ │ -
70 void in(T&&, TreePath) const {}
│ │ │ │ -
71
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ -
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition treepath.hh:199
│ │ │ │ +
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
│ │ │ │
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
│ │ │ │ -
constexpr auto depth()
The depth of the Tree.
Definition visitor.hh:514
│ │ │ │ +
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
│ │ │ │ -
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 {} │ │ │ │ │ @@ -1,482 +1,164 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -visitor.hh │ │ │ │ │ +pairtraversal.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_PAIRTRAVERSAL_HH │ │ │ │ │ +5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -9 │ │ │ │ │ -10namespace _D_u_n_e { │ │ │ │ │ -11 namespace TypeTree { │ │ │ │ │ -12 │ │ │ │ │ -19 │ │ │ │ │ -_4_6 struct _D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ -47 { │ │ │ │ │ -48 │ │ │ │ │ -50 │ │ │ │ │ -57 template │ │ │ │ │ -_5_8 void _p_r_e(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_v_i_s_i_t_o_r_._h_h> │ │ │ │ │ +13#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +14 │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16 namespace TypeTree { │ │ │ │ │ +17 │ │ │ │ │ +_2_3 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> │ │ │ │ │ +_3_8 void _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(T1&& tree1, T2&& tree2, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, V&& visitor) │ │ │ │ │ +39 { │ │ │ │ │ +40 visitor.leaf(tree1, tree2, _t_r_e_e_P_a_t_h); │ │ │ │ │ +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 _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(T1&& tree1, T2&& tree2, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h); │ │ │ │ │ 59 │ │ │ │ │ -61 │ │ │ │ │ -69 template │ │ │ │ │ -_7_0 void _i_n(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -71 │ │ │ │ │ +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 │ │ │ │ │ -80 template │ │ │ │ │ -_8_1 void _p_o_s_t(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -82 │ │ │ │ │ -84 │ │ │ │ │ -90 template │ │ │ │ │ -_9_1 void _l_e_a_f(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -92 │ │ │ │ │ -94 │ │ │ │ │ -104 template │ │ │ │ │ -_1_0_5 void _b_e_f_o_r_e_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex) const {} │ │ │ │ │ -106 │ │ │ │ │ -108 │ │ │ │ │ -119 template │ │ │ │ │ -_1_2_0 void _a_f_t_e_r_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex) const {} │ │ │ │ │ -121 │ │ │ │ │ -122 }; │ │ │ │ │ -123 │ │ │ │ │ -124 │ │ │ │ │ -126 │ │ │ │ │ -_1_6_1 struct _D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -162 { │ │ │ │ │ -163 │ │ │ │ │ -165 │ │ │ │ │ -173 template │ │ │ │ │ -_1_7_4 void _p_r_e(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -175 │ │ │ │ │ -177 │ │ │ │ │ -186 template │ │ │ │ │ -_1_8_7 void _i_n(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -188 │ │ │ │ │ -190 │ │ │ │ │ -198 template │ │ │ │ │ -_1_9_9 void _p_o_s_t(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -200 │ │ │ │ │ -202 │ │ │ │ │ -213 template │ │ │ │ │ -_2_1_4 void _l_e_a_f(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ -215 │ │ │ │ │ -217 │ │ │ │ │ -229 template │ │ │ │ │ -_2_3_0 void _b_e_f_o_r_e_C_h_i_l_d(T1&&, Child1&&, T2&&, Child2&&, _T_r_e_e_P_a_t_h, ChildIndex) │ │ │ │ │ -const {} │ │ │ │ │ -231 │ │ │ │ │ -233 │ │ │ │ │ -245 template │ │ │ │ │ -_2_4_6 void _a_f_t_e_r_C_h_i_l_d(T1&&, Child1&&, T2&&, Child2&&, _T_r_e_e_P_a_t_h, ChildIndex) const │ │ │ │ │ -{} │ │ │ │ │ -247 │ │ │ │ │ -248 }; │ │ │ │ │ -249 │ │ │ │ │ -250 │ │ │ │ │ -251 namespace Experimental { │ │ │ │ │ -252 │ │ │ │ │ -_2_8_3 struct _D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ -284 { │ │ │ │ │ -285 │ │ │ │ │ -293 template │ │ │ │ │ -_2_9_4 auto _p_r_e(T&&, _T_r_e_e_P_a_t_h, const U& u) const { return u;} │ │ │ │ │ -295 │ │ │ │ │ -303 template │ │ │ │ │ -_3_0_4 auto _i_n(T&&, _T_r_e_e_P_a_t_h, const U& u) const {return u;} │ │ │ │ │ -305 │ │ │ │ │ -313 template │ │ │ │ │ -_3_1_4 auto _p_o_s_t(T&&, _T_r_e_e_P_a_t_h, const U& u) const {return u;} │ │ │ │ │ -315 │ │ │ │ │ -323 template │ │ │ │ │ -_3_2_4 auto _l_e_a_f(T&&, _T_r_e_e_P_a_t_h, const U& u) const { return u;} │ │ │ │ │ -325 │ │ │ │ │ -333 template │ │ │ │ │ -_3_3_4 auto _b_e_f_o_r_e_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex, const U& u) const │ │ │ │ │ -{return u;} │ │ │ │ │ -335 │ │ │ │ │ -343 template │ │ │ │ │ -_3_4_4 auto _a_f_t_e_r_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex, const U& u) const │ │ │ │ │ -{return u;} │ │ │ │ │ -345 │ │ │ │ │ -346 }; │ │ │ │ │ -347 } // namespace Experimental │ │ │ │ │ -348 │ │ │ │ │ -350 │ │ │ │ │ -_3_5_5 struct _V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ -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 │ │ │ │ │ -_3_6_7 struct _V_i_s_i_t_C_h_i_l_d │ │ │ │ │ -368 { │ │ │ │ │ -_3_7_0 static const bool _v_a_l_u_e = false; │ │ │ │ │ -371 }; │ │ │ │ │ -372 │ │ │ │ │ -373 }; │ │ │ │ │ -374 │ │ │ │ │ -375 │ │ │ │ │ -377 │ │ │ │ │ -_3_8_1 struct _V_i_s_i_t_T_r_e_e │ │ │ │ │ -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 │ │ │ │ │ -_3_9_3 struct _V_i_s_i_t_C_h_i_l_d │ │ │ │ │ -394 { │ │ │ │ │ -_3_9_6 static const bool _v_a_l_u_e = true; │ │ │ │ │ -397 }; │ │ │ │ │ -398 │ │ │ │ │ -399 }; │ │ │ │ │ -400 │ │ │ │ │ -402 │ │ │ │ │ -_4_0_9 struct _S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -410 { │ │ │ │ │ -_4_1_2 static const _T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e _t_r_e_e_P_a_t_h_T_y_p_e = _T_r_e_e_P_a_t_h_T_y_p_e_:_:_f_u_l_l_y_S_t_a_t_i_c; │ │ │ │ │ -413 }; │ │ │ │ │ -414 │ │ │ │ │ -416 │ │ │ │ │ -_4_2_3 struct _D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -424 { │ │ │ │ │ -_4_2_6 static const _T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e _t_r_e_e_P_a_t_h_T_y_p_e = _T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c; │ │ │ │ │ -427 }; │ │ │ │ │ -428 │ │ │ │ │ -_4_3_0 struct _T_r_e_e_V_i_s_i_t_o_r │ │ │ │ │ -431 : public _D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ -432 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ -433 {}; │ │ │ │ │ -434 │ │ │ │ │ -_4_3_6 struct _D_i_r_e_c_t_C_h_i_l_d_r_e_n_V_i_s_i_t_o_r │ │ │ │ │ -437 : public _D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ -438 , public _V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ -439 {}; │ │ │ │ │ -440 │ │ │ │ │ -_4_4_2 struct _T_r_e_e_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -443 : public _D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -444 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ -445 {}; │ │ │ │ │ -446 │ │ │ │ │ -_4_4_8 struct _D_i_r_e_c_t_C_h_i_l_d_r_e_n_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -449 : public _D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -450 , public _V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ -451 {}; │ │ │ │ │ -452 │ │ │ │ │ -_4_5_3 namespace Experimental::Info { │ │ │ │ │ -454 │ │ │ │ │ -_4_5_5 struct _L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -456 : public _D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ -457 , public _S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -458 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ -459 { │ │ │ │ │ -460 template │ │ │ │ │ -_4_6_1 auto _b_e_f_o_r_e_C_h_i_l_d(Tree&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex, U u) const { │ │ │ │ │ -462 // in this case child index is an integral constant: forward u │ │ │ │ │ -463 return u; │ │ │ │ │ -464 } │ │ │ │ │ -465 │ │ │ │ │ -466 template │ │ │ │ │ -_4_6_7 std::size_t _b_e_f_o_r_e_C_h_i_l_d(Tree&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, 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 │ │ │ │ │ -_4_7_3 auto _l_e_a_f(Tree&&, _T_r_e_e_P_a_t_h, U u) const │ │ │ │ │ -474 { │ │ │ │ │ -475 return Hybrid::plus(u,Dune::Indices::_1); │ │ │ │ │ -476 } │ │ │ │ │ -477 │ │ │ │ │ -478 }; │ │ │ │ │ -479 │ │ │ │ │ -_4_8_0 struct _N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -481 : public _L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -482 { │ │ │ │ │ -483 template │ │ │ │ │ -_4_8_4 auto _p_r_e(Tree&&, _T_r_e_e_P_a_t_h, U u) const { │ │ │ │ │ -485 return Hybrid::plus(u,Indices::_1); │ │ │ │ │ -486 } │ │ │ │ │ -487 }; │ │ │ │ │ -488 │ │ │ │ │ -_4_8_9 struct _D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ -490 : public _D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ -491 , public _S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -492 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ -493 { │ │ │ │ │ -494 template │ │ │ │ │ -_4_9_5 auto _l_e_a_f(Tree&&, _T_r_e_e_P_a_t_h, U u) const │ │ │ │ │ -496 { │ │ │ │ │ -497 auto path_size = index_constant<_t_r_e_e_P_a_t_h_S_i_z_e(_T_r_e_e_P_a_t_h{})>{}; │ │ │ │ │ -498 auto _d_e_p_t_h = Hybrid::plus(path_size,Indices::_1); │ │ │ │ │ -499 return Hybrid::max(_d_e_p_t_h,u); │ │ │ │ │ -500 } │ │ │ │ │ -501 }; │ │ │ │ │ -502 │ │ │ │ │ -504 // result is alwayas an integral constant │ │ │ │ │ -505 template │ │ │ │ │ -_5_0_6 auto _d_e_p_t_h(const Tree& tree) │ │ │ │ │ -507 { │ │ │ │ │ -508 return _h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(tree,_D_e_p_t_h_V_i_s_i_t_o_r{},Indices::_0); │ │ │ │ │ -509 } │ │ │ │ │ -510 │ │ │ │ │ -512 // return types is std::integral_constant. │ │ │ │ │ -513 template │ │ │ │ │ -_5_1_4 constexpr auto _d_e_p_t_h() │ │ │ │ │ -515 { │ │ │ │ │ -516 return decltype(_h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(std::declval(),_D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ -{},Indices::_0)){}; │ │ │ │ │ -517 } │ │ │ │ │ -518 │ │ │ │ │ -520 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -521 template │ │ │ │ │ -_5_2_2 auto _n_o_d_e_C_o_u_n_t(const Tree& tree) │ │ │ │ │ -523 { │ │ │ │ │ -524 return _h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(tree,_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r{},Indices::_0); │ │ │ │ │ -525 } │ │ │ │ │ -526 │ │ │ │ │ -528 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -529 template │ │ │ │ │ -_5_3_0 auto _l_e_a_f_C_o_u_n_t(const Tree& tree) │ │ │ │ │ -531 { │ │ │ │ │ -532 return _h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(tree,_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r{},Dune::Indices::_0); │ │ │ │ │ -533 } │ │ │ │ │ -534 │ │ │ │ │ -536 template │ │ │ │ │ -_5_3_7 constexpr bool _i_s_D_y_n_a_m_i_c = std::is_same()))>{}; │ │ │ │ │ -538 │ │ │ │ │ -539 } // namespace Experimental::Info │ │ │ │ │ -540 │ │ │ │ │ -542 │ │ │ │ │ -543 } // namespace TypeTree │ │ │ │ │ -544} //namespace Dune │ │ │ │ │ -545 │ │ │ │ │ -546#endif // DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +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, _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h); │ │ │ │ │ +95 │ │ │ │ │ +96 constexpr bool visitChild = Visitor::template │ │ │ │ │ +VisitChild::value; │ │ │ │ │ +97 if constexpr(visitChild) { │ │ │ │ │ +98 auto childTreePath = _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k(_t_r_e_e_P_a_t_h, i); │ │ │ │ │ +99 _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(child1, child2, childTreePath, visitor); │ │ │ │ │ +100 } │ │ │ │ │ +101 │ │ │ │ │ +102 visitor.afterChild(tree1, child1, tree2, child2, _t_r_e_e_P_a_t_h, i); │ │ │ │ │ +103 }); │ │ │ │ │ +104 } │ │ │ │ │ +105 visitor.post(tree1, tree2, _t_r_e_e_P_a_t_h); │ │ │ │ │ +106 } │ │ │ │ │ +107 │ │ │ │ │ +108 } // namespace Detail │ │ │ │ │ +109 │ │ │ │ │ +111 │ │ │ │ │ +125 template │ │ │ │ │ +_1_2_6 void _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor) │ │ │ │ │ +127 { │ │ │ │ │ +128 _D_e_t_a_i_l_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(tree1, tree2, _h_y_b_r_i_d_T_r_e_e_P_a_t_h(), visitor); │ │ │ │ │ +129 } │ │ │ │ │ +130 │ │ │ │ │ +132 │ │ │ │ │ +133 } // namespace TypeTree │ │ │ │ │ +134} //namespace Dune │ │ │ │ │ +135 │ │ │ │ │ +136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_v_i_s_i_t_o_r_._h_h │ │ │ │ │ +_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ _t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d │ │ │ │ │ -typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ -Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:223 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ -constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ -Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:199 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r │ │ │ │ │ +void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor) │ │ │ │ │ +Apply visitor to a pair of TypeTrees. │ │ │ │ │ +DDeeffiinniittiioonn pairtraversal.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ +constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t i) │ │ │ │ │ +Appends a run time index to a HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:281 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:180 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:521 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e │ │ │ │ │ -auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ -Apply hybrid visitor to TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:698 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e │ │ │ │ │ -Type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_f_u_l_l_y_S_t_a_t_i_c │ │ │ │ │ -@ fullyStatic │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c │ │ │ │ │ -@ dynamic │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_i_s_D_y_n_a_m_i_c │ │ │ │ │ -constexpr bool isDynamic │ │ │ │ │ -true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:537 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t │ │ │ │ │ -auto leafCount(const Tree &tree) │ │ │ │ │ -The number of leaf nodes in the Tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:530 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t │ │ │ │ │ -auto nodeCount(const Tree &tree) │ │ │ │ │ -The total number of nodes in the Tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:522 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h │ │ │ │ │ -constexpr auto depth() │ │ │ │ │ -The depth of the Tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:514 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r │ │ │ │ │ +void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor) │ │ │ │ │ +DDeeffiinniittiioonn pairtraversal.hh:38 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ -Visitor interface and base class for TypeTree visitors. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:47 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_i_n │ │ │ │ │ -void in(T &&, TreePath) const │ │ │ │ │ -Method for infix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:70 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_a_f_t_e_r_C_h_i_l_d │ │ │ │ │ -void afterChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ -Method for child-parent traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:120 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ -void beforeChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ -Method for parent-child traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:105 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_p_o_s_t │ │ │ │ │ -void post(T &&, TreePath) const │ │ │ │ │ -Method for postfix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:81 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -void leaf(T &&, TreePath) const │ │ │ │ │ -Method for leaf traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:91 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ -void pre(T &&, TreePath) const │ │ │ │ │ -Method for prefix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:58 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:162 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -void leaf(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for leaf traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:214 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ -void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) │ │ │ │ │ -const │ │ │ │ │ -Method for parent-child traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:230 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ -void pre(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for prefix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:174 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_p_o_s_t │ │ │ │ │ -void post(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for postfix traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:199 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_i_n │ │ │ │ │ -void in(T1 &&, T2 &&, TreePath) const │ │ │ │ │ -Method for infix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:187 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_a_f_t_e_r_C_h_i_l_d │ │ │ │ │ -void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const │ │ │ │ │ -Method for child-parent traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:246 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ -Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:284 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_p_o_s_t │ │ │ │ │ -auto post(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for postfix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:314 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ -auto pre(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for prefix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:294 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -auto leaf(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for leaf traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:324 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_a_f_t_e_r_C_h_i_l_d │ │ │ │ │ -auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ -Method for child-parent traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:344 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_i_n │ │ │ │ │ -auto in(T &&, TreePath, const U &u) const │ │ │ │ │ -Method for infix tree traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:304 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ -auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ -Method for parent-child traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:334 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ -Mixin base class for visitors that only want to visit the direct children of a │ │ │ │ │ -node. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:356 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n_:_:_V_i_s_i_t_C_h_i_l_d │ │ │ │ │ -Template struct for determining whether or not to visit a given child. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:368 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n_:_:_V_i_s_i_t_C_h_i_l_d_:_:_v_a_l_u_e │ │ │ │ │ -static const bool value │ │ │ │ │ -Do not visit any child. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:370 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e │ │ │ │ │ -Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:382 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e_:_:_V_i_s_i_t_C_h_i_l_d │ │ │ │ │ -Template struct for determining whether or not to visit a given child. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:394 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e_:_:_V_i_s_i_t_C_h_i_l_d_:_:_v_a_l_u_e │ │ │ │ │ -static const bool value │ │ │ │ │ -Visit any child. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:396 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -Mixin base class for visitors that require a static TreePath during traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:410 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_a_v_e_r_s_a_l_:_:_t_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ -static const TreePathType::Type treePathType │ │ │ │ │ -Use the static tree traversal algorithm. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:412 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ -Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ -traversal. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:424 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l_:_:_t_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ -static const TreePathType::Type treePathType │ │ │ │ │ -Use the dynamic tree traversal algorithm. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:426 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_V_i_s_i_t_o_r │ │ │ │ │ -Convenience base class for visiting the entire tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:433 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_V_i_s_i_t_o_r │ │ │ │ │ -Convenience base class for visiting the direct children of a node. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:439 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -Convenience base class for visiting an entire tree pair. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:445 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ -Convenience base class for visiting the direct children of a node pair. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:451 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:459 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:473 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ -auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:461 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ -std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:467 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:482 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ -auto pre(Tree &&, TreePath, U u) const │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:484 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:493 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_D_e_p_t_h_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ -auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:495 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powernode.hh File Reference │ │ │ │ +dune-typetree: filteredcompositenode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,37 +72,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
powernode.hh File Reference
│ │ │ │ +
filteredcompositenode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <array>
│ │ │ │ -#include <memory>
│ │ │ │ +
#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/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/common/indices.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...
class  Dune::TypeTree::FilteredCompositeNode< Node, Filter >
 Base class for composite nodes representing a filtered view on an underlying composite node. More...
 
struct  Dune::TypeTree::PowerNode< T, k >::Child< i >
 Access to the type and storage type of the i-th child. More...
struct  Dune::TypeTree::FilteredCompositeNode< Node, Filter >::Child< k >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,31 +1,30 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -powernode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +filteredcompositenode.hh File Reference │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_l_t_e_r_s_._h_h> │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_<_ _T_,_ _k_ _> │ │ │ │ │ -  Collect k instances of type T within a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _N_o_d_e_,_ _F_i_l_t_e_r_ _> │ │ │ │ │ +  Base class for composite nodes representing a filtered view on an │ │ │ │ │ + underlying composite node. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_<_ _T_,_ _k_ _>_:_:_C_h_i_l_d_<_ _i_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _N_o_d_e_,_ _F_i_l_t_e_r_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ │   Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powernode.hh Source File │ │ │ │ +dune-typetree: filteredcompositenode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,403 +74,289 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
powernode.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_POWERNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │
6
│ │ │ │ -
7#include <cassert>
│ │ │ │ -
8#include <array>
│ │ │ │ -
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
│ │ │ │ + │ │ │ │ + │ │ │ │ +
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
│ │ │ │ -
29#ifndef DOXYGEN
│ │ │ │ +
28#ifndef DOXYGEN
│ │ │ │ +
29 namespace {
│ │ │ │
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
│ │ │ │ +
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
│ │ │ │ -
48 template<typename T, std::size_t k>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
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;
│ │ │ │ -
66
│ │ │ │ -
│ │ │ │ -
67 static constexpr auto degree ()
│ │ │ │ -
68 {
│ │ │ │ -
69 return std::integral_constant<std::size_t,k>{};
│ │ │ │ -
70 }
│ │ │ │ -
│ │ │ │ -
71
│ │ │ │ - │ │ │ │ -
74
│ │ │ │ -
76 typedef T ChildType;
│ │ │ │ +
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 typedef std::array<std::shared_ptr<T>,k> NodeStorage;
│ │ │ │ -
80
│ │ │ │ -
81
│ │ │ │ -
83 template<std::size_t i>
│ │ │ │ -
│ │ │ │ -
84 struct Child
│ │ │ │ -
85 {
│ │ │ │ +
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_assert((i < degree()), "child index out of range");
│ │ │ │ +
87 static const bool nodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
│ │ │ │
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
│ │ │ │ +
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
│ │ │ │ -
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 }
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
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 }
│ │ │ │ +
134#endif // DOXYGEN
│ │ │ │ +
135
│ │ │ │ +
137 typedef typename OriginalChild::Type Type;
│ │ │ │ +
138
│ │ │ │ +
140 typedef typename OriginalChild::type type;
│ │ │ │ +
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 }
│ │ │ │ +
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
│ │ │ │ -
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);
│ │ │ │ +
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
│ │ │ │ -
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 }
│ │ │ │ +
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 }
│ │ │ │
│ │ │ │ -
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];
│ │ │ │ +
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 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
│ │ │ │ +
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
│ │ │ │
│ │ │ │ -
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 }
│ │ │ │ +
230 return _node;
│ │ │ │ +
231 }
│ │ │ │
│ │ │ │ -
238
│ │ │ │ -
240
│ │ │ │ +
232
│ │ │ │ +
234
│ │ │ │ +
│ │ │ │ +
237 std::shared_ptr<const Node> unfilteredStorage () const
│ │ │ │ +
238 {
│ │ │ │ +
239 return _node;
│ │ │ │ +
240 }
│ │ │ │ +
│ │ │ │ +
241
│ │ │ │
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.
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,466 +1,336 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -powernode.hh │ │ │ │ │ +filteredcompositenode.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ +5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14 │ │ │ │ │ -15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ -18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_l_t_e_r_s_._h_h> │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include │ │ │ │ │ +16 │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_l_t_e_r_s_._h_h> │ │ │ │ │ +18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ 19 │ │ │ │ │ 20namespace _D_u_n_e { │ │ │ │ │ 21 namespace TypeTree { │ │ │ │ │ 22 │ │ │ │ │ -29#ifndef DOXYGEN │ │ │ │ │ +28#ifndef DOXYGEN │ │ │ │ │ +29 namespace { │ │ │ │ │ 30 │ │ │ │ │ -32 template │ │ │ │ │ -33 struct AssertPowerNodeChildCount │ │ │ │ │ -34 : public std::enable_if::value && │ │ │ │ │ -37 PowerNode::degree() == k, │ │ │ │ │ -38 T> │ │ │ │ │ -39 {}; │ │ │ │ │ -40 │ │ │ │ │ -41#endif │ │ │ │ │ +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 │ │ │ │ │ -48 template │ │ │ │ │ -_4_9 class _P_o_w_e_r_N_o_d_e │ │ │ │ │ -50 { │ │ │ │ │ -51 │ │ │ │ │ -52 public: │ │ │ │ │ -53 │ │ │ │ │ -_5_5 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ -56 │ │ │ │ │ -_5_8 static const bool _i_s_P_o_w_e_r = true; │ │ │ │ │ -59 │ │ │ │ │ -_6_1 static const bool _i_s_C_o_m_p_o_s_i_t_e = false; │ │ │ │ │ -62 │ │ │ │ │ -64 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -_6_5 static const std::size_t _C_H_I_L_D_R_E_N = k; │ │ │ │ │ -66 │ │ │ │ │ -_6_7 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ -68 { │ │ │ │ │ -69 return std::integral_constant{}; │ │ │ │ │ -70 } │ │ │ │ │ -71 │ │ │ │ │ -_7_3 typedef _P_o_w_e_r_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ -74 │ │ │ │ │ -_7_6 typedef T _C_h_i_l_d_T_y_p_e; │ │ │ │ │ +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 │ │ │ │ │ -_7_9 typedef std::array,k> _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -80 │ │ │ │ │ -81 │ │ │ │ │ -83 template │ │ │ │ │ -_8_4 struct _C_h_i_l_d │ │ │ │ │ -85 { │ │ │ │ │ +79 template │ │ │ │ │ +_8_0 class _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +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_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +87 static const bool nodeIsConst = std::is_const::type>::value; │ │ │ │ │ 88 │ │ │ │ │ -_9_0 typedef T _T_y_p_e; │ │ │ │ │ -91 │ │ │ │ │ -_9_3 typedef T _t_y_p_e; │ │ │ │ │ -94 }; │ │ │ │ │ -95 │ │ │ │ │ -98 │ │ │ │ │ -100 │ │ │ │ │ -103 template │ │ │ │ │ -_1_0_4 T& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ -105 { │ │ │ │ │ -106 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -107 return *_children[i]; │ │ │ │ │ -108 } │ │ │ │ │ -109 │ │ │ │ │ +89 template │ │ │ │ │ +90 struct lazy_enable │ │ │ │ │ +91 { │ │ │ │ │ +92 static const bool value = !nodeIsConst; │ │ │ │ │ +93 }; │ │ │ │ │ +94 │ │ │ │ │ +95 public: │ │ │ │ │ +96 │ │ │ │ │ +_9_8 typedef _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ +99 │ │ │ │ │ +_1_0_1 typedef typename mapped_children::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +102 │ │ │ │ │ +_1_0_4 typedef typename mapped_children::ChildTypes _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ +105 │ │ │ │ │ +_1_0_7 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ +108 │ │ │ │ │ +_1_1_0 static const bool _i_s_P_o_w_e_r = false; │ │ │ │ │ 111 │ │ │ │ │ -114 template │ │ │ │ │ -_1_1_5 const T& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ -116 { │ │ │ │ │ -117 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -118 return *_children[i]; │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -122 │ │ │ │ │ -125 template │ │ │ │ │ -_1_2_6 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) │ │ │ │ │ -127 { │ │ │ │ │ -128 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -129 return _children[i]; │ │ │ │ │ -130 } │ │ │ │ │ +_1_1_3 static const bool _i_s_C_o_m_p_o_s_i_t_e = true; │ │ │ │ │ +114 │ │ │ │ │ +116 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +_1_1_7 static const std::size_t _C_H_I_L_D_R_E_N = filter_result::size; │ │ │ │ │ +118 │ │ │ │ │ +_1_1_9 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ +120 { │ │ │ │ │ +121 return std::integral_constant{}; │ │ │ │ │ +122 } │ │ │ │ │ +123 │ │ │ │ │ +125 template │ │ │ │ │ +_1_2_6 struct _C_h_i_l_d { │ │ │ │ │ +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 │ │ │ │ │ -136 template │ │ │ │ │ -_1_3_7 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) const │ │ │ │ │ -138 { │ │ │ │ │ -139 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -140 return _children[i]; │ │ │ │ │ -141 } │ │ │ │ │ +134#endif // DOXYGEN │ │ │ │ │ +135 │ │ │ │ │ +_1_3_7 typedef typename OriginalChild::Type _T_y_p_e; │ │ │ │ │ +138 │ │ │ │ │ +_1_4_0 typedef typename OriginalChild::type _t_y_p_e; │ │ │ │ │ +141 }; │ │ │ │ │ 142 │ │ │ │ │ -144 template │ │ │ │ │ -_1_4_5 void _s_e_t_C_h_i_l_d (T& t, index_constant = {}) │ │ │ │ │ -146 { │ │ │ │ │ -147 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -148 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ -149 } │ │ │ │ │ -150 │ │ │ │ │ -152 template │ │ │ │ │ -_1_5_3 void _s_e_t_C_h_i_l_d (T&& t, index_constant = {}) │ │ │ │ │ -154 { │ │ │ │ │ -155 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -156 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ -157 } │ │ │ │ │ +145 │ │ │ │ │ +147 │ │ │ │ │ +150 template::value, int>::type = 0> │ │ │ │ │ +_1_5_2 auto& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ +153 { │ │ │ │ │ +154 return _node->template child::mapped_index>(); │ │ │ │ │ +155 } │ │ │ │ │ +156 │ │ │ │ │ 158 │ │ │ │ │ -160 template │ │ │ │ │ -_1_6_1 void _s_e_t_C_h_i_l_d (std::shared_ptr st, index_constant = {}) │ │ │ │ │ -162 { │ │ │ │ │ -163 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ -164 _children[i] = std::move(st); │ │ │ │ │ +161 template │ │ │ │ │ +_1_6_2 const auto& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ +163 { │ │ │ │ │ +164 return _node->template child::mapped_index>(); │ │ │ │ │ 165 } │ │ │ │ │ 166 │ │ │ │ │ 168 │ │ │ │ │ -169 │ │ │ │ │ -172 │ │ │ │ │ -174 │ │ │ │ │ -_1_7_7 T& _c_h_i_l_d (std::size_t i) │ │ │ │ │ -178 { │ │ │ │ │ -179 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -180 return *_children[i]; │ │ │ │ │ -181 } │ │ │ │ │ -182 │ │ │ │ │ -184 │ │ │ │ │ -_1_8_7 const T& _c_h_i_l_d (std::size_t i) const │ │ │ │ │ -188 { │ │ │ │ │ -189 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -190 return *_children[i]; │ │ │ │ │ -191 } │ │ │ │ │ -192 │ │ │ │ │ +171 template::value, int>::type = 0> │ │ │ │ │ +_1_7_3 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) │ │ │ │ │ +174 { │ │ │ │ │ +175 return _node->template childStorage::mapped_index>(); │ │ │ │ │ +176 } │ │ │ │ │ +177 │ │ │ │ │ +179 │ │ │ │ │ +182 template │ │ │ │ │ +_1_8_3 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) const │ │ │ │ │ +184 { │ │ │ │ │ +185 return _node->template childStorage::mapped_index>(); │ │ │ │ │ +186 } │ │ │ │ │ +187 │ │ │ │ │ +189 template │ │ │ │ │ +_1_9_0 void _s_e_t_C_h_i_l_d (ChildType&& _c_h_i_l_d, typename std::enable_if:: │ │ │ │ │ +value,void*>::type = 0) │ │ │ │ │ +191 { │ │ │ │ │ +192 _node->template setChild::mapped_index>(std::forward │ │ │ │ │ +(_c_h_i_l_d)); │ │ │ │ │ +193 } │ │ │ │ │ 194 │ │ │ │ │ -_1_9_7 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) │ │ │ │ │ -198 { │ │ │ │ │ -199 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -200 return _children[i]; │ │ │ │ │ -201 } │ │ │ │ │ -202 │ │ │ │ │ -204 │ │ │ │ │ -_2_0_7 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) const │ │ │ │ │ -208 { │ │ │ │ │ -209 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -210 return _children[i]; │ │ │ │ │ +196 │ │ │ │ │ +199 │ │ │ │ │ +200 protected: │ │ │ │ │ +201 │ │ │ │ │ +203 │ │ │ │ │ +206 template │ │ │ │ │ +207 typename std::enable_if::type │ │ │ │ │ +_2_0_8 _u_n_f_i_l_t_e_r_e_d () │ │ │ │ │ +209 { │ │ │ │ │ +210 return *_node; │ │ │ │ │ 211 } │ │ │ │ │ 212 │ │ │ │ │ -_2_1_4 void _s_e_t_C_h_i_l_d (std::size_t i, T& t) │ │ │ │ │ -215 { │ │ │ │ │ -216 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -217 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ -218 } │ │ │ │ │ -219 │ │ │ │ │ -_2_2_1 void _s_e_t_C_h_i_l_d (std::size_t i, T&& t) │ │ │ │ │ -222 { │ │ │ │ │ -223 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -224 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ -225 } │ │ │ │ │ -226 │ │ │ │ │ -_2_2_8 void _s_e_t_C_h_i_l_d (std::size_t i, std::shared_ptr st) │ │ │ │ │ +214 │ │ │ │ │ +_2_1_7 const Node& _u_n_f_i_l_t_e_r_e_d () const │ │ │ │ │ +218 { │ │ │ │ │ +219 return *_node; │ │ │ │ │ +220 } │ │ │ │ │ +221 │ │ │ │ │ +223 │ │ │ │ │ +226 template │ │ │ │ │ +227 typename std::enable_if >::type │ │ │ │ │ +_2_2_8 _u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e () │ │ │ │ │ 229 { │ │ │ │ │ -230 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -231 _children[i] = std::move(st); │ │ │ │ │ -232 } │ │ │ │ │ -233 │ │ │ │ │ -_2_3_4 const _N_o_d_e_S_t_o_r_a_g_e& _n_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ -235 { │ │ │ │ │ -236 return _children; │ │ │ │ │ -237 } │ │ │ │ │ -238 │ │ │ │ │ -240 │ │ │ │ │ +230 return _node; │ │ │ │ │ +231 } │ │ │ │ │ +232 │ │ │ │ │ +234 │ │ │ │ │ +_2_3_7 std::shared_ptr _u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e () const │ │ │ │ │ +238 { │ │ │ │ │ +239 return _node; │ │ │ │ │ +240 } │ │ │ │ │ +241 │ │ │ │ │ 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. │ │ │ │ │ +244 public: │ │ │ │ │ +245 │ │ │ │ │ +248 │ │ │ │ │ +_2_5_0 _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e (std::shared_ptr node) │ │ │ │ │ +251 : _node(std::move(node)) │ │ │ │ │ +252 {} │ │ │ │ │ +253 │ │ │ │ │ +_2_5_5 _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e (Node& node) │ │ │ │ │ +256 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ +257 {} │ │ │ │ │ +258 │ │ │ │ │ 260 │ │ │ │ │ -262 │ │ │ │ │ -266#ifdef DOXYGEN │ │ │ │ │ -267 template │ │ │ │ │ -_2_6_8 ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ -269#else │ │ │ │ │ -270 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ -272 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ -279 } │ │ │ │ │ -280 │ │ │ │ │ -282 │ │ │ │ │ -286#ifdef DOXYGEN │ │ │ │ │ -287 template │ │ │ │ │ -_2_8_8 const ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ -289#else │ │ │ │ │ -290 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ -292 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ -299 } │ │ │ │ │ -300 │ │ │ │ │ -302 │ │ │ │ │ -305 │ │ │ │ │ -306 protected: │ │ │ │ │ -307 │ │ │ │ │ -309 │ │ │ │ │ -_3_1_7 _P_o_w_e_r_N_o_d_e () │ │ │ │ │ -318 {} │ │ │ │ │ -319 │ │ │ │ │ -_3_2_1 explicit _P_o_w_e_r_N_o_d_e (const _N_o_d_e_S_t_o_r_a_g_e& children) │ │ │ │ │ -322 : _children(children) │ │ │ │ │ -323 {} │ │ │ │ │ -324 │ │ │ │ │ -_3_2_6 explicit _P_o_w_e_r_N_o_d_e (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 │ │ │ │ │ -_3_4_3 _P_o_w_e_r_N_o_d_e(T& t1, T& t2, ...) │ │ │ │ │ -344 {} │ │ │ │ │ -345 │ │ │ │ │ -346#else │ │ │ │ │ -347 │ │ │ │ │ -348 template>...>::value │ │ │ │ │ -351 ,int> = 0> │ │ │ │ │ -352 _P_o_w_e_r_N_o_d_e (Children&&... children) │ │ │ │ │ -353 { │ │ │ │ │ -354 static_assert(_d_e_g_r_e_e() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ -called with incorrect number of children"); │ │ │ │ │ -355 _children = _N_o_d_e_S_t_o_r_a_g_e{convert_arg(std::forward(children))...}; │ │ │ │ │ -356 } │ │ │ │ │ -357 │ │ │ │ │ -358 template...>::value │ │ │ │ │ -361 ,int> = 0> │ │ │ │ │ -362 _P_o_w_e_r_N_o_d_e (std::shared_ptr... children) │ │ │ │ │ -363 { │ │ │ │ │ -364 static_assert(_d_e_g_r_e_e() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ -called with incorrect number of children"); │ │ │ │ │ -365 _children = _N_o_d_e_S_t_o_r_a_g_e{children...}; │ │ │ │ │ -366 } │ │ │ │ │ -367 │ │ │ │ │ -368#endif // DOXYGEN │ │ │ │ │ -369 │ │ │ │ │ -371 │ │ │ │ │ -372 private: │ │ │ │ │ -373 _N_o_d_e_S_t_o_r_a_g_e _children; │ │ │ │ │ -374 }; │ │ │ │ │ -375 │ │ │ │ │ -377 │ │ │ │ │ -378 } // namespace TypeTree │ │ │ │ │ -379} //namespace Dune │ │ │ │ │ -380 │ │ │ │ │ -381#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ -_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ +261 private: │ │ │ │ │ +262 std::shared_ptr _node; │ │ │ │ │ +263 }; │ │ │ │ │ +264 │ │ │ │ │ +266 │ │ │ │ │ +267 } // namespace TypeTree │ │ │ │ │ +268} //namespace Dune │ │ │ │ │ +269 │ │ │ │ │ +270#endif // DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ +_f_i_l_t_e_r_s_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a power node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:19 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ -Collect k instances of type T within a dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(T &t, index_constant< i >={}) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:145 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -T & child(std::size_t i) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:177 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const T & child(index_constant< i >={}) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:115 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(std::shared_ptr< T > st, index_constant< i >={}) │ │ │ │ │ -Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:161 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< T > childStorage(index_constant< i >={}) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ -PowerNode(T &t1, T &t2,...) │ │ │ │ │ -Initialize all children with the passed-in objects. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:343 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -const NodeStorage & nodeStorage() const │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:234 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -std::array< std::shared_ptr< T >, k > NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< const T > childStorage(index_constant< i >={}) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:137 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ -PowerNode(T &t, bool distinct_objects=true) │ │ │ │ │ -Initialize all children with copies of a storage object constructed from the │ │ │ │ │ -parameter t. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:326 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -PowerNodeTag NodeTag │ │ │ │ │ -The type tag that describes a PowerNode. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:73 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const T & child(std::size_t i) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:187 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +Base class for composite nodes representing a filtered view on an underlying │ │ │ │ │ +composite node. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:81 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +auto childStorage(index_constant< k >={}) const │ │ │ │ │ +Returns the storage of the k-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:183 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ static constexpr auto degree() │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:67 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< const T > childStorage(std::size_t i) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:207 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:65 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:228 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a non composite in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:61 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:119 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +mapped_children::NodeStorage NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:101 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:190 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ static const bool isLeaf │ │ │ │ │ Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:55 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:107 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d │ │ │ │ │ +const Node & unfiltered() const │ │ │ │ │ +Returns the unfiltered node (const version). │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:217 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a composite in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:113 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e │ │ │ │ │ +std::enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage() │ │ │ │ │ +Returns the storage object of the unfiltered node. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:228 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ static const bool isPower │ │ │ │ │ -Mark this class as a power in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:58 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ -PowerNode(const NodeStorage &children) │ │ │ │ │ -Initialize the PowerNode with a copy of the passed-in storage type. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:321 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ -T ChildType │ │ │ │ │ -The type of each child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -T & child(index_constant< i >={}) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:104 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:268 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(std::size_t i, T &&t) │ │ │ │ │ -Store the passed value in i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:221 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(T &&t, index_constant< i >={}) │ │ │ │ │ -Store the passed value in i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:153 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ -PowerNode() │ │ │ │ │ -Default constructor. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:317 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const ImplementationDefined & child(Indices... indices) │ │ │ │ │ -Returns the child given by the list of indices. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:288 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(std::size_t i, T &t) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:214 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< T > childStorage(std::size_t i) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:197 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:110 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +FilteredCompositeNode(Node &node) │ │ │ │ │ +Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:255 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +FilteredCompositeNode(std::shared_ptr< Node > node) │ │ │ │ │ +Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:250 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +auto childStorage(index_constant< k >={}) │ │ │ │ │ +Returns the storage of the k-th child. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:173 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const auto & child(index_constant< k >={}) const │ │ │ │ │ +Returns the k-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:162 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +auto & child(index_constant< k >={}) │ │ │ │ │ +Returns the k-th child. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:152 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +CompositeNodeTag NodeTag │ │ │ │ │ +The type tag that describes a CompositeNode. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:98 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ +mapped_children::ChildTypes ChildTypes │ │ │ │ │ +A tuple storing the types of all children. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:104 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d │ │ │ │ │ +std::enable_if< enabled, Node & >::type unfiltered() │ │ │ │ │ +Returns the unfiltered node. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:208 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:117 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< const Node > unfilteredStorage() const │ │ │ │ │ +Returns the storage object of the unfiltered node (const version). │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:237 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ │ Access to the type and storage type of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:85 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ │ -T type │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ │ +OriginalChild::type type │ │ │ │ │ The type of the child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:93 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ │ -T Type │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:140 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ │ +OriginalChild::Type Type │ │ │ │ │ The type of the child. │ │ │ │ │ -DDeeffiinniittiioonn powernode.hh:90 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h │ │ │ │ │ -Check if type represents a tree path. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:182 │ │ │ │ │ +DDeeffiinniittiioonn filteredcompositenode.hh:137 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: proxynode.hh File Reference │ │ │ │ +dune-typetree: transformation.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,60 +71,52 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
proxynode.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
transformation.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 <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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Classes

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...
struct  Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive >
 Transform a 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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,49 +1,39 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -proxynode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +transformation.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_<_ _P_r_o_x_i_e_d_N_o_d_e_ _> │ │ │ │ │ -  Mixin class providing methods for child access with compile-time │ │ │ │ │ - parameter. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_<_ _P_r_o_x_i_e_d_N_o_d_e_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ │ -  Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_<_ _P_r_o_x_i_e_d_N_o_d_e_ _> │ │ │ │ │ -  Mixin class providing methods for child access with run-time │ │ │ │ │ - parameter. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _L_e_a_f_N_o_d_e_T_a_g_ _> │ │ │ │ │ -  _P_r_o_x_y_N_o_d_e base class for _L_e_a_f_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g_ _> │ │ │ │ │ -  _P_r_o_x_y_N_o_d_e base class for _C_o_m_p_o_s_i_t_e_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _P_o_w_e_r_N_o_d_e_T_a_g_ _> │ │ │ │ │ -  _P_r_o_x_y_N_o_d_e base class for _P_o_w_e_r_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g_ _> │ │ │ │ │ -  _P_r_o_x_y_N_o_d_e base class for _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_<_ _N_o_d_e_ _> │ │ │ │ │ -  Base class for nodes acting as a proxy for an existing node. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_<_ _S_o_u_r_c_e_T_r_e_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_a_g_, │ │ │ │ │ + _r_e_c_u_r_s_i_v_e_ _> │ │ │ │ │ +  Transform a _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n (SourceNode *, Transformation │ │ │ │ │ + *, Tag *) │ │ │ │ │ +  Register transformation descriptor to transform SourceNode with │ │ │ │ │ + Transformation. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: proxynode.hh Source File │ │ │ │ +dune-typetree: transformation.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,404 +74,510 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
proxynode.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_PROXYNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TRANSFORMATION_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:
│ │ │ │ +
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
│ │ │ │ +
32
│ │ │ │ +
51 template<typename SourceNode, typename Transformation, typename Tag>
│ │ │ │ +
52 void registerNodeTransformation(SourceNode*, Transformation*, Tag*);
│ │ │ │
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
│ │ │ │ +
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
│ │ │ │ -
78 template<std::size_t k>
│ │ │ │ -
│ │ │ │ -
79 const auto& child (index_constant<k> = {}) const
│ │ │ │ -
80 {
│ │ │ │ -
81 return node().proxiedNode().template child<k>();
│ │ │ │ -
82 }
│ │ │ │ -
│ │ │ │ +
76 static_assert((!std::is_same<type,void>::value), "Unable to find valid transformation descriptor");
│ │ │ │ +
77 };
│ │ │ │ +
78
│ │ │ │ +
79#endif // DOXYGEN
│ │ │ │ +
80
│ │ │ │ +
81
│ │ │ │
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 }
│ │ │ │ -
│ │ │ │ +
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 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;
│ │ │ │ +
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
│ │ │ │ -
137 template<bool enabled = !proxiedNodeIsConst>
│ │ │ │ -
138 typename std::enable_if<enabled,Node&>::type
│ │ │ │ -
139 node ()
│ │ │ │ +
│ │ │ │ +
139 static transformed_storage_type transform_storage(std::shared_ptr<const SourceTree> sp, const Transformation& t = Transformation())
│ │ │ │
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:
│ │ │ │ +
│ │ │ │ +
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
│ │ │ │ -
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>
│ │ │ │ - │ │ │ │ +
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
│ │ │ │ -
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 };
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
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()>;
│ │ │ │ +
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 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:
│ │ │ │ +
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 typedef Node ProxiedNode;
│ │ │ │ -
269
│ │ │ │ - │ │ │ │ -
271
│ │ │ │ -
273 static const bool isLeaf = Node::isLeaf;
│ │ │ │ +
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
│ │ │ │ -
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 }
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
│ │ │ │ -
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
│ │ │ │ - │ │ │ │ - │ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ +
void registerNodeTransformation(SourceNode *, Transformation *, Tag *)
Register transformation descriptor to transform SourceNode with Transformation.
│ │ │ │
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,459 +1,629 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -proxynode.hh │ │ │ │ │ +transformation.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_TRANSFORMATION_HH │ │ │ │ │ +5#define DUNE_TYPETREE_TRANSFORMATION_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13 │ │ │ │ │ -14namespace _D_u_n_e { │ │ │ │ │ -15 namespace TypeTree { │ │ │ │ │ -16 │ │ │ │ │ -22 template │ │ │ │ │ -23 class ProxyNode; │ │ │ │ │ -24 │ │ │ │ │ -26 template │ │ │ │ │ -_2_7 class _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -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 _P_r_o_x_y_N_o_d_e_<_P_r_o_x_i_e_d_N_o_d_e_> _N_o_d_e; │ │ │ │ │ -39 │ │ │ │ │ -40 template │ │ │ │ │ -41 typename std::enable_if::type │ │ │ │ │ -42 node () │ │ │ │ │ -43 { │ │ │ │ │ -44 return static_cast<_N_o_d_e&>(*this); │ │ │ │ │ -45 } │ │ │ │ │ -46 │ │ │ │ │ -47 const _N_o_d_e& node () const │ │ │ │ │ -48 { │ │ │ │ │ -49 return static_cast(*this); │ │ │ │ │ -50 } │ │ │ │ │ -51 │ │ │ │ │ -52 public: │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +19 │ │ │ │ │ +20 │ │ │ │ │ +21namespace _D_u_n_e { │ │ │ │ │ +22 namespace TypeTree { │ │ │ │ │ +23 │ │ │ │ │ +29#ifdef DOXYGEN │ │ │ │ │ +30 │ │ │ │ │ +32 │ │ │ │ │ +51 template │ │ │ │ │ +_5_2 void _r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n(SourceNode*, Transformation*, Tag*); │ │ │ │ │ 53 │ │ │ │ │ -55 template │ │ │ │ │ -_5_6 struct _C_h_i_l_d │ │ │ │ │ -57 : public ProxiedNode::template _C_h_i_l_d │ │ │ │ │ -58 {}; │ │ │ │ │ -59 │ │ │ │ │ -62 │ │ │ │ │ -64 │ │ │ │ │ -67 template::value, int>::type = 0> │ │ │ │ │ -_6_9 auto& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ -70 { │ │ │ │ │ -71 return node().proxiedNode().template child(); │ │ │ │ │ -72 } │ │ │ │ │ -73 │ │ │ │ │ +54#else // DOXYGEN │ │ │ │ │ +55 │ │ │ │ │ +66 template │ │ │ │ │ +67 struct LookupNodeTransformation │ │ │ │ │ +68 { │ │ │ │ │ +69 │ │ │ │ │ +70 typedef decltype(_r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n(declptr(),declptr │ │ │ │ │ +(),declptr())) lookup_type; │ │ │ │ │ +71 │ │ │ │ │ +72 typedef typename _e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n< │ │ │ │ │ +73 lookup_type │ │ │ │ │ +74 >::type type; │ │ │ │ │ 75 │ │ │ │ │ -78 template │ │ │ │ │ -_7_9 const auto& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ -80 { │ │ │ │ │ -81 return node().proxiedNode().template child(); │ │ │ │ │ -82 } │ │ │ │ │ +76 static_assert((!std::is_same::value), "Unable to find valid │ │ │ │ │ +transformation descriptor"); │ │ │ │ │ +77 }; │ │ │ │ │ +78 │ │ │ │ │ +79#endif // DOXYGEN │ │ │ │ │ +80 │ │ │ │ │ +81 │ │ │ │ │ 83 │ │ │ │ │ -85 │ │ │ │ │ -88 template::value, int>::type = 0> │ │ │ │ │ -_9_0 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) │ │ │ │ │ -91 { │ │ │ │ │ -92 return node().proxiedNode().template childStorage(); │ │ │ │ │ -93 } │ │ │ │ │ -94 │ │ │ │ │ -96 │ │ │ │ │ -102 template │ │ │ │ │ -_1_0_3 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) const │ │ │ │ │ -104 { │ │ │ │ │ -105 return node().proxiedNode().template childStorage(); │ │ │ │ │ -106 } │ │ │ │ │ +92 template │ │ │ │ │ +_9_3 struct _T_r_a_n_s_f_o_r_m_T_r_e_e │ │ │ │ │ +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 │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>::transformed_type transformed_type; │ │ │ │ │ +102 │ │ │ │ │ +103 // the storage type of the new tree that will result from this │ │ │ │ │ +transformation │ │ │ │ │ +104 typedef typename │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>::transformed_storage_type transformed_storage_type; │ │ │ │ │ +105 │ │ │ │ │ +106#endif // DOXYGEN │ │ │ │ │ 107 │ │ │ │ │ -109 template │ │ │ │ │ -_1_1_0 void _s_e_t_C_h_i_l_d (ProxyChild&& _c_h_i_l_d, typename std:: │ │ │ │ │ -enable_if::value,void*>::type = 0) │ │ │ │ │ -111 { │ │ │ │ │ -112 node().proxiedNode().template setChild(std::forward(_c_h_i_l_d)); │ │ │ │ │ -113 } │ │ │ │ │ -114 │ │ │ │ │ -_1_1_5 const typename ProxiedNode::NodeStorage& _n_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ -116 { │ │ │ │ │ -117 return node().proxiedNode().nodeStorage(); │ │ │ │ │ -118 } │ │ │ │ │ -119 │ │ │ │ │ -120 }; │ │ │ │ │ -121 │ │ │ │ │ -123 │ │ │ │ │ -128 template │ │ │ │ │ -_1_2_9 class _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -130 : public _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -131 { │ │ │ │ │ -132 │ │ │ │ │ -133 typedef _P_r_o_x_y_N_o_d_e_<_P_r_o_x_i_e_d_N_o_d_e_> _N_o_d_e; │ │ │ │ │ -134 │ │ │ │ │ -135 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ +_1_0_9 typedef transformed_type _t_y_p_e; │ │ │ │ │ +110 │ │ │ │ │ +_1_1_1 typedef _t_y_p_e _T_y_p_e; │ │ │ │ │ +112 │ │ │ │ │ +_1_1_4 static transformed_type _t_r_a_n_s_f_o_r_m(const SourceTree& s, const │ │ │ │ │ +Transformation& t = Transformation()) │ │ │ │ │ +115 { │ │ │ │ │ +116 return │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>_:_:_t_r_a_n_s_f_o_r_m(s,t); │ │ │ │ │ +117 } │ │ │ │ │ +118 │ │ │ │ │ +_1_2_0 static transformed_type _t_r_a_n_s_f_o_r_m(const SourceTree& s, Transformation& t) │ │ │ │ │ +121 { │ │ │ │ │ +122 return │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>_:_:_t_r_a_n_s_f_o_r_m(s,t); │ │ │ │ │ +123 } │ │ │ │ │ +124 │ │ │ │ │ +_1_2_6 static transformed_type _t_r_a_n_s_f_o_r_m(std::shared_ptr sp, │ │ │ │ │ +const Transformation& t = Transformation()) │ │ │ │ │ +127 { │ │ │ │ │ +128 return │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>_:_:_t_r_a_n_s_f_o_r_m(sp,t); │ │ │ │ │ +129 } │ │ │ │ │ +130 │ │ │ │ │ +_1_3_2 static transformed_type _t_r_a_n_s_f_o_r_m(std::shared_ptr sp, │ │ │ │ │ +Transformation& t) │ │ │ │ │ +133 { │ │ │ │ │ +134 return │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>_:_:_t_r_a_n_s_f_o_r_m(sp,t); │ │ │ │ │ +135 } │ │ │ │ │ 136 │ │ │ │ │ -137 template │ │ │ │ │ -138 typename std::enable_if::type │ │ │ │ │ -139 node () │ │ │ │ │ +_1_3_9 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr sp, const Transformation& t = Transformation()) │ │ │ │ │ 140 { │ │ │ │ │ -141 return static_cast<_N_o_d_e&>(*this); │ │ │ │ │ +141 return │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(sp,t); │ │ │ │ │ 142 } │ │ │ │ │ 143 │ │ │ │ │ -144 const _N_o_d_e& node () const │ │ │ │ │ -145 { │ │ │ │ │ -146 return static_cast(*this); │ │ │ │ │ -147 } │ │ │ │ │ -148 │ │ │ │ │ -149 public: │ │ │ │ │ +_1_4_6 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr sp, Transformation& t) │ │ │ │ │ +147 { │ │ │ │ │ +148 return │ │ │ │ │ +_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ +recursive>_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(sp,t); │ │ │ │ │ +149 } │ │ │ │ │ 150 │ │ │ │ │ +151 │ │ │ │ │ +152 }; │ │ │ │ │ 153 │ │ │ │ │ +154#ifndef DOXYGEN // internal per-node implementations of the transformation │ │ │ │ │ +algorithm │ │ │ │ │ 155 │ │ │ │ │ -158 template::type = 0> │ │ │ │ │ -_1_6_0 auto& _c_h_i_l_d (std::size_t i) │ │ │ │ │ -161 { │ │ │ │ │ -162 return node().proxiedNode().child(i); │ │ │ │ │ -163 } │ │ │ │ │ -164 │ │ │ │ │ -166 │ │ │ │ │ -_1_6_9 const auto& _c_h_i_l_d (std::size_t i) const │ │ │ │ │ -170 { │ │ │ │ │ -171 return node().proxiedNode().child(i); │ │ │ │ │ -172 } │ │ │ │ │ -173 │ │ │ │ │ -175 │ │ │ │ │ -178 template::type = 0> │ │ │ │ │ -_1_8_0 auto _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) │ │ │ │ │ -181 { │ │ │ │ │ -182 return node().proxiedNode().childStorage(i); │ │ │ │ │ -183 } │ │ │ │ │ -184 │ │ │ │ │ -186 │ │ │ │ │ -_1_9_2 auto _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) const │ │ │ │ │ -193 { │ │ │ │ │ -194 return node().proxiedNode().childStorage(i); │ │ │ │ │ -195 } │ │ │ │ │ -196 │ │ │ │ │ -198 template │ │ │ │ │ -_1_9_9 void _s_e_t_C_h_i_l_d (std::size_t i, ProxyChild&& _c_h_i_l_d, typename std:: │ │ │ │ │ -enable_if::type = 0) │ │ │ │ │ -200 { │ │ │ │ │ -201 node().proxiedNode().setChild(i, std::forward(_c_h_i_l_d)); │ │ │ │ │ -202 } │ │ │ │ │ -203 │ │ │ │ │ -204 }; │ │ │ │ │ -205 │ │ │ │ │ -207 template │ │ │ │ │ -_2_0_8 struct _P_r_o_x_y_N_o_d_e_B_a_s_e; │ │ │ │ │ +156 // handle a leaf node - this is easy │ │ │ │ │ +157 template │ │ │ │ │ +158 struct TransformTree │ │ │ │ │ +159 { │ │ │ │ │ +160 // get transformed type from specification │ │ │ │ │ +161 typedef typename LookupNodeTransformation>_:_:_t_y_p_e │ │ │ │ │ +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 _t_r_a_n_s_f_o_r_m(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 _t_r_a_n_s_f_o_r_m(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 _t_r_a_n_s_f_o_r_m(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 _t_r_a_n_s_f_o_r_m(std::shared_ptr sp, const T& t) │ │ │ │ │ +186 { │ │ │ │ │ +187 return NodeTransformation::transform(sp,t); │ │ │ │ │ +188 } │ │ │ │ │ +189 │ │ │ │ │ +190 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr │ │ │ │ │ +sp, T& t) │ │ │ │ │ +191 { │ │ │ │ │ +192 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ +193 } │ │ │ │ │ +194 │ │ │ │ │ +195 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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 │ │ │ │ │ -211 template │ │ │ │ │ -_2_1_2 struct _P_r_o_x_y_N_o_d_e_B_a_s_e │ │ │ │ │ -213 { │ │ │ │ │ -214 }; │ │ │ │ │ -215 │ │ │ │ │ -217 template │ │ │ │ │ -_2_1_8 struct _P_r_o_x_y_N_o_d_e_B_a_s_e<_N_o_d_e,_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g> │ │ │ │ │ -219 : public _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -220 { │ │ │ │ │ -_2_2_1 typedef typename Node::ChildTypes _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ -_2_2_2 typedef typename Node::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -223 }; │ │ │ │ │ +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 │ │ │ │ │ -226 template │ │ │ │ │ -_2_2_7 struct _P_r_o_x_y_N_o_d_e_B_a_s_e<_N_o_d_e,_P_o_w_e_r_N_o_d_e_T_a_g> │ │ │ │ │ -228 : public _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -229 { │ │ │ │ │ -_2_3_0 typedef typename Node::ChildType _C_h_i_l_d_T_y_p_e; │ │ │ │ │ -_2_3_1 typedef typename Node::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -232 }; │ │ │ │ │ -233 │ │ │ │ │ -235 template │ │ │ │ │ -_2_3_6 struct _P_r_o_x_y_N_o_d_e_B_a_s_e<_N_o_d_e,_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g> │ │ │ │ │ -237 : public _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +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 { │ │ │ │ │ -_2_3_9 typedef typename Node::ChildType _C_h_i_l_d_T_y_p_e; │ │ │ │ │ -_2_4_0 typedef typename Node::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -241 }; │ │ │ │ │ -242 │ │ │ │ │ -244 │ │ │ │ │ -250 template │ │ │ │ │ -_2_5_1 class _P_r_o_x_y_N_o_d_e │ │ │ │ │ -252 : public _P_r_o_x_y_N_o_d_e_B_a_s_e> │ │ │ │ │ -253 { │ │ │ │ │ -254 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ -255 │ │ │ │ │ -256 template │ │ │ │ │ -257 using HasStaticDegree = index_constant; │ │ │ │ │ +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 template │ │ │ │ │ -_2_6_0 static constexpr bool hasStaticDegree = Std::is_detected::value; │ │ │ │ │ -261 │ │ │ │ │ -262 // accessor mixins need to be friends for access to proxiedNode() │ │ │ │ │ -263 friend class _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s; │ │ │ │ │ -264 friend class _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s; │ │ │ │ │ -265 │ │ │ │ │ -266 public: │ │ │ │ │ +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 │ │ │ │ │ -_2_6_8 typedef Node _P_r_o_x_i_e_d_N_o_d_e; │ │ │ │ │ -269 │ │ │ │ │ -_2_7_0 typedef _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g_<_N_o_d_e_> _N_o_d_e_T_a_g; │ │ │ │ │ -271 │ │ │ │ │ -_2_7_3 static const bool _i_s_L_e_a_f = Node::isLeaf; │ │ │ │ │ +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 │ │ │ │ │ -_2_7_6 static const bool _i_s_P_o_w_e_r = Node::isPower; │ │ │ │ │ -277 │ │ │ │ │ -_2_7_9 static const bool _i_s_C_o_m_p_o_s_i_t_e = Node::isComposite; │ │ │ │ │ -280 │ │ │ │ │ -282 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -_2_8_3 static const std::size_t _C_H_I_L_D_R_E_N = Dune::Std::detected_or_t< │ │ │ │ │ -284 std::integral_constant::max │ │ │ │ │ -()>, │ │ │ │ │ -285 _S_t_a_t_i_c_D_e_g_r_e_e, │ │ │ │ │ -286 Node │ │ │ │ │ -287 >::value; │ │ │ │ │ -288 │ │ │ │ │ -289 template , int> = 0> │ │ │ │ │ -_2_9_1 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ -292 { │ │ │ │ │ -293 return N::degree(); │ │ │ │ │ -294 } │ │ │ │ │ -295 │ │ │ │ │ -296 template , int> = 0> │ │ │ │ │ -_2_9_8 auto _d_e_g_r_e_e () const │ │ │ │ │ -299 { │ │ │ │ │ -300 return _p_r_o_x_i_e_d_N_o_d_e().degree(); │ │ │ │ │ -301 } │ │ │ │ │ -302 │ │ │ │ │ -303 │ │ │ │ │ -304 protected: │ │ │ │ │ -305 │ │ │ │ │ -308 │ │ │ │ │ -310 template │ │ │ │ │ -311 typename std::enable_if::type │ │ │ │ │ -_3_1_2 _p_r_o_x_i_e_d_N_o_d_e () │ │ │ │ │ +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 return *_node; │ │ │ │ │ -315 } │ │ │ │ │ -316 │ │ │ │ │ -_3_1_8 const Node& _p_r_o_x_i_e_d_N_o_d_e () const │ │ │ │ │ -319 { │ │ │ │ │ -320 return *_node; │ │ │ │ │ -321 } │ │ │ │ │ -322 │ │ │ │ │ -324 template │ │ │ │ │ -325 typename std::enable_if >::type │ │ │ │ │ -_3_2_6 _p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e () │ │ │ │ │ -327 { │ │ │ │ │ -328 return _node; │ │ │ │ │ +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 │ │ │ │ │ -_3_3_2 std::shared_ptr _p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ +331 // Transform an instance of source tree. │ │ │ │ │ +332 static transformed_type transform(std::shared_ptr source_ptr, │ │ │ │ │ +const Transformation& transformation) │ │ │ │ │ 333 { │ │ │ │ │ -334 return _node; │ │ │ │ │ -335 } │ │ │ │ │ -336 │ │ │ │ │ -338 │ │ │ │ │ -341 │ │ │ │ │ -_3_4_2 _P_r_o_x_y_N_o_d_e (Node& node) │ │ │ │ │ -343 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ -344 {} │ │ │ │ │ -345 │ │ │ │ │ -_3_4_6 _P_r_o_x_y_N_o_d_e (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 │ │ │ │ │ +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 _r_e_s_u_l_t, │ │ │ │ │ +409 LookupNodeTransformation>::type::recursive │ │ │ │ │ +410 >::transformed_type... │ │ │ │ │ +411 >::type transformed_type; │ │ │ │ │ +412 │ │ │ │ │ +413 typedef typename NodeTransformation::template _r_e_s_u_l_t, │ │ │ │ │ +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 _t_r_a_n_s_f_o_r_m(const S& s, T& t) │ │ │ │ │ +481 { │ │ │ │ │ +482 return transform_composite_node::transform │ │ │ │ │ +(s,t,child_indices()); │ │ │ │ │ +483 } │ │ │ │ │ +484 │ │ │ │ │ +485 static transformed_type _t_r_a_n_s_f_o_r_m(const S& s, const T& t) │ │ │ │ │ +486 { │ │ │ │ │ +487 return transform_composite_node::transform │ │ │ │ │ +(s,t,child_indices()); │ │ │ │ │ +488 } │ │ │ │ │ +489 │ │ │ │ │ +490 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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 _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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 │ │ │ │ │ +_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ _n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ -decltype(Node::degree()) StaticDegree │ │ │ │ │ -Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ +_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +void registerNodeTransformation(SourceNode *, Transformation *, Tag *) │ │ │ │ │ +Register transformation descriptor to transform SourceNode with Transformation. │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a power node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:19 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a power node with runtime degree. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:22 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e │ │ │ │ │ -Base class for nodes acting as a proxy for an existing node. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:253 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_P_r_o_x_y_N_o_d_e │ │ │ │ │ -ProxyNode(Node &node) │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:342 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -Dune::TypeTree::NodeTag< Node > NodeTag │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:270 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a composite in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:279 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:273 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:276 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ -auto degree() const │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:298 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e │ │ │ │ │ -std::enable_if< enabled, Node & >::type proxiedNode() │ │ │ │ │ -Returns the proxied node. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:312 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:283 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< const Node > proxiedNodeStorage() const │ │ │ │ │ -Returns the storage of the proxied node (const version). │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:332 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_P_r_o_x_i_e_d_N_o_d_e │ │ │ │ │ -Node ProxiedNode │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:268 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage() │ │ │ │ │ -Returns the storage of the proxied node. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:326 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:291 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_P_r_o_x_y_N_o_d_e │ │ │ │ │ -ProxyNode(std::shared_ptr< Node > node) │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:346 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e │ │ │ │ │ -const Node & proxiedNode() const │ │ │ │ │ -Returns the proxied node (const version). │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:318 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -Mixin class providing methods for child access with compile-time parameter. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:28 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ -auto & child(index_constant< k >={}) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:69 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:110 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -const ProxiedNode::NodeStorage & nodeStorage() const │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:115 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -auto childStorage(index_constant< k >={}) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:90 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ -const auto & child(index_constant< k >={}) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -auto childStorage(index_constant< k >={}) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:103 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_C_h_i_l_d │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:58 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ -Mixin class providing methods for child access with run-time parameter. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:131 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ -auto & child(std::size_t i) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:160 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -auto childStorage(std::size_t i) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:192 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:199 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ -const auto & child(std::size_t i) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:169 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -auto childStorage(std::size_t i) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:180 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e │ │ │ │ │ -Tag-based dispatch to appropriate base class that provides necessary │ │ │ │ │ -functionality. │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:208 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g_ _>_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -Node::NodeStorage NodeStorage │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:222 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g_ _>_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ -Node::ChildTypes ChildTypes │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:221 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -Node::NodeStorage NodeStorage │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:231 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ -Node::ChildType ChildType │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:230 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -Node::NodeStorage NodeStorage │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:240 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ -Node::ChildType ChildType │ │ │ │ │ -DDeeffiinniittiioonn proxynode.hh:239 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e │ │ │ │ │ +Transform a TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:94 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_T_y_p_e │ │ │ │ │ +type Type │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:111 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(std::shared_ptr< const SourceTree > sp, │ │ │ │ │ +Transformation &t) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:132 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(std::shared_ptr< const SourceTree > sp, const │ │ │ │ │ +Transformation &t=Transformation()) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(const SourceTree &s, Transformation &t) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:120 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_y_p_e │ │ │ │ │ +transformed_type type │ │ │ │ │ +The type of the transformed tree. │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:109 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(const SourceTree &s, const Transformation │ │ │ │ │ +&t=Transformation()) │ │ │ │ │ +Apply transformation to an existing tree s. │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:114 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceTree > sp, const Transformation &t=Transformation()) │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:139 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceTree > sp, Transformation &t) │ │ │ │ │ +DDeeffiinniittiioonn transformation.hh:146 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ +Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:140 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: utility.hh File Reference │ │ │ │ +dune-typetree: traversalutilities.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,45 +70,102 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
utility.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
traversalutilities.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 <dune/typetree/traversal.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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ 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.
 
│ │ │ │ +

Variable Documentation

│ │ │ │ + │ │ │ │ +

◆ _functor

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

◆ _reduction

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

◆ _value

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

◆ treePathType

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
const TreePathType::Type treePathType = TreePathType::dynamic
│ │ │ │ +
│ │ │ │ +static
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,31 +1,33 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -utility.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +traversalutilities.hh File Reference │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_<_ _T_r_e_e_,_ _T_a_g_ _> │ │ │ │ │ -  Struct for obtaining some basic structural information about a │ │ │ │ │ - _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +ResultType  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_d_u_c_e_O_v_e_r_L_e_a_f_s (const Tree &tree, F functor, R │ │ │ │ │ + reduction, ResultType startValue) │ │ │ │ │ +  Calculate a quantity as a reduction over the leaf nodes of a │ │ │ │ │ + _T_y_p_e_T_r_e_e. │ │ │ │ │ +  │ │ │ │ │ +********** VVaarriiaabbllee DDooccuummeennttaattiioonn ********** │ │ │ │ │ +********** _?◆_? __ffuunnccttoorr ********** │ │ │ │ │ +F _functor │ │ │ │ │ +********** _?◆_? __rreedduuccttiioonn ********** │ │ │ │ │ +R _reduction │ │ │ │ │ +********** _?◆_? __vvaalluuee ********** │ │ │ │ │ +ResultType _value │ │ │ │ │ +********** _?◆_? ttrreeeePPaatthhTTyyppee ********** │ │ │ │ │ +const TreePathType::Type treePathType = TreePathType::dynamic static │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00020_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: utility.hh Source File │ │ │ │ +dune-typetree: traversalutilities.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,284 +74,89 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
utility.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_UTILITY_HH
│ │ │ │ -
5#define DUNE_TYPETREE_UTILITY_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TRAVERSALUTILITIES_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>
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ +
8
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10 namespace TypeTree {
│ │ │ │ +
11
│ │ │ │ +
17 namespace {
│ │ │ │
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 }
│ │ │ │ -
39
│ │ │ │ -
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 }
│ │ │ │ +
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 };
│ │ │ │ +
51
│ │ │ │ +
52 } // anonymous namespace
│ │ │ │ +
53
│ │ │ │
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
│ │ │ │ - │ │ │ │ - │ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
Type
Definition treepath.hh:30
│ │ │ │ +
@ dynamic
Definition treepath.hh:30
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,312 +1,108 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -utility.hh │ │ │ │ │ +traversalutilities.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_TRAVERSALUTILITIES_HH │ │ │ │ │ +5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12 │ │ │ │ │ -13#include │ │ │ │ │ -14#include │ │ │ │ │ -15#include │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +8 │ │ │ │ │ +9namespace _D_u_n_e { │ │ │ │ │ +10 namespace TypeTree { │ │ │ │ │ +11 │ │ │ │ │ +17 namespace { │ │ │ │ │ 18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -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 } │ │ │ │ │ -39 │ │ │ │ │ -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 } │ │ │ │ │ +20 │ │ │ │ │ +25 template │ │ │ │ │ +26 struct LeafReductionVisitor │ │ │ │ │ +27 : public TypeTree::TreeVisitor │ │ │ │ │ +28 { │ │ │ │ │ +29 │ │ │ │ │ +_3_0 static const _T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e _t_r_e_e_P_a_t_h_T_y_p_e = _T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c; │ │ │ │ │ +31 │ │ │ │ │ +32 template │ │ │ │ │ +33 void leaf(const Node& node, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h) │ │ │ │ │ +34 { │ │ │ │ │ +35 ___v_a_l_u_e = ___r_e_d_u_c_t_i_o_n(___v_a_l_u_e,___f_u_n_c_t_o_r(node,_t_r_e_e_P_a_t_h)); │ │ │ │ │ +36 } │ │ │ │ │ +37 │ │ │ │ │ +38 LeafReductionVisitor(F functor, R reduction, ResultType startValue) │ │ │ │ │ +39 : ___f_u_n_c_t_o_r(functor) │ │ │ │ │ +40 , ___r_e_d_u_c_t_i_o_n(reduction) │ │ │ │ │ +41 , ___v_a_l_u_e(startValue) │ │ │ │ │ +42 {} │ │ │ │ │ +43 │ │ │ │ │ +44 ResultType _r_e_s_u_l_t() { return ___v_a_l_u_e; } │ │ │ │ │ +45 │ │ │ │ │ +_4_6 F ___f_u_n_c_t_o_r; │ │ │ │ │ +_4_7 R ___r_e_d_u_c_t_i_o_n; │ │ │ │ │ +_4_8 ResultType ___v_a_l_u_e; │ │ │ │ │ +49 │ │ │ │ │ +50 }; │ │ │ │ │ +51 │ │ │ │ │ +52 } // anonymous namespace │ │ │ │ │ +53 │ │ │ │ │ 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 _r_e_s_u_l_t = Op{}(T{Args}...); │ │ │ │ │ -123 return std::integral_constant,_r_e_s_u_l_t>{}; │ │ │ │ │ -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 │ │ │ │ │ -_1_6_7 struct _T_r_e_e_I_n_f_o │ │ │ │ │ -168 { │ │ │ │ │ -169 │ │ │ │ │ -170 private: │ │ │ │ │ -171 // Start the tree traversal │ │ │ │ │ -172 typedef _T_r_e_e_I_n_f_o_<_T_r_e_e_,_N_o_d_e_T_a_g_<_T_r_e_e_>> _N_o_d_e_I_n_f_o; │ │ │ │ │ -173 │ │ │ │ │ -174 public: │ │ │ │ │ -175 │ │ │ │ │ -_1_7_7 static const std::size_t _d_e_p_t_h = _N_o_d_e_I_n_f_o_:_:_d_e_p_t_h; │ │ │ │ │ -178 │ │ │ │ │ -_1_8_0 static const std::size_t _n_o_d_e_C_o_u_n_t = _N_o_d_e_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t; │ │ │ │ │ -181 │ │ │ │ │ -_1_8_3 static const std::size_t _l_e_a_f_C_o_u_n_t = _N_o_d_e_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t; │ │ │ │ │ -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 _T_r_e_e_I_n_f_o │ │ │ │ │ -198 { │ │ │ │ │ -199 │ │ │ │ │ -200 static const std::size_t _d_e_p_t_h = 1; │ │ │ │ │ -201 │ │ │ │ │ -202 static const std::size_t _n_o_d_e_C_o_u_n_t = 1; │ │ │ │ │ -203 │ │ │ │ │ -204 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 _d_e_p_t_h = 1 + ChildInfo::depth; │ │ │ │ │ -217 │ │ │ │ │ -218 static const std::size_t _n_o_d_e_C_o_u_n_t = 1 + StaticDegree::value * │ │ │ │ │ -ChildInfo::nodeCount; │ │ │ │ │ -219 │ │ │ │ │ -220 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 _n_o_d_e_C_o_u_n_t = 0; │ │ │ │ │ -256 │ │ │ │ │ -257 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 _d_e_p_t_h = 1 + Children::maxDepth; │ │ │ │ │ -271 │ │ │ │ │ -272 static const std::size_t _n_o_d_e_C_o_u_n_t = 1 + Children::nodeCount; │ │ │ │ │ -273 │ │ │ │ │ -274 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 │ │ │ │ │ +80 template │ │ │ │ │ +_8_1 ResultType _r_e_d_u_c_e_O_v_e_r_L_e_a_f_s(const Tree& tree, F functor, R reduction, │ │ │ │ │ +ResultType startValue) │ │ │ │ │ +82 { │ │ │ │ │ +83 LeafReductionVisitor visitor(functor,reduction,startValue); │ │ │ │ │ +84 _T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e(tree,visitor); │ │ │ │ │ +85 return visitor.result(); │ │ │ │ │ +86 } │ │ │ │ │ +87 │ │ │ │ │ +89 │ │ │ │ │ +90 } // namespace TypeTree │ │ │ │ │ +91} //namespace Dune │ │ │ │ │ +92 │ │ │ │ │ +93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ +___r_e_d_u_c_t_i_o_n │ │ │ │ │ +R _reduction │ │ │ │ │ +DDeeffiinniittiioonn traversalutilities.hh:47 │ │ │ │ │ +___f_u_n_c_t_o_r │ │ │ │ │ +F _functor │ │ │ │ │ +DDeeffiinniittiioonn traversalutilities.hh:46 │ │ │ │ │ +_t_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ +static const TreePathType::Type treePathType │ │ │ │ │ +DDeeffiinniittiioonn traversalutilities.hh:30 │ │ │ │ │ +___v_a_l_u_e │ │ │ │ │ +ResultType _value │ │ │ │ │ +DDeeffiinniittiioonn traversalutilities.hh:48 │ │ │ │ │ _r_e_s_u_l_t │ │ │ │ │ static const result_type result │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_d_u_c_e_O_v_e_r_L_e_a_f_s │ │ │ │ │ +ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType │ │ │ │ │ +startValue) │ │ │ │ │ +Calculate a quantity as a reduction over the leaf nodes of a TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn traversalutilities.hh:81 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e │ │ │ │ │ +void applyToTree(Tree &&tree, Visitor &&visitor) │ │ │ │ │ +Apply visitor to TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn traversal.hh:237 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:521 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t │ │ │ │ │ -auto leafCount(const Tree &tree) │ │ │ │ │ -The number of leaf nodes in the Tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:530 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t │ │ │ │ │ -auto nodeCount(const Tree &tree) │ │ │ │ │ -The total number of nodes in the Tree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:522 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h │ │ │ │ │ -auto depth(const Tree &tree) │ │ │ │ │ -The depth of the TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn visitor.hh:506 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o │ │ │ │ │ -Struct for obtaining some basic structural information about a TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn utility.hh:168 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t │ │ │ │ │ -static const std::size_t leafCount │ │ │ │ │ -The number of leaf nodes in the TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn utility.hh:183 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_:_:_d_e_p_t_h │ │ │ │ │ -static const std::size_t depth │ │ │ │ │ -The depth of the TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn utility.hh:177 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t │ │ │ │ │ -static const std::size_t nodeCount │ │ │ │ │ -The total number of nodes in the TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn utility.hh:180 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e │ │ │ │ │ +Type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c │ │ │ │ │ +@ dynamic │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: fixedcapacitystack.hh File Reference │ │ │ │ +dune-typetree: typetraits.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,36 +71,100 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
fixedcapacitystack.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
typetraits.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <cassert>
│ │ │ │ +
#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

class  Dune::TypeTree::FixedCapacityStackView< T >
struct  Dune::first_type< T0, T... >
 
class  Dune::TypeTree::FixedCapacityStack< T, capacity >
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.
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,23 +1,87 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -fixedcapacitystack.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +typetraits.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_<_ _T_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_f_i_r_s_t___t_y_p_e_<_ _T_0_,_ _T_._._._ _> │ │ │ │ │   │ │ │ │ │ -class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_<_ _T_,_ _c_a_p_a_c_i_t_y_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_<_ _T_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_<_ _T_ _>_:_:_y_e_s │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_<_ _T_ _>_:_:_n_o │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_m_a_y_b_e_<_ _N_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_y_e_s │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_n_o │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_<_ _T_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_<_ _T_ _>_:_:_y_e_s │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_<_ _T_ _>_:_:_n_o │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_m_a_y_b_e_<_ _N_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_y_e_s │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_n_o │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_l_w_a_y_s_V_o_i_d_<_ _t_y_p_e_n_a_m_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ +  Marker tag declaring a meta function. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___e_v_a_l_u_a_t_e_<_ _F_ _> │ │ │ │ │ +  Helper meta function to delay evaluation of F. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___i_d_e_n_t_i_t_y_<_ _F_ _> │ │ │ │ │ +  Identity function. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n_<_ _F_ _> │ │ │ │ │ +  Meta function that evaluates its argument iff it inherits from │ │ │ │ │ + _m_e_t_a___f_u_n_c_t_i_o_n. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h_<_ _T_ _> │ │ │ │ │ +  Check if type represents a tree path. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l │ │ │ │ │ +  │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ + T *  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_c_l_p_t_r () │ │ │ │ │ +  Helper function for generating a pointer to a value of type T │ │ │ │ │ + in an unevaluated operand setting. │ │ │ │ │ +  │ │ │ │ │ +constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l_:_:_i_s_T_r_e_e_P_a_t_h (void *) -> std::false_type │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l_:_:_i_s_T_r_e_e_P_a_t_h (const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< I... > │ │ │ │ │ + *) -> std::true_type │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s_T_r_e_e_P_a_t_h (const T &) -> _I_s_T_r_e_e_P_a_t_h< T > │ │ │ │ │ +  Check if given object represents a tree path. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00023_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: fixedcapacitystack.hh Source File │ │ │ │ +dune-typetree: typetraits.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,213 +74,276 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
fixedcapacitystack.hh
│ │ │ │ +
typetraits.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_TYPETRAITS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │
6
│ │ │ │ -
7#include <array>
│ │ │ │ -
8#include <cassert>
│ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <dune/common/typetraits.hh>
│ │ │ │
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11 namespace TypeTree {
│ │ │ │ + │ │ │ │ + │ │ │ │
12
│ │ │ │ -
13
│ │ │ │ +
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>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
20 {
│ │ │ │ -
21
│ │ │ │ -
22 public:
│ │ │ │ -
23
│ │ │ │ -
24 struct Impl
│ │ │ │ -
25 {
│ │ │ │ +
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 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 {}
│ │ │ │ +
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 };
│ │ │ │
│ │ │ │ -
41
│ │ │ │ -
42 public:
│ │ │ │
43
│ │ │ │ -
│ │ │ │ -
44 std::size_t size() const
│ │ │ │ -
45 {
│ │ │ │ -
46 return _impl._size;
│ │ │ │ -
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()
│ │ │ │ -
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 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 }
│ │ │ │ -
│ │ │ │ +
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 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 };
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
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:
│ │ │ │ -
128
│ │ │ │ -
129 using view_base::back;
│ │ │ │ -
130 using view_base::front;
│ │ │ │ -
131 using view_base::size;
│ │ │ │ -
132 using view_base::operator[];
│ │ │ │ -
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:
│ │ │ │ -
140
│ │ │ │ -
141 //FixedCapacityStack(const FixedCapacityStack&);
│ │ │ │ -
142 FixedCapacityStack& operator=(const FixedCapacityStack&);
│ │ │ │ -
143
│ │ │ │ -
144 };
│ │ │ │ +
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 };
│ │ │ │
│ │ │ │ -
145
│ │ │ │
147
│ │ │ │ -
148 } // namespace TypeTree
│ │ │ │ -
149} //namespace Dune
│ │ │ │ -
150
│ │ │ │ -
151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH
│ │ │ │ +
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ + │ │ │ │ + │ │ │ │ +
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
│ │ │ │ + │ │ │ │ +
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 {} │ │ │ │ │ @@ -1,207 +1,342 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -fixedcapacitystack.hh │ │ │ │ │ +typetraits.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_TYPETRAITS_HH │ │ │ │ │ +5#define DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10namespace _D_u_n_e { │ │ │ │ │ -11 namespace TypeTree { │ │ │ │ │ +10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ 12 │ │ │ │ │ -13 │ │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ │ +14 │ │ │ │ │ +15 // Provide some more C++11 TMP helpers. │ │ │ │ │ +16 // These should be upstreamed to dune-common ASAP. │ │ │ │ │ 17 │ │ │ │ │ -18 template │ │ │ │ │ -_1_9 class _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ -20 { │ │ │ │ │ -21 │ │ │ │ │ -22 public: │ │ │ │ │ -23 │ │ │ │ │ -24 struct Impl │ │ │ │ │ -25 { │ │ │ │ │ +18 template │ │ │ │ │ +_1_9 struct _f_i_r_s_t___t_y_p_e; │ │ │ │ │ +20 │ │ │ │ │ +21 template │ │ │ │ │ +_2_2 struct _f_i_r_s_t___t_y_p_e │ │ │ │ │ +23 { │ │ │ │ │ +_2_4 typedef T0 _t_y_p_e; │ │ │ │ │ +25 }; │ │ │ │ │ 26 │ │ │ │ │ -27 Impl(T* data, std::size_t _c_a_p_a_c_i_t_y) │ │ │ │ │ -28 : _data(data) │ │ │ │ │ -29 , _size(0) │ │ │ │ │ -30 , _capacity(_c_a_p_a_c_i_t_y) │ │ │ │ │ -31 {} │ │ │ │ │ -32 │ │ │ │ │ -33 T * const _data; │ │ │ │ │ -34 std::size_t _size; │ │ │ │ │ -35 const std::size_t _capacity; │ │ │ │ │ -36 }; │ │ │ │ │ -37 │ │ │ │ │ -_3_8 _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w(Impl& impl) │ │ │ │ │ -39 : _impl(impl) │ │ │ │ │ -40 {} │ │ │ │ │ -41 │ │ │ │ │ -42 public: │ │ │ │ │ +27 namespace TypeTree { │ │ │ │ │ +28 │ │ │ │ │ +29 template │ │ │ │ │ +_3_0 struct _h_a_s___n_o_d_e___t_a_g │ │ │ │ │ +31 { │ │ │ │ │ +_3_2 struct _y_e_s { char _d_u_m_m_y[1]; }; │ │ │ │ │ +_3_3 struct _n_o { char _d_u_m_m_y[2]; }; │ │ │ │ │ +34 │ │ │ │ │ +35 template │ │ │ │ │ +_3_6 static _y_e_s _t_e_s_t(_N_o_d_e_T_a_g_<_X_> *); │ │ │ │ │ +37 template │ │ │ │ │ +_3_8 static _n_o _t_e_s_t(...); │ │ │ │ │ +39 │ │ │ │ │ +_4_1 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ +42 }; │ │ │ │ │ 43 │ │ │ │ │ -_4_4 std::size_t _s_i_z_e() const │ │ │ │ │ -45 { │ │ │ │ │ -46 return _impl._size; │ │ │ │ │ -47 } │ │ │ │ │ -48 │ │ │ │ │ -_4_9 std::size_t _c_a_p_a_c_i_t_y() const │ │ │ │ │ -50 { │ │ │ │ │ -51 return _impl._capacity; │ │ │ │ │ -52 } │ │ │ │ │ -53 │ │ │ │ │ -_5_4 bool _e_m_p_t_y() const │ │ │ │ │ -55 { │ │ │ │ │ -56 return _impl._size == 0; │ │ │ │ │ -57 } │ │ │ │ │ -58 │ │ │ │ │ -_5_9 bool _f_u_l_l() const │ │ │ │ │ -60 { │ │ │ │ │ -61 return _impl._size == _impl._capacity; │ │ │ │ │ -62 } │ │ │ │ │ -63 │ │ │ │ │ -_6_4 void _p_u_s_h___b_a_c_k(const T& t) │ │ │ │ │ -65 { │ │ │ │ │ -66 assert(!_f_u_l_l()); │ │ │ │ │ -67 _impl._data[_impl._size++] = t; │ │ │ │ │ -68 } │ │ │ │ │ -69 │ │ │ │ │ -_7_0 void _p_o_p___b_a_c_k() │ │ │ │ │ -71 { │ │ │ │ │ -72 assert(!_e_m_p_t_y()); │ │ │ │ │ -73 --_impl._size; │ │ │ │ │ -74 } │ │ │ │ │ -75 │ │ │ │ │ -_7_6 T& _b_a_c_k() │ │ │ │ │ -77 { │ │ │ │ │ -78 assert(!_e_m_p_t_y()); │ │ │ │ │ -79 return _impl._data[_impl._size-1]; │ │ │ │ │ -80 } │ │ │ │ │ -81 │ │ │ │ │ -_8_2 const T& _b_a_c_k() const │ │ │ │ │ -83 { │ │ │ │ │ -84 assert(!_e_m_p_t_y()); │ │ │ │ │ -85 return _impl._data[_impl._size-1]; │ │ │ │ │ -86 } │ │ │ │ │ -87 │ │ │ │ │ -_8_8 T& _f_r_o_n_t() │ │ │ │ │ -89 { │ │ │ │ │ -90 assert(!_e_m_p_t_y()); │ │ │ │ │ -91 return _impl._data[0]; │ │ │ │ │ -92 } │ │ │ │ │ -93 │ │ │ │ │ -_9_4 const T& _f_r_o_n_t() const │ │ │ │ │ -95 { │ │ │ │ │ -96 assert(!_e_m_p_t_y()); │ │ │ │ │ -97 return _impl._data[0]; │ │ │ │ │ -98 } │ │ │ │ │ -99 │ │ │ │ │ -_1_0_0 T& _o_p_e_r_a_t_o_r_[_](std::size_t k) │ │ │ │ │ -101 { │ │ │ │ │ -102 assert(k < _impl._size); │ │ │ │ │ -103 return _impl._data[k]; │ │ │ │ │ -104 } │ │ │ │ │ +44 template │ │ │ │ │ +_4_5 struct _h_a_s___n_o_d_e___t_a_g___v_a_l_u_e │ │ │ │ │ +46 { │ │ │ │ │ +47 template │ │ │ │ │ +_4_8 struct _m_a_y_b_e { char _d_u_m_m_y[N+1]; }; │ │ │ │ │ +_4_9 struct _y_e_s { char _d_u_m_m_y[2]; }; │ │ │ │ │ +_5_0 struct _n_o { char _d_u_m_m_y[1]; }; │ │ │ │ │ +51 │ │ │ │ │ +52 template │ │ │ │ │ +53 static _m_a_y_b_e_<_s_t_d_:_:_i_s___b_a_s_e___o_f_<_V_,_ _N_o_d_e_T_a_g_<_X_>>_:_:_v_a_l_u_e> │ │ │ │ │ +_5_4 _t_e_s_t(_N_o_d_e_T_a_g_<_X_> * a); │ │ │ │ │ +55 template │ │ │ │ │ +_5_6 static _n_o _t_e_s_t(...); │ │ │ │ │ +57 │ │ │ │ │ +_5_9 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ +60 }; │ │ │ │ │ +61 │ │ │ │ │ +62 template │ │ │ │ │ +_6_3 struct _h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g │ │ │ │ │ +64 { │ │ │ │ │ +_6_5 struct _y_e_s { char _d_u_m_m_y[1]; }; │ │ │ │ │ +_6_6 struct _n_o { char _d_u_m_m_y[2]; }; │ │ │ │ │ +67 │ │ │ │ │ +68 template │ │ │ │ │ +_6_9 static _y_e_s _t_e_s_t(_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g_<_X_> *); │ │ │ │ │ +70 template │ │ │ │ │ +_7_1 static _n_o _t_e_s_t(...); │ │ │ │ │ +72 │ │ │ │ │ +_7_4 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ +75 }; │ │ │ │ │ +76 │ │ │ │ │ +77 template │ │ │ │ │ +_7_8 struct _h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e │ │ │ │ │ +79 { │ │ │ │ │ +80 template │ │ │ │ │ +_8_1 struct _m_a_y_b_e { char _d_u_m_m_y[N+1]; }; │ │ │ │ │ +_8_2 struct _y_e_s { char _d_u_m_m_y[2]; }; │ │ │ │ │ +_8_3 struct _n_o { char _d_u_m_m_y[1]; }; │ │ │ │ │ +84 │ │ │ │ │ +85 template │ │ │ │ │ +86 static _m_a_y_b_e_<_s_t_d_:_:_i_s___b_a_s_e___o_f_<_V_,_ _I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g_<_X_>>_:_:_v_a_l_u_e> │ │ │ │ │ +_8_7 _t_e_s_t(_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g_<_X_> * a); │ │ │ │ │ +88 template │ │ │ │ │ +_8_9 static _n_o _t_e_s_t(...); │ │ │ │ │ +90 │ │ │ │ │ +_9_2 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ +93 }; │ │ │ │ │ +94 │ │ │ │ │ +95 template │ │ │ │ │ +_9_6 struct _A_l_w_a_y_s_V_o_i_d │ │ │ │ │ +97 { │ │ │ │ │ +_9_8 typedef void _t_y_p_e; │ │ │ │ │ +99 }; │ │ │ │ │ +100 │ │ │ │ │ +101 │ │ │ │ │ +103 template │ │ │ │ │ +_1_0_4 T* _d_e_c_l_p_t_r(); │ │ │ │ │ 105 │ │ │ │ │ -_1_0_6 const T& _o_p_e_r_a_t_o_r_[_](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 }; │ │ │ │ │ +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 │ │ │ │ │ -117 │ │ │ │ │ -118 template │ │ │ │ │ -_1_1_9 class _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k │ │ │ │ │ -120 : private std::array │ │ │ │ │ -121 , private _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w::Impl │ │ │ │ │ -122 , public _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ -123 { │ │ │ │ │ -124 │ │ │ │ │ -125 typedef _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_<_T_> _v_i_e_w___b_a_s_e; │ │ │ │ │ -126 │ │ │ │ │ -127 public: │ │ │ │ │ -128 │ │ │ │ │ -129 using _v_i_e_w___b_a_s_e_:_:_b_a_c_k; │ │ │ │ │ -130 using _v_i_e_w___b_a_s_e_:_:_f_r_o_n_t; │ │ │ │ │ -131 using _v_i_e_w___b_a_s_e_:_:_s_i_z_e; │ │ │ │ │ -132 using view_base::operator[]; │ │ │ │ │ -133 │ │ │ │ │ -_1_3_4 _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k() │ │ │ │ │ -135 : _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w::Impl(&(static_cast&> │ │ │ │ │ -(*this)[0]),_c_a_p_a_c_i_t_y) │ │ │ │ │ -136 , _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w(static_cast::Impl&>(*this)) │ │ │ │ │ -137 {} │ │ │ │ │ -138 │ │ │ │ │ -139 private: │ │ │ │ │ -140 │ │ │ │ │ -141 //FixedCapacityStack(const FixedCapacityStack&); │ │ │ │ │ -142 _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k& operator=(const _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k&); │ │ │ │ │ -143 │ │ │ │ │ -144 }; │ │ │ │ │ -145 │ │ │ │ │ +118 │ │ │ │ │ +_1_2_1 struct _m_e_t_a___f_u_n_c_t_i_o_n {}; │ │ │ │ │ +122 │ │ │ │ │ +124 template │ │ │ │ │ +_1_2_5 struct _l_a_z_y___e_v_a_l_u_a_t_e │ │ │ │ │ +126 { │ │ │ │ │ +_1_2_7 typedef typename F::type _t_y_p_e; │ │ │ │ │ +128 }; │ │ │ │ │ +129 │ │ │ │ │ +131 template │ │ │ │ │ +_1_3_2 struct _l_a_z_y___i_d_e_n_t_i_t_y │ │ │ │ │ +133 { │ │ │ │ │ +_1_3_4 typedef F _t_y_p_e; │ │ │ │ │ +135 }; │ │ │ │ │ +136 │ │ │ │ │ +138 template │ │ │ │ │ +_1_3_9 struct _e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ +140 { │ │ │ │ │ +141 typedef typename std::conditional< │ │ │ │ │ +142 std::is_base_of::value, │ │ │ │ │ +143 _l_a_z_y___e_v_a_l_u_a_t_e_<_F_>, │ │ │ │ │ +144 _l_a_z_y___i_d_e_n_t_i_t_y_<_F_> │ │ │ │ │ +_1_4_5 >::type::type _t_y_p_e; │ │ │ │ │ +146 }; │ │ │ │ │ 147 │ │ │ │ │ -148 } // namespace TypeTree │ │ │ │ │ -149} //namespace Dune │ │ │ │ │ -150 │ │ │ │ │ -151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ +_1_4_8 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 │ │ │ │ │ +_1_5_3 constexpr auto _i_s_T_r_e_e_P_a_t_h(void*) │ │ │ │ │ +154 -> std::false_type │ │ │ │ │ +155 { │ │ │ │ │ +156 return std::false_type(); │ │ │ │ │ +157 } │ │ │ │ │ +158 │ │ │ │ │ +159 // Overload for instances of HybridTreePath<...> │ │ │ │ │ +160 template │ │ │ │ │ +_1_6_1 constexpr auto _i_s_T_r_e_e_P_a_t_h(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_I_._._._>*) │ │ │ │ │ +162 -> std::true_type │ │ │ │ │ +163 { │ │ │ │ │ +164 return std::true_type(); │ │ │ │ │ +165 } │ │ │ │ │ +166 │ │ │ │ │ +167 } │ │ │ │ │ +168 │ │ │ │ │ +179 template │ │ │ │ │ +_1_8_0 struct _I_s_T_r_e_e_P_a_t_h : │ │ │ │ │ +181 public decltype(impl::isTreePath((typename std::decay::type*)(nullptr))) │ │ │ │ │ +182 {}; │ │ │ │ │ +183 │ │ │ │ │ +190 template │ │ │ │ │ +_1_9_1 constexpr auto _i_s_T_r_e_e_P_a_t_h(const T&) │ │ │ │ │ +192 -> _I_s_T_r_e_e_P_a_t_h_<_T_> │ │ │ │ │ +193 { │ │ │ │ │ +194 return _I_s_T_r_e_e_P_a_t_h_<_T_>(); │ │ │ │ │ +195 } │ │ │ │ │ +196 │ │ │ │ │ +197 │ │ │ │ │ +198 } // end namespace TypeTree │ │ │ │ │ +199} // end namespace Dune │ │ │ │ │ +200 │ │ │ │ │ +201#endif // DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g │ │ │ │ │ +typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ +Returns the implementation tag of the given Node. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:80 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:20 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_e_m_p_t_y │ │ │ │ │ -bool empty() const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:54 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_f_u_l_l │ │ │ │ │ -bool full() const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:59 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -T & operator[](std::size_t k) │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:100 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_p_o_p___b_a_c_k │ │ │ │ │ -void pop_back() │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:70 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_b_a_c_k │ │ │ │ │ -T & back() │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_c_a_p_a_c_i_t_y │ │ │ │ │ -std::size_t capacity() const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_f_r_o_n_t │ │ │ │ │ -T & front() │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:88 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_f_r_o_n_t │ │ │ │ │ -const T & front() const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:94 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -const T & operator[](std::size_t k) const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:106 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ -void push_back(const T &t) │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:64 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_b_a_c_k │ │ │ │ │ -const T & back() const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:82 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_s_i_z_e │ │ │ │ │ -std::size_t size() const │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:44 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ -FixedCapacityStackView(Impl &impl) │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:123 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k │ │ │ │ │ -FixedCapacityStack() │ │ │ │ │ -DDeeffiinniittiioonn fixedcapacitystack.hh:134 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr auto isTreePath(const T &) -> IsTreePath< T > │ │ │ │ │ +Check if given object represents a tree path. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:191 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_c_l_p_t_r │ │ │ │ │ +T * declptr() │ │ │ │ │ +Helper function for generating a pointer to a value of type T in an unevaluated │ │ │ │ │ +operand setting. │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l_:_:_i_s_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr auto isTreePath(void *) -> std::false_type │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:153 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_f_i_r_s_t___t_y_p_e │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:19 │ │ │ │ │ +_D_u_n_e_:_:_f_i_r_s_t___t_y_p_e_<_ _T_0_,_ _T_._._._ _>_:_:_t_y_p_e │ │ │ │ │ +T0 type │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:24 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:31 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_v_a_l_u_e │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines a NodeTag. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:41 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_t_e_s_t │ │ │ │ │ +static yes test(NodeTag< X > *) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_t_e_s_t │ │ │ │ │ +static no test(...) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_y_e_s │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:32 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[1] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:32 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_n_o │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:33 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[2] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:33 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ +static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_v_a_l_u_e │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines a NodeTag of type V. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:59 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ +static no test(...) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:48 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[N+1] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:48 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_y_e_s │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[2] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_n_o │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[1] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:64 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_t_e_s_t │ │ │ │ │ +static yes test(ImplementationTag< X > *) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_t_e_s_t │ │ │ │ │ +static no test(...) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_v_a_l_u_e │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines an ImplementationTag. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:74 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_y_e_s │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:65 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[1] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:65 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_n_o │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:66 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[2] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:66 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ +static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test │ │ │ │ │ +(ImplementationTag< X > *a) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ +static no test(...) │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_v_a_l_u_e │ │ │ │ │ +static constexpr bool value │ │ │ │ │ +True if class T defines an ImplementationTag of type V. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:92 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:81 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[N+1] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:81 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_y_e_s │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:82 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[2] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:82 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_n_o │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:83 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ +char dummy[1] │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:83 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_l_w_a_y_s_V_o_i_d │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:97 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_l_w_a_y_s_V_o_i_d_:_:_t_y_p_e │ │ │ │ │ +void type │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:98 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ +Marker tag declaring a meta function. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:121 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___e_v_a_l_u_a_t_e │ │ │ │ │ +Helper meta function to delay evaluation of F. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___e_v_a_l_u_a_t_e_:_:_t_y_p_e │ │ │ │ │ +F::type type │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:127 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___i_d_e_n_t_i_t_y │ │ │ │ │ +Identity function. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:133 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___i_d_e_n_t_i_t_y_:_:_t_y_p_e │ │ │ │ │ +F type │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:134 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ +Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:140 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n_:_:_t_y_p_e │ │ │ │ │ +std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F │ │ │ │ │ +>, lazy_identity< F > >::type::type type │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:145 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h │ │ │ │ │ +Check if type represents a tree path. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:182 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: childextraction.hh File Reference │ │ │ │ +dune-typetree: nodetags.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,66 +70,43 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
childextraction.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
nodetags.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>
│ │ │ │ -
│ │ │ │ + │ │ │ │

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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ 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.
 
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.
 
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.
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -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.
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,58 +1,29 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -childextraction.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +nodetags.hh File Reference │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ +CCllaasssseess │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ +  Tag designating a leaf node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +  Tag designating a power node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +  Tag designating a power node with runtime degree. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ +  Tag designating a composite node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -TTyyppeeddeeffss │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d = typename impl::_Child< Node, indices... >::type │ │ │ │ │ -  Template alias for the type of a child node given by a list of child │ │ │ │ │ - indices. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d_F_o_r_T_r_e_e_P_a_t_h = typename impl::_ChildForTreePath< │ │ │ │ │ - Node, _T_r_e_e_P_a_t_h >::type │ │ │ │ │ -  Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h type. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x = 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. │ │ │ │ │ -  │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -ImplementationDefined  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d (Node &&node, Indices... indices) │ │ │ │ │ -  Extracts the child of a node given by a sequence of │ │ │ │ │ - compile-time and run-time indices. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -ImplementationDefined  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e (Node &&node, Indices... │ │ │ │ │ - indices) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -ImplementationDefined  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d (Node &&node, _H_y_b_r_i_d_T_r_e_e_P_a_t_h< │ │ │ │ │ - Indices... > _t_r_e_e_P_a_t_h) │ │ │ │ │ -  Extracts the child of a node given by a _H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ - object. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00026_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: childextraction.hh Source File │ │ │ │ +dune-typetree: nodetags.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,288 +74,52 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
childextraction.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_CHILDEXTRACTION_HH
│ │ │ │ -
5#define DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_NODETAGS_HH
│ │ │ │
6
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <utility>
│ │ │ │ +
7namespace Dune {
│ │ │ │ +
8 namespace TypeTree {
│ │ │ │
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
│ │ │ │ - │ │ │ │ - │ │ │ │ +
16 struct LeafNodeTag {};
│ │ │ │
17
│ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20 namespace TypeTree {
│ │ │ │ -
21
│ │ │ │ +
19 struct PowerNodeTag {};
│ │ │ │ +
20
│ │ │ │ + │ │ │ │ +
23
│ │ │ │ + │ │ │ │
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...>)
│ │ │ │ -
93 {
│ │ │ │ -
94 return childStorageImpl(std::forward<NodePtr>(nodePtr),treePathEntry<i>(tp)...);
│ │ │ │ -
95 }
│ │ │ │ -
96
│ │ │ │ -
97 } // end namespace Impl
│ │ │ │ -
98
│ │ │ │ -
99#endif // DOXYGEN
│ │ │ │ -
100
│ │ │ │ -
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 }
│ │ │ │ -
│ │ │ │ -
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
│ │ │ │ -
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 };
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ -
A hybrid version of TreePath that supports both compile time and run time indices.
Definition treepath.hh:79
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,319 +1,54 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -childextraction.hh │ │ │ │ │ +nodetags.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_NODETAGS_HH │ │ │ │ │ +5#define DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +7namespace _D_u_n_e { │ │ │ │ │ +8 namespace TypeTree { │ │ │ │ │ 9 │ │ │ │ │ -10#include │ │ │ │ │ -11#include │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14 │ │ │ │ │ -15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +_1_6 struct _L_e_a_f_N_o_d_e_T_a_g {}; │ │ │ │ │ 17 │ │ │ │ │ -18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -20 namespace TypeTree { │ │ │ │ │ -21 │ │ │ │ │ +_1_9 struct _P_o_w_e_r_N_o_d_e_T_a_g {}; │ │ │ │ │ +20 │ │ │ │ │ +_2_2 struct _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g {}; │ │ │ │ │ +23 │ │ │ │ │ +_2_5 struct _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g {}; │ │ │ │ │ 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) │ │ │ │ │ -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) │ │ │ │ │ -93 { │ │ │ │ │ -94 return childStorageImpl(std::forward(nodePtr),treePathEntry │ │ │ │ │ -(tp)...); │ │ │ │ │ -95 } │ │ │ │ │ -96 │ │ │ │ │ -97 } // end namespace Impl │ │ │ │ │ -98 │ │ │ │ │ -99#endif // DOXYGEN │ │ │ │ │ -100 │ │ │ │ │ -102 │ │ │ │ │ -124 template │ │ │ │ │ -125#ifdef DOXYGEN │ │ │ │ │ -_1_2_6 ImplementationDefined _c_h_i_l_d (Node&& node, Indices... indices) │ │ │ │ │ -127#else │ │ │ │ │ -128 decltype(auto) _c_h_i_l_d (Node&& node, Indices... indices) │ │ │ │ │ -129#endif │ │ │ │ │ -130 { │ │ │ │ │ -131 return Impl::childImpl(std::forward(node),indices...); │ │ │ │ │ -132 } │ │ │ │ │ -133 │ │ │ │ │ -134 template │ │ │ │ │ -135#ifdef DOXYGEN │ │ │ │ │ -_1_3_6 ImplementationDefined _c_h_i_l_d_S_t_o_r_a_g_e (Node&& node, Indices... indices) │ │ │ │ │ -137#else │ │ │ │ │ -138 auto _c_h_i_l_d_S_t_o_r_a_g_e (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 │ │ │ │ │ -_1_7_1 ImplementationDefined _c_h_i_l_d (Node&& node, _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_I_n_d_i_c_e_s_._._._> │ │ │ │ │ -_t_r_e_e_P_a_t_h) │ │ │ │ │ -172#else │ │ │ │ │ -173 decltype(auto) _c_h_i_l_d (Node&& node, _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_I_n_d_i_c_e_s_._._._> 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 _c_h_i_l_d (Node&& node, HybridTreePath │ │ │ │ │ -_t_r_e_e_P_a_t_h) │ │ │ │ │ -182#else │ │ │ │ │ -183 auto _c_h_i_l_d_S_t_o_r_a_g_e (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 │ │ │ │ │ -_2_2_3 using _C_h_i_l_d = 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 │ │ │ │ │ -_2_5_0 using _C_h_i_l_d_F_o_r_T_r_e_e_P_a_t_h = 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 │ │ │ │ │ -_2_8_2 using _i_s___f_l_a_t___i_n_d_e_x = 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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x_<_T_>_:_:_v_a_l_u_e, │ │ │ │ │ -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 !_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x_<_T_>_:_:_v_a_l_u_e, │ │ │ │ │ -304 bool │ │ │ │ │ -305 >::type │ │ │ │ │ -306 _non_empty_tree_path (T t) │ │ │ │ │ -307 { │ │ │ │ │ -308 return _t_r_e_e_P_a_t_h_S_i_z_e(t) > 0; │ │ │ │ │ -309 } │ │ │ │ │ -310 │ │ │ │ │ -311 } │ │ │ │ │ -312 │ │ │ │ │ -313#endif // DOXYGEN │ │ │ │ │ -314 │ │ │ │ │ -316 │ │ │ │ │ -317 } // namespace TypeTree │ │ │ │ │ -318} //namespace Dune │ │ │ │ │ -319 │ │ │ │ │ -320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:282 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -ImplementationDefined childStorage(Node &&node, Indices... indices) │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:136 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d │ │ │ │ │ -typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ -Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:223 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d_F_o_r_T_r_e_e_P_a_t_h │ │ │ │ │ -typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath │ │ │ │ │ -Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ -HybridTreePath type. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:250 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ -constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ -Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:199 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ +30 struct StartTag {}; │ │ │ │ │ +31 │ │ │ │ │ +32 │ │ │ │ │ +33 │ │ │ │ │ +34#endif // DOXYGEN │ │ │ │ │ +35 │ │ │ │ │ +37 │ │ │ │ │ +38 } // namespace TypeTree │ │ │ │ │ +39} //namespace Dune │ │ │ │ │ +40 │ │ │ │ │ +41#endif // DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a power node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:19 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a power node with runtime degree. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:22 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: exceptions.hh File Reference │ │ │ │ +dune-typetree: utility.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,39 +72,43 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
exceptions.hh File Reference
│ │ │ │ +
utility.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ -

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

│ │ │ │ -
#include <dune/common/exceptions.hh>
│ │ │ │ +
#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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::TypeTree::Exception
 Base class for all TypeTree exceptions. More...
struct  Dune::TypeTree::TreeInfo< Tree, Tag >
 Struct for obtaining some basic structural information about a TypeTree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

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

Detailed Description

│ │ │ │ -

TypeTree-specific exceptions.

│ │ │ │ -
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,24 +1,31 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -exceptions.hh File Reference │ │ │ │ │ -TypeTree-specific exceptions. _M_o_r_e_._._. │ │ │ │ │ -#include │ │ │ │ │ +utility.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_c_e_p_t_i_o_n │ │ │ │ │ -  Base class for all _T_y_p_e_T_r_e_e exceptions. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_<_ _T_r_e_e_,_ _T_a_g_ _> │ │ │ │ │ +  Struct for obtaining some basic structural information about a │ │ │ │ │ + _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ │ -TypeTree-specific exceptions. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: exceptions.hh Source File │ │ │ │ +dune-typetree: utility.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,39 +74,284 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
exceptions.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#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_UTILITY_HH
│ │ │ │ +
5#define DUNE_TYPETREE_UTILITY_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 }
│ │ │ │ +
39
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │
Definition accumulate_static.hh:13
│ │ │ │ -
Base class for all TypeTree exceptions.
Definition exceptions.hh:19
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,33 +1,312 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -exceptions.hh │ │ │ │ │ +utility.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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 _D_u_n_e { │ │ │ │ │ -14 namespace TypeTree { │ │ │ │ │ -15 │ │ │ │ │ -_1_7 class _E_x_c_e_p_t_i_o_n │ │ │ │ │ -18 : public Dune::Exception │ │ │ │ │ -19 {}; │ │ │ │ │ -20 │ │ │ │ │ -21 } // namespace TypeTree │ │ │ │ │ -22} // namespace Dune │ │ │ │ │ -23 │ │ │ │ │ -24#endif // DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ +3 │ │ │ │ │ +4#ifndef DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ +5#define DUNE_TYPETREE_UTILITY_HH │ │ │ │ │ +6 │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12 │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +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 } │ │ │ │ │ +39 │ │ │ │ │ +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 _r_e_s_u_l_t = Op{}(T{Args}...); │ │ │ │ │ +123 return std::integral_constant,_r_e_s_u_l_t>{}; │ │ │ │ │ +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 │ │ │ │ │ +_1_6_7 struct _T_r_e_e_I_n_f_o │ │ │ │ │ +168 { │ │ │ │ │ +169 │ │ │ │ │ +170 private: │ │ │ │ │ +171 // Start the tree traversal │ │ │ │ │ +172 typedef _T_r_e_e_I_n_f_o_<_T_r_e_e_,_N_o_d_e_T_a_g_<_T_r_e_e_>> _N_o_d_e_I_n_f_o; │ │ │ │ │ +173 │ │ │ │ │ +174 public: │ │ │ │ │ +175 │ │ │ │ │ +_1_7_7 static const std::size_t _d_e_p_t_h = _N_o_d_e_I_n_f_o_:_:_d_e_p_t_h; │ │ │ │ │ +178 │ │ │ │ │ +_1_8_0 static const std::size_t _n_o_d_e_C_o_u_n_t = _N_o_d_e_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t; │ │ │ │ │ +181 │ │ │ │ │ +_1_8_3 static const std::size_t _l_e_a_f_C_o_u_n_t = _N_o_d_e_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t; │ │ │ │ │ +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 _T_r_e_e_I_n_f_o │ │ │ │ │ +198 { │ │ │ │ │ +199 │ │ │ │ │ +200 static const std::size_t _d_e_p_t_h = 1; │ │ │ │ │ +201 │ │ │ │ │ +202 static const std::size_t _n_o_d_e_C_o_u_n_t = 1; │ │ │ │ │ +203 │ │ │ │ │ +204 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 _d_e_p_t_h = 1 + ChildInfo::depth; │ │ │ │ │ +217 │ │ │ │ │ +218 static const std::size_t _n_o_d_e_C_o_u_n_t = 1 + StaticDegree::value * │ │ │ │ │ +ChildInfo::nodeCount; │ │ │ │ │ +219 │ │ │ │ │ +220 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 _n_o_d_e_C_o_u_n_t = 0; │ │ │ │ │ +256 │ │ │ │ │ +257 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 _d_e_p_t_h = 1 + Children::maxDepth; │ │ │ │ │ +271 │ │ │ │ │ +272 static const std::size_t _n_o_d_e_C_o_u_n_t = 1 + Children::nodeCount; │ │ │ │ │ +273 │ │ │ │ │ +274 static const std::size_t _l_e_a_f_C_o_u_n_t = 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 │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_c_e_p_t_i_o_n │ │ │ │ │ -Base class for all TypeTree exceptions. │ │ │ │ │ -DDeeffiinniittiioonn exceptions.hh:19 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t │ │ │ │ │ +auto leafCount(const Tree &tree) │ │ │ │ │ +The number of leaf nodes in the Tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:530 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t │ │ │ │ │ +auto nodeCount(const Tree &tree) │ │ │ │ │ +The total number of nodes in the Tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:522 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h │ │ │ │ │ +auto depth(const Tree &tree) │ │ │ │ │ +The depth of the TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:506 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o │ │ │ │ │ +Struct for obtaining some basic structural information about a TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn utility.hh:168 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t │ │ │ │ │ +static const std::size_t leafCount │ │ │ │ │ +The number of leaf nodes in the TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn utility.hh:183 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_:_:_d_e_p_t_h │ │ │ │ │ +static const std::size_t depth │ │ │ │ │ +The depth of the TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn utility.hh:177 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t │ │ │ │ │ +static const std::size_t nodeCount │ │ │ │ │ +The total number of nodes in the TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn utility.hh:180 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: accumulate_static.hh File Reference │ │ │ │ +dune-typetree: typetree.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -69,135 +69,32 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
│ │ │ │ -Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
accumulate_static.hh File Reference
│ │ │ │ +
typetree.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ +
#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

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
 
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.
 
│ │ │ │ -

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 {} │ │ │ │ │ @@ -1,83 +1,23 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -accumulate_static.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +typetree.hh File Reference │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_l_e_a_f_n_o_d_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_d_y_n_a_m_i_c_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_o_m_p_o_s_i_t_e_n_o_d_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_a_i_r_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_a_c_c_u_m_u_l_a_t_e___s_t_a_t_i_c_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type using ||. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type using &&. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type using +. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type using -. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type using *. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type by returning their │ │ │ │ │ - minimum. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ -  Statically combine two values of type result_type by returning their │ │ │ │ │ - maximum. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e_<_ _T_r_e_e_,_ _F_u_n_c_t_o_r_,_ _R_e_d_u_c_t_i_o_n_,_ _s_t_a_r_t_V_a_l_u_e_, │ │ │ │ │ - _P_a_r_e_n_t_C_h_i_l_d_R_e_d_u_c_t_i_o_n_ _> │ │ │ │ │ -  Statically accumulate a value over the nodes of a _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_<_ _F_u_n_c_t_o_r_,_ _R_e_d_u_c_t_i_o_n_,_ _S_t_a_r_t_T_y_p_e_, │ │ │ │ │ - _P_a_r_e_n_t_C_h_i_l_d_R_e_d_u_c_t_i_o_n_,_ _R_e_d_u_c_t_i_o_n_A_l_g_o_r_i_t_h_m_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_T_y_p_e_<_ _T_r_e_e_,_ _P_o_l_i_c_y_ _> │ │ │ │ │ -  Statically accumulate a type over the nodes of a _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -NNaammeessppaacceess │ │ │ │ │ -namespace   _D_u_n_e │ │ │ │ │ -  │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │ -  │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ │ -  │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e (Tree &&tree, Visitor │ │ │ │ │ - &&visitor, Init &&init) │ │ │ │ │ -  Apply hybrid visitor to _T_y_p_e_T_r_e_e. │ │ │ │ │ -  │ │ │ │ │ -********** VVaarriiaabbllee DDooccuummeennttaattiioonn ********** │ │ │ │ │ -********** _?◆_? cchhiilldd__rreessuulltt ********** │ │ │ │ │ -const result_type child_result = │ │ │ │ │ -accumulate_value>_:_: static │ │ │ │ │ -_r_e_s_u_l_t │ │ │ │ │ -********** _?◆_? rreessuulltt ********** │ │ │ │ │ -const result_type result = current_value static │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: accumulate_static.hh Source File │ │ │ │ +dune-typetree: typetree.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,592 +74,51 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
accumulate_static.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_ACCUMULATE_STATIC_HH
│ │ │ │ -
5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_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 };
│ │ │ │ -
│ │ │ │ -
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 static const result_type result = r1 > r2 ? r1 : r2;
│ │ │ │ -
95 };
│ │ │ │ -
│ │ │ │ -
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 {
│ │ │ │ -
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 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
│ │ │ │ -
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
│ │ │ │ -
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,
│ │ │ │ -
300 TreePath
│ │ │ │ -
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,
│ │ │ │ -
383 NodeTag<child>
│ │ │ │ -
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 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
│ │ │ │ -
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
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
20
│ │ │ │ +
21#endif // DUNE_TYPETREE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,695 +1,44 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -accumulate_static.hh │ │ │ │ │ +typetree.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_HH │ │ │ │ │ +5#define DUNE_TYPETREE_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -11 │ │ │ │ │ -12 │ │ │ │ │ -_1_3namespace _D_u_n_e { │ │ │ │ │ -_1_4 namespace TypeTree { │ │ │ │ │ -15 │ │ │ │ │ -22 template │ │ │ │ │ -_2_3 struct _o_r__ │ │ │ │ │ -24 { │ │ │ │ │ -25 template │ │ │ │ │ -_2_6 struct _r_e_d_u_c_e │ │ │ │ │ -27 { │ │ │ │ │ -_2_8 static const result_type _r_e_s_u_l_t = r1 || r2; │ │ │ │ │ -29 }; │ │ │ │ │ -30 }; │ │ │ │ │ -31 │ │ │ │ │ -33 template │ │ │ │ │ -_3_4 struct _a_n_d__ │ │ │ │ │ -35 { │ │ │ │ │ -36 template │ │ │ │ │ -_3_7 struct _r_e_d_u_c_e │ │ │ │ │ -38 { │ │ │ │ │ -_3_9 static const result_type _r_e_s_u_l_t = r1 && r2; │ │ │ │ │ -40 }; │ │ │ │ │ -41 }; │ │ │ │ │ -42 │ │ │ │ │ -44 template │ │ │ │ │ -_4_5 struct _p_l_u_s │ │ │ │ │ -46 { │ │ │ │ │ -47 template │ │ │ │ │ -_4_8 struct _r_e_d_u_c_e │ │ │ │ │ -49 { │ │ │ │ │ -_5_0 static const result_type _r_e_s_u_l_t = r1 + r2; │ │ │ │ │ -51 }; │ │ │ │ │ -52 }; │ │ │ │ │ -53 │ │ │ │ │ -55 template │ │ │ │ │ -_5_6 struct _m_i_n_u_s │ │ │ │ │ -57 { │ │ │ │ │ -58 template │ │ │ │ │ -_5_9 struct _r_e_d_u_c_e │ │ │ │ │ -60 { │ │ │ │ │ -_6_1 static const result_type _r_e_s_u_l_t = r1 - r2; │ │ │ │ │ -62 }; │ │ │ │ │ -63 }; │ │ │ │ │ -64 │ │ │ │ │ -66 template │ │ │ │ │ -_6_7 struct _m_u_l_t_i_p_l_y │ │ │ │ │ -68 { │ │ │ │ │ -69 template │ │ │ │ │ -_7_0 struct _r_e_d_u_c_e │ │ │ │ │ -71 { │ │ │ │ │ -_7_2 static const result_type _r_e_s_u_l_t = r1 * r2; │ │ │ │ │ -73 }; │ │ │ │ │ -74 }; │ │ │ │ │ -75 │ │ │ │ │ -77 template │ │ │ │ │ -_7_8 struct _m_i_n │ │ │ │ │ -79 { │ │ │ │ │ -80 template │ │ │ │ │ -_8_1 struct _r_e_d_u_c_e │ │ │ │ │ -82 { │ │ │ │ │ -_8_3 static const result_type _r_e_s_u_l_t = r1 < r2 ? r1 : r2; │ │ │ │ │ -84 }; │ │ │ │ │ -85 }; │ │ │ │ │ -86 │ │ │ │ │ -88 template │ │ │ │ │ -_8_9 struct _m_a_x │ │ │ │ │ -90 { │ │ │ │ │ -91 template │ │ │ │ │ -_9_2 struct _r_e_d_u_c_e │ │ │ │ │ -93 { │ │ │ │ │ -_9_4 static const result_type _r_e_s_u_l_t = r1 > r2 ? r1 : r2; │ │ │ │ │ -95 }; │ │ │ │ │ -96 }; │ │ │ │ │ -97 │ │ │ │ │ -98 │ │ │ │ │ -99 namespace { │ │ │ │ │ -100 │ │ │ │ │ -101 // implementation of the traversal algorithm │ │ │ │ │ -102 │ │ │ │ │ -104 template │ │ │ │ │ -105 struct accumulate_node_helper │ │ │ │ │ -106 { │ │ │ │ │ -107 │ │ │ │ │ -108 typedef typename Functor::result_type result_type; │ │ │ │ │ -109 │ │ │ │ │ -_1_1_0 static const result_type _r_e_s_u_l_t = 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 _r_e_s_u_l_t = Reduction::template │ │ │ │ │ -reduce::result>::result; │ │ │ │ │ -122 │ │ │ │ │ -123 }; │ │ │ │ │ -124 │ │ │ │ │ -126 template │ │ │ │ │ -127 struct accumulate_value; │ │ │ │ │ -128 │ │ │ │ │ -130 template │ │ │ │ │ -131 struct │ │ │ │ │ -accumulate_value │ │ │ │ │ -132 { │ │ │ │ │ -133 │ │ │ │ │ -134 typedef typename Functor::result_type result_type; │ │ │ │ │ -135 │ │ │ │ │ -136 static const result_type _r_e_s_u_l_t = │ │ │ │ │ -137 │ │ │ │ │ -138 │ │ │ │ │ -accumulate_node_helper::value>_:_:_r_e_s_u_l_t; │ │ │ │ │ -139 │ │ │ │ │ -140 }; │ │ │ │ │ -141 │ │ │ │ │ -143 template │ │ │ │ │ -144 struct accumulate_over_children │ │ │ │ │ -145 { │ │ │ │ │ -146 │ │ │ │ │ -147 typedef typename Functor::result_type result_type; │ │ │ │ │ -148 │ │ │ │ │ -149 typedef decltype(_p_u_s_h___b_a_c_k(_T_r_e_e_P_a_t_h{},index_constant{})) │ │ │ │ │ -child_tree_path; │ │ │ │ │ -150 │ │ │ │ │ -151 typedef typename Node::template _C_h_i_l_d::Type child; │ │ │ │ │ -152 │ │ │ │ │ -_1_5_3 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 _r_e_s_u_l_t = 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 _c_h_i_l_d___r_e_s_u_l_t = │ │ │ │ │ -accumulate_over_children:: │ │ │ │ │ -value>_:_:_r_e_s_u_l_t; │ │ │ │ │ -179 │ │ │ │ │ -180 static const result_type _r_e_s_u_l_t = │ │ │ │ │ -181 │ │ │ │ │ -accumulate_node_helper::value>_:_:_r_e_s_u_l_t; │ │ │ │ │ -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 │ │ │ │ │ -_2_5_8 struct _A_c_c_u_m_u_l_a_t_e_V_a_l_u_e │ │ │ │ │ -259 { │ │ │ │ │ -260 │ │ │ │ │ -_2_6_2 typedef typename Functor::result_type _r_e_s_u_l_t___t_y_p_e; │ │ │ │ │ -263 │ │ │ │ │ -_2_6_5 static const _r_e_s_u_l_t___t_y_p_e _r_e_s_u_l_t = │ │ │ │ │ -accumulate_value,_N_o_d_e_T_a_g_<_T_r_e_e_>>_:_: │ │ │ │ │ -_r_e_s_u_l_t; │ │ │ │ │ -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(_p_u_s_h___b_a_c_k(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 _T_r_e_e_P_a_t_h, │ │ │ │ │ -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 _T_r_e_e_P_a_t_h, │ │ │ │ │ -428 Policy::functor::template doVisit< │ │ │ │ │ -429 Node, │ │ │ │ │ -430 _T_r_e_e_P_a_t_h │ │ │ │ │ -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 > │ │ │ │ │ -_4_6_5 struct _T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y │ │ │ │ │ -466 { │ │ │ │ │ -467 │ │ │ │ │ -_4_9_5 typedef Functor _f_u_n_c_t_o_r; │ │ │ │ │ -496 │ │ │ │ │ -_5_1_6 typedef Reduction _s_i_b_l_i_n_g___r_e_d_u_c_t_i_o_n; │ │ │ │ │ -517 │ │ │ │ │ -_5_2_4 typedef ParentChildReduction _p_a_r_e_n_t___c_h_i_l_d___r_e_d_u_c_t_i_o_n; │ │ │ │ │ -525 │ │ │ │ │ -_5_3_2 typedef StartType _s_t_a_r_t___t_y_p_e; │ │ │ │ │ -533 │ │ │ │ │ -_5_3_8 typedef ReductionAlgorithm _r_e_d_u_c_t_i_o_n___s_t_r_a_t_e_g_y; │ │ │ │ │ -539 }; │ │ │ │ │ -540 │ │ │ │ │ -541 │ │ │ │ │ -543 │ │ │ │ │ -551 template │ │ │ │ │ -_5_5_2 struct _A_c_c_u_m_u_l_a_t_e_T_y_p_e │ │ │ │ │ -553 { │ │ │ │ │ -554 │ │ │ │ │ -556 typedef typename accumulate_type< │ │ │ │ │ -557 Tree, │ │ │ │ │ -558 Policy, │ │ │ │ │ -559 typename Policy::start_type, │ │ │ │ │ -560 _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_>, │ │ │ │ │ -561 _N_o_d_e_T_a_g_<_T_r_e_e_> │ │ │ │ │ -_5_6_2 >::type _t_y_p_e; │ │ │ │ │ -563 │ │ │ │ │ -564 }; │ │ │ │ │ -565 │ │ │ │ │ -566 │ │ │ │ │ -567 │ │ │ │ │ -568 │ │ │ │ │ -569 │ │ │ │ │ -570 /***************************************************/ │ │ │ │ │ -571 │ │ │ │ │ -_5_7_2 namespace Experimental { │ │ │ │ │ -573 namespace Impl { │ │ │ │ │ -574 │ │ │ │ │ -576 template::isLeaf, int> = 0> │ │ │ │ │ -578 auto hybridApplyToTree(T&& tree, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, V&& visitor, U&& │ │ │ │ │ -current_val) │ │ │ │ │ -579 { │ │ │ │ │ -580 return visitor.leaf(tree, _t_r_e_e_P_a_t_h, std::forward(current_val)); │ │ │ │ │ -581 } │ │ │ │ │ -582 │ │ │ │ │ -584 template::isLeaf, int> = 0> │ │ │ │ │ -586 auto hybridApplyToTree(T&& tree, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h, 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&& _c_h_i_l_d = tree.child(i); │ │ │ │ │ -605 using _C_h_i_l_d = std::decay_t; │ │ │ │ │ -606 │ │ │ │ │ -607 auto val_before = visitor.beforeChild(tree, _c_h_i_l_d, _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h, 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 = _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k(_t_r_e_e_P_a_t_h, i); │ │ │ │ │ -620 return hybridApplyToTree(_c_h_i_l_d, childTreePath, visitor, std::move(val_in)); │ │ │ │ │ -621 } │ │ │ │ │ -622 else │ │ │ │ │ -623 return std::move(val_in); │ │ │ │ │ -624 }(); │ │ │ │ │ -625 │ │ │ │ │ -626 return visitor.afterChild(tree, _c_h_i_l_d, _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h, in_val); │ │ │ │ │ -670 } │ │ │ │ │ -671 │ │ │ │ │ -672 } │ │ │ │ │ -673 │ │ │ │ │ -697 template │ │ │ │ │ -_6_9_8 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init) │ │ │ │ │ -699 { │ │ │ │ │ -700 return Impl::hybridApplyToTree(tree, _h_y_b_r_i_d_T_r_e_e_P_a_t_h(), visitor, init); │ │ │ │ │ -701 } │ │ │ │ │ -702 │ │ │ │ │ -703 } // namespace Experimental │ │ │ │ │ -704 │ │ │ │ │ -706 } // namespace TypeTree │ │ │ │ │ -707} //namespace Dune │ │ │ │ │ -708 │ │ │ │ │ -709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ -_c_h_i_l_d___r_e_s_u_l_t │ │ │ │ │ -static const result_type child_result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:153 │ │ │ │ │ -_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ +7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_l_e_a_f_n_o_d_e_._h_h> │ │ │ │ │ +10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_d_y_n_a_m_i_c_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ +12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_o_m_p_o_s_i_t_e_n_o_d_e_._h_h> │ │ │ │ │ +13#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +14#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_a_i_r_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_._h_h> │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ +18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_a_c_c_u_m_u_l_a_t_e___s_t_a_t_i_c_._h_h> │ │ │ │ │ +19#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ +20 │ │ │ │ │ +21#endif // DUNE_TYPETREE_HH │ │ │ │ │ +_p_a_i_r_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ +_t_r_a_n_s_f_o_r_m_a_t_i_o_n_._h_h │ │ │ │ │ +_t_r_a_v_e_r_s_a_l_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d │ │ │ │ │ -typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ -Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:223 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ -constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t i) │ │ │ │ │ -Appends a run time index to a HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:281 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:180 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:521 │ │ │ │ │ -_D_u_n_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r__ │ │ │ │ │ -Statically combine two values of type result_type using ||. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:24 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:27 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:28 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d__ │ │ │ │ │ -Statically combine two values of type result_type using &&. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:35 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:39 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s │ │ │ │ │ -Statically combine two values of type result_type using +. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s │ │ │ │ │ -Statically combine two values of type result_type using -. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:57 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:60 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:61 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y │ │ │ │ │ -Statically combine two values of type result_type using *. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:68 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:71 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:72 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n │ │ │ │ │ -Statically combine two values of type result_type by returning their minimum. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:82 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:83 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x │ │ │ │ │ -Statically combine two values of type result_type by returning their maximum. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:90 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_:_:_r_e_d_u_c_e │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:93 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:94 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e │ │ │ │ │ -Statically accumulate a value over the nodes of a TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:259 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e_:_:_r_e_s_u_l_t___t_y_p_e │ │ │ │ │ -Functor::result_type result_type │ │ │ │ │ -The result type of the computation. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:262 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e_:_:_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -The accumulated result of the computation. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:265 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:466 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_p_a_r_e_n_t___c_h_i_l_d___r_e_d_u_c_t_i_o_n │ │ │ │ │ -ParentChildReduction parent_child_reduction │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:524 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_f_u_n_c_t_o_r │ │ │ │ │ -Functor functor │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:495 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_s_t_a_r_t___t_y_p_e │ │ │ │ │ -StartType start_type │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:532 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_r_e_d_u_c_t_i_o_n___s_t_r_a_t_e_g_y │ │ │ │ │ -ReductionAlgorithm reduction_strategy │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:538 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_s_i_b_l_i_n_g___r_e_d_u_c_t_i_o_n │ │ │ │ │ -Reduction sibling_reduction │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:516 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_T_y_p_e │ │ │ │ │ -Statically accumulate a type over the nodes of a TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:553 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_T_y_p_e_:_:_t_y_p_e │ │ │ │ │ -accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, │ │ │ │ │ -NodeTag< Tree > >::type type │ │ │ │ │ -The accumulated result of the computation. │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:562 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +_l_e_a_f_n_o_d_e_._h_h │ │ │ │ │ +_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ +_t_r_a_n_s_f_o_r_m_a_t_i_o_n_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ │ +_p_o_w_e_r_n_o_d_e_._h_h │ │ │ │ │ +_a_c_c_u_m_u_l_a_t_e___s_t_a_t_i_c_._h_h │ │ │ │ │ +_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ +_d_y_n_a_m_i_c_p_o_w_e_r_n_o_d_e_._h_h │ │ │ │ │ +_c_o_m_p_o_s_i_t_e_n_o_d_e_._h_h │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: transformation.hh File Reference │ │ │ │ +dune-typetree: filters.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,52 +71,70 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
transformation.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
filters.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ +
#include <tuple>
│ │ │ │ #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

struct  Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive >
 Transform a TypeTree. 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::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
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<typename SourceNode , typename Transformation , typename Tag >
void Dune::TypeTree::registerNodeTransformation (SourceNode *, Transformation *, Tag *)
 Register transformation descriptor to transform SourceNode with Transformation.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,39 +1,63 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -transformation.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +filters.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ #include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_<_ _S_o_u_r_c_e_T_r_e_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_a_g_, │ │ │ │ │ - _r_e_c_u_r_s_i_v_e_ _> │ │ │ │ │ -  Transform a _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_E_n_t_r_y_<_ _n_e_w___k_,_ _o_l_d___k_ _> │ │ │ │ │ +  A filter entry describing the mapping of one child in the filtered │ │ │ │ │ + node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_<_ _F_i_l_t_e_r_E_n_t_r_i_e_s_ _> │ │ │ │ │ +  The result of a filter. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_<_ _F_i_l_t_e_r_E_n_t_r_i_e_s_ _>_:_:_a_p_p_l_y_<_ _N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_T_a_g │ │ │ │ │ +  Tag describing a simple filter that can only decide whether or not to │ │ │ │ │ + include a single given child. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g │ │ │ │ │ +  Tag describing an advanced filter that has full control over the │ │ │ │ │ + construction of the list of FilterEntries. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ +  Base class for advanced filters. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_a_p_p_l_y_<_ _N_o_d_e_,_ _C_h_i_l_d_r_e_n_ _> │ │ │ │ │ +  Apply this filter to the given node and children. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r │ │ │ │ │ +  Default simple filter that accepts any node and leaves its child │ │ │ │ │ + structure unchanged. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_v_a_l_i_d_a_t_e_<_ _N_o_d_e_ _> │ │ │ │ │ +  Validates the combination of filter and node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_a_p_p_l_y_<_ _C_h_i_l_d_,_ _n_e_w___i_n_d_e_x_,_ _o_l_d___i_n_d_e_x_ _> │ │ │ │ │ +  Applies the filter to the given child node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_n_d_e_x_F_i_l_t_e_r_<_ _i_n_d_i_c_e_s_ _> │ │ │ │ │ +  Filter class for _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e that selects the children with │ │ │ │ │ + the given indices. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_<_ _F_i_l_t_e_r_ _> │ │ │ │ │ +  Adapter class that takes a _S_i_m_p_l_e_F_i_l_t_e_r, validated it and turns it │ │ │ │ │ + into an _A_d_v_a_n_c_e_d_F_i_l_t_e_r. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_<_ _F_i_l_t_e_r_ _>_:_:_a_p_p_l_y_<_ _N_o_d_e_,_ _C_h_i_l_d_r_e_n_ _> │ │ │ │ │ +  Apply the filter. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n (SourceNode *, Transformation │ │ │ │ │ - *, Tag *) │ │ │ │ │ -  Register transformation descriptor to transform SourceNode with │ │ │ │ │ - Transformation. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: transformation.hh Source File │ │ │ │ +dune-typetree: filters.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,510 +74,259 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
transformation.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_TRANSFORMATION_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TRANSFORMATION_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_FILTERS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_FILTERS_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 {
│ │ │ │ +
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
│ │ │ │ -
29#ifdef DOXYGEN
│ │ │ │ +
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
│ │ │ │ -
51 template<typename SourceNode, typename Transformation, typename Tag>
│ │ │ │ -
52 void registerNodeTransformation(SourceNode*, Transformation*, Tag*);
│ │ │ │ +
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;
│ │ │ │ +
48 typedef std::tuple<typename Node::template Child<FilterEntries::original_index>::Type...> ChildTypes;
│ │ │ │ +
49 typedef std::tuple<std::shared_ptr<typename Node::template Child<FilterEntries::original_index>::Type>...> NodeStorage;
│ │ │ │ +
50 };
│ │ │ │ +
│ │ │ │ +
51
│ │ │ │ +
52 };
│ │ │ │ +
│ │ │ │
53
│ │ │ │ -
54#else // DOXYGEN
│ │ │ │ -
55
│ │ │ │ -
66 template<typename S, typename T, typename Tag>
│ │ │ │ -
67 struct LookupNodeTransformation
│ │ │ │ -
68 {
│ │ │ │ +
55 struct SimpleFilterTag {};
│ │ │ │ +
56
│ │ │ │ + │ │ │ │ +
59
│ │ │ │ +
60
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
63 {
│ │ │ │ +
64
│ │ │ │ + │ │ │ │ +
67
│ │ │ │ +
68#ifdef DOXYGEN
│ │ │ │
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;
│ │ │ │ +
71 template<typename Node, typename... Children>
│ │ │ │ +
│ │ │ │ +
72 struct apply
│ │ │ │ +
73 {
│ │ │ │
75
│ │ │ │ -
76 static_assert((!std::is_same<type,void>::value), "Unable to find valid transformation descriptor");
│ │ │ │ -
77 };
│ │ │ │ -
78
│ │ │ │ -
79#endif // DOXYGEN
│ │ │ │ +
78 typedef implementation-defined type;
│ │ │ │ +
79 };
│ │ │ │ +
│ │ │ │
80
│ │ │ │ -
81
│ │ │ │ -
83
│ │ │ │ -
92 template<typename SourceTree, typename Transformation, typename Tag = StartTag, bool recursive = true>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
94 {
│ │ │ │ -
95
│ │ │ │ -
96#ifndef DOXYGEN
│ │ │ │ +
81#endif // DOXYGEN
│ │ │ │ +
82
│ │ │ │ +
83 };
│ │ │ │ +
│ │ │ │ +
84
│ │ │ │ +
86
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
92 {
│ │ │ │ +
93
│ │ │ │ + │ │ │ │ +
96
│ │ │ │
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;
│ │ │ │ +
99 template<typename Node>
│ │ │ │ +
│ │ │ │ +
100 struct validate
│ │ │ │ +
101 {
│ │ │ │ +
103 static const bool value = true;
│ │ │ │ +
104 };
│ │ │ │ +
│ │ │ │
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
│ │ │ │ +
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 };
│ │ │ │ -
│ │ │ │ +
152 } // anonymous namespace
│ │ │ │
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>
│ │ │ │ +
154
│ │ │ │ +
156 template<std::size_t... indices>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
158 : public AdvancedFilter
│ │ │ │
159 {
│ │ │ │ -
160 // get transformed type from specification
│ │ │ │ -
161 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>::type NodeTransformation;
│ │ │ │ +
160
│ │ │ │ +
161#ifndef DOXYGEN
│ │ │ │
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 }
│ │ │ │ +
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 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
│ │ │ │ +
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 // 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)
│ │ │ │ +
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 return NodeTransformation::transform(s,t);
│ │ │ │ -
217 }
│ │ │ │ +
216
│ │ │ │ +
217 static_assert((Filter::template validate<Node>::value),"Invalid simple filter");
│ │ │ │
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 }
│ │ │ │ +
219 typedef typename filter_helper<Filter,0,0,Children...>::template apply<>::type type;
│ │ │ │ +
220
│ │ │ │ +
221 };
│ │ │ │ +
│ │ │ │ +
222
│ │ │ │ +
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
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
void registerNodeTransformation(SourceNode *, Transformation *, Tag *)
Register transformation descriptor to transform SourceNode with Transformation.
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,629 +1,316 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -transformation.hh │ │ │ │ │ +filters.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_FILTERS_HH │ │ │ │ │ +5#define DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ -14#include │ │ │ │ │ -15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -19 │ │ │ │ │ -20 │ │ │ │ │ -21namespace _D_u_n_e { │ │ │ │ │ -22 namespace TypeTree { │ │ │ │ │ +7#include │ │ │ │ │ +8 │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11namespace _D_u_n_e { │ │ │ │ │ +12 namespace TypeTree { │ │ │ │ │ +13 │ │ │ │ │ +20 template │ │ │ │ │ +_2_1 struct _F_i_l_t_e_r_E_n_t_r_y │ │ │ │ │ +22 { │ │ │ │ │ 23 │ │ │ │ │ -29#ifdef DOXYGEN │ │ │ │ │ +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 │ │ │ │ │ -51 template │ │ │ │ │ -_5_2 void _r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n(SourceNode*, Transformation*, Tag*); │ │ │ │ │ +33 }; │ │ │ │ │ +34 │ │ │ │ │ +36 template │ │ │ │ │ +_3_7 struct _F_i_l_t_e_r_R_e_s_u_l_t │ │ │ │ │ +38 { │ │ │ │ │ +39 │ │ │ │ │ +_4_0 static const std::size_t _s_i_z_e = sizeof...(FilterEntries); │ │ │ │ │ +41 │ │ │ │ │ +_4_2 typedef std::tuple _I_n_d_e_x_M_a_p; │ │ │ │ │ +43 │ │ │ │ │ +44 template │ │ │ │ │ +_4_5 struct _a_p_p_l_y │ │ │ │ │ +46 { │ │ │ │ │ +_4_7 typedef std::tuple...> _C_h_i_l_d_r_e_n; │ │ │ │ │ +_4_8 typedef std::tuple::Type...> _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ +_4_9 typedef std::tuple::Type>...> _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +50 }; │ │ │ │ │ +51 │ │ │ │ │ +52 }; │ │ │ │ │ 53 │ │ │ │ │ -54#else // DOXYGEN │ │ │ │ │ -55 │ │ │ │ │ -66 template │ │ │ │ │ -67 struct LookupNodeTransformation │ │ │ │ │ -68 { │ │ │ │ │ +_5_5 struct _S_i_m_p_l_e_F_i_l_t_e_r_T_a_g {}; │ │ │ │ │ +56 │ │ │ │ │ +_5_8 struct _A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g {}; │ │ │ │ │ +59 │ │ │ │ │ +60 │ │ │ │ │ +_6_2 struct _A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ +63 { │ │ │ │ │ +64 │ │ │ │ │ +_6_6 typedef _A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g _F_i_l_t_e_r_T_a_g; │ │ │ │ │ +67 │ │ │ │ │ +68#ifdef DOXYGEN │ │ │ │ │ 69 │ │ │ │ │ -70 typedef decltype(_r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n(declptr(),declptr │ │ │ │ │ -(),declptr())) lookup_type; │ │ │ │ │ -71 │ │ │ │ │ -72 typedef typename _e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n< │ │ │ │ │ -73 lookup_type │ │ │ │ │ -74 >::type type; │ │ │ │ │ +71 template │ │ │ │ │ +_7_2 struct _a_p_p_l_y │ │ │ │ │ +73 { │ │ │ │ │ 75 │ │ │ │ │ -76 static_assert((!std::is_same::value), "Unable to find valid │ │ │ │ │ -transformation descriptor"); │ │ │ │ │ -77 }; │ │ │ │ │ -78 │ │ │ │ │ -79#endif // DOXYGEN │ │ │ │ │ +_7_8 typedef implementation-defined _t_y_p_e; │ │ │ │ │ +79 }; │ │ │ │ │ 80 │ │ │ │ │ -81 │ │ │ │ │ -83 │ │ │ │ │ -92 template │ │ │ │ │ -_9_3 struct _T_r_a_n_s_f_o_r_m_T_r_e_e │ │ │ │ │ -94 { │ │ │ │ │ -95 │ │ │ │ │ -96#ifndef DOXYGEN │ │ │ │ │ +81#endif // DOXYGEN │ │ │ │ │ +82 │ │ │ │ │ +83 }; │ │ │ │ │ +84 │ │ │ │ │ +86 │ │ │ │ │ +_9_1 struct _S_i_m_p_l_e_F_i_l_t_e_r │ │ │ │ │ +92 { │ │ │ │ │ +93 │ │ │ │ │ +_9_5 typedef _S_i_m_p_l_e_F_i_l_t_e_r_T_a_g _F_i_l_t_e_r_T_a_g; │ │ │ │ │ +96 │ │ │ │ │ 97 │ │ │ │ │ -98 typedef typename LookupNodeTransformation::type NodeTransformation; │ │ │ │ │ -99 │ │ │ │ │ -100 // the type of the new tree that will result from this transformation │ │ │ │ │ -101 typedef typename │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>::transformed_type transformed_type; │ │ │ │ │ -102 │ │ │ │ │ -103 // the storage type of the new tree that will result from this │ │ │ │ │ -transformation │ │ │ │ │ -104 typedef typename │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>::transformed_storage_type transformed_storage_type; │ │ │ │ │ +99 template │ │ │ │ │ +_1_0_0 struct _v_a_l_i_d_a_t_e │ │ │ │ │ +101 { │ │ │ │ │ +_1_0_3 static const bool _v_a_l_u_e = true; │ │ │ │ │ +104 }; │ │ │ │ │ 105 │ │ │ │ │ -106#endif // DOXYGEN │ │ │ │ │ 107 │ │ │ │ │ -_1_0_9 typedef transformed_type _t_y_p_e; │ │ │ │ │ -110 │ │ │ │ │ -_1_1_1 typedef _t_y_p_e _T_y_p_e; │ │ │ │ │ -112 │ │ │ │ │ -_1_1_4 static transformed_type _t_r_a_n_s_f_o_r_m(const SourceTree& s, const │ │ │ │ │ -Transformation& t = Transformation()) │ │ │ │ │ -115 { │ │ │ │ │ -116 return │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>_:_:_t_r_a_n_s_f_o_r_m(s,t); │ │ │ │ │ -117 } │ │ │ │ │ -118 │ │ │ │ │ -_1_2_0 static transformed_type _t_r_a_n_s_f_o_r_m(const SourceTree& s, Transformation& t) │ │ │ │ │ -121 { │ │ │ │ │ -122 return │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>_:_:_t_r_a_n_s_f_o_r_m(s,t); │ │ │ │ │ -123 } │ │ │ │ │ -124 │ │ │ │ │ -_1_2_6 static transformed_type _t_r_a_n_s_f_o_r_m(std::shared_ptr sp, │ │ │ │ │ -const Transformation& t = Transformation()) │ │ │ │ │ -127 { │ │ │ │ │ -128 return │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>_:_:_t_r_a_n_s_f_o_r_m(sp,t); │ │ │ │ │ -129 } │ │ │ │ │ -130 │ │ │ │ │ -_1_3_2 static transformed_type _t_r_a_n_s_f_o_r_m(std::shared_ptr sp, │ │ │ │ │ -Transformation& t) │ │ │ │ │ -133 { │ │ │ │ │ -134 return │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>_:_:_t_r_a_n_s_f_o_r_m(sp,t); │ │ │ │ │ -135 } │ │ │ │ │ -136 │ │ │ │ │ -_1_3_9 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr sp, const Transformation& t = Transformation()) │ │ │ │ │ -140 { │ │ │ │ │ -141 return │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(sp,t); │ │ │ │ │ -142 } │ │ │ │ │ -143 │ │ │ │ │ -_1_4_6 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr sp, Transformation& t) │ │ │ │ │ -147 { │ │ │ │ │ -148 return │ │ │ │ │ -_T_r_a_n_s_f_o_r_m_T_r_e_e_<_S_o_u_r_c_e_T_r_e_e_,_T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_N_o_d_e_T_a_g_<_S_o_u_r_c_e_T_r_e_e_>,NodeTransformation:: │ │ │ │ │ -recursive>_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(sp,t); │ │ │ │ │ -149 } │ │ │ │ │ -150 │ │ │ │ │ +115 template │ │ │ │ │ +_1_1_6 struct _a_p_p_l_y │ │ │ │ │ +117 { │ │ │ │ │ +_1_1_9 static const bool _v_a_l_u_e = 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 _F_i_l_t_e_r_R_e_s_u_l_t 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 }; │ │ │ │ │ +152 } // anonymous namespace │ │ │ │ │ 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 │ │ │ │ │ +154 │ │ │ │ │ +156 template │ │ │ │ │ +_1_5_7 struct _I_n_d_e_x_F_i_l_t_e_r │ │ │ │ │ +158 : public _A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ 159 { │ │ │ │ │ -160 // get transformed type from specification │ │ │ │ │ -161 typedef typename LookupNodeTransformation>_:_:_t_y_p_e │ │ │ │ │ -NodeTransformation; │ │ │ │ │ +160 │ │ │ │ │ +161#ifndef DOXYGEN │ │ │ │ │ 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 _t_r_a_n_s_f_o_r_m(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 _t_r_a_n_s_f_o_r_m(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 _t_r_a_n_s_f_o_r_m(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 _t_r_a_n_s_f_o_r_m(std::shared_ptr sp, const T& t) │ │ │ │ │ +163 template │ │ │ │ │ +164 struct _a_p_p_l_y │ │ │ │ │ +165 { │ │ │ │ │ +166 typedef typename index_filter_helper::template _a_p_p_l_y_<_>_:_: │ │ │ │ │ +_t_y_p_e _t_y_p_e; │ │ │ │ │ +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 return NodeTransformation::transform(sp,t); │ │ │ │ │ -188 } │ │ │ │ │ -189 │ │ │ │ │ -190 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr │ │ │ │ │ -sp, T& t) │ │ │ │ │ -191 { │ │ │ │ │ -192 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ -193 } │ │ │ │ │ +187 typedef _F_i_l_t_e_r_R_e_s_u_l_t type; │ │ │ │ │ +188 }; │ │ │ │ │ +189 }; │ │ │ │ │ +190 │ │ │ │ │ +191 template │ │ │ │ │ +192 struct filter_helper │ │ │ │ │ +193 { │ │ │ │ │ 194 │ │ │ │ │ -195 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr │ │ │ │ │ -sp, const T& t) │ │ │ │ │ -196 { │ │ │ │ │ -197 return NodeTransformation::transform_storage(sp,t); │ │ │ │ │ -198 } │ │ │ │ │ -199 │ │ │ │ │ -200 }; │ │ │ │ │ -201 │ │ │ │ │ +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 // 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) │ │ │ │ │ +203 }; │ │ │ │ │ +204 │ │ │ │ │ +205 } // anonymous namespace │ │ │ │ │ +206 │ │ │ │ │ +208 template │ │ │ │ │ +_2_0_9 struct _f_i_l_t_e_r │ │ │ │ │ +210 { │ │ │ │ │ +211 │ │ │ │ │ +213 template │ │ │ │ │ +_2_1_4 struct _a_p_p_l_y │ │ │ │ │ 215 { │ │ │ │ │ -216 return NodeTransformation::transform(s,t); │ │ │ │ │ -217 } │ │ │ │ │ +216 │ │ │ │ │ +217 static_assert((Filter::template validate::value),"Invalid simple │ │ │ │ │ +filter"); │ │ │ │ │ 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 } │ │ │ │ │ +_2_1_9 typedef typename filter_helper::template _a_p_p_l_y_<_>_:_: │ │ │ │ │ +_t_y_p_e _t_y_p_e; │ │ │ │ │ +220 │ │ │ │ │ +221 }; │ │ │ │ │ +222 │ │ │ │ │ +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 _r_e_s_u_l_t, │ │ │ │ │ -409 LookupNodeTransformation>::type::recursive │ │ │ │ │ -410 >::transformed_type... │ │ │ │ │ -411 >::type transformed_type; │ │ │ │ │ -412 │ │ │ │ │ -413 typedef typename NodeTransformation::template _r_e_s_u_l_t, │ │ │ │ │ -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 _t_r_a_n_s_f_o_r_m(const S& s, T& t) │ │ │ │ │ -481 { │ │ │ │ │ -482 return transform_composite_node::transform │ │ │ │ │ -(s,t,child_indices()); │ │ │ │ │ -483 } │ │ │ │ │ -484 │ │ │ │ │ -485 static transformed_type _t_r_a_n_s_f_o_r_m(const S& s, const T& t) │ │ │ │ │ -486 { │ │ │ │ │ -487 return transform_composite_node::transform │ │ │ │ │ -(s,t,child_indices()); │ │ │ │ │ -488 } │ │ │ │ │ -489 │ │ │ │ │ -490 static transformed_storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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 _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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 │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ -_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_g_i_s_t_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -void registerNodeTransformation(SourceNode *, Transformation *, Tag *) │ │ │ │ │ -Register transformation descriptor to transform SourceNode with Transformation. │ │ │ │ │ +226 │ │ │ │ │ +227 } // namespace TypeTree │ │ │ │ │ +228} //namespace Dune │ │ │ │ │ +229 │ │ │ │ │ +230#endif // DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e │ │ │ │ │ -Transform a TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:94 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_T_y_p_e │ │ │ │ │ -type Type │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:111 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(std::shared_ptr< const SourceTree > sp, │ │ │ │ │ -Transformation &t) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:132 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(std::shared_ptr< const SourceTree > sp, const │ │ │ │ │ -Transformation &t=Transformation()) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(const SourceTree &s, Transformation &t) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:120 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_y_p_e │ │ │ │ │ -transformed_type type │ │ │ │ │ -The type of the transformed tree. │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:109 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(const SourceTree &s, const Transformation │ │ │ │ │ -&t=Transformation()) │ │ │ │ │ -Apply transformation to an existing tree s. │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:114 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceTree > sp, const Transformation &t=Transformation()) │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:139 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_a_n_s_f_o_r_m_T_r_e_e_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceTree > sp, Transformation &t) │ │ │ │ │ -DDeeffiinniittiioonn transformation.hh:146 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ -Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:140 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_E_n_t_r_y │ │ │ │ │ +A filter entry describing the mapping of one child in the filtered node. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:22 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t │ │ │ │ │ +The result of a filter. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_I_n_d_e_x_M_a_p │ │ │ │ │ +std::tuple< FilterEntries... > IndexMap │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:42 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_s_i_z_e │ │ │ │ │ +static const std::size_t size │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:40 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y_:_:_C_h_i_l_d_r_e_n │ │ │ │ │ +std::tuple< typename Node::template Child< FilterEntries::original_index >... > │ │ │ │ │ +Children │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:47 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ +std::tuple< typename Node::template Child< FilterEntries::original_index >:: │ │ │ │ │ +Type... > ChildTypes │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:48 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +std::tuple< std::shared_ptr< typename Node::template Child< FilterEntries:: │ │ │ │ │ +original_index >::Type >... > NodeStorage │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_T_a_g │ │ │ │ │ +Tag describing a simple filter that can only decide whether or not to include a │ │ │ │ │ +single given child. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:55 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g │ │ │ │ │ +Tag describing an advanced filter that has full control over the construction │ │ │ │ │ +of the list of FilterEn... │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:58 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ +Base class for advanced filters. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:63 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_F_i_l_t_e_r_T_a_g │ │ │ │ │ +AdvancedFilterTag FilterTag │ │ │ │ │ +Filter tag for deciding on filter application mechanism. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:66 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_a_p_p_l_y │ │ │ │ │ +Apply this filter to the given node and children. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:73 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_a_p_p_l_y_:_:_t_y_p_e │ │ │ │ │ +implementation defined type │ │ │ │ │ +The result of the filtering process. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:78 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r │ │ │ │ │ +Default simple filter that accepts any node and leaves its child structure │ │ │ │ │ +unchanged. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:92 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_F_i_l_t_e_r_T_a_g │ │ │ │ │ +SimpleFilterTag FilterTag │ │ │ │ │ +Filter tag for deciding on filter application mechanism. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:95 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_v_a_l_i_d_a_t_e │ │ │ │ │ +Validates the combination of filter and node. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:101 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_v_a_l_i_d_a_t_e_:_:_v_a_l_u_e │ │ │ │ │ +static const bool value │ │ │ │ │ +True if the combination of filter and node is valid. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:103 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_a_p_p_l_y │ │ │ │ │ +Applies the filter to the given child node. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:117 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_a_p_p_l_y_:_:_v_a_l_u_e │ │ │ │ │ +static const bool value │ │ │ │ │ +True if the child will be included in the filtered node. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:119 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_n_d_e_x_F_i_l_t_e_r │ │ │ │ │ +Filter class for FilteredCompositeNode that selects the children with the given │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:159 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r │ │ │ │ │ +Adapter class that takes a SimpleFilter, validated it and turns it into an │ │ │ │ │ +AdvancedFilter. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:210 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_:_:_a_p_p_l_y │ │ │ │ │ +Apply the filter. │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:215 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_:_:_a_p_p_l_y_:_:_t_y_p_e │ │ │ │ │ +filter_helper< Filter, 0, 0, Children... >::template apply ::type type │ │ │ │ │ +DDeeffiinniittiioonn filters.hh:219 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treecontainer.hh File Reference │ │ │ │ +dune-typetree: leafnode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,74 +71,36 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
treecontainer.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
leafnode.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#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>
│ │ │ │ +
#include <dune/typetree/nodetags.hh>
│ │ │ │ +#include <cstddef>
│ │ │ │ +#include <type_traits>
│ │ │ │
│ │ │ │

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 >
class  Dune::TypeTree::LeafNode
 Base class for leaf nodes in a dune-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.
 
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.
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -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.
 
template<class Value , class Tree >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree)
 Create container havin the same structure as the given tree.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,62 +1,23 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -treecontainer.hh File Reference │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +leafnode.hh File Reference │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_<_ _L_e_a_f_T_o_V_a_l_u_e_ _> │ │ │ │ │ -  │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_<_ _C_o_n_t_a_i_n_e_r_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e_<_ _L_e_a_f_T_o_V_a_l_u_e_ _> │ │ │ │ │ +class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e │ │ │ │ │ +  Base class for leaf nodes in a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l │ │ │ │ │ -  │ │ │ │ │ -TTyyppeeddeeffss │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_U_n_i_f_o_r_m_T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t< decltype │ │ │ │ │ - (_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r< Value >(std::declval< const Tree & >()))> │ │ │ │ │ -  Alias to container type generated by makeTreeContainer for given tree │ │ │ │ │ - type and uniform value type. │ │ │ │ │ -  │ │ │ │ │ -template class LeafToValue, class Tree > │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t< decltype(_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ - (std::declval< const Tree & >(), std::declval< _D_e_t_a_i_l_:_: │ │ │ │ │ - _L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e< LeafToValue > >()))> │ │ │ │ │ -  Alias to container type generated by makeTreeContainer for give tree │ │ │ │ │ - type and when using LeafToValue to create values. │ │ │ │ │ -  │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d (Container │ │ │ │ │ - &&container) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r (const Tree &tree, LeafToValue │ │ │ │ │ - &&leafToValue) │ │ │ │ │ -  Create container havin the same structure as the given tree. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r (const Tree &tree) │ │ │ │ │ -  Create container havin the same structure as the given tree. │ │ │ │ │ -  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00038_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treecontainer.hh Source File │ │ │ │ +dune-typetree: leafnode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,331 +74,77 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
treecontainer.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_TREECONTAINER_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │
6
│ │ │ │ -
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
│ │ │ │ -
│ │ │ │ -
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 }
│ │ │ │ -
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 };
│ │ │ │ -
│ │ │ │ -
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 }
│ │ │ │ -
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
│ │ │ │ -
307
│ │ │ │ -
308 } // namespace TypeTree
│ │ │ │ -
309} //namespace Dune
│ │ │ │ -
310
│ │ │ │ -
311#endif // DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ - │ │ │ │ -
auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue)
Create container havin the same structure as the given tree.
Definition treecontainer.hh:266
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │ + │ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,363 +1,91 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -treecontainer.hh │ │ │ │ │ +leafnode.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_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 │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -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 │ │ │ │ │ -_3_6 class _C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y │ │ │ │ │ -37 { │ │ │ │ │ -38 template │ │ │ │ │ -39 using DynamicDegreeConcept = decltype((std::size_t(std::declval()._d_e_g_r_e_e │ │ │ │ │ -()), 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 │ │ │ │ │ -_5_6 _C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y(LeafToValue leafToValue) : │ │ │ │ │ -57 leafToValue_(leafToValue) │ │ │ │ │ -58 {} │ │ │ │ │ -59 │ │ │ │ │ -60 template │ │ │ │ │ -_6_1 auto _o_p_e_r_a_t_o_r_(_)(const Node& node) │ │ │ │ │ -62 { │ │ │ │ │ -63 return (*this)(node, Dune::PriorityTag<5>{}); │ │ │ │ │ -64 } │ │ │ │ │ -65 │ │ │ │ │ -66 private: │ │ │ │ │ -67 │ │ │ │ │ -68 template = true> │ │ │ │ │ -70 auto _o_p_e_r_a_t_o_r_(_)(const Node& node, Dune::PriorityTag<4>) │ │ │ │ │ -71 { │ │ │ │ │ -72 return leafToValue_(node); │ │ │ │ │ -73 } │ │ │ │ │ -74 │ │ │ │ │ -75 template = true, │ │ │ │ │ -77 DynamicChildAccessConcept = true> │ │ │ │ │ -78 auto _o_p_e_r_a_t_o_r_(_)(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 _o_p_e_r_a_t_o_r_(_)(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 _o_p_e_r_a_t_o_r_(_)(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 }; │ │ │ │ │ -110 │ │ │ │ │ -111 │ │ │ │ │ -112 /* │ │ │ │ │ -113 * \brief Wrap nested container to provide a VectorBackend │ │ │ │ │ -114 */ │ │ │ │ │ -115 template │ │ │ │ │ -_1_1_6 class _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ -117 { │ │ │ │ │ -118 template │ │ │ │ │ -119 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_>& path) │ │ │ │ │ -120 { │ │ │ │ │ -121 return container; │ │ │ │ │ -122 } │ │ │ │ │ -123 │ │ │ │ │ -124 template │ │ │ │ │ -125 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& path) │ │ │ │ │ -126 { │ │ │ │ │ -127 auto head = path[Dune::Indices::_0]; │ │ │ │ │ -128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){ │ │ │ │ │ -129 return _t_r_e_e_P_a_t_h(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: │ │ │ │ │ -_1_6_9 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d(Container&& container) : │ │ │ │ │ -170 container_(std::move(container)) │ │ │ │ │ -171 {} │ │ │ │ │ -172 │ │ │ │ │ -174 template = true> │ │ │ │ │ -_1_7_5 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d(const Tree& tree) : │ │ │ │ │ -176 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d() │ │ │ │ │ -177 { │ │ │ │ │ -178 this->resize(tree); │ │ │ │ │ -179 } │ │ │ │ │ -180 │ │ │ │ │ -182 template , bool> = true> │ │ │ │ │ -_1_8_4 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d() : │ │ │ │ │ -185 container_() │ │ │ │ │ -186 {} │ │ │ │ │ -187 │ │ │ │ │ -188 template │ │ │ │ │ -_1_8_9 decltype(auto) operator[](const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& path) const │ │ │ │ │ -190 { │ │ │ │ │ -191 return accessByTreePath(container_, path); │ │ │ │ │ -192 } │ │ │ │ │ -193 │ │ │ │ │ -194 template │ │ │ │ │ -_1_9_5 decltype(auto) operator[](const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& path) │ │ │ │ │ -196 { │ │ │ │ │ -197 return accessByTreePath(container_, path); │ │ │ │ │ -198 } │ │ │ │ │ -199 │ │ │ │ │ -201 template = true> │ │ │ │ │ -_2_0_2 void _r_e_s_i_z_e(const Tree& tree) │ │ │ │ │ -203 { │ │ │ │ │ -204 resizeImpl(container_, tree, Dune::PriorityTag<5>{}); │ │ │ │ │ -205 } │ │ │ │ │ -206 │ │ │ │ │ -_2_0_7 const Container& _d_a_t_a() const │ │ │ │ │ -208 { │ │ │ │ │ -209 return container_; │ │ │ │ │ -210 } │ │ │ │ │ -211 │ │ │ │ │ -_2_1_2 Container& _d_a_t_a() │ │ │ │ │ -213 { │ │ │ │ │ -214 return container_; │ │ │ │ │ -215 } │ │ │ │ │ -216 │ │ │ │ │ -217 private: │ │ │ │ │ -218 Container container_; │ │ │ │ │ -219 }; │ │ │ │ │ -220 │ │ │ │ │ -221 template │ │ │ │ │ -_2_2_2 auto _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d(Container&& container) │ │ │ │ │ -223 { │ │ │ │ │ -224 return _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_<_s_t_d_:_:_d_e_c_a_y___t_<_C_o_n_t_a_i_n_e_r_>>(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> │ │ │ │ │ -_2_3_5 struct _L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e │ │ │ │ │ -236 { │ │ │ │ │ -237 template │ │ │ │ │ -_2_3_8 auto _o_p_e_r_a_t_o_r_(_)(const Node& node) const │ │ │ │ │ -239 { │ │ │ │ │ -240 return LeafToValue{}; │ │ │ │ │ -241 } │ │ │ │ │ -242 }; │ │ │ │ │ -243 │ │ │ │ │ -244 } // namespace Detail │ │ │ │ │ -245 │ │ │ │ │ -265 template │ │ │ │ │ -_2_6_6 auto _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r(const Tree& tree, LeafToValue&& leafToValue) │ │ │ │ │ -267 { │ │ │ │ │ -268 auto f = std::ref(leafToValue); │ │ │ │ │ -269 auto factory = _D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_<_d_e_c_l_t_y_p_e_(_f_)_>(f); │ │ │ │ │ -270 return Detail::makeTreeContainerVectorBackend(factory(tree)); │ │ │ │ │ -271 } │ │ │ │ │ -272 │ │ │ │ │ -288 template │ │ │ │ │ -_2_8_9 auto _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r(const Tree& tree) │ │ │ │ │ -290 { │ │ │ │ │ -291 return _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r(tree, [](const auto&) {return Value{};}); │ │ │ │ │ -292 } │ │ │ │ │ -293 │ │ │ │ │ -297 template │ │ │ │ │ -_2_9_8 using _U_n_i_f_o_r_m_T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t │ │ │ │ │ -(std::declval()))>; │ │ │ │ │ -299 │ │ │ │ │ -303 template class LeafToValue, class Tree> │ │ │ │ │ -_3_0_4 using _T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t(), std::declval>()))>; │ │ │ │ │ -305 │ │ │ │ │ -307 │ │ │ │ │ -308 } // namespace TypeTree │ │ │ │ │ -309} //namespace Dune │ │ │ │ │ -310 │ │ │ │ │ -311#endif // DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ -_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ -auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue) │ │ │ │ │ -Create container havin the same structure as the given tree. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:266 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_U_n_i_f_o_r_m_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:298 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ -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 ... │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:304 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_g_r_e_e │ │ │ │ │ -std::size_t degree(const Node &node) │ │ │ │ │ -Returns the degree of node as run time information. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:85 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ +7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11namespace _D_u_n_e { │ │ │ │ │ +12 namespace TypeTree { │ │ │ │ │ +13 │ │ │ │ │ +_2_5 class _L_e_a_f_N_o_d_e │ │ │ │ │ +26 { │ │ │ │ │ +27 │ │ │ │ │ +28 public: │ │ │ │ │ +29 │ │ │ │ │ +_3_1 static const bool _i_s_L_e_a_f = true; │ │ │ │ │ +32 │ │ │ │ │ +_3_4 static const bool _i_s_P_o_w_e_r = false; │ │ │ │ │ +35 │ │ │ │ │ +_3_7 static const bool _i_s_C_o_m_p_o_s_i_t_e = false; │ │ │ │ │ +38 │ │ │ │ │ +40 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +_4_1 static const std::size_t _C_H_I_L_D_R_E_N = 0; │ │ │ │ │ +42 │ │ │ │ │ +_4_4 typedef _L_e_a_f_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ +45 │ │ │ │ │ +_4_6 static constexpr auto _d_e_g_r_e_e() │ │ │ │ │ +47 { │ │ │ │ │ +48 return std::integral_constant{}; │ │ │ │ │ +49 } │ │ │ │ │ +50 │ │ │ │ │ +51 protected: │ │ │ │ │ +52 │ │ │ │ │ +54 │ │ │ │ │ +_5_9 _L_e_a_f_N_o_d_e() {} │ │ │ │ │ +60 }; │ │ │ │ │ +61 │ │ │ │ │ +63 │ │ │ │ │ +64 } // namespace TypeTree │ │ │ │ │ +65} //namespace Dune │ │ │ │ │ +66 │ │ │ │ │ +67#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ -auto makeTreeContainerVectorBackend(Container &&container) │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:222 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:37 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ -auto operator()(const Node &node) │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:61 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y │ │ │ │ │ -ContainerFactory(LeafToValue leafToValue) │ │ │ │ │ -Create ContainerFactory. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:56 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:117 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_r_e_s_i_z_e │ │ │ │ │ -void resize(const Tree &tree) │ │ │ │ │ -Resize the (nested) container depending on the degree of the tree nodes. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:202 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_d_a_t_a │ │ │ │ │ -Container & data() │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:212 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_d_a_t_a │ │ │ │ │ -const Container & data() const │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:207 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ -TreeContainerVectorBackend(Container &&container) │ │ │ │ │ -Move the passed container into the internal storage. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:169 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ -TreeContainerVectorBackend() │ │ │ │ │ -Default constructor. The stored container might need to be resized before │ │ │ │ │ -usage. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:184 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ -TreeContainerVectorBackend(const Tree &tree) │ │ │ │ │ -Default construct the container and perform a resize depending on the tree-node │ │ │ │ │ -degrees. │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:175 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:236 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ -auto operator()(const Node &node) const │ │ │ │ │ -DDeeffiinniittiioonn treecontainer.hh:238 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e │ │ │ │ │ +Base class for leaf nodes in a dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:26 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +LeafNodeTag NodeTag │ │ │ │ │ +The type tag that describes a LeafNode. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:44 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as a leaf in a dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:31 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +Leafs have no children. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:41 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:34 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_L_e_a_f_N_o_d_e │ │ │ │ │ +LeafNode() │ │ │ │ │ +Default constructor. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:59 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a non composite in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:37 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +DDeeffiinniittiioonn leafnode.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: generictransformationdescriptors.hh File Reference │ │ │ │ +dune-typetree: childextraction.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,57 +70,66 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
generictransformationdescriptors.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
childextraction.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ -#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <dune/typetree/powercompositenodetransformationtemplates.hh>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ +
#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>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ -Classes

struct  Dune::TypeTree::GenericLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
 
struct  Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
 
struct  Dune::TypeTree::GenericPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
 
struct  Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
 
struct  Dune::TypeTree::GenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
 
struct  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
 
struct  Dune::TypeTree::GenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ 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.
 
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.
 
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.
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +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.
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,53 +1,58 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -generictransformationdescriptors.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +_N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +childextraction.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_c_o_m_p_o_s_i_t_e_n_o_d_e_t_r_a_n_s_f_o_r_m_a_t_i_o_n_t_e_m_p_l_a_t_e_s_._h_h> │ │ │ │ │ -#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +TTyyppeeddeeffss │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d = typename impl::_Child< Node, indices... >::type │ │ │ │ │ +  Template alias for the type of a child node given by a list of child │ │ │ │ │ + indices. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d_F_o_r_T_r_e_e_P_a_t_h = typename impl::_ChildForTreePath< │ │ │ │ │ + Node, _T_r_e_e_P_a_t_h >::type │ │ │ │ │ +  Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h type. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x = 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. │ │ │ │ │ +  │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +ImplementationDefined  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d (Node &&node, Indices... indices) │ │ │ │ │ +  Extracts the child of a node given by a sequence of │ │ │ │ │ + compile-time and run-time indices. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +ImplementationDefined  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e (Node &&node, Indices... │ │ │ │ │ + indices) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +ImplementationDefined  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d (Node &&node, _H_y_b_r_i_d_T_r_e_e_P_a_t_h< │ │ │ │ │ + Indices... > _t_r_e_e_P_a_t_h) │ │ │ │ │ +  Extracts the child of a node given by a _H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ + object. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00041_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: generictransformationdescriptors.hh Source File │ │ │ │ +dune-typetree: childextraction.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,286 +74,288 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
generictransformationdescriptors.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_GENERICTRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │ +
5#define DUNE_TYPETREE_CHILDEXTRACTION_HH
│ │ │ │
6
│ │ │ │ -
7#include <array>
│ │ │ │ -
8#include <memory>
│ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <utility>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
13#include <dune/common/exceptions.hh>
│ │ │ │ +
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
│ │ │ │ -
15
│ │ │ │ -
16namespace Dune {
│ │ │ │ -
17 namespace TypeTree {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
17
│ │ │ │
18
│ │ │ │ -
24 template<typename SourceNode, typename Transformation, typename TransformedNode>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
26 {
│ │ │ │ -
27
│ │ │ │ -
28 static const bool recursive = false;
│ │ │ │ -
29
│ │ │ │ -
30 typedef TransformedNode transformed_type;
│ │ │ │ -
31 typedef std::shared_ptr<transformed_type> transformed_storage_type;
│ │ │ │ -
32
│ │ │ │ -
│ │ │ │ -
33 static transformed_type transform(const SourceNode& s, const Transformation& t)
│ │ │ │ +
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 return transformed_type(s,t);
│ │ │ │ -
36 }
│ │ │ │ -
│ │ │ │ -
37
│ │ │ │ -
│ │ │ │ -
38 static transformed_type transform(std::shared_ptr<const SourceNode> s, const Transformation& t)
│ │ │ │ -
39 {
│ │ │ │ -
40 return transformed_type(s,t);
│ │ │ │ -
41 }
│ │ │ │ -
│ │ │ │ -
42
│ │ │ │ -
│ │ │ │ -
43 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
│ │ │ │ -
44 {
│ │ │ │ -
45 return std::make_shared<transformed_type>(s,t);
│ │ │ │ -
46 }
│ │ │ │ -
│ │ │ │ -
47
│ │ │ │ -
48 };
│ │ │ │ -
│ │ │ │ -
49
│ │ │ │ -
50
│ │ │ │ -
51 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNodeTemplate>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
53 {
│ │ │ │ +
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 static const bool recursive = true;
│ │ │ │ -
56
│ │ │ │ -
57 template<typename TC>
│ │ │ │ -
│ │ │ │ -
58 struct result
│ │ │ │ -
59 {
│ │ │ │ -
60 typedef typename TransformedNodeTemplate<TC>::type type;
│ │ │ │ -
61 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
62 static const std::size_t degree = StaticDegree<type>::value;
│ │ │ │ -
63 };
│ │ │ │ -
│ │ │ │ -
64
│ │ │ │ -
65 template<typename TC>
│ │ │ │ -
│ │ │ │ -
66 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ -
67 {
│ │ │ │ -
68 return typename result<TC>::type(s,t,children);
│ │ │ │ -
69 }
│ │ │ │ -
│ │ │ │ -
70
│ │ │ │ -
71 template<typename TC>
│ │ │ │ -
│ │ │ │ -
72 static typename result<TC>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ -
73 {
│ │ │ │ -
74 return typename result<TC>::type(s,t,children);
│ │ │ │ -
75 }
│ │ │ │ -
│ │ │ │ -
76
│ │ │ │ -
77 template<typename TC>
│ │ │ │ -
│ │ │ │ -
78 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)
│ │ │ │ -
79 {
│ │ │ │ -
80 return std::make_shared<typename result<TC>::type>(s,t,children);
│ │ │ │ +
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 };
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ -
86 template<typename SourceNode, typename Transformation, template<typename,typename,std::size_t> class TransformedNode>
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
89 Transformation,
│ │ │ │ -
90 GenericPowerNodeTransformationTemplate<SourceNode,
│ │ │ │ -
91 Transformation,
│ │ │ │ -
92 TransformedNode>::template result
│ │ │ │ -
93 >
│ │ │ │ -
94 {};
│ │ │ │ -
│ │ │ │ -
95
│ │ │ │ +
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
│ │ │ │ -
97 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNodeTemplate>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
99 {
│ │ │ │ +
97 } // end namespace Impl
│ │ │ │ +
98
│ │ │ │ +
99#endif // DOXYGEN
│ │ │ │
100
│ │ │ │ -
101 static const bool recursive = true;
│ │ │ │
102
│ │ │ │ -
103 template<typename TC>
│ │ │ │ -
│ │ │ │ -
104 struct result
│ │ │ │ -
105 {
│ │ │ │ -
106 typedef typename TransformedNodeTemplate<TC>::type type;
│ │ │ │ -
107 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
108 };
│ │ │ │ -
│ │ │ │ -
109
│ │ │ │ -
110 template<typename TC>
│ │ │ │ -
│ │ │ │ -
111 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ -
112 {
│ │ │ │ -
113 return typename result<TC>::type(s,t,children);
│ │ │ │ -
114 }
│ │ │ │ -
│ │ │ │ -
115
│ │ │ │ -
116 template<typename TC>
│ │ │ │ -
│ │ │ │ -
117 static typename result<TC>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ -
118 {
│ │ │ │ -
119 return typename result<TC>::type(s,t,children);
│ │ │ │ -
120 }
│ │ │ │ -
│ │ │ │ -
121
│ │ │ │ -
122 template<typename TC>
│ │ │ │ -
│ │ │ │ -
123 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)
│ │ │ │ -
124 {
│ │ │ │ -
125 return std::make_shared<typename result<TC>::type>(s,t,children);
│ │ │ │ -
126 }
│ │ │ │ -
│ │ │ │ -
127
│ │ │ │ -
128 };
│ │ │ │ -
│ │ │ │ -
129
│ │ │ │ -
130
│ │ │ │ -
131 template<typename SourceNode, typename Transformation, template<typename,typename> class TransformedNode>
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
134 Transformation,
│ │ │ │ -
135 GenericDynamicPowerNodeTransformationTemplate<SourceNode,
│ │ │ │ -
136 Transformation,
│ │ │ │ -
137 TransformedNode>::template result
│ │ │ │ -
138 >
│ │ │ │ -
139 {};
│ │ │ │ -
│ │ │ │ -
140
│ │ │ │ -
141
│ │ │ │ -
142 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNodeTemplate>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
144 {
│ │ │ │ -
145
│ │ │ │ -
146 static const bool recursive = true;
│ │ │ │ -
147
│ │ │ │ -
148 template<typename... TC>
│ │ │ │ -
│ │ │ │ -
149 struct result
│ │ │ │ -
150 {
│ │ │ │ -
151 typedef typename TransformedNodeTemplate<TC...>::type type;
│ │ │ │ -
152 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
153 };
│ │ │ │ -
│ │ │ │ -
154
│ │ │ │ -
155 template<typename... TC>
│ │ │ │ -
│ │ │ │ -
156 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ -
157 {
│ │ │ │ -
158 return typename result<TC...>::type(s,t,children...);
│ │ │ │ -
159 }
│ │ │ │ -
│ │ │ │ -
160
│ │ │ │ -
161 template<typename... TC>
│ │ │ │ -
│ │ │ │ -
162 static typename result<TC...>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ -
163 {
│ │ │ │ -
164 return typename result<TC...>::type(s,t,children...);
│ │ │ │ -
165 }
│ │ │ │ -
│ │ │ │ -
166
│ │ │ │ -
167 template<typename... TC>
│ │ │ │ -
│ │ │ │ -
168 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ -
169 {
│ │ │ │ -
170 return std::make_shared<typename result<TC...>::type>(s,t,children...);
│ │ │ │ -
171 }
│ │ │ │ -
│ │ │ │ -
172
│ │ │ │ -
173 };
│ │ │ │ -
│ │ │ │ -
174
│ │ │ │ -
175
│ │ │ │ -
176 template<typename SourceNode, typename Transformation, template<typename,typename...> class TransformedNode>
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
179 Transformation,
│ │ │ │ -
180 GenericCompositeNodeTransformationTemplate<SourceNode,
│ │ │ │ -
181 Transformation,
│ │ │ │ -
182 TransformedNode>::template result
│ │ │ │ -
183 >
│ │ │ │ -
184 {};
│ │ │ │ -
│ │ │ │ -
185
│ │ │ │ -
187
│ │ │ │ -
188 } // namespace TypeTree
│ │ │ │ -
189} //namespace Dune
│ │ │ │ +
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 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#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
│ │ │ │ +
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 };
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ -
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition generictransformationdescriptors.hh:43
│ │ │ │ -
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition generictransformationdescriptors.hh:33
│ │ │ │ -
Definition generictransformationdescriptors.hh:53
│ │ │ │ -
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 generictransformationdescriptors.hh:78
│ │ │ │ -
static const bool recursive
Definition generictransformationdescriptors.hh:55
│ │ │ │ -
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)
Definition generictransformationdescriptors.hh:72
│ │ │ │ -
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition generictransformationdescriptors.hh:66
│ │ │ │ -
Definition generictransformationdescriptors.hh:59
│ │ │ │ -
TransformedNodeTemplate< TC >::type type
Definition generictransformationdescriptors.hh:60
│ │ │ │ -
static const std::size_t degree
Definition generictransformationdescriptors.hh:62
│ │ │ │ -
std::shared_ptr< type > storage_type
Definition generictransformationdescriptors.hh:61
│ │ │ │ -
Definition generictransformationdescriptors.hh:94
│ │ │ │ -
Definition generictransformationdescriptors.hh:99
│ │ │ │ -
static result< TC >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition generictransformationdescriptors.hh:117
│ │ │ │ -
static const bool recursive
Definition generictransformationdescriptors.hh:101
│ │ │ │ -
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition generictransformationdescriptors.hh:111
│ │ │ │ -
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 generictransformationdescriptors.hh:123
│ │ │ │ -
Definition generictransformationdescriptors.hh:105
│ │ │ │ -
TransformedNodeTemplate< TC >::type type
Definition generictransformationdescriptors.hh:106
│ │ │ │ -
std::shared_ptr< type > storage_type
Definition generictransformationdescriptors.hh:107
│ │ │ │ -
Definition generictransformationdescriptors.hh:139
│ │ │ │ -
Definition generictransformationdescriptors.hh:144
│ │ │ │ -
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition generictransformationdescriptors.hh:156
│ │ │ │ -
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition generictransformationdescriptors.hh:168
│ │ │ │ -
static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition generictransformationdescriptors.hh:162
│ │ │ │ -
static const bool recursive
Definition generictransformationdescriptors.hh:146
│ │ │ │ -
Definition generictransformationdescriptors.hh:150
│ │ │ │ -
TransformedNodeTemplate< TC... >::type type
Definition generictransformationdescriptors.hh:151
│ │ │ │ -
std::shared_ptr< type > storage_type
Definition generictransformationdescriptors.hh:152
│ │ │ │ -
Definition generictransformationdescriptors.hh:184
│ │ │ │ +
A hybrid version of TreePath that supports both compile time and run time indices.
Definition treepath.hh:79
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,343 +1,319 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -generictransformationdescriptors.hh │ │ │ │ │ +childextraction.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ -5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ +4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ +5#define DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_c_o_m_p_o_s_i_t_e_n_o_d_e_t_r_a_n_s_f_o_r_m_a_t_i_o_n_t_e_m_p_l_a_t_e_s_._h_h> │ │ │ │ │ -13#include │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ 14 │ │ │ │ │ -15 │ │ │ │ │ -16namespace _D_u_n_e { │ │ │ │ │ -17 namespace TypeTree { │ │ │ │ │ +15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +17 │ │ │ │ │ 18 │ │ │ │ │ -24 template │ │ │ │ │ -_2_5 struct _G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -26 { │ │ │ │ │ -27 │ │ │ │ │ -_2_8 static const bool _r_e_c_u_r_s_i_v_e = false; │ │ │ │ │ -29 │ │ │ │ │ -_3_0 typedef TransformedNode _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e; │ │ │ │ │ -_3_1 typedef std::shared_ptr _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -32 │ │ │ │ │ -_3_3 static _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const Transformation& │ │ │ │ │ -t) │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +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 return _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e(s,t); │ │ │ │ │ -36 } │ │ │ │ │ -37 │ │ │ │ │ -_3_8 static _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e _t_r_a_n_s_f_o_r_m(std::shared_ptr s, const │ │ │ │ │ -Transformation& t) │ │ │ │ │ -39 { │ │ │ │ │ -40 return _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e(s,t); │ │ │ │ │ -41 } │ │ │ │ │ -42 │ │ │ │ │ -_4_3 static _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr s, const Transformation& t) │ │ │ │ │ -44 { │ │ │ │ │ -45 return std::make_shared(s,t); │ │ │ │ │ -46 } │ │ │ │ │ -47 │ │ │ │ │ -48 }; │ │ │ │ │ -49 │ │ │ │ │ -50 │ │ │ │ │ -51 template class TransformedNodeTemplate> │ │ │ │ │ -_5_2 struct _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -53 { │ │ │ │ │ +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 │ │ │ │ │ -_5_5 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ -56 │ │ │ │ │ -57 template │ │ │ │ │ -_5_8 struct _r_e_s_u_l_t │ │ │ │ │ -59 { │ │ │ │ │ -_6_0 typedef typename TransformedNodeTemplate::type _t_y_p_e; │ │ │ │ │ -_6_1 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -_6_2 static const std::size_t _d_e_g_r_e_e = _S_t_a_t_i_c_D_e_g_r_e_e_<_t_y_p_e_>_:_:_v_a_l_u_e; │ │ │ │ │ -63 }; │ │ │ │ │ -64 │ │ │ │ │ -65 template │ │ │ │ │ -_6_6 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ -Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& │ │ │ │ │ -children) │ │ │ │ │ -67 { │ │ │ │ │ -68 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ -69 } │ │ │ │ │ -70 │ │ │ │ │ -71 template │ │ │ │ │ -_7_2 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(std::shared_ptr │ │ │ │ │ -s, const Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_: │ │ │ │ │ -_d_e_g_r_e_e>& children) │ │ │ │ │ -73 { │ │ │ │ │ -74 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ -75 } │ │ │ │ │ -76 │ │ │ │ │ -77 template │ │ │ │ │ -_7_8 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& children) │ │ │ │ │ -79 { │ │ │ │ │ -80 return std::make_shared::type>(s,t,children); │ │ │ │ │ +55 template │ │ │ │ │ +56 auto childStorageImpl (NodePtr&& nodePtr) │ │ │ │ │ +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 }; │ │ │ │ │ -84 │ │ │ │ │ -85 │ │ │ │ │ -86 template class TransformedNode> │ │ │ │ │ -_8_7 struct _G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -88 : public _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n::template result │ │ │ │ │ -93 > │ │ │ │ │ -94 {}; │ │ │ │ │ -95 │ │ │ │ │ +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 │ │ │ │ │ -97 template class TransformedNodeTemplate> │ │ │ │ │ -_9_8 struct _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -99 { │ │ │ │ │ +97 } // end namespace Impl │ │ │ │ │ +98 │ │ │ │ │ +99#endif // DOXYGEN │ │ │ │ │ 100 │ │ │ │ │ -_1_0_1 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ 102 │ │ │ │ │ -103 template │ │ │ │ │ -_1_0_4 struct _r_e_s_u_l_t │ │ │ │ │ -105 { │ │ │ │ │ -_1_0_6 typedef typename TransformedNodeTemplate::type _t_y_p_e; │ │ │ │ │ -_1_0_7 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -108 }; │ │ │ │ │ -109 │ │ │ │ │ -110 template │ │ │ │ │ -_1_1_1 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ -Transformation& t, const std::vector>& children) │ │ │ │ │ -112 { │ │ │ │ │ -113 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ -114 } │ │ │ │ │ -115 │ │ │ │ │ -116 template │ │ │ │ │ -_1_1_7 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(std::shared_ptr s, const Transformation& t, const std::vector>& │ │ │ │ │ -children) │ │ │ │ │ -118 { │ │ │ │ │ -119 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ -120 } │ │ │ │ │ -121 │ │ │ │ │ -122 template │ │ │ │ │ -_1_2_3 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, const std:: │ │ │ │ │ -vector>& children) │ │ │ │ │ -124 { │ │ │ │ │ -125 return std::make_shared::type>(s,t,children); │ │ │ │ │ -126 } │ │ │ │ │ -127 │ │ │ │ │ -128 }; │ │ │ │ │ -129 │ │ │ │ │ -130 │ │ │ │ │ -131 template class TransformedNode> │ │ │ │ │ -_1_3_2 struct _G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -133 : public _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n::template result │ │ │ │ │ -138 > │ │ │ │ │ -139 {}; │ │ │ │ │ -140 │ │ │ │ │ -141 │ │ │ │ │ -142 template class TransformedNodeTemplate> │ │ │ │ │ -_1_4_3 struct _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -144 { │ │ │ │ │ -145 │ │ │ │ │ -_1_4_6 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ -147 │ │ │ │ │ -148 template │ │ │ │ │ -_1_4_9 struct _r_e_s_u_l_t │ │ │ │ │ -150 { │ │ │ │ │ -_1_5_1 typedef typename TransformedNodeTemplate_:_:_t_y_p_e _t_y_p_e; │ │ │ │ │ -_1_5_2 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -153 }; │ │ │ │ │ -154 │ │ │ │ │ -155 template │ │ │ │ │ -_1_5_6 static typename _r_e_s_u_l_t::type _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ -Transformation& t, std::shared_ptr... children) │ │ │ │ │ -157 { │ │ │ │ │ -158 return typename _r_e_s_u_l_t_<_T_C_._._._>_:_:_t_y_p_e(s,t,children...); │ │ │ │ │ -159 } │ │ │ │ │ -160 │ │ │ │ │ -161 template │ │ │ │ │ -_1_6_2 static typename _r_e_s_u_l_t::type _t_r_a_n_s_f_o_r_m(std::shared_ptr s, const Transformation& t, std::shared_ptr... children) │ │ │ │ │ -163 { │ │ │ │ │ -164 return typename _r_e_s_u_l_t_<_T_C_._._._>_:_:_t_y_p_e(s,t,children...); │ │ │ │ │ -165 } │ │ │ │ │ -166 │ │ │ │ │ -167 template │ │ │ │ │ -_1_6_8 static typename _r_e_s_u_l_t::storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, std::shared_ptr... │ │ │ │ │ -children) │ │ │ │ │ -169 { │ │ │ │ │ -170 return std::make_shared::type>(s,t,children...); │ │ │ │ │ -171 } │ │ │ │ │ -172 │ │ │ │ │ -173 }; │ │ │ │ │ -174 │ │ │ │ │ -175 │ │ │ │ │ -176 template class TransformedNode> │ │ │ │ │ -_1_7_7 struct _G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -178 : public _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n::template result │ │ │ │ │ -183 > │ │ │ │ │ -184 {}; │ │ │ │ │ -185 │ │ │ │ │ -187 │ │ │ │ │ -188 } // namespace TypeTree │ │ │ │ │ -189} //namespace Dune │ │ │ │ │ +124 template │ │ │ │ │ +125#ifdef DOXYGEN │ │ │ │ │ +_1_2_6 ImplementationDefined _c_h_i_l_d (Node&& node, Indices... indices) │ │ │ │ │ +127#else │ │ │ │ │ +128 decltype(auto) _c_h_i_l_d (Node&& node, Indices... indices) │ │ │ │ │ +129#endif │ │ │ │ │ +130 { │ │ │ │ │ +131 return Impl::childImpl(std::forward(node),indices...); │ │ │ │ │ +132 } │ │ │ │ │ +133 │ │ │ │ │ +134 template │ │ │ │ │ +135#ifdef DOXYGEN │ │ │ │ │ +_1_3_6 ImplementationDefined _c_h_i_l_d_S_t_o_r_a_g_e (Node&& node, Indices... indices) │ │ │ │ │ +137#else │ │ │ │ │ +138 auto _c_h_i_l_d_S_t_o_r_a_g_e (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 │ │ │ │ │ +_1_7_1 ImplementationDefined _c_h_i_l_d (Node&& node, _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_I_n_d_i_c_e_s_._._._> │ │ │ │ │ +_t_r_e_e_P_a_t_h) │ │ │ │ │ +172#else │ │ │ │ │ +173 decltype(auto) _c_h_i_l_d (Node&& node, _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_I_n_d_i_c_e_s_._._._> 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 _c_h_i_l_d (Node&& node, HybridTreePath │ │ │ │ │ +_t_r_e_e_P_a_t_h) │ │ │ │ │ +182#else │ │ │ │ │ +183 auto _c_h_i_l_d_S_t_o_r_a_g_e (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#endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +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 │ │ │ │ │ +_2_2_3 using _C_h_i_l_d = 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 │ │ │ │ │ +_2_5_0 using _C_h_i_l_d_F_o_r_T_r_e_e_P_a_t_h = 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 │ │ │ │ │ +_2_8_2 using _i_s___f_l_a_t___i_n_d_e_x = 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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x_<_T_>_:_:_v_a_l_u_e, │ │ │ │ │ +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 !_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x_<_T_>_:_:_v_a_l_u_e, │ │ │ │ │ +304 bool │ │ │ │ │ +305 >::type │ │ │ │ │ +306 _non_empty_tree_path (T t) │ │ │ │ │ +307 { │ │ │ │ │ +308 return _t_r_e_e_P_a_t_h_S_i_z_e(t) > 0; │ │ │ │ │ +309 } │ │ │ │ │ +310 │ │ │ │ │ +311 } │ │ │ │ │ +312 │ │ │ │ │ +313#endif // DOXYGEN │ │ │ │ │ +314 │ │ │ │ │ +316 │ │ │ │ │ +317 } // namespace TypeTree │ │ │ │ │ +318} //namespace Dune │ │ │ │ │ +319 │ │ │ │ │ +320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH │ │ │ │ │ _n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_p_o_w_e_r_c_o_m_p_o_s_i_t_e_n_o_d_e_t_r_a_n_s_f_o_r_m_a_t_i_o_n_t_e_m_p_l_a_t_e_s_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ -decltype(Node::degree()) StaticDegree │ │ │ │ │ -Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ +_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s___f_l_a_t___i_n_d_e_x │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:282 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +ImplementationDefined childStorage(Node &&node, Indices... indices) │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:136 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d │ │ │ │ │ +typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ +Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:223 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d_F_o_r_T_r_e_e_P_a_t_h │ │ │ │ │ +typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath │ │ │ │ │ +Template alias for the type of a child node given by a TreePath or a │ │ │ │ │ +HybridTreePath type. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:250 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ +constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ +Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:199 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:26 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___t_y_p_e │ │ │ │ │ -TransformedNode transformed_type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< transformed_type > transformed_storage_type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:31 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(std::shared_ptr< const SourceNode > s, const │ │ │ │ │ -Transformation &t) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:28 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:43 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(const SourceNode &s, const Transformation &t) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:33 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:53 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -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) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:78 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:55 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -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) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:72 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ -&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:66 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:59 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNodeTemplate< TC >::type type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:60 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_d_e_g_r_e_e │ │ │ │ │ -static const std::size_t degree │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:62 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:61 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:94 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:99 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC >::type transform(std::shared_ptr< const SourceNode > s, │ │ │ │ │ -const Transformation &t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:117 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:101 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ -&t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:111 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ │ -_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC │ │ │ │ │ -> > &children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:123 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:105 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNodeTemplate< TC >::type type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:106 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_: │ │ │ │ │ -_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:107 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:139 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:144 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC... >::type transform(const SourceNode &s, const │ │ │ │ │ -Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:156 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ │ -_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static result< TC... >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:168 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, │ │ │ │ │ -const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:162 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:146 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:150 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNodeTemplate< TC... >::type type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:151 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_: │ │ │ │ │ -_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:152 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn generictransformationdescriptors.hh:184 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html │ │ │ │ @@ -72,16 +72,16 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
transformationutilities.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html │ │ │ │ @@ -83,20 +83,20 @@ │ │ │ │
│ │ │ │ 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
│ │ │ │
6
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │
9
│ │ │ │
10#endif // DUNE_TYPETREE_TRANSFORMATIONUTILITIES_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodetags.hh File Reference │ │ │ │ +dune-typetree: powernode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,33 +72,37 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
nodetags.hh File Reference
│ │ │ │ +
powernode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ +
#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

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...
class  Dune::TypeTree::PowerNode< T, k >
 Collect k instances of type T within a dune-typetree. More...
 
struct  Dune::TypeTree::CompositeNodeTag
 Tag designating a composite node. More...
struct  Dune::TypeTree::PowerNode< T, k >::Child< i >
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,28 +1,32 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -nodetags.hh File Reference │ │ │ │ │ +powernode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ -  Tag designating a leaf node. _M_o_r_e_._._. │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_<_ _T_,_ _k_ _> │ │ │ │ │ +  Collect k instances of type T within a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -  Tag designating a power node. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -  Tag designating a power node with runtime degree. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ -  Tag designating a composite node. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_<_ _T_,_ _k_ _>_:_:_C_h_i_l_d_<_ _i_ _> │ │ │ │ │ +  Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00047_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodetags.hh Source File │ │ │ │ +dune-typetree: powernode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,52 +74,403 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
nodetags.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_NODETAGS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_POWERNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_POWERNODE_HH
│ │ │ │
6
│ │ │ │ -
7namespace Dune {
│ │ │ │ -
8 namespace TypeTree {
│ │ │ │ -
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
│ │ │ │ +
7#include <cassert>
│ │ │ │ +
8#include <array>
│ │ │ │ +
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 // DUNE_TYPETREE_NODETAGS_HH
│ │ │ │ +
41#endif
│ │ │ │ +
42
│ │ │ │ +
48 template<typename T, std::size_t k>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
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;
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,54 +1,466 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -nodetags.hh │ │ │ │ │ +powernode.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_NODETAGS_HH │ │ │ │ │ -5#define DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ +4#ifndef DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ +5#define DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ 6 │ │ │ │ │ -7namespace _D_u_n_e { │ │ │ │ │ -8 namespace TypeTree { │ │ │ │ │ -9 │ │ │ │ │ -_1_6 struct _L_e_a_f_N_o_d_e_T_a_g {}; │ │ │ │ │ -17 │ │ │ │ │ -_1_9 struct _P_o_w_e_r_N_o_d_e_T_a_g {}; │ │ │ │ │ -20 │ │ │ │ │ -_2_2 struct _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g {}; │ │ │ │ │ -23 │ │ │ │ │ -_2_5 struct _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g {}; │ │ │ │ │ -26 │ │ │ │ │ -27#ifndef DOXYGEN │ │ │ │ │ -28 │ │ │ │ │ -30 struct StartTag {}; │ │ │ │ │ -31 │ │ │ │ │ -32 │ │ │ │ │ -33 │ │ │ │ │ -34#endif // DOXYGEN │ │ │ │ │ -35 │ │ │ │ │ -37 │ │ │ │ │ -38 } // namespace TypeTree │ │ │ │ │ -39} //namespace Dune │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14 │ │ │ │ │ +15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ +18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +19 │ │ │ │ │ +20namespace _D_u_n_e { │ │ │ │ │ +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 // DUNE_TYPETREE_NODETAGS_HH │ │ │ │ │ +41#endif │ │ │ │ │ +42 │ │ │ │ │ +48 template │ │ │ │ │ +_4_9 class _P_o_w_e_r_N_o_d_e │ │ │ │ │ +50 { │ │ │ │ │ +51 │ │ │ │ │ +52 public: │ │ │ │ │ +53 │ │ │ │ │ +_5_5 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ +56 │ │ │ │ │ +_5_8 static const bool _i_s_P_o_w_e_r = true; │ │ │ │ │ +59 │ │ │ │ │ +_6_1 static const bool _i_s_C_o_m_p_o_s_i_t_e = false; │ │ │ │ │ +62 │ │ │ │ │ +64 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +_6_5 static const std::size_t _C_H_I_L_D_R_E_N = k; │ │ │ │ │ +66 │ │ │ │ │ +_6_7 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ +68 { │ │ │ │ │ +69 return std::integral_constant{}; │ │ │ │ │ +70 } │ │ │ │ │ +71 │ │ │ │ │ +_7_3 typedef _P_o_w_e_r_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ +74 │ │ │ │ │ +_7_6 typedef T _C_h_i_l_d_T_y_p_e; │ │ │ │ │ +77 │ │ │ │ │ +_7_9 typedef std::array,k> _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +80 │ │ │ │ │ +81 │ │ │ │ │ +83 template │ │ │ │ │ +_8_4 struct _C_h_i_l_d │ │ │ │ │ +85 { │ │ │ │ │ +86 │ │ │ │ │ +87 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +88 │ │ │ │ │ +_9_0 typedef T _T_y_p_e; │ │ │ │ │ +91 │ │ │ │ │ +_9_3 typedef T _t_y_p_e; │ │ │ │ │ +94 }; │ │ │ │ │ +95 │ │ │ │ │ +98 │ │ │ │ │ +100 │ │ │ │ │ +103 template │ │ │ │ │ +_1_0_4 T& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ +105 { │ │ │ │ │ +106 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +107 return *_children[i]; │ │ │ │ │ +108 } │ │ │ │ │ +109 │ │ │ │ │ +111 │ │ │ │ │ +114 template │ │ │ │ │ +_1_1_5 const T& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ +116 { │ │ │ │ │ +117 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +118 return *_children[i]; │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +122 │ │ │ │ │ +125 template │ │ │ │ │ +_1_2_6 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) │ │ │ │ │ +127 { │ │ │ │ │ +128 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +129 return _children[i]; │ │ │ │ │ +130 } │ │ │ │ │ +131 │ │ │ │ │ +133 │ │ │ │ │ +136 template │ │ │ │ │ +_1_3_7 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) const │ │ │ │ │ +138 { │ │ │ │ │ +139 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +140 return _children[i]; │ │ │ │ │ +141 } │ │ │ │ │ +142 │ │ │ │ │ +144 template │ │ │ │ │ +_1_4_5 void _s_e_t_C_h_i_l_d (T& t, index_constant = {}) │ │ │ │ │ +146 { │ │ │ │ │ +147 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +148 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ +149 } │ │ │ │ │ +150 │ │ │ │ │ +152 template │ │ │ │ │ +_1_5_3 void _s_e_t_C_h_i_l_d (T&& t, index_constant = {}) │ │ │ │ │ +154 { │ │ │ │ │ +155 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +156 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ +157 } │ │ │ │ │ +158 │ │ │ │ │ +160 template │ │ │ │ │ +_1_6_1 void _s_e_t_C_h_i_l_d (std::shared_ptr st, index_constant = {}) │ │ │ │ │ +162 { │ │ │ │ │ +163 static_assert((i < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +164 _children[i] = std::move(st); │ │ │ │ │ +165 } │ │ │ │ │ +166 │ │ │ │ │ +168 │ │ │ │ │ +169 │ │ │ │ │ +172 │ │ │ │ │ +174 │ │ │ │ │ +_1_7_7 T& _c_h_i_l_d (std::size_t i) │ │ │ │ │ +178 { │ │ │ │ │ +179 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +180 return *_children[i]; │ │ │ │ │ +181 } │ │ │ │ │ +182 │ │ │ │ │ +184 │ │ │ │ │ +_1_8_7 const T& _c_h_i_l_d (std::size_t i) const │ │ │ │ │ +188 { │ │ │ │ │ +189 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +190 return *_children[i]; │ │ │ │ │ +191 } │ │ │ │ │ +192 │ │ │ │ │ +194 │ │ │ │ │ +_1_9_7 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) │ │ │ │ │ +198 { │ │ │ │ │ +199 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +200 return _children[i]; │ │ │ │ │ +201 } │ │ │ │ │ +202 │ │ │ │ │ +204 │ │ │ │ │ +_2_0_7 std::shared_ptr _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) const │ │ │ │ │ +208 { │ │ │ │ │ +209 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +210 return _children[i]; │ │ │ │ │ +211 } │ │ │ │ │ +212 │ │ │ │ │ +_2_1_4 void _s_e_t_C_h_i_l_d (std::size_t i, T& t) │ │ │ │ │ +215 { │ │ │ │ │ +216 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +217 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ +218 } │ │ │ │ │ +219 │ │ │ │ │ +_2_2_1 void _s_e_t_C_h_i_l_d (std::size_t i, T&& t) │ │ │ │ │ +222 { │ │ │ │ │ +223 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +224 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ +225 } │ │ │ │ │ +226 │ │ │ │ │ +_2_2_8 void _s_e_t_C_h_i_l_d (std::size_t i, std::shared_ptr st) │ │ │ │ │ +229 { │ │ │ │ │ +230 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +231 _children[i] = std::move(st); │ │ │ │ │ +232 } │ │ │ │ │ +233 │ │ │ │ │ +_2_3_4 const _N_o_d_e_S_t_o_r_a_g_e& _n_o_d_e_S_t_o_r_a_g_e () 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 │ │ │ │ │ +_2_6_8 ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ +269#else │ │ │ │ │ +270 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ +272 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ +279 } │ │ │ │ │ +280 │ │ │ │ │ +282 │ │ │ │ │ +286#ifdef DOXYGEN │ │ │ │ │ +287 template │ │ │ │ │ +_2_8_8 const ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ +289#else │ │ │ │ │ +290 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ +292 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ +299 } │ │ │ │ │ +300 │ │ │ │ │ +302 │ │ │ │ │ +305 │ │ │ │ │ +306 protected: │ │ │ │ │ +307 │ │ │ │ │ +309 │ │ │ │ │ +_3_1_7 _P_o_w_e_r_N_o_d_e () │ │ │ │ │ +318 {} │ │ │ │ │ +319 │ │ │ │ │ +_3_2_1 explicit _P_o_w_e_r_N_o_d_e (const _N_o_d_e_S_t_o_r_a_g_e& children) │ │ │ │ │ +322 : _children(children) │ │ │ │ │ +323 {} │ │ │ │ │ +324 │ │ │ │ │ +_3_2_6 explicit _P_o_w_e_r_N_o_d_e (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 │ │ │ │ │ +_3_4_3 _P_o_w_e_r_N_o_d_e(T& t1, T& t2, ...) │ │ │ │ │ +344 {} │ │ │ │ │ +345 │ │ │ │ │ +346#else │ │ │ │ │ +347 │ │ │ │ │ +348 template>...>::value │ │ │ │ │ +351 ,int> = 0> │ │ │ │ │ +352 _P_o_w_e_r_N_o_d_e (Children&&... children) │ │ │ │ │ +353 { │ │ │ │ │ +354 static_assert(_d_e_g_r_e_e() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ +called with incorrect number of children"); │ │ │ │ │ +355 _children = _N_o_d_e_S_t_o_r_a_g_e{convert_arg(std::forward(children))...}; │ │ │ │ │ +356 } │ │ │ │ │ +357 │ │ │ │ │ +358 template...>::value │ │ │ │ │ +361 ,int> = 0> │ │ │ │ │ +362 _P_o_w_e_r_N_o_d_e (std::shared_ptr... children) │ │ │ │ │ +363 { │ │ │ │ │ +364 static_assert(_d_e_g_r_e_e() == sizeof...(Children), "PowerNode constructor is │ │ │ │ │ +called with incorrect number of children"); │ │ │ │ │ +365 _children = _N_o_d_e_S_t_o_r_a_g_e{children...}; │ │ │ │ │ +366 } │ │ │ │ │ +367 │ │ │ │ │ +368#endif // DOXYGEN │ │ │ │ │ +369 │ │ │ │ │ +371 │ │ │ │ │ +372 private: │ │ │ │ │ +373 _N_o_d_e_S_t_o_r_a_g_e _children; │ │ │ │ │ +374 }; │ │ │ │ │ +375 │ │ │ │ │ +377 │ │ │ │ │ +378 } // namespace TypeTree │ │ │ │ │ +379} //namespace Dune │ │ │ │ │ +380 │ │ │ │ │ +381#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ +_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ Tag designating a power node. │ │ │ │ │ DDeeffiinniittiioonn nodetags.hh:19 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a power node with runtime degree. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:22 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ +Collect k instances of type T within a dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(T &t, index_constant< i >={}) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:145 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +T & child(std::size_t i) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:177 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const T & child(index_constant< i >={}) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:115 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(std::shared_ptr< T > st, index_constant< i >={}) │ │ │ │ │ +Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:161 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< T > childStorage(index_constant< i >={}) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ +PowerNode(T &t1, T &t2,...) │ │ │ │ │ +Initialize all children with the passed-in objects. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:343 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +const NodeStorage & nodeStorage() const │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:234 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +std::array< std::shared_ptr< T >, k > NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< const T > childStorage(index_constant< i >={}) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:137 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ +PowerNode(T &t, bool distinct_objects=true) │ │ │ │ │ +Initialize all children with copies of a storage object constructed from the │ │ │ │ │ +parameter t. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:326 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +PowerNodeTag NodeTag │ │ │ │ │ +The type tag that describes a PowerNode. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:73 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const T & child(std::size_t i) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:187 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:67 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< const T > childStorage(std::size_t i) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:207 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:65 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:228 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a non composite in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:61 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:55 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a power in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:58 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ +PowerNode(const NodeStorage &children) │ │ │ │ │ +Initialize the PowerNode with a copy of the passed-in storage type. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:321 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ +T ChildType │ │ │ │ │ +The type of each child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:76 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +T & child(index_constant< i >={}) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:104 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:268 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(std::size_t i, T &&t) │ │ │ │ │ +Store the passed value in i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:221 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(T &&t, index_constant< i >={}) │ │ │ │ │ +Store the passed value in i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:153 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_P_o_w_e_r_N_o_d_e │ │ │ │ │ +PowerNode() │ │ │ │ │ +Default constructor. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:317 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:288 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(std::size_t i, T &t) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:214 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< T > childStorage(std::size_t i) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:197 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:85 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ │ +T type │ │ │ │ │ +The type of the child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:93 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ │ +T Type │ │ │ │ │ +The type of the child. │ │ │ │ │ +DDeeffiinniittiioonn powernode.hh:90 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h │ │ │ │ │ +Check if type represents a tree path. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:182 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: dynamicpowernode.hh File Reference │ │ │ │ +dune-typetree: generictransformationdescriptors.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,33 +72,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
dynamicpowernode.hh File Reference
│ │ │ │ +
generictransformationdescriptors.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <vector>
│ │ │ │ +
#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/typetraits.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.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Classes

class  Dune::TypeTree::DynamicPowerNode< T >
 Collect multiple instances of type T within a dune-typetree. More...
struct  Dune::TypeTree::GenericLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
 
struct  Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
 
struct  Dune::TypeTree::GenericPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
 
struct  Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
 
struct  Dune::TypeTree::GenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
 
struct  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
 
struct  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
 
struct  Dune::TypeTree::GenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,28 +1,52 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -dynamicpowernode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +generictransformationdescriptors.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_c_o_m_p_o_s_i_t_e_n_o_d_e_t_r_a_n_s_f_o_r_m_a_t_i_o_n_t_e_m_p_l_a_t_e_s_._h_h> │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_<_ _T_ _> │ │ │ │ │ -  Collect multiple instances of type T within a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_< │ │ │ │ │ + _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_T_e_m_p_l_a_t_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00050_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: dynamicpowernode.hh Source File │ │ │ │ +dune-typetree: generictransformationdescriptors.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,219 +74,286 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
dynamicpowernode.hh
│ │ │ │ +
generictransformationdescriptors.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_GENERICTRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_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>
│ │ │ │ +
7#include <array>
│ │ │ │ +
8#include <memory>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
13#include <dune/common/exceptions.hh>
│ │ │ │
14
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
15
│ │ │ │ +
16namespace Dune {
│ │ │ │ +
17 namespace TypeTree {
│ │ │ │
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
│ │ │ │ -
44 static const bool isComposite = false;
│ │ │ │ -
45
│ │ │ │ -
│ │ │ │ -
47 std::size_t degree() const
│ │ │ │ -
48 {
│ │ │ │ -
49 return _children.size();
│ │ │ │ -
50 }
│ │ │ │ +
24 template<typename SourceNode, typename Transformation, typename TransformedNode>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
26 {
│ │ │ │ +
27
│ │ │ │ +
28 static const bool recursive = false;
│ │ │ │ +
29
│ │ │ │ +
30 typedef TransformedNode transformed_type;
│ │ │ │ +
31 typedef std::shared_ptr<transformed_type> transformed_storage_type;
│ │ │ │ +
32
│ │ │ │ +
│ │ │ │ +
33 static transformed_type transform(const SourceNode& s, const Transformation& t)
│ │ │ │ +
34 {
│ │ │ │ +
35 return transformed_type(s,t);
│ │ │ │ +
36 }
│ │ │ │ +
│ │ │ │ +
37
│ │ │ │ +
│ │ │ │ +
38 static transformed_type transform(std::shared_ptr<const SourceNode> s, const Transformation& t)
│ │ │ │ +
39 {
│ │ │ │ +
40 return transformed_type(s,t);
│ │ │ │ +
41 }
│ │ │ │
│ │ │ │ -
51
│ │ │ │ - │ │ │ │ +
42
│ │ │ │ +
│ │ │ │ +
43 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
│ │ │ │ +
44 {
│ │ │ │ +
45 return std::make_shared<transformed_type>(s,t);
│ │ │ │ +
46 }
│ │ │ │ +
│ │ │ │ +
47
│ │ │ │ +
48 };
│ │ │ │ +
│ │ │ │ +
49
│ │ │ │ +
50
│ │ │ │ +
51 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNodeTemplate>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
53 {
│ │ │ │
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
│ │ │ │ +
55 static const bool recursive = true;
│ │ │ │ +
56
│ │ │ │ +
57 template<typename TC>
│ │ │ │ +
│ │ │ │ +
58 struct result
│ │ │ │ +
59 {
│ │ │ │ +
60 typedef typename TransformedNodeTemplate<TC>::type type;
│ │ │ │ +
61 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
62 static const std::size_t degree = StaticDegree<type>::value;
│ │ │ │ +
63 };
│ │ │ │ +
│ │ │ │ +
64
│ │ │ │ +
65 template<typename TC>
│ │ │ │ +
│ │ │ │ +
66 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ +
67 {
│ │ │ │ +
68 return typename result<TC>::type(s,t,children);
│ │ │ │ +
69 }
│ │ │ │ +
│ │ │ │
70
│ │ │ │ -
72
│ │ │ │ -
│ │ │ │ -
75 ChildType& child (std::size_t i)
│ │ │ │ -
76 {
│ │ │ │ -
77 assert(i < degree() && "child index out of range");
│ │ │ │ -
78 return *_children[i];
│ │ │ │ -
79 }
│ │ │ │ +
71 template<typename TC>
│ │ │ │ +
│ │ │ │ +
72 static typename result<TC>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
│ │ │ │ +
73 {
│ │ │ │ +
74 return typename result<TC>::type(s,t,children);
│ │ │ │ +
75 }
│ │ │ │ +
│ │ │ │ +
76
│ │ │ │ +
77 template<typename TC>
│ │ │ │ +
│ │ │ │ +
78 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)
│ │ │ │ +
79 {
│ │ │ │ +
80 return std::make_shared<typename result<TC>::type>(s,t,children);
│ │ │ │ +
81 }
│ │ │ │
│ │ │ │ -
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 }
│ │ │ │ +
83 };
│ │ │ │
│ │ │ │ +
84
│ │ │ │ +
85
│ │ │ │ +
86 template<typename SourceNode, typename Transformation, template<typename,typename,std::size_t> class TransformedNode>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
89 Transformation,
│ │ │ │ +
90 GenericPowerNodeTransformationTemplate<SourceNode,
│ │ │ │ +
91 Transformation,
│ │ │ │ +
92 TransformedNode>::template result
│ │ │ │ +
93 >
│ │ │ │ +
94 {};
│ │ │ │ +
│ │ │ │ +
95
│ │ │ │ +
96
│ │ │ │ +
97 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNodeTemplate>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
99 {
│ │ │ │
100
│ │ │ │ +
101 static const bool recursive = true;
│ │ │ │
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));
│ │ │ │ +
103 template<typename TC>
│ │ │ │ +
│ │ │ │ +
104 struct result
│ │ │ │ +
105 {
│ │ │ │ +
106 typedef typename TransformedNodeTemplate<TC>::type type;
│ │ │ │ +
107 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
108 };
│ │ │ │ +
│ │ │ │ +
109
│ │ │ │ +
110 template<typename TC>
│ │ │ │ +
│ │ │ │ +
111 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ +
112 {
│ │ │ │ +
113 return typename result<TC>::type(s,t,children);
│ │ │ │ +
114 }
│ │ │ │ +
│ │ │ │ +
115
│ │ │ │ +
116 template<typename TC>
│ │ │ │ +
│ │ │ │ +
117 static typename result<TC>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ +
118 {
│ │ │ │ +
119 return typename result<TC>::type(s,t,children);
│ │ │ │ +
120 }
│ │ │ │ +
│ │ │ │ +
121
│ │ │ │ +
122 template<typename TC>
│ │ │ │ +
│ │ │ │ +
123 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)
│ │ │ │ +
124 {
│ │ │ │ +
125 return std::make_shared<typename result<TC>::type>(s,t,children);
│ │ │ │
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 }
│ │ │ │ +
128 };
│ │ │ │
│ │ │ │ -
139
│ │ │ │ +
129
│ │ │ │ +
130
│ │ │ │ +
131 template<typename SourceNode, typename Transformation, template<typename,typename> class TransformedNode>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
134 Transformation,
│ │ │ │ +
135 GenericDynamicPowerNodeTransformationTemplate<SourceNode,
│ │ │ │ +
136 Transformation,
│ │ │ │ +
137 TransformedNode>::template result
│ │ │ │ +
138 >
│ │ │ │ +
139 {};
│ │ │ │ +
│ │ │ │ +
140
│ │ │ │
141
│ │ │ │ -
144
│ │ │ │ -
145 protected:
│ │ │ │ -
146
│ │ │ │ -
149 DynamicPowerNode () = delete;
│ │ │ │ -
150
│ │ │ │ -
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 {}
│ │ │ │ +
142 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNodeTemplate>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
144 {
│ │ │ │ +
145
│ │ │ │ +
146 static const bool recursive = true;
│ │ │ │ +
147
│ │ │ │ +
148 template<typename... TC>
│ │ │ │ +
│ │ │ │ +
149 struct result
│ │ │ │ +
150 {
│ │ │ │ +
151 typedef typename TransformedNodeTemplate<TC...>::type type;
│ │ │ │ +
152 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
153 };
│ │ │ │ +
│ │ │ │ +
154
│ │ │ │ +
155 template<typename... TC>
│ │ │ │ +
│ │ │ │ +
156 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ +
157 {
│ │ │ │ +
158 return typename result<TC...>::type(s,t,children...);
│ │ │ │ +
159 }
│ │ │ │ +
│ │ │ │ +
160
│ │ │ │ +
161 template<typename... TC>
│ │ │ │ +
│ │ │ │ +
162 static typename result<TC...>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ +
163 {
│ │ │ │ +
164 return typename result<TC...>::type(s,t,children...);
│ │ │ │ +
165 }
│ │ │ │ +
│ │ │ │ +
166
│ │ │ │ +
167 template<typename... TC>
│ │ │ │ +
│ │ │ │ +
168 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
│ │ │ │ +
169 {
│ │ │ │ +
170 return std::make_shared<typename result<TC...>::type>(s,t,children...);
│ │ │ │ +
171 }
│ │ │ │ +
│ │ │ │ +
172
│ │ │ │ +
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 }
│ │ │ │ +
175
│ │ │ │ +
176 template<typename SourceNode, typename Transformation, template<typename,typename...> class TransformedNode>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
179 Transformation,
│ │ │ │ +
180 GenericCompositeNodeTransformationTemplate<SourceNode,
│ │ │ │ +
181 Transformation,
│ │ │ │ +
182 TransformedNode>::template result
│ │ │ │ +
183 >
│ │ │ │ +
184 {};
│ │ │ │ +
│ │ │ │ +
185
│ │ │ │ +
187
│ │ │ │ +
188 } // namespace TypeTree
│ │ │ │ +
189} //namespace Dune
│ │ │ │
190
│ │ │ │ -
191#endif // DOXYGEN
│ │ │ │ -
192
│ │ │ │ -
194
│ │ │ │ -
195 private:
│ │ │ │ -
196 NodeStorage _children;
│ │ │ │ -
197 };
│ │ │ │ -
│ │ │ │ -
198
│ │ │ │ -
200
│ │ │ │ -
201 } // namespace TypeTree
│ │ │ │ -
202} //namespace Dune
│ │ │ │ -
203
│ │ │ │ -
204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ +
static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
Definition generictransformationdescriptors.hh:43
│ │ │ │ +
static transformed_type transform(const SourceNode &s, const Transformation &t)
Definition generictransformationdescriptors.hh:33
│ │ │ │ +
Definition generictransformationdescriptors.hh:53
│ │ │ │ +
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 generictransformationdescriptors.hh:78
│ │ │ │ +
static const bool recursive
Definition generictransformationdescriptors.hh:55
│ │ │ │ +
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)
Definition generictransformationdescriptors.hh:72
│ │ │ │ +
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)
Definition generictransformationdescriptors.hh:66
│ │ │ │ +
Definition generictransformationdescriptors.hh:59
│ │ │ │ +
TransformedNodeTemplate< TC >::type type
Definition generictransformationdescriptors.hh:60
│ │ │ │ +
static const std::size_t degree
Definition generictransformationdescriptors.hh:62
│ │ │ │ +
std::shared_ptr< type > storage_type
Definition generictransformationdescriptors.hh:61
│ │ │ │ +
Definition generictransformationdescriptors.hh:94
│ │ │ │ +
Definition generictransformationdescriptors.hh:99
│ │ │ │ +
static result< TC >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition generictransformationdescriptors.hh:117
│ │ │ │ +
static const bool recursive
Definition generictransformationdescriptors.hh:101
│ │ │ │ +
static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
Definition generictransformationdescriptors.hh:111
│ │ │ │ +
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 generictransformationdescriptors.hh:123
│ │ │ │ +
Definition generictransformationdescriptors.hh:105
│ │ │ │ +
TransformedNodeTemplate< TC >::type type
Definition generictransformationdescriptors.hh:106
│ │ │ │ +
std::shared_ptr< type > storage_type
Definition generictransformationdescriptors.hh:107
│ │ │ │ +
Definition generictransformationdescriptors.hh:139
│ │ │ │ +
Definition generictransformationdescriptors.hh:144
│ │ │ │ +
static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
Definition generictransformationdescriptors.hh:156
│ │ │ │ +
static result< TC... >::storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition generictransformationdescriptors.hh:168
│ │ │ │ +
static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
Definition generictransformationdescriptors.hh:162
│ │ │ │ +
static const bool recursive
Definition generictransformationdescriptors.hh:146
│ │ │ │ +
Definition generictransformationdescriptors.hh:150
│ │ │ │ +
TransformedNodeTemplate< TC... >::type type
Definition generictransformationdescriptors.hh:151
│ │ │ │ +
std::shared_ptr< type > storage_type
Definition generictransformationdescriptors.hh:152
│ │ │ │ +
Definition generictransformationdescriptors.hh:184
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,253 +1,343 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -dynamicpowernode.hh │ │ │ │ │ +generictransformationdescriptors.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ +5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10#include │ │ │ │ │ -11 │ │ │ │ │ -12#include │ │ │ │ │ -13#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_c_o_m_p_o_s_i_t_e_n_o_d_e_t_r_a_n_s_f_o_r_m_a_t_i_o_n_t_e_m_p_l_a_t_e_s_._h_h> │ │ │ │ │ +13#include │ │ │ │ │ 14 │ │ │ │ │ -15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +15 │ │ │ │ │ +16namespace _D_u_n_e { │ │ │ │ │ +17 namespace TypeTree { │ │ │ │ │ 18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -20 namespace TypeTree { │ │ │ │ │ -21 │ │ │ │ │ -31 template │ │ │ │ │ -_3_2 class _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ -33 { │ │ │ │ │ -34 │ │ │ │ │ -35 public: │ │ │ │ │ -36 │ │ │ │ │ -_3_8 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ -39 │ │ │ │ │ -_4_1 static const bool _i_s_P_o_w_e_r = true; │ │ │ │ │ +24 template │ │ │ │ │ +_2_5 struct _G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +26 { │ │ │ │ │ +27 │ │ │ │ │ +_2_8 static const bool _r_e_c_u_r_s_i_v_e = false; │ │ │ │ │ +29 │ │ │ │ │ +_3_0 typedef TransformedNode _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e; │ │ │ │ │ +_3_1 typedef std::shared_ptr _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +32 │ │ │ │ │ +_3_3 static _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const Transformation& │ │ │ │ │ +t) │ │ │ │ │ +34 { │ │ │ │ │ +35 return _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e(s,t); │ │ │ │ │ +36 } │ │ │ │ │ +37 │ │ │ │ │ +_3_8 static _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e _t_r_a_n_s_f_o_r_m(std::shared_ptr s, const │ │ │ │ │ +Transformation& t) │ │ │ │ │ +39 { │ │ │ │ │ +40 return _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e(s,t); │ │ │ │ │ +41 } │ │ │ │ │ 42 │ │ │ │ │ -_4_4 static const bool _i_s_C_o_m_p_o_s_i_t_e = false; │ │ │ │ │ -45 │ │ │ │ │ -_4_7 std::size_t _d_e_g_r_e_e() const │ │ │ │ │ -48 { │ │ │ │ │ -49 return _children.size(); │ │ │ │ │ -50 } │ │ │ │ │ -51 │ │ │ │ │ -_5_3 typedef _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ +_4_3 static _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr s, const Transformation& t) │ │ │ │ │ +44 { │ │ │ │ │ +45 return std::make_shared(s,t); │ │ │ │ │ +46 } │ │ │ │ │ +47 │ │ │ │ │ +48 }; │ │ │ │ │ +49 │ │ │ │ │ +50 │ │ │ │ │ +51 template class TransformedNodeTemplate> │ │ │ │ │ +_5_2 struct _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +53 { │ │ │ │ │ 54 │ │ │ │ │ -_5_6 typedef T _C_h_i_l_d_T_y_p_e; │ │ │ │ │ -57 │ │ │ │ │ -_5_9 typedef std::shared_ptr _C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e; │ │ │ │ │ -60 │ │ │ │ │ -_6_2 typedef std::shared_ptr _C_h_i_l_d_C_o_n_s_t_S_t_o_r_a_g_e_T_y_p_e; │ │ │ │ │ -63 │ │ │ │ │ -_6_5 typedef std::vector _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -66 │ │ │ │ │ -67 │ │ │ │ │ +_5_5 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ +56 │ │ │ │ │ +57 template │ │ │ │ │ +_5_8 struct _r_e_s_u_l_t │ │ │ │ │ +59 { │ │ │ │ │ +_6_0 typedef typename TransformedNodeTemplate::type _t_y_p_e; │ │ │ │ │ +_6_1 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +_6_2 static const std::size_t _d_e_g_r_e_e = _S_t_a_t_i_c_D_e_g_r_e_e_<_t_y_p_e_>_:_:_v_a_l_u_e; │ │ │ │ │ +63 }; │ │ │ │ │ +64 │ │ │ │ │ +65 template │ │ │ │ │ +_6_6 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ +Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& │ │ │ │ │ +children) │ │ │ │ │ +67 { │ │ │ │ │ +68 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ +69 } │ │ │ │ │ 70 │ │ │ │ │ -72 │ │ │ │ │ -_7_5 _C_h_i_l_d_T_y_p_e& _c_h_i_l_d (std::size_t i) │ │ │ │ │ -76 { │ │ │ │ │ -77 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -78 return *_children[i]; │ │ │ │ │ -79 } │ │ │ │ │ -80 │ │ │ │ │ +71 template │ │ │ │ │ +_7_2 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(std::shared_ptr │ │ │ │ │ +s, const Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_: │ │ │ │ │ +_d_e_g_r_e_e>& children) │ │ │ │ │ +73 { │ │ │ │ │ +74 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ +75 } │ │ │ │ │ +76 │ │ │ │ │ +77 template │ │ │ │ │ +_7_8 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& children) │ │ │ │ │ +79 { │ │ │ │ │ +80 return std::make_shared::type>(s,t,children); │ │ │ │ │ +81 } │ │ │ │ │ 82 │ │ │ │ │ -_8_5 const _C_h_i_l_d_T_y_p_e& _c_h_i_l_d (std::size_t i) const │ │ │ │ │ -86 { │ │ │ │ │ -87 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -88 return *_children[i]; │ │ │ │ │ -89 } │ │ │ │ │ -90 │ │ │ │ │ -92 │ │ │ │ │ -_9_5 _C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) │ │ │ │ │ -96 { │ │ │ │ │ -97 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -98 return _children[i]; │ │ │ │ │ -99 } │ │ │ │ │ +83 }; │ │ │ │ │ +84 │ │ │ │ │ +85 │ │ │ │ │ +86 template class TransformedNode> │ │ │ │ │ +_8_7 struct _G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +88 : public _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n::template result │ │ │ │ │ +93 > │ │ │ │ │ +94 {}; │ │ │ │ │ +95 │ │ │ │ │ +96 │ │ │ │ │ +97 template class TransformedNodeTemplate> │ │ │ │ │ +_9_8 struct _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +99 { │ │ │ │ │ 100 │ │ │ │ │ +_1_0_1 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ 102 │ │ │ │ │ -_1_0_8 _C_h_i_l_d_C_o_n_s_t_S_t_o_r_a_g_e_T_y_p_e _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) const │ │ │ │ │ -109 { │ │ │ │ │ -110 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -111 return _children[i]; │ │ │ │ │ -112 } │ │ │ │ │ -113 │ │ │ │ │ -_1_1_5 void _s_e_t_C_h_i_l_d (std::size_t i, _C_h_i_l_d_T_y_p_e& t) │ │ │ │ │ -116 { │ │ │ │ │ -117 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -118 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -_1_2_2 void _s_e_t_C_h_i_l_d (std::size_t i, _C_h_i_l_d_T_y_p_e&& t) │ │ │ │ │ -123 { │ │ │ │ │ -124 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -125 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ +103 template │ │ │ │ │ +_1_0_4 struct _r_e_s_u_l_t │ │ │ │ │ +105 { │ │ │ │ │ +_1_0_6 typedef typename TransformedNodeTemplate::type _t_y_p_e; │ │ │ │ │ +_1_0_7 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +108 }; │ │ │ │ │ +109 │ │ │ │ │ +110 template │ │ │ │ │ +_1_1_1 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ +Transformation& t, const std::vector>& children) │ │ │ │ │ +112 { │ │ │ │ │ +113 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ +114 } │ │ │ │ │ +115 │ │ │ │ │ +116 template │ │ │ │ │ +_1_1_7 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(std::shared_ptr s, const Transformation& t, const std::vector>& │ │ │ │ │ +children) │ │ │ │ │ +118 { │ │ │ │ │ +119 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(s,t,children); │ │ │ │ │ +120 } │ │ │ │ │ +121 │ │ │ │ │ +122 template │ │ │ │ │ +_1_2_3 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, const std:: │ │ │ │ │ +vector>& children) │ │ │ │ │ +124 { │ │ │ │ │ +125 return std::make_shared::type>(s,t,children); │ │ │ │ │ 126 } │ │ │ │ │ 127 │ │ │ │ │ -_1_2_9 void _s_e_t_C_h_i_l_d (std::size_t i, _C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e st) │ │ │ │ │ -130 { │ │ │ │ │ -131 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ -132 _children[i] = std::move(st); │ │ │ │ │ -133 } │ │ │ │ │ -134 │ │ │ │ │ -_1_3_5 const _N_o_d_e_S_t_o_r_a_g_e& _n_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ -136 { │ │ │ │ │ -137 return _children; │ │ │ │ │ -138 } │ │ │ │ │ -139 │ │ │ │ │ +128 }; │ │ │ │ │ +129 │ │ │ │ │ +130 │ │ │ │ │ +131 template class TransformedNode> │ │ │ │ │ +_1_3_2 struct _G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +133 : public _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n::template result │ │ │ │ │ +138 > │ │ │ │ │ +139 {}; │ │ │ │ │ +140 │ │ │ │ │ 141 │ │ │ │ │ -144 │ │ │ │ │ -145 protected: │ │ │ │ │ -146 │ │ │ │ │ -_1_4_9 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e () = delete; │ │ │ │ │ -150 │ │ │ │ │ -152 │ │ │ │ │ -_1_6_0 explicit _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (std::size_t size) │ │ │ │ │ -161 : _children(size) │ │ │ │ │ -162 {} │ │ │ │ │ -163 │ │ │ │ │ -_1_6_5 explicit _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (_N_o_d_e_S_t_o_r_a_g_e children) │ │ │ │ │ -166 : _children(std::move(children)) │ │ │ │ │ -167 {} │ │ │ │ │ -168 │ │ │ │ │ -169#ifdef DOXYGEN │ │ │ │ │ -170 │ │ │ │ │ -_1_7_2 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (T& t1, T& t2, ...) │ │ │ │ │ -173 {} │ │ │ │ │ +142 template class TransformedNodeTemplate> │ │ │ │ │ +_1_4_3 struct _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +144 { │ │ │ │ │ +145 │ │ │ │ │ +_1_4_6 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ +147 │ │ │ │ │ +148 template │ │ │ │ │ +_1_4_9 struct _r_e_s_u_l_t │ │ │ │ │ +150 { │ │ │ │ │ +_1_5_1 typedef typename TransformedNodeTemplate_:_:_t_y_p_e _t_y_p_e; │ │ │ │ │ +_1_5_2 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +153 }; │ │ │ │ │ +154 │ │ │ │ │ +155 template │ │ │ │ │ +_1_5_6 static typename _r_e_s_u_l_t::type _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ +Transformation& t, std::shared_ptr... children) │ │ │ │ │ +157 { │ │ │ │ │ +158 return typename _r_e_s_u_l_t_<_T_C_._._._>_:_:_t_y_p_e(s,t,children...); │ │ │ │ │ +159 } │ │ │ │ │ +160 │ │ │ │ │ +161 template │ │ │ │ │ +_1_6_2 static typename _r_e_s_u_l_t::type _t_r_a_n_s_f_o_r_m(std::shared_ptr s, const Transformation& t, std::shared_ptr... children) │ │ │ │ │ +163 { │ │ │ │ │ +164 return typename _r_e_s_u_l_t_<_T_C_._._._>_:_:_t_y_p_e(s,t,children...); │ │ │ │ │ +165 } │ │ │ │ │ +166 │ │ │ │ │ +167 template │ │ │ │ │ +_1_6_8 static typename _r_e_s_u_l_t::storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, std::shared_ptr... │ │ │ │ │ +children) │ │ │ │ │ +169 { │ │ │ │ │ +170 return std::make_shared::type>(s,t,children...); │ │ │ │ │ +171 } │ │ │ │ │ +172 │ │ │ │ │ +173 }; │ │ │ │ │ 174 │ │ │ │ │ -175#else │ │ │ │ │ -176 │ │ │ │ │ -177 template> &&...), │ │ │ │ │ -bool> = true> │ │ │ │ │ -179 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (Children&&... children) │ │ │ │ │ -180 { │ │ │ │ │ -181 _children = _N_o_d_e_S_t_o_r_a_g_e{convert_arg(std::forward(children))...}; │ │ │ │ │ -182 } │ │ │ │ │ -183 │ │ │ │ │ -184 template> &&...), │ │ │ │ │ -bool> = true> │ │ │ │ │ -186 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (std::shared_ptr... children) │ │ │ │ │ -187 { │ │ │ │ │ -188 _children = _N_o_d_e_S_t_o_r_a_g_e{std::move(children)...}; │ │ │ │ │ -189 } │ │ │ │ │ +175 │ │ │ │ │ +176 template class TransformedNode> │ │ │ │ │ +_1_7_7 struct _G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +178 : public _T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n::template result │ │ │ │ │ +183 > │ │ │ │ │ +184 {}; │ │ │ │ │ +185 │ │ │ │ │ +187 │ │ │ │ │ +188 } // namespace TypeTree │ │ │ │ │ +189} //namespace Dune │ │ │ │ │ 190 │ │ │ │ │ -191#endif // DOXYGEN │ │ │ │ │ -192 │ │ │ │ │ -194 │ │ │ │ │ -195 private: │ │ │ │ │ -196 _N_o_d_e_S_t_o_r_a_g_e _children; │ │ │ │ │ -197 }; │ │ │ │ │ -198 │ │ │ │ │ -200 │ │ │ │ │ -201 } // namespace TypeTree │ │ │ │ │ -202} //namespace Dune │ │ │ │ │ -203 │ │ │ │ │ -204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +191#endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ +_p_o_w_e_r_c_o_m_p_o_s_i_t_e_n_o_d_e_t_r_a_n_s_f_o_r_m_a_t_i_o_n_t_e_m_p_l_a_t_e_s_._h_h │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ +decltype(Node::degree()) StaticDegree │ │ │ │ │ +Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ -Collect multiple instances of type T within a dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:33 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a power in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:41 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -std::vector< ChildStorageType > NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:65 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -const NodeStorage & nodeStorage() const │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:135 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -ChildConstStorageType childStorage(std::size_t i) const │ │ │ │ │ -Returns the storage of the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:108 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const ChildType & child(std::size_t i) const │ │ │ │ │ -Returns the i-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:85 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e │ │ │ │ │ -std::shared_ptr< T > ChildStorageType │ │ │ │ │ -The storage type of each child. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:59 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ -DynamicPowerNode(T &t1, T &t2,...) │ │ │ │ │ -Initialize all children with the passed-in objects. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:172 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_C_o_n_s_t_S_t_o_r_a_g_e_T_y_p_e │ │ │ │ │ -std::shared_ptr< const T > ChildConstStorageType │ │ │ │ │ -The const version of the storage type of each child. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:62 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ -DynamicPowerNode(NodeStorage children) │ │ │ │ │ -Initialize the DynamicPowerNode with a copy of the passed-in storage type. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:165 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -DynamicPowerNodeTag NodeTag │ │ │ │ │ -The type tag that describes the node. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:53 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ -T ChildType │ │ │ │ │ -The type of each child. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:56 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(std::size_t i, ChildType &t) │ │ │ │ │ -Sets the i-th child to the passed-in value. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:115 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(std::size_t i, ChildStorageType st) │ │ │ │ │ -Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:129 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ -DynamicPowerNode(std::size_t size) │ │ │ │ │ -Construct a node with the given number of children. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:160 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a non composite in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:44 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -void setChild(std::size_t i, ChildType &&t) │ │ │ │ │ -Store the passed value in i-th child. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:122 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -ChildType & child(std::size_t i) │ │ │ │ │ -Returns the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:75 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ -std::size_t degree() const │ │ │ │ │ -The number of children. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:47 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -ChildStorageType childStorage(std::size_t i) │ │ │ │ │ -Returns the storage of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:95 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn dynamicpowernode.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ -DynamicPowerNode()=delete │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a power node with runtime degree. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:22 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:26 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___t_y_p_e │ │ │ │ │ +TransformedNode transformed_type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< transformed_type > transformed_storage_type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:31 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(std::shared_ptr< const SourceNode > s, const │ │ │ │ │ +Transformation &t) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:28 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:43 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(const SourceNode &s, const Transformation &t) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:33 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:53 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +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) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:78 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:55 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +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) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:72 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ +&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:66 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:59 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNodeTemplate< TC >::type type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:60 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_d_e_g_r_e_e │ │ │ │ │ +static const std::size_t degree │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:62 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:61 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:94 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:99 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC >::type transform(std::shared_ptr< const SourceNode > s, │ │ │ │ │ +const Transformation &t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:117 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:101 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ +&t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:111 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ │ +_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC │ │ │ │ │ +> > &children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:123 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:105 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNodeTemplate< TC >::type type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:106 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_: │ │ │ │ │ +_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:107 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:139 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:144 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC... >::type transform(const SourceNode &s, const │ │ │ │ │ +Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:156 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_: │ │ │ │ │ +_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static result< TC... >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:168 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, │ │ │ │ │ +const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:162 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:146 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:150 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNodeTemplate< TC... >::type type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:151 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_e_m_p_l_a_t_i_z_e_d_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_: │ │ │ │ │ +_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:152 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn generictransformationdescriptors.hh:184 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: traversalutilities.hh File Reference │ │ │ │ +dune-typetree: simpletransformationdescriptors.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,102 +70,51 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
traversalutilities.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
simpletransformationdescriptors.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/typetree/traversal.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.

│ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ +Classes

struct  Dune::TypeTree::SimpleLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
 
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 >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ 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.
 
│ │ │ │ -

Variable Documentation

│ │ │ │ - │ │ │ │ -

◆ _functor

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

◆ _reduction

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

◆ _value

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

◆ treePathType

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
const TreePathType::Type treePathType = TreePathType::dynamic
│ │ │ │ -
│ │ │ │ -static
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,33 +1,43 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -traversalutilities.hh File Reference │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +simpletransformationdescriptors.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ +CCllaasssseess │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ + _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -ResultType  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_d_u_c_e_O_v_e_r_L_e_a_f_s (const Tree &tree, F functor, R │ │ │ │ │ - reduction, ResultType startValue) │ │ │ │ │ -  Calculate a quantity as a reduction over the leaf nodes of a │ │ │ │ │ - _T_y_p_e_T_r_e_e. │ │ │ │ │ -  │ │ │ │ │ -********** VVaarriiaabbllee DDooccuummeennttaattiioonn ********** │ │ │ │ │ -********** _?◆_? __ffuunnccttoorr ********** │ │ │ │ │ -F _functor │ │ │ │ │ -********** _?◆_? __rreedduuccttiioonn ********** │ │ │ │ │ -R _reduction │ │ │ │ │ -********** _?◆_? __vvaalluuee ********** │ │ │ │ │ -ResultType _value │ │ │ │ │ -********** _?◆_? ttrreeeePPaatthhTTyyppee ********** │ │ │ │ │ -const TreePathType::Type treePathType = TreePathType::dynamic static │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: traversalutilities.hh Source File │ │ │ │ +dune-typetree: simpletransformationdescriptors.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,89 +74,207 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
traversalutilities.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_TRAVERSALUTILITIES_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │ +
5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ -
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
│ │ │ │ - │ │ │ │ +
7#include <array>
│ │ │ │ +
8#include <memory>
│ │ │ │ +
9
│ │ │ │ + │ │ │ │ + │ │ │ │ +
12#include <dune/common/exceptions.hh>
│ │ │ │ +
13
│ │ │ │ +
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<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 {}
│ │ │ │ +
│ │ │ │ +
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 ResultType result() { return _value; }
│ │ │ │ -
45
│ │ │ │ - │ │ │ │ - │ │ │ │ -
48 ResultType _value;
│ │ │ │ -
49
│ │ │ │ -
50 };
│ │ │ │ -
51
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ +
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)
│ │ │ │ +
89 {
│ │ │ │ +
90 return typename result<TC>::type(children);
│ │ │ │ +
91 }
│ │ │ │ +
│ │ │ │
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
│ │ │ │ +
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
│ │ │ │ +
108 template<typename... TC>
│ │ │ │ +
│ │ │ │ +
109 struct result
│ │ │ │ +
110 {
│ │ │ │ +
111 typedef TransformedNode<TC...> type;
│ │ │ │ +
112 typedef std::shared_ptr<type> storage_type;
│ │ │ │ +
113 };
│ │ │ │ +
│ │ │ │ +
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 }
│ │ │ │ +
│ │ │ │ +
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
│ │ │ │ -
Type
Definition treepath.hh:30
│ │ │ │ -
@ dynamic
Definition treepath.hh:30
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,108 +1,249 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -traversalutilities.hh │ │ │ │ │ +simpletransformationdescriptors.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ +5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ -8 │ │ │ │ │ -9namespace _D_u_n_e { │ │ │ │ │ -10 namespace TypeTree { │ │ │ │ │ -11 │ │ │ │ │ -17 namespace { │ │ │ │ │ -18 │ │ │ │ │ -20 │ │ │ │ │ -25 template │ │ │ │ │ -26 struct LeafReductionVisitor │ │ │ │ │ -27 : public TypeTree::TreeVisitor │ │ │ │ │ -28 { │ │ │ │ │ -29 │ │ │ │ │ -_3_0 static const _T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e _t_r_e_e_P_a_t_h_T_y_p_e = _T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c; │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +12#include │ │ │ │ │ +13 │ │ │ │ │ +14 │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16 namespace TypeTree { │ │ │ │ │ +17 │ │ │ │ │ +23 template │ │ │ │ │ +_2_4 struct _S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +25 { │ │ │ │ │ +26 │ │ │ │ │ +_2_7 static const bool _r_e_c_u_r_s_i_v_e = false; │ │ │ │ │ +28 │ │ │ │ │ +_2_9 typedef TransformedNode _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e; │ │ │ │ │ +_3_0 typedef std::shared_ptr _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ 31 │ │ │ │ │ -32 template │ │ │ │ │ -33 void leaf(const Node& node, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h) │ │ │ │ │ -34 { │ │ │ │ │ -35 ___v_a_l_u_e = ___r_e_d_u_c_t_i_o_n(___v_a_l_u_e,___f_u_n_c_t_o_r(node,_t_r_e_e_P_a_t_h)); │ │ │ │ │ -36 } │ │ │ │ │ -37 │ │ │ │ │ -38 LeafReductionVisitor(F functor, R reduction, ResultType startValue) │ │ │ │ │ -39 : ___f_u_n_c_t_o_r(functor) │ │ │ │ │ -40 , ___r_e_d_u_c_t_i_o_n(reduction) │ │ │ │ │ -41 , ___v_a_l_u_e(startValue) │ │ │ │ │ -42 {} │ │ │ │ │ +_3_2 static _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const Transformation& │ │ │ │ │ +t) │ │ │ │ │ +33 { │ │ │ │ │ +34 return _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e(); │ │ │ │ │ +35 } │ │ │ │ │ +36 │ │ │ │ │ +_3_7 static _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr s, const Transformation& t) │ │ │ │ │ +38 { │ │ │ │ │ +39 return std::make_shared(); │ │ │ │ │ +40 } │ │ │ │ │ +41 │ │ │ │ │ +42 }; │ │ │ │ │ 43 │ │ │ │ │ -44 ResultType _r_e_s_u_l_t() { return ___v_a_l_u_e; } │ │ │ │ │ -45 │ │ │ │ │ -_4_6 F ___f_u_n_c_t_o_r; │ │ │ │ │ -_4_7 R ___r_e_d_u_c_t_i_o_n; │ │ │ │ │ -_4_8 ResultType ___v_a_l_u_e; │ │ │ │ │ -49 │ │ │ │ │ -50 }; │ │ │ │ │ -51 │ │ │ │ │ -52 } // anonymous namespace │ │ │ │ │ -53 │ │ │ │ │ -55 │ │ │ │ │ -80 template │ │ │ │ │ -_8_1 ResultType _r_e_d_u_c_e_O_v_e_r_L_e_a_f_s(const Tree& tree, F functor, R reduction, │ │ │ │ │ -ResultType startValue) │ │ │ │ │ +44 │ │ │ │ │ +45 template class TransformedNode> │ │ │ │ │ +_4_6 struct _S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +47 { │ │ │ │ │ +48 │ │ │ │ │ +_4_9 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ +50 │ │ │ │ │ +51 template │ │ │ │ │ +_5_2 struct _r_e_s_u_l_t │ │ │ │ │ +53 { │ │ │ │ │ +_5_4 typedef TransformedNode::value> _t_y_p_e; │ │ │ │ │ +_5_5 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +_5_6 static const std::size_t _d_e_g_r_e_e = _S_t_a_t_i_c_D_e_g_r_e_e_<_t_y_p_e_>_:_:_v_a_l_u_e; │ │ │ │ │ +57 }; │ │ │ │ │ +58 │ │ │ │ │ +59 template │ │ │ │ │ +_6_0 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ +Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& │ │ │ │ │ +children) │ │ │ │ │ +61 { │ │ │ │ │ +62 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(children); │ │ │ │ │ +63 } │ │ │ │ │ +64 │ │ │ │ │ +65 template │ │ │ │ │ +_6_6 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ +shared_ptr s, const Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& children) │ │ │ │ │ +67 { │ │ │ │ │ +68 return std::make_shared::type>(children); │ │ │ │ │ +69 } │ │ │ │ │ +70 │ │ │ │ │ +71 }; │ │ │ │ │ +72 │ │ │ │ │ +73 │ │ │ │ │ +74 template class TransformedNode> │ │ │ │ │ +_7_5 struct _S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +76 { │ │ │ │ │ +77 │ │ │ │ │ +_7_8 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ +79 │ │ │ │ │ +80 template │ │ │ │ │ +_8_1 struct _r_e_s_u_l_t │ │ │ │ │ 82 { │ │ │ │ │ -83 LeafReductionVisitor visitor(functor,reduction,startValue); │ │ │ │ │ -84 _T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e(tree,visitor); │ │ │ │ │ -85 return visitor.result(); │ │ │ │ │ -86 } │ │ │ │ │ -87 │ │ │ │ │ -89 │ │ │ │ │ -90 } // namespace TypeTree │ │ │ │ │ -91} //namespace Dune │ │ │ │ │ +_8_3 typedef TransformedNode _t_y_p_e; │ │ │ │ │ +_8_4 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +85 }; │ │ │ │ │ +86 │ │ │ │ │ +87 template │ │ │ │ │ +_8_8 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ +Transformation& t, const std::vector>& children) │ │ │ │ │ +89 { │ │ │ │ │ +90 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(children); │ │ │ │ │ +91 } │ │ │ │ │ 92 │ │ │ │ │ -93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH │ │ │ │ │ -_r_e_s_u_l_t │ │ │ │ │ -static const result_type result │ │ │ │ │ -DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ -___r_e_d_u_c_t_i_o_n │ │ │ │ │ -R _reduction │ │ │ │ │ -DDeeffiinniittiioonn traversalutilities.hh:47 │ │ │ │ │ -___f_u_n_c_t_o_r │ │ │ │ │ -F _functor │ │ │ │ │ -DDeeffiinniittiioonn traversalutilities.hh:46 │ │ │ │ │ -_t_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ -static const TreePathType::Type treePathType │ │ │ │ │ -DDeeffiinniittiioonn traversalutilities.hh:30 │ │ │ │ │ -___v_a_l_u_e │ │ │ │ │ -ResultType _value │ │ │ │ │ -DDeeffiinniittiioonn traversalutilities.hh:48 │ │ │ │ │ -_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_r_e_d_u_c_e_O_v_e_r_L_e_a_f_s │ │ │ │ │ -ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType │ │ │ │ │ -startValue) │ │ │ │ │ -Calculate a quantity as a reduction over the leaf nodes of a TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn traversalutilities.hh:81 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e │ │ │ │ │ -void applyToTree(Tree &&tree, Visitor &&visitor) │ │ │ │ │ -Apply visitor to TypeTree. │ │ │ │ │ -DDeeffiinniittiioonn traversal.hh:237 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:521 │ │ │ │ │ +93 template │ │ │ │ │ +_9_4 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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> │ │ │ │ │ +_1_0_3 struct _S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +104 { │ │ │ │ │ +105 │ │ │ │ │ +_1_0_6 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ +107 │ │ │ │ │ +108 template │ │ │ │ │ +_1_0_9 struct _r_e_s_u_l_t │ │ │ │ │ +110 { │ │ │ │ │ +_1_1_1 typedef TransformedNode _t_y_p_e; │ │ │ │ │ +_1_1_2 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ +113 }; │ │ │ │ │ +114 │ │ │ │ │ +115 template │ │ │ │ │ +_1_1_6 static typename _r_e_s_u_l_t::type _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ +Transformation& t, std::shared_ptr... children) │ │ │ │ │ +117 { │ │ │ │ │ +118 return typename _r_e_s_u_l_t_<_T_C_._._._>_:_:_t_y_p_e(children...); │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +121 template │ │ │ │ │ +_1_2_2 static typename _r_e_s_u_l_t::storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(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 │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ +decltype(Node::degree()) StaticDegree │ │ │ │ │ +Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e │ │ │ │ │ -Type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c │ │ │ │ │ -@ dynamic │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static transformed_type transform(const SourceNode &s, const Transformation &t) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:32 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:27 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< transformed_type > transformed_storage_type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:37 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___t_y_p_e │ │ │ │ │ +TransformedNode transformed_type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:29 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:47 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +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) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:66 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ +&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:60 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:53 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNode< TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:54 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_d_e_g_r_e_e │ │ │ │ │ +static const std::size_t degree │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:56 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:55 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:76 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:78 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ +&t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:88 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC │ │ │ │ │ +> > &children) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:94 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:82 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNode< TC > type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:83 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:84 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:104 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ +static const bool recursive │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:106 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ +static result< TC... >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ +SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:122 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ +static result< TC... >::type transform(const SourceNode &s, const │ │ │ │ │ +Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:116 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:110 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ +std::shared_ptr< type > storage_type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:112 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ +TransformedNode< TC... > type │ │ │ │ │ +DDeeffiinniittiioonn simpletransformationdescriptors.hh:111 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: simpletransformationdescriptors.hh File Reference │ │ │ │ +dune-typetree: fixedcapacitystack.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,40 +72,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 {} │ │ │ │ │ @@ -1,42 +1,22 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -simpletransformationdescriptors.hh File Reference │ │ │ │ │ +fixedcapacitystack.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ +class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_<_ _T_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_<_ _T_,_ _c_a_p_a_c_i_t_y_ _> │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: simpletransformationdescriptors.hh Source File │ │ │ │ +dune-typetree: fixedcapacitystack.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,207 +74,213 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
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 };
│ │ │ │ +
│ │ │ │ +
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 }
│ │ │ │
│ │ │ │ -
86
│ │ │ │ -
87 template<typename TC>
│ │ │ │ +
87
│ │ │ │
│ │ │ │ -
88 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
│ │ │ │ +
88 T& front()
│ │ │ │
89 {
│ │ │ │ -
90 return typename result<TC>::type(children);
│ │ │ │ -
91 }
│ │ │ │ +
90 assert(!empty());
│ │ │ │ +
91 return _impl._data[0];
│ │ │ │ +
92 }
│ │ │ │
│ │ │ │ -
92
│ │ │ │ -
93 template<typename TC>
│ │ │ │ +
93
│ │ │ │
│ │ │ │ -
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
│ │ │ │ -
108 template<typename... TC>
│ │ │ │ -
│ │ │ │ -
109 struct result
│ │ │ │ -
110 {
│ │ │ │ -
111 typedef TransformedNode<TC...> type;
│ │ │ │ -
112 typedef std::shared_ptr<type> storage_type;
│ │ │ │ -
113 };
│ │ │ │ +
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 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 {} │ │ │ │ │ @@ -1,249 +1,207 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -simpletransformationdescriptors.hh │ │ │ │ │ +fixedcapacitystack.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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 <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -12#include │ │ │ │ │ +10namespace _D_u_n_e { │ │ │ │ │ +11 namespace TypeTree { │ │ │ │ │ +12 │ │ │ │ │ 13 │ │ │ │ │ -14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16 namespace TypeTree { │ │ │ │ │ 17 │ │ │ │ │ -23 template │ │ │ │ │ -_2_4 struct _S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ +18 template │ │ │ │ │ +_1_9 class _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ +20 { │ │ │ │ │ +21 │ │ │ │ │ +22 public: │ │ │ │ │ +23 │ │ │ │ │ +24 struct Impl │ │ │ │ │ 25 { │ │ │ │ │ 26 │ │ │ │ │ -_2_7 static const bool _r_e_c_u_r_s_i_v_e = false; │ │ │ │ │ -28 │ │ │ │ │ -_2_9 typedef TransformedNode _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e; │ │ │ │ │ -_3_0 typedef std::shared_ptr _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -31 │ │ │ │ │ -_3_2 static _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const Transformation& │ │ │ │ │ -t) │ │ │ │ │ -33 { │ │ │ │ │ -34 return _t_r_a_n_s_f_o_r_m_e_d___t_y_p_e(); │ │ │ │ │ -35 } │ │ │ │ │ -36 │ │ │ │ │ -_3_7 static _t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std::shared_ptr s, const Transformation& t) │ │ │ │ │ -38 { │ │ │ │ │ -39 return std::make_shared(); │ │ │ │ │ -40 } │ │ │ │ │ +27 Impl(T* data, std::size_t _c_a_p_a_c_i_t_y) │ │ │ │ │ +28 : _data(data) │ │ │ │ │ +29 , _size(0) │ │ │ │ │ +30 , _capacity(_c_a_p_a_c_i_t_y) │ │ │ │ │ +31 {} │ │ │ │ │ +32 │ │ │ │ │ +33 T * const _data; │ │ │ │ │ +34 std::size_t _size; │ │ │ │ │ +35 const std::size_t _capacity; │ │ │ │ │ +36 }; │ │ │ │ │ +37 │ │ │ │ │ +_3_8 _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w(Impl& impl) │ │ │ │ │ +39 : _impl(impl) │ │ │ │ │ +40 {} │ │ │ │ │ 41 │ │ │ │ │ -42 }; │ │ │ │ │ +42 public: │ │ │ │ │ 43 │ │ │ │ │ -44 │ │ │ │ │ -45 template class TransformedNode> │ │ │ │ │ -_4_6 struct _S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -47 { │ │ │ │ │ +_4_4 std::size_t _s_i_z_e() const │ │ │ │ │ +45 { │ │ │ │ │ +46 return _impl._size; │ │ │ │ │ +47 } │ │ │ │ │ 48 │ │ │ │ │ -_4_9 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ -50 │ │ │ │ │ -51 template │ │ │ │ │ -_5_2 struct _r_e_s_u_l_t │ │ │ │ │ -53 { │ │ │ │ │ -_5_4 typedef TransformedNode::value> _t_y_p_e; │ │ │ │ │ -_5_5 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -_5_6 static const std::size_t _d_e_g_r_e_e = _S_t_a_t_i_c_D_e_g_r_e_e_<_t_y_p_e_>_:_:_v_a_l_u_e; │ │ │ │ │ -57 }; │ │ │ │ │ +_4_9 std::size_t _c_a_p_a_c_i_t_y() const │ │ │ │ │ +50 { │ │ │ │ │ +51 return _impl._capacity; │ │ │ │ │ +52 } │ │ │ │ │ +53 │ │ │ │ │ +_5_4 bool _e_m_p_t_y() const │ │ │ │ │ +55 { │ │ │ │ │ +56 return _impl._size == 0; │ │ │ │ │ +57 } │ │ │ │ │ 58 │ │ │ │ │ -59 template │ │ │ │ │ -_6_0 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ -Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& │ │ │ │ │ -children) │ │ │ │ │ -61 { │ │ │ │ │ -62 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(children); │ │ │ │ │ -63 } │ │ │ │ │ -64 │ │ │ │ │ -65 template │ │ │ │ │ -_6_6 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, const std::array,_r_e_s_u_l_t_<_T_C_>_:_:_d_e_g_r_e_e>& children) │ │ │ │ │ -67 { │ │ │ │ │ -68 return std::make_shared::type>(children); │ │ │ │ │ -69 } │ │ │ │ │ -70 │ │ │ │ │ -71 }; │ │ │ │ │ -72 │ │ │ │ │ -73 │ │ │ │ │ -74 template class TransformedNode> │ │ │ │ │ -_7_5 struct _S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -76 { │ │ │ │ │ -77 │ │ │ │ │ -_7_8 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ -79 │ │ │ │ │ -80 template │ │ │ │ │ -_8_1 struct _r_e_s_u_l_t │ │ │ │ │ -82 { │ │ │ │ │ -_8_3 typedef TransformedNode _t_y_p_e; │ │ │ │ │ -_8_4 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -85 }; │ │ │ │ │ -86 │ │ │ │ │ -87 template │ │ │ │ │ -_8_8 static typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ -Transformation& t, const std::vector>& children) │ │ │ │ │ +_5_9 bool _f_u_l_l() const │ │ │ │ │ +60 { │ │ │ │ │ +61 return _impl._size == _impl._capacity; │ │ │ │ │ +62 } │ │ │ │ │ +63 │ │ │ │ │ +_6_4 void _p_u_s_h___b_a_c_k(const T& t) │ │ │ │ │ +65 { │ │ │ │ │ +66 assert(!_f_u_l_l()); │ │ │ │ │ +67 _impl._data[_impl._size++] = t; │ │ │ │ │ +68 } │ │ │ │ │ +69 │ │ │ │ │ +_7_0 void _p_o_p___b_a_c_k() │ │ │ │ │ +71 { │ │ │ │ │ +72 assert(!_e_m_p_t_y()); │ │ │ │ │ +73 --_impl._size; │ │ │ │ │ +74 } │ │ │ │ │ +75 │ │ │ │ │ +_7_6 T& _b_a_c_k() │ │ │ │ │ +77 { │ │ │ │ │ +78 assert(!_e_m_p_t_y()); │ │ │ │ │ +79 return _impl._data[_impl._size-1]; │ │ │ │ │ +80 } │ │ │ │ │ +81 │ │ │ │ │ +_8_2 const T& _b_a_c_k() const │ │ │ │ │ +83 { │ │ │ │ │ +84 assert(!_e_m_p_t_y()); │ │ │ │ │ +85 return _impl._data[_impl._size-1]; │ │ │ │ │ +86 } │ │ │ │ │ +87 │ │ │ │ │ +_8_8 T& _f_r_o_n_t() │ │ │ │ │ 89 { │ │ │ │ │ -90 return typename _r_e_s_u_l_t_<_T_C_>_:_:_t_y_p_e(children); │ │ │ │ │ -91 } │ │ │ │ │ -92 │ │ │ │ │ -93 template │ │ │ │ │ -_9_4 static typename _r_e_s_u_l_t_<_T_C_>_:_:_s_t_o_r_a_g_e___t_y_p_e _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, const std:: │ │ │ │ │ -vector>& children) │ │ │ │ │ +90 assert(!_e_m_p_t_y()); │ │ │ │ │ +91 return _impl._data[0]; │ │ │ │ │ +92 } │ │ │ │ │ +93 │ │ │ │ │ +_9_4 const T& _f_r_o_n_t() const │ │ │ │ │ 95 { │ │ │ │ │ -96 return std::make_shared::type>(children); │ │ │ │ │ -97 } │ │ │ │ │ -98 │ │ │ │ │ -99 }; │ │ │ │ │ -100 │ │ │ │ │ -101 │ │ │ │ │ -102 template class TransformedNode> │ │ │ │ │ -_1_0_3 struct _S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -104 { │ │ │ │ │ +96 assert(!_e_m_p_t_y()); │ │ │ │ │ +97 return _impl._data[0]; │ │ │ │ │ +98 } │ │ │ │ │ +99 │ │ │ │ │ +_1_0_0 T& _o_p_e_r_a_t_o_r_[_](std::size_t k) │ │ │ │ │ +101 { │ │ │ │ │ +102 assert(k < _impl._size); │ │ │ │ │ +103 return _impl._data[k]; │ │ │ │ │ +104 } │ │ │ │ │ 105 │ │ │ │ │ -_1_0_6 static const bool _r_e_c_u_r_s_i_v_e = true; │ │ │ │ │ -107 │ │ │ │ │ -108 template │ │ │ │ │ -_1_0_9 struct _r_e_s_u_l_t │ │ │ │ │ -110 { │ │ │ │ │ -_1_1_1 typedef TransformedNode _t_y_p_e; │ │ │ │ │ -_1_1_2 typedef std::shared_ptr _s_t_o_r_a_g_e___t_y_p_e; │ │ │ │ │ -113 }; │ │ │ │ │ +_1_0_6 const T& _o_p_e_r_a_t_o_r_[_](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 │ │ │ │ │ -_1_1_6 static typename _r_e_s_u_l_t::type _t_r_a_n_s_f_o_r_m(const SourceNode& s, const │ │ │ │ │ -Transformation& t, std::shared_ptr... children) │ │ │ │ │ -117 { │ │ │ │ │ -118 return typename _r_e_s_u_l_t_<_T_C_._._._>_:_:_t_y_p_e(children...); │ │ │ │ │ -119 } │ │ │ │ │ -120 │ │ │ │ │ -121 template │ │ │ │ │ -_1_2_2 static typename _r_e_s_u_l_t::storage_type _t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e(std:: │ │ │ │ │ -shared_ptr s, const Transformation& t, std::shared_ptr... │ │ │ │ │ -children) │ │ │ │ │ +115 }; │ │ │ │ │ +116 │ │ │ │ │ +117 │ │ │ │ │ +118 template │ │ │ │ │ +_1_1_9 class _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k │ │ │ │ │ +120 : private std::array │ │ │ │ │ +121 , private _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w::Impl │ │ │ │ │ +122 , public _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ 123 { │ │ │ │ │ -124 return std::make_shared::type>(children...); │ │ │ │ │ -125 } │ │ │ │ │ +124 │ │ │ │ │ +125 typedef _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_<_T_> _v_i_e_w___b_a_s_e; │ │ │ │ │ 126 │ │ │ │ │ -127 }; │ │ │ │ │ +127 public: │ │ │ │ │ 128 │ │ │ │ │ -130 │ │ │ │ │ -131 } // namespace TypeTree │ │ │ │ │ -132} //namespace Dune │ │ │ │ │ +129 using _v_i_e_w___b_a_s_e_:_:_b_a_c_k; │ │ │ │ │ +130 using _v_i_e_w___b_a_s_e_:_:_f_r_o_n_t; │ │ │ │ │ +131 using _v_i_e_w___b_a_s_e_:_:_s_i_z_e; │ │ │ │ │ +132 using view_base::operator[]; │ │ │ │ │ 133 │ │ │ │ │ -134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ -decltype(Node::degree()) StaticDegree │ │ │ │ │ -Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ +_1_3_4 _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k() │ │ │ │ │ +135 : _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w::Impl(&(static_cast&> │ │ │ │ │ +(*this)[0]),_c_a_p_a_c_i_t_y) │ │ │ │ │ +136 , _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w(static_cast::Impl&>(*this)) │ │ │ │ │ +137 {} │ │ │ │ │ +138 │ │ │ │ │ +139 private: │ │ │ │ │ +140 │ │ │ │ │ +141 //FixedCapacityStack(const FixedCapacityStack&); │ │ │ │ │ +142 _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k& operator=(const _F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k&); │ │ │ │ │ +143 │ │ │ │ │ +144 }; │ │ │ │ │ +145 │ │ │ │ │ +147 │ │ │ │ │ +148 } // namespace TypeTree │ │ │ │ │ +149} //namespace Dune │ │ │ │ │ +150 │ │ │ │ │ +151#endif // DUNE_TYPETREE_FIXEDCAPACITYSTACK_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:25 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static transformed_type transform(const SourceNode &s, const Transformation &t) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:32 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:27 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< transformed_type > transformed_storage_type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static transformed_storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:37 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_L_e_a_f_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m_e_d___t_y_p_e │ │ │ │ │ -TransformedNode transformed_type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:29 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:47 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -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) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:66 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ -&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:60 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:53 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNode< TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:54 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_d_e_g_r_e_e │ │ │ │ │ -static const std::size_t degree │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:56 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:55 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:78 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC >::type transform(const SourceNode &s, const Transformation │ │ │ │ │ -&t, const std::vector< std::shared_ptr< TC > > &children) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:88 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static result< TC >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC │ │ │ │ │ -> > &children) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:94 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:82 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNode< TC > type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:83 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:84 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:104 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_c_u_r_s_i_v_e │ │ │ │ │ -static const bool recursive │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:106 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m___s_t_o_r_a_g_e │ │ │ │ │ -static result< TC... >::storage_type transform_storage(std::shared_ptr< const │ │ │ │ │ -SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:122 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_t_r_a_n_s_f_o_r_m │ │ │ │ │ -static result< TC... >::type transform(const SourceNode &s, const │ │ │ │ │ -Transformation &t, std::shared_ptr< TC >... children) │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:116 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:110 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_s_t_o_r_a_g_e___t_y_p_e │ │ │ │ │ -std::shared_ptr< type > storage_type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:112 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNode< TC... > type │ │ │ │ │ -DDeeffiinniittiioonn simpletransformationdescriptors.hh:111 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:20 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_e_m_p_t_y │ │ │ │ │ +bool empty() const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:54 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_f_u_l_l │ │ │ │ │ +bool full() const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:59 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +T & operator[](std::size_t k) │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:100 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_p_o_p___b_a_c_k │ │ │ │ │ +void pop_back() │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:70 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_b_a_c_k │ │ │ │ │ +T & back() │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:76 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_c_a_p_a_c_i_t_y │ │ │ │ │ +std::size_t capacity() const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_f_r_o_n_t │ │ │ │ │ +T & front() │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:88 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_f_r_o_n_t │ │ │ │ │ +const T & front() const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:94 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +const T & operator[](std::size_t k) const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:106 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ +void push_back(const T &t) │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:64 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_b_a_c_k │ │ │ │ │ +const T & back() const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:82 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_s_i_z_e │ │ │ │ │ +std::size_t size() const │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:44 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_V_i_e_w │ │ │ │ │ +FixedCapacityStackView(Impl &impl) │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:123 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k_:_:_F_i_x_e_d_C_a_p_a_c_i_t_y_S_t_a_c_k │ │ │ │ │ +FixedCapacityStack() │ │ │ │ │ +DDeeffiinniittiioonn fixedcapacitystack.hh:134 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filters.hh File Reference │ │ │ │ +dune-typetree: nodeinterface.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,70 +71,60 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
filters.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
nodeinterface.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <tuple>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ +
#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::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...
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.
 
template<typename T >
using Dune::TypeTree::ImplementationTag = typename std::decay_t< T >::ImplementationTag
 Returns the implementation tag of the given Node.
 
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.
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<typename Node >
std::size_t Dune::TypeTree::degree (const Node &node)
 Returns the degree of node as run time information.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,63 +1,43 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -filters.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +nodeinterface.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_E_n_t_r_y_<_ _n_e_w___k_,_ _o_l_d___k_ _> │ │ │ │ │ -  A filter entry describing the mapping of one child in the filtered │ │ │ │ │ - node. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_<_ _F_i_l_t_e_r_E_n_t_r_i_e_s_ _> │ │ │ │ │ -  The result of a filter. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_<_ _F_i_l_t_e_r_E_n_t_r_i_e_s_ _>_:_:_a_p_p_l_y_<_ _N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_T_a_g │ │ │ │ │ -  Tag describing a simple filter that can only decide whether or not to │ │ │ │ │ - include a single given child. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g │ │ │ │ │ -  Tag describing an advanced filter that has full control over the │ │ │ │ │ - construction of the list of FilterEntries. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ -  Base class for advanced filters. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_a_p_p_l_y_<_ _N_o_d_e_,_ _C_h_i_l_d_r_e_n_ _> │ │ │ │ │ -  Apply this filter to the given node and children. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r │ │ │ │ │ -  Default simple filter that accepts any node and leaves its child │ │ │ │ │ - structure unchanged. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_v_a_l_i_d_a_t_e_<_ _N_o_d_e_ _> │ │ │ │ │ -  Validates the combination of filter and node. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_a_p_p_l_y_<_ _C_h_i_l_d_,_ _n_e_w___i_n_d_e_x_,_ _o_l_d___i_n_d_e_x_ _> │ │ │ │ │ -  Applies the filter to the given child node. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_n_d_e_x_F_i_l_t_e_r_<_ _i_n_d_i_c_e_s_ _> │ │ │ │ │ -  Filter class for _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e that selects the children with │ │ │ │ │ - the given indices. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_<_ _F_i_l_t_e_r_ _> │ │ │ │ │ -  Adapter class that takes a _S_i_m_p_l_e_F_i_l_t_e_r, validated it and turns it │ │ │ │ │ - into an _A_d_v_a_n_c_e_d_F_i_l_t_e_r. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_<_ _F_i_l_t_e_r_ _>_:_:_a_p_p_l_y_<_ _N_o_d_e_,_ _C_h_i_l_d_r_e_n_ _> │ │ │ │ │ -  Apply the filter. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e │ │ │ │ │ +  Interface for nodes in a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +TTyyppeeddeeffss │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g = typename std::decay_t< Node >::NodeTag │ │ │ │ │ +  Returns the node tag of the given Node. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g = typename std::decay_t< T >:: │ │ │ │ │ + ImplementationTag │ │ │ │ │ +  Returns the implementation tag of the given Node. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e = decltype(Node::degree()) │ │ │ │ │ +  Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ + integral_constant. │ │ │ │ │ +  │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ +std::size_t  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_g_r_e_e (const Node &node) │ │ │ │ │ +  Returns the degree of node as run time information. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00059_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filters.hh Source File │ │ │ │ +dune-typetree: nodeinterface.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,259 +74,102 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
filters.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_FILTERS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_FILTERS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_NODEINTERFACE_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 {
│ │ │ │ +
7#include <cstddef>
│ │ │ │ +
8#include <type_traits>
│ │ │ │ +
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
│ │ │ │ -
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;
│ │ │ │ -
48 typedef std::tuple<typename Node::template Child<FilterEntries::original_index>::Type...> ChildTypes;
│ │ │ │ -
49 typedef std::tuple<std::shared_ptr<typename Node::template Child<FilterEntries::original_index>::Type>...> NodeStorage;
│ │ │ │ -
50 };
│ │ │ │ -
│ │ │ │ -
51
│ │ │ │ -
52 };
│ │ │ │ -
│ │ │ │ -
53
│ │ │ │ -
55 struct SimpleFilterTag {};
│ │ │ │ -
56
│ │ │ │ - │ │ │ │ -
59
│ │ │ │ +
41 static const bool isComposite = implementationDefined;
│ │ │ │ +
42
│ │ │ │ +
44
│ │ │ │ +
49 static const std::size_t CHILDREN = implementationDefined;
│ │ │ │ +
50
│ │ │ │ +
52
│ │ │ │ +
57 static auto degree();
│ │ │ │ +
58
│ │ │ │
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
│ │ │ │ +
65 typedef ImplementationDefined NodeTag;
│ │ │ │ +
66
│ │ │ │ +
68
│ │ │ │ +
71 typedef ImplementationDefined NodeStorage;
│ │ │ │ +
72 };
│ │ │ │ +
│ │ │ │ +
73
│ │ │ │ +
75 template<typename Node>
│ │ │ │ +
76 using NodeTag = typename std::decay_t<Node>::NodeTag;
│ │ │ │ +
77
│ │ │ │ +
79 template<typename T>
│ │ │ │ +
80 using ImplementationTag = typename std::decay_t<T>::ImplementationTag;
│ │ │ │ +
81
│ │ │ │
82
│ │ │ │ -
83 };
│ │ │ │ -
│ │ │ │ -
84
│ │ │ │ -
86
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
92 {
│ │ │ │ +
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
│ │ │ │ - │ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,316 +1,127 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -filters.hh │ │ │ │ │ +nodeinterface.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_FILTERS_HH │ │ │ │ │ -5#define DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ +4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ +5#define DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11namespace _D_u_n_e { │ │ │ │ │ -12 namespace TypeTree { │ │ │ │ │ -13 │ │ │ │ │ -20 template │ │ │ │ │ -_2_1 struct _F_i_l_t_e_r_E_n_t_r_y │ │ │ │ │ -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 │ │ │ │ │ -_3_7 struct _F_i_l_t_e_r_R_e_s_u_l_t │ │ │ │ │ -38 { │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9 │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12namespace _D_u_n_e { │ │ │ │ │ +13 namespace TypeTree { │ │ │ │ │ +14 │ │ │ │ │ +_3_2 struct _N_o_d_e_I_n_t_e_r_f_a_c_e │ │ │ │ │ +33 { │ │ │ │ │ +_3_5 static const bool _i_s_L_e_a_f = implementationDefined; │ │ │ │ │ +36 │ │ │ │ │ +_3_8 static const bool _i_s_P_o_w_e_r = implementationDefined; │ │ │ │ │ 39 │ │ │ │ │ -_4_0 static const std::size_t _s_i_z_e = sizeof...(FilterEntries); │ │ │ │ │ -41 │ │ │ │ │ -_4_2 typedef std::tuple _I_n_d_e_x_M_a_p; │ │ │ │ │ -43 │ │ │ │ │ -44 template │ │ │ │ │ -_4_5 struct _a_p_p_l_y │ │ │ │ │ -46 { │ │ │ │ │ -_4_7 typedef std::tuple...> _C_h_i_l_d_r_e_n; │ │ │ │ │ -_4_8 typedef std::tuple::Type...> _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ -_4_9 typedef std::tuple::Type>...> _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -50 }; │ │ │ │ │ -51 │ │ │ │ │ -52 }; │ │ │ │ │ -53 │ │ │ │ │ -_5_5 struct _S_i_m_p_l_e_F_i_l_t_e_r_T_a_g {}; │ │ │ │ │ -56 │ │ │ │ │ -_5_8 struct _A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g {}; │ │ │ │ │ -59 │ │ │ │ │ +_4_1 static const bool _i_s_C_o_m_p_o_s_i_t_e = implementationDefined; │ │ │ │ │ +42 │ │ │ │ │ +44 │ │ │ │ │ +_4_9 static const std::size_t _C_H_I_L_D_R_E_N = implementationDefined; │ │ │ │ │ +50 │ │ │ │ │ +52 │ │ │ │ │ +_5_7 static auto _d_e_g_r_e_e(); │ │ │ │ │ +58 │ │ │ │ │ 60 │ │ │ │ │ -_6_2 struct _A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ -63 { │ │ │ │ │ -64 │ │ │ │ │ -_6_6 typedef _A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g _F_i_l_t_e_r_T_a_g; │ │ │ │ │ -67 │ │ │ │ │ -68#ifdef DOXYGEN │ │ │ │ │ -69 │ │ │ │ │ -71 template │ │ │ │ │ -_7_2 struct _a_p_p_l_y │ │ │ │ │ -73 { │ │ │ │ │ -75 │ │ │ │ │ -_7_8 typedef implementation-defined _t_y_p_e; │ │ │ │ │ -79 }; │ │ │ │ │ -80 │ │ │ │ │ -81#endif // DOXYGEN │ │ │ │ │ +_6_5 typedef ImplementationDefined _N_o_d_e_T_a_g; │ │ │ │ │ +66 │ │ │ │ │ +68 │ │ │ │ │ +_7_1 typedef ImplementationDefined _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +72 }; │ │ │ │ │ +73 │ │ │ │ │ +75 template │ │ │ │ │ +_7_6 using _N_o_d_e_T_a_g = typename std::decay_t::NodeTag; │ │ │ │ │ +77 │ │ │ │ │ +79 template │ │ │ │ │ +_8_0 using _I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g = typename std::decay_t::ImplementationTag; │ │ │ │ │ +81 │ │ │ │ │ 82 │ │ │ │ │ -83 }; │ │ │ │ │ -84 │ │ │ │ │ -86 │ │ │ │ │ -_9_1 struct _S_i_m_p_l_e_F_i_l_t_e_r │ │ │ │ │ -92 { │ │ │ │ │ +84 template │ │ │ │ │ +_8_5 std::size_t _d_e_g_r_e_e(const Node& node) │ │ │ │ │ +86 { │ │ │ │ │ +87 return _d_e_g_r_e_e(&node,_N_o_d_e_T_a_g_<_N_o_d_e_>()); │ │ │ │ │ +88 } │ │ │ │ │ +89 │ │ │ │ │ +90#ifndef DOXYGEN │ │ │ │ │ +91 │ │ │ │ │ 93 │ │ │ │ │ -_9_5 typedef _S_i_m_p_l_e_F_i_l_t_e_r_T_a_g _F_i_l_t_e_r_T_a_g; │ │ │ │ │ -96 │ │ │ │ │ -97 │ │ │ │ │ -99 template │ │ │ │ │ -_1_0_0 struct _v_a_l_i_d_a_t_e │ │ │ │ │ +99 template │ │ │ │ │ +100 std::size_t _d_e_g_r_e_e(const Node* node, _N_o_d_e_T_a_g) │ │ │ │ │ 101 { │ │ │ │ │ -_1_0_3 static const bool _v_a_l_u_e = true; │ │ │ │ │ -104 }; │ │ │ │ │ -105 │ │ │ │ │ -107 │ │ │ │ │ -115 template │ │ │ │ │ -_1_1_6 struct _a_p_p_l_y │ │ │ │ │ -117 { │ │ │ │ │ -_1_1_9 static const bool _v_a_l_u_e = 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 _F_i_l_t_e_r_R_e_s_u_l_t 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 │ │ │ │ │ -_1_5_7 struct _I_n_d_e_x_F_i_l_t_e_r │ │ │ │ │ -158 : public _A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ -159 { │ │ │ │ │ -160 │ │ │ │ │ -161#ifndef DOXYGEN │ │ │ │ │ -162 │ │ │ │ │ -163 template │ │ │ │ │ -164 struct _a_p_p_l_y │ │ │ │ │ -165 { │ │ │ │ │ -166 typedef typename index_filter_helper::template _a_p_p_l_y_<_>_:_: │ │ │ │ │ -_t_y_p_e _t_y_p_e; │ │ │ │ │ -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 _F_i_l_t_e_r_R_e_s_u_l_t 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 │ │ │ │ │ -_2_0_9 struct _f_i_l_t_e_r │ │ │ │ │ -210 { │ │ │ │ │ -211 │ │ │ │ │ -213 template │ │ │ │ │ -_2_1_4 struct _a_p_p_l_y │ │ │ │ │ -215 { │ │ │ │ │ -216 │ │ │ │ │ -217 static_assert((Filter::template validate::value),"Invalid simple │ │ │ │ │ -filter"); │ │ │ │ │ -218 │ │ │ │ │ -_2_1_9 typedef typename filter_helper::template _a_p_p_l_y_<_>_:_: │ │ │ │ │ -_t_y_p_e _t_y_p_e; │ │ │ │ │ -220 │ │ │ │ │ -221 }; │ │ │ │ │ -222 │ │ │ │ │ -223 }; │ │ │ │ │ -224 │ │ │ │ │ -226 │ │ │ │ │ -227 } // namespace TypeTree │ │ │ │ │ -228} //namespace Dune │ │ │ │ │ -229 │ │ │ │ │ -230#endif // DUNE_TYPETREE_FILTERS_HH │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ -ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ -Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ +102 return node->degree(); │ │ │ │ │ +103 } │ │ │ │ │ +104 │ │ │ │ │ +105#endif // DOXYGEN │ │ │ │ │ +106 │ │ │ │ │ +108 │ │ │ │ │ +112 template │ │ │ │ │ +_1_1_3 using _S_t_a_t_i_c_D_e_g_r_e_e = decltype(Node::degree()); │ │ │ │ │ +114 │ │ │ │ │ +116 │ │ │ │ │ +117 } // namespace TypeTree │ │ │ │ │ +118} //namespace Dune │ │ │ │ │ +119 │ │ │ │ │ +120#endif // DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_g_r_e_e │ │ │ │ │ +std::size_t degree(const Node &node) │ │ │ │ │ +Returns the degree of node as run time information. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:85 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g │ │ │ │ │ +typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ +Returns the implementation tag of the given Node. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:80 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ +decltype(Node::degree()) StaticDegree │ │ │ │ │ +Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_E_n_t_r_y │ │ │ │ │ -A filter entry describing the mapping of one child in the filtered node. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:22 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t │ │ │ │ │ -The result of a filter. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_I_n_d_e_x_M_a_p │ │ │ │ │ -std::tuple< FilterEntries... > IndexMap │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:42 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_s_i_z_e │ │ │ │ │ -static const std::size_t size │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:40 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y_:_:_C_h_i_l_d_r_e_n │ │ │ │ │ -std::tuple< typename Node::template Child< FilterEntries::original_index >... > │ │ │ │ │ -Children │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:47 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ -std::tuple< typename Node::template Child< FilterEntries::original_index >:: │ │ │ │ │ -Type... > ChildTypes │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:48 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_R_e_s_u_l_t_:_:_a_p_p_l_y_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -std::tuple< std::shared_ptr< typename Node::template Child< FilterEntries:: │ │ │ │ │ -original_index >::Type >... > NodeStorage │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_T_a_g │ │ │ │ │ -Tag describing a simple filter that can only decide whether or not to include a │ │ │ │ │ -single given child. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:55 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_T_a_g │ │ │ │ │ -Tag describing an advanced filter that has full control over the construction │ │ │ │ │ -of the list of FilterEn... │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:58 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r │ │ │ │ │ -Base class for advanced filters. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:63 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_F_i_l_t_e_r_T_a_g │ │ │ │ │ -AdvancedFilterTag FilterTag │ │ │ │ │ -Filter tag for deciding on filter application mechanism. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:66 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_a_p_p_l_y │ │ │ │ │ -Apply this filter to the given node and children. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:73 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_d_v_a_n_c_e_d_F_i_l_t_e_r_:_:_a_p_p_l_y_:_:_t_y_p_e │ │ │ │ │ -implementation defined type │ │ │ │ │ -The result of the filtering process. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:78 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r │ │ │ │ │ -Default simple filter that accepts any node and leaves its child structure │ │ │ │ │ -unchanged. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:92 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_F_i_l_t_e_r_T_a_g │ │ │ │ │ -SimpleFilterTag FilterTag │ │ │ │ │ -Filter tag for deciding on filter application mechanism. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:95 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_v_a_l_i_d_a_t_e │ │ │ │ │ -Validates the combination of filter and node. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:101 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_v_a_l_i_d_a_t_e_:_:_v_a_l_u_e │ │ │ │ │ -static const bool value │ │ │ │ │ -True if the combination of filter and node is valid. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:103 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_a_p_p_l_y │ │ │ │ │ -Applies the filter to the given child node. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:117 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_i_m_p_l_e_F_i_l_t_e_r_:_:_a_p_p_l_y_:_:_v_a_l_u_e │ │ │ │ │ -static const bool value │ │ │ │ │ -True if the child will be included in the filtered node. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:119 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_n_d_e_x_F_i_l_t_e_r │ │ │ │ │ -Filter class for FilteredCompositeNode that selects the children with the given │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:159 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r │ │ │ │ │ -Adapter class that takes a SimpleFilter, validated it and turns it into an │ │ │ │ │ -AdvancedFilter. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:210 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_:_:_a_p_p_l_y │ │ │ │ │ -Apply the filter. │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:215 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_i_l_t_e_r_:_:_a_p_p_l_y_:_:_t_y_p_e │ │ │ │ │ -filter_helper< Filter, 0, 0, Children... >::template apply ::type type │ │ │ │ │ -DDeeffiinniittiioonn filters.hh:219 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e │ │ │ │ │ +Interface for nodes in a dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:33 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +Number of children of this node in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_d_e_g_r_e_e │ │ │ │ │ +static auto degree() │ │ │ │ │ +Number of children of this node in the dune-typetree. │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Whether this is a power node in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_i_s_L_e_a_f │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Whether this is a leaf node in a dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:35 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +ImplementationDefined NodeStorage │ │ │ │ │ +container type to pass around a collection of children │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:71 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Whether this is a composite node in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:41 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +ImplementationDefined NodeTag │ │ │ │ │ +The type tag that describes what kind of node this is. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:65 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodeinterface.hh File Reference │ │ │ │ +dune-typetree: treecontainer.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,57 +74,71 @@ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Typedefs | │ │ │ │ Functions
│ │ │ │ -
nodeinterface.hh File Reference
│ │ │ │ +
treecontainer.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/common/documentation.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::NodeInterface
 Interface for nodes in a dune-typetree. More...
class  Dune::TypeTree::Detail::ContainerFactory< LeafToValue >
 
class  Dune::TypeTree::Detail::TreeContainerVectorBackend< Container >
 
struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Namespaces

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

│ │ │ │ Typedefs

template<typename Node >
using Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag
 Returns the node tag of the given Node.
 
template<typename T >
using Dune::TypeTree::ImplementationTag = typename std::decay_t< T >::ImplementationTag
 Returns the implementation tag of the given Node.
 
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.
 
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.
 
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.
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<typename Node >
std::size_t Dune::TypeTree::degree (const Node &node)
 Returns the degree of node as run time information.
 
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.
 
template<class Value , class Tree >
auto Dune::TypeTree::makeTreeContainer (const Tree &tree)
 Create container havin the same structure as the given tree.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,43 +1,62 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -nodeinterface.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +treecontainer.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e │ │ │ │ │ -  Interface for nodes in a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_<_ _L_e_a_f_T_o_V_a_l_u_e_ _> │ │ │ │ │ +  │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_<_ _C_o_n_t_a_i_n_e_r_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e_<_ _L_e_a_f_T_o_V_a_l_u_e_ _> │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l │ │ │ │ │ +  │ │ │ │ │ TTyyppeeddeeffss │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g = typename std::decay_t< Node >::NodeTag │ │ │ │ │ -  Returns the node tag of the given Node. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g = typename std::decay_t< T >:: │ │ │ │ │ - ImplementationTag │ │ │ │ │ -  Returns the implementation tag of the given Node. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e = decltype(Node::degree()) │ │ │ │ │ -  Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ - integral_constant. │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_U_n_i_f_o_r_m_T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t< decltype │ │ │ │ │ + (_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r< Value >(std::declval< const Tree & >()))> │ │ │ │ │ +  Alias to container type generated by makeTreeContainer for given tree │ │ │ │ │ + type and uniform value type. │ │ │ │ │ +  │ │ │ │ │ +template class LeafToValue, class Tree > │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t< decltype(_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ + (std::declval< const Tree & >(), std::declval< _D_e_t_a_i_l_:_: │ │ │ │ │ + _L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e< LeafToValue > >()))> │ │ │ │ │ +  Alias to container type generated by makeTreeContainer for give tree │ │ │ │ │ + type and when using LeafToValue to create values. │ │ │ │ │   │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ -std::size_t  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_g_r_e_e (const Node &node) │ │ │ │ │ -  Returns the degree of node as run time information. │ │ │ │ │ +template │ │ │ │ │ +auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d (Container │ │ │ │ │ + &&container) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r (const Tree &tree, LeafToValue │ │ │ │ │ + &&leafToValue) │ │ │ │ │ +  Create container havin the same structure as the given tree. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r (const Tree &tree) │ │ │ │ │ +  Create container havin the same structure as the given tree. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00062_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: nodeinterface.hh Source File │ │ │ │ +dune-typetree: treecontainer.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,102 +74,331 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
nodeinterface.hh
│ │ │ │ +
treecontainer.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_TREECONTAINER_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │
6
│ │ │ │ -
7#include <cstddef>
│ │ │ │ -
8#include <type_traits>
│ │ │ │ -
9
│ │ │ │ -
10#include <dune/common/documentation.hh>
│ │ │ │ +
7#include <type_traits>
│ │ │ │ +
8#include <utility>
│ │ │ │ +
9#include <functional>
│ │ │ │ +
10#include <array>
│ │ │ │
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>
│ │ │ │ -
76 using NodeTag = typename std::decay_t<Node>::NodeTag;
│ │ │ │ -
77
│ │ │ │ -
79 template<typename T>
│ │ │ │ -
80 using ImplementationTag = typename std::decay_t<T>::ImplementationTag;
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ +
│ │ │ │ +
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 }
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 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
│ │ │ │ +
307
│ │ │ │ +
308 } // namespace TypeTree
│ │ │ │ +
309} //namespace Dune
│ │ │ │ +
310
│ │ │ │ +
311#endif // DUNE_TYPETREE_TREECONTAINER_HH
│ │ │ │ + │ │ │ │ +
auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue)
Create container havin the same structure as the given tree.
Definition treecontainer.hh:266
│ │ │ │ +
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
│ │ │ │
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
│ │ │ │ +
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition treepath.hh:191
│ │ │ │
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
│ │ │ │ +
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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,127 +1,363 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -nodeinterface.hh │ │ │ │ │ +treecontainer.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_TREECONTAINER_HH │ │ │ │ │ +5#define DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9 │ │ │ │ │ -10#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ 11 │ │ │ │ │ -12namespace _D_u_n_e { │ │ │ │ │ -13 namespace TypeTree { │ │ │ │ │ -14 │ │ │ │ │ -_3_2 struct _N_o_d_e_I_n_t_e_r_f_a_c_e │ │ │ │ │ -33 { │ │ │ │ │ -_3_5 static const bool _i_s_L_e_a_f = implementationDefined; │ │ │ │ │ -36 │ │ │ │ │ -_3_8 static const bool _i_s_P_o_w_e_r = implementationDefined; │ │ │ │ │ -39 │ │ │ │ │ -_4_1 static const bool _i_s_C_o_m_p_o_s_i_t_e = implementationDefined; │ │ │ │ │ -42 │ │ │ │ │ -44 │ │ │ │ │ -_4_9 static const std::size_t _C_H_I_L_D_R_E_N = implementationDefined; │ │ │ │ │ -50 │ │ │ │ │ -52 │ │ │ │ │ -_5_7 static auto _d_e_g_r_e_e(); │ │ │ │ │ -58 │ │ │ │ │ -60 │ │ │ │ │ -_6_5 typedef ImplementationDefined _N_o_d_e_T_a_g; │ │ │ │ │ -66 │ │ │ │ │ -68 │ │ │ │ │ -_7_1 typedef ImplementationDefined _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -72 }; │ │ │ │ │ -73 │ │ │ │ │ -75 template │ │ │ │ │ -_7_6 using _N_o_d_e_T_a_g = typename std::decay_t::NodeTag; │ │ │ │ │ -77 │ │ │ │ │ -79 template │ │ │ │ │ -_8_0 using _I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g = typename std::decay_t::ImplementationTag; │ │ │ │ │ -81 │ │ │ │ │ -82 │ │ │ │ │ -84 template │ │ │ │ │ -_8_5 std::size_t _d_e_g_r_e_e(const Node& node) │ │ │ │ │ -86 { │ │ │ │ │ -87 return _d_e_g_r_e_e(&node,_N_o_d_e_T_a_g_<_N_o_d_e_>()); │ │ │ │ │ -88 } │ │ │ │ │ -89 │ │ │ │ │ -90#ifndef DOXYGEN │ │ │ │ │ -91 │ │ │ │ │ -93 │ │ │ │ │ -99 template │ │ │ │ │ -100 std::size_t _d_e_g_r_e_e(const Node* node, _N_o_d_e_T_a_g) │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14#include │ │ │ │ │ +15#include │ │ │ │ │ +16 │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +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 │ │ │ │ │ +_3_6 class _C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y │ │ │ │ │ +37 { │ │ │ │ │ +38 template │ │ │ │ │ +39 using DynamicDegreeConcept = decltype((std::size_t(std::declval()._d_e_g_r_e_e │ │ │ │ │ +()), 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 │ │ │ │ │ +_5_6 _C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y(LeafToValue leafToValue) : │ │ │ │ │ +57 leafToValue_(leafToValue) │ │ │ │ │ +58 {} │ │ │ │ │ +59 │ │ │ │ │ +60 template │ │ │ │ │ +_6_1 auto _o_p_e_r_a_t_o_r_(_)(const Node& node) │ │ │ │ │ +62 { │ │ │ │ │ +63 return (*this)(node, Dune::PriorityTag<5>{}); │ │ │ │ │ +64 } │ │ │ │ │ +65 │ │ │ │ │ +66 private: │ │ │ │ │ +67 │ │ │ │ │ +68 template = true> │ │ │ │ │ +70 auto _o_p_e_r_a_t_o_r_(_)(const Node& node, Dune::PriorityTag<4>) │ │ │ │ │ +71 { │ │ │ │ │ +72 return leafToValue_(node); │ │ │ │ │ +73 } │ │ │ │ │ +74 │ │ │ │ │ +75 template = true, │ │ │ │ │ +77 DynamicChildAccessConcept = true> │ │ │ │ │ +78 auto _o_p_e_r_a_t_o_r_(_)(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 _o_p_e_r_a_t_o_r_(_)(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 _o_p_e_r_a_t_o_r_(_)(const Node& node, Dune::PriorityTag<1>) │ │ │ │ │ 101 { │ │ │ │ │ -102 return node->degree(); │ │ │ │ │ -103 } │ │ │ │ │ -104 │ │ │ │ │ -105#endif // DOXYGEN │ │ │ │ │ +102 return Dune::unpackIntegerSequence([&](auto... indices) { │ │ │ │ │ +103 return Dune::makeTupleVector((*this)(node.child(indices))...); │ │ │ │ │ +104 }, std::make_index_sequence()); │ │ │ │ │ +105 } │ │ │ │ │ 106 │ │ │ │ │ -108 │ │ │ │ │ -112 template │ │ │ │ │ -_1_1_3 using _S_t_a_t_i_c_D_e_g_r_e_e = decltype(Node::degree()); │ │ │ │ │ -114 │ │ │ │ │ -116 │ │ │ │ │ -117 } // namespace TypeTree │ │ │ │ │ -118} //namespace Dune │ │ │ │ │ -119 │ │ │ │ │ -120#endif // DUNE_TYPETREE_NODEINTERFACE_HH │ │ │ │ │ +107 private: │ │ │ │ │ +108 LeafToValue leafToValue_; │ │ │ │ │ +109 }; │ │ │ │ │ +110 │ │ │ │ │ +111 │ │ │ │ │ +112 /* │ │ │ │ │ +113 * \brief Wrap nested container to provide a VectorBackend │ │ │ │ │ +114 */ │ │ │ │ │ +115 template │ │ │ │ │ +_1_1_6 class _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ +117 { │ │ │ │ │ +118 template │ │ │ │ │ +119 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_>& path) │ │ │ │ │ +120 { │ │ │ │ │ +121 return container; │ │ │ │ │ +122 } │ │ │ │ │ +123 │ │ │ │ │ +124 template │ │ │ │ │ +125 static constexpr decltype(auto) accessByTreePath(C&& container, const │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& path) │ │ │ │ │ +126 { │ │ │ │ │ +127 auto head = path[Dune::Indices::_0]; │ │ │ │ │ +128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){ │ │ │ │ │ +129 return _t_r_e_e_P_a_t_h(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: │ │ │ │ │ +_1_6_9 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d(Container&& container) : │ │ │ │ │ +170 container_(std::move(container)) │ │ │ │ │ +171 {} │ │ │ │ │ +172 │ │ │ │ │ +174 template = true> │ │ │ │ │ +_1_7_5 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d(const Tree& tree) : │ │ │ │ │ +176 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d() │ │ │ │ │ +177 { │ │ │ │ │ +178 this->resize(tree); │ │ │ │ │ +179 } │ │ │ │ │ +180 │ │ │ │ │ +182 template , bool> = true> │ │ │ │ │ +_1_8_4 _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d() : │ │ │ │ │ +185 container_() │ │ │ │ │ +186 {} │ │ │ │ │ +187 │ │ │ │ │ +188 template │ │ │ │ │ +_1_8_9 decltype(auto) operator[](const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& path) const │ │ │ │ │ +190 { │ │ │ │ │ +191 return accessByTreePath(container_, path); │ │ │ │ │ +192 } │ │ │ │ │ +193 │ │ │ │ │ +194 template │ │ │ │ │ +_1_9_5 decltype(auto) operator[](const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& path) │ │ │ │ │ +196 { │ │ │ │ │ +197 return accessByTreePath(container_, path); │ │ │ │ │ +198 } │ │ │ │ │ +199 │ │ │ │ │ +201 template = true> │ │ │ │ │ +_2_0_2 void _r_e_s_i_z_e(const Tree& tree) │ │ │ │ │ +203 { │ │ │ │ │ +204 resizeImpl(container_, tree, Dune::PriorityTag<5>{}); │ │ │ │ │ +205 } │ │ │ │ │ +206 │ │ │ │ │ +_2_0_7 const Container& _d_a_t_a() const │ │ │ │ │ +208 { │ │ │ │ │ +209 return container_; │ │ │ │ │ +210 } │ │ │ │ │ +211 │ │ │ │ │ +_2_1_2 Container& _d_a_t_a() │ │ │ │ │ +213 { │ │ │ │ │ +214 return container_; │ │ │ │ │ +215 } │ │ │ │ │ +216 │ │ │ │ │ +217 private: │ │ │ │ │ +218 Container container_; │ │ │ │ │ +219 }; │ │ │ │ │ +220 │ │ │ │ │ +221 template │ │ │ │ │ +_2_2_2 auto _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d(Container&& container) │ │ │ │ │ +223 { │ │ │ │ │ +224 return _T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_<_s_t_d_:_:_d_e_c_a_y___t_<_C_o_n_t_a_i_n_e_r_>>(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> │ │ │ │ │ +_2_3_5 struct _L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e │ │ │ │ │ +236 { │ │ │ │ │ +237 template │ │ │ │ │ +_2_3_8 auto _o_p_e_r_a_t_o_r_(_)(const Node& node) const │ │ │ │ │ +239 { │ │ │ │ │ +240 return LeafToValue{}; │ │ │ │ │ +241 } │ │ │ │ │ +242 }; │ │ │ │ │ +243 │ │ │ │ │ +244 } // namespace Detail │ │ │ │ │ +245 │ │ │ │ │ +265 template │ │ │ │ │ +_2_6_6 auto _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r(const Tree& tree, LeafToValue&& leafToValue) │ │ │ │ │ +267 { │ │ │ │ │ +268 auto f = std::ref(leafToValue); │ │ │ │ │ +269 auto factory = _D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_<_d_e_c_l_t_y_p_e_(_f_)_>(f); │ │ │ │ │ +270 return Detail::makeTreeContainerVectorBackend(factory(tree)); │ │ │ │ │ +271 } │ │ │ │ │ +272 │ │ │ │ │ +288 template │ │ │ │ │ +_2_8_9 auto _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r(const Tree& tree) │ │ │ │ │ +290 { │ │ │ │ │ +291 return _m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r(tree, [](const auto&) {return Value{};}); │ │ │ │ │ +292 } │ │ │ │ │ +293 │ │ │ │ │ +297 template │ │ │ │ │ +_2_9_8 using _U_n_i_f_o_r_m_T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t │ │ │ │ │ +(std::declval()))>; │ │ │ │ │ +299 │ │ │ │ │ +303 template class LeafToValue, class Tree> │ │ │ │ │ +_3_0_4 using _T_r_e_e_C_o_n_t_a_i_n_e_r = std::decay_t(), std::declval>()))>; │ │ │ │ │ +305 │ │ │ │ │ +307 │ │ │ │ │ +308 } // namespace TypeTree │ │ │ │ │ +309} //namespace Dune │ │ │ │ │ +310 │ │ │ │ │ +311#endif // DUNE_TYPETREE_TREECONTAINER_HH │ │ │ │ │ +_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ +auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue) │ │ │ │ │ +Create container havin the same structure as the given tree. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:266 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_U_n_i_f_o_r_m_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:298 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r │ │ │ │ │ +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 ... │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:304 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_g_r_e_e │ │ │ │ │ std::size_t degree(const Node &node) │ │ │ │ │ Returns the degree of node as run time information. │ │ │ │ │ DDeeffiinniittiioonn nodeinterface.hh:85 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g │ │ │ │ │ -typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ -Returns the implementation tag of the given Node. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:80 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ -decltype(Node::degree()) StaticDegree │ │ │ │ │ -Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ -integral_constant. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e │ │ │ │ │ -Interface for nodes in a dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:33 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -Number of children of this node in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_d_e_g_r_e_e │ │ │ │ │ -static auto degree() │ │ │ │ │ -Number of children of this node in the dune-typetree. │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Whether this is a power node in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_i_s_L_e_a_f │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Whether this is a leaf node in a dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:35 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -ImplementationDefined NodeStorage │ │ │ │ │ -container type to pass around a collection of children │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:71 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Whether this is a composite node in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:41 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_I_n_t_e_r_f_a_c_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -ImplementationDefined NodeTag │ │ │ │ │ -The type tag that describes what kind of node this is. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:65 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_m_a_k_e_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ +auto makeTreeContainerVectorBackend(Container &&container) │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:222 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:37 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ +auto operator()(const Node &node) │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:61 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y_:_:_C_o_n_t_a_i_n_e_r_F_a_c_t_o_r_y │ │ │ │ │ +ContainerFactory(LeafToValue leafToValue) │ │ │ │ │ +Create ContainerFactory. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:56 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:117 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_r_e_s_i_z_e │ │ │ │ │ +void resize(const Tree &tree) │ │ │ │ │ +Resize the (nested) container depending on the degree of the tree nodes. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:202 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_d_a_t_a │ │ │ │ │ +Container & data() │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:212 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_d_a_t_a │ │ │ │ │ +const Container & data() const │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:207 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ +TreeContainerVectorBackend(Container &&container) │ │ │ │ │ +Move the passed container into the internal storage. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:169 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ +TreeContainerVectorBackend() │ │ │ │ │ +Default constructor. The stored container might need to be resized before │ │ │ │ │ +usage. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:184 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d_:_:_T_r_e_e_C_o_n_t_a_i_n_e_r_V_e_c_t_o_r_B_a_c_k_e_n_d │ │ │ │ │ +TreeContainerVectorBackend(const Tree &tree) │ │ │ │ │ +Default construct the container and perform a resize depending on the tree-node │ │ │ │ │ +degrees. │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:175 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:236 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_L_e_a_f_T_o_D_e_f_a_u_l_t_C_o_n_s_t_r_u_c_t_i_b_l_e_V_a_l_u_e_:_:_o_p_e_r_a_t_o_r_(_) │ │ │ │ │ +auto operator()(const Node &node) const │ │ │ │ │ +DDeeffiinniittiioonn treecontainer.hh:238 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treepath.hh File Reference │ │ │ │ +dune-typetree: accumulate_static.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,163 +72,132 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Enumerations | │ │ │ │ Functions
│ │ │ │ -
treepath.hh File Reference
│ │ │ │ +
accumulate_static.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>
│ │ │ │ +
#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.

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

│ │ │ │ Classes

class  Dune::TypeTree::HybridTreePath< T >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
struct  Dune::TypeTree::or_< result_type >
 Statically combine two values of type result_type using ||. More...
 
struct  Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >
struct  Dune::TypeTree::or_< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k >
struct  Dune::TypeTree::and_< result_type >
 Statically combine two values of type result_type using &&. More...
 
struct  Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k >
struct  Dune::TypeTree::and_< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >
struct  Dune::TypeTree::plus< result_type >
 Statically combine two values of type result_type using +. More...
 
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >
struct  Dune::TypeTree::plus< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
struct  Dune::TypeTree::minus< result_type >
 Statically combine two values of type result_type using -. More...
 
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... >
struct  Dune::TypeTree::minus< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >
struct  Dune::TypeTree::multiply< result_type >
 Statically combine two values of type result_type using *. More...
 
struct  Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
struct  Dune::TypeTree::multiply< result_type >::reduce< r1, r2 >
 
struct  Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > >
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
 
namespace  Dune::TypeTree::TreePathType
namespace  Dune::TypeTree::Experimental
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -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.
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... t)
 Constructs a new HybridTreePath from the given indices.
 
template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize (const HybridTreePath< T... > &)
 Returns the size (number of components) of the given HybridTreePath.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
template<class... T>
constexpr auto Dune::TypeTree::pop_front (const HybridTreePath< T... > &tp)
 Removes first index on a HybridTreePath.
 
template<class... T>
constexpr auto Dune::TypeTree::pop_back (const HybridTreePath< T... > &tp)
 Removes last index on a HybridTreePath.
 
template<class... S, class... T>
constexpr bool Dune::TypeTree::operator== (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for value equality.
 
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.
 
template<class... S, class... T>
constexpr auto Dune::TypeTree::operator!= (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for unequality.
 
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.
 
template<typename... T>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T... > &tp)
 Dumps a HybridTreePath to a stream.
 
template<typename Tree , typename Visitor , typename Init >
auto Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor &&visitor, Init &&init)
 Apply hybrid visitor to TypeTree.
 
│ │ │ │ +

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 {} │ │ │ │ │ @@ -1,204 +1,83 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _E_n_u_m_e_r_a_t_i_o_n_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -treepath.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +accumulate_static.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_x_e_d_c_a_p_a_c_i_t_y_s_t_a_c_k_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _T_ _> │ │ │ │ │ -  A hybrid version of TreePath that supports both compile time and run │ │ │ │ │ - time indices. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type using ||. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_S_i_z_e_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _> │ │ │ │ │ - _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i │ │ │ │ │ - _>_._._._ _>_,_ _k_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type using &&. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i │ │ │ │ │ - _>_._._._ _>_,_ _k_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_ _>_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type using +. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _j_ _>_, │ │ │ │ │ - _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_,_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _l_ _>_._._._ _>_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_, │ │ │ │ │ - _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type using -. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _> │ │ │ │ │ - _>_,_ _i_._._._ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _j_ _>_, │ │ │ │ │ - _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_,_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _l_ _>_._._._ _>_,_ _i_._._._ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type using *. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_, │ │ │ │ │ - _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_C_o_n_c_a_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._. │ │ │ │ │ - _>_,_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_._._._ _>_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type by returning their │ │ │ │ │ + minimum. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_<_ _r_e_s_u_l_t___t_y_p_e_ _> │ │ │ │ │ +  Statically combine two values of type result_type by returning their │ │ │ │ │ + maximum. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_<_ _r_e_s_u_l_t___t_y_p_e_ _>_:_:_r_e_d_u_c_e_<_ _r_1_,_ _r_2_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e_<_ _T_r_e_e_,_ _F_u_n_c_t_o_r_,_ _R_e_d_u_c_t_i_o_n_,_ _s_t_a_r_t_V_a_l_u_e_, │ │ │ │ │ + _P_a_r_e_n_t_C_h_i_l_d_R_e_d_u_c_t_i_o_n_ _> │ │ │ │ │ +  Statically accumulate a value over the nodes of a _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_<_ _F_u_n_c_t_o_r_,_ _R_e_d_u_c_t_i_o_n_,_ _S_t_a_r_t_T_y_p_e_, │ │ │ │ │ + _P_a_r_e_n_t_C_h_i_l_d_R_e_d_u_c_t_i_o_n_,_ _R_e_d_u_c_t_i_o_n_A_l_g_o_r_i_t_h_m_ _> │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_T_y_p_e_<_ _T_r_e_e_,_ _P_o_l_i_c_y_ _> │ │ │ │ │ +  Statically accumulate a type over the nodes of a _T_y_p_e_T_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ -  │ │ │ │ │ -TTyyppeeddeeffss │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h = _H_y_b_r_i_d_T_r_e_e_P_a_t_h< Dune::index_constant< i >... │ │ │ │ │ - > │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_e_e_P_a_t_h = _H_y_b_r_i_d_T_r_e_e_P_a_t_h< Dune::index_constant< i │ │ │ │ │ - >... > │ │ │ │ │ -  │ │ │ │ │ -EEnnuummeerraattiioonnss │ │ │ │ │ -enum   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e { _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_: │ │ │ │ │ - _f_u_l_l_y_S_t_a_t_i_c , _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c } │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ │   │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ - void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_r_i_n_t___t_r_e_e___p_a_t_h (std:: │ │ │ │ │ - ostream &os) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_r_i_n_t___t_r_e_e___p_a_t_h (std:: │ │ │ │ │ - ostream &os) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... >  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h (const T │ │ │ │ │ - &... t) │ │ │ │ │ -  Constructs a new _H_y_b_r_i_d_T_r_e_e_P_a_t_h from the │ │ │ │ │ - given indices. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... >  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h (const T &... │ │ │ │ │ - t) │ │ │ │ │ -  Constructs a new _H_y_b_r_i_d_T_r_e_e_P_a_t_h from the │ │ │ │ │ - given indices. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr std::size_t  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &) │ │ │ │ │ -  Returns the size (number of components) │ │ │ │ │ - of the given _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_E_n_t_r_y (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< 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 _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr std::size_t  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_I_n_d_e_x (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, │ │ │ │ │ - index_constant< i >={}) │ │ │ │ │ -  Returns the index value of the i-th │ │ │ │ │ - element of the _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template 0), bool >:: │ │ │ │ │ -type = true> │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_b_a_c_k (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) -> decltype │ │ │ │ │ - (_t_r_e_e_P_a_t_h_E_n_t_r_y< sizeof...(T) -1 >(tp)) │ │ │ │ │ -  Returns a copy of the last element of │ │ │ │ │ - the _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_r_o_n_t (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) -> decltype │ │ │ │ │ - (_t_r_e_e_P_a_t_h_E_n_t_r_y< 0 >(tp)) │ │ │ │ │ -  Returns a copy of the first element of │ │ │ │ │ - the _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T..., std:: _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k (const │ │ │ │ │ - size_t >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, std::size_t │ │ │ │ │ - i) │ │ │ │ │ -  Appends a run time index to a │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T..., _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k (const │ │ │ │ │ - index_constant< i > >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, │ │ │ │ │ - index_constant< i > i_={}) │ │ │ │ │ -  Appends a compile time index to a │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< std::size_t, _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___f_r_o_n_t (const │ │ │ │ │ - T... >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, std::size_t │ │ │ │ │ - element) │ │ │ │ │ -  Prepends a run time index to a │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___f_r_o_n_t (const │ │ │ │ │ - index_constant< i >, T... >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, │ │ │ │ │ - index_constant< i > _i={}) │ │ │ │ │ -  Prepends a compile time index to a │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___f_r_o_n_t (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) │ │ │ │ │ -  Removes first index on a _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___b_a_c_k (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) │ │ │ │ │ -  Removes last index on a _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr bool  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_=_= (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< S... > &lhs, const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &rhs) │ │ │ │ │ -  Compare two _H_y_b_r_i_d_T_r_e_e_P_a_t_hs for value │ │ │ │ │ - equality. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_=_= (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< std::integral_constant< │ │ │ │ │ - S, lhs >... > &, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< │ │ │ │ │ - std::integral_constant< T, rhs >... > &) │ │ │ │ │ -  Overload for purely static │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_hs. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_!_= (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< S... > &lhs, const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &rhs) │ │ │ │ │ -  Compare two _H_y_b_r_i_d_T_r_e_e_P_a_t_hs for │ │ │ │ │ - unequality. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_!_= (const │ │ │ │ │ - _H_y_b_r_i_d_T_r_e_e_P_a_t_h< std::integral_constant< │ │ │ │ │ - S, lhs >... > &, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< │ │ │ │ │ - std::integral_constant< T, rhs >... > &) │ │ │ │ │ -  Compare two static _H_y_b_r_i_d_T_r_e_e_P_a_t_hs for │ │ │ │ │ - unequality. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - std::ostream &  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_<_< (std::ostream │ │ │ │ │ - &os, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) │ │ │ │ │ -  Dumps a _H_y_b_r_i_d_T_r_e_e_P_a_t_h to a stream. │ │ │ │ │ -  │ │ │ │ │ +template │ │ │ │ │ +auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e (Tree &&tree, Visitor │ │ │ │ │ + &&visitor, Init &&init) │ │ │ │ │ +  Apply hybrid visitor to _T_y_p_e_T_r_e_e. │ │ │ │ │ +  │ │ │ │ │ +********** VVaarriiaabbllee DDooccuummeennttaattiioonn ********** │ │ │ │ │ +********** _?◆_? cchhiilldd__rreessuulltt ********** │ │ │ │ │ +const result_type child_result = │ │ │ │ │ +accumulate_value>_:_: static │ │ │ │ │ +_r_e_s_u_l_t │ │ │ │ │ +********** _?◆_? rreessuulltt ********** │ │ │ │ │ +const result_type result = current_value static │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: treepath.hh Source File │ │ │ │ +dune-typetree: accumulate_static.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,553 +74,592 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
treepath.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_TREEPATH_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH
│ │ │ │ +
5#define DUNE_TYPETREE_ACCUMULATE_STATIC_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>
│ │ │ │ - │ │ │ │ +
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
│ │ │ │ -
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>
│ │ │ │ +
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
│ │ │ │ -
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 {}
│ │ │ │ -
│ │ │ │ +
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 static const result_type result = r1 > r2 ? r1 : r2;
│ │ │ │ +
95 };
│ │ │ │ +
│ │ │ │ +
96 };
│ │ │ │ +
│ │ │ │ +
97
│ │ │ │ +
98
│ │ │ │ +
99 namespace {
│ │ │ │
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 }
│ │ │ │ -
│ │ │ │ +
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 {
│ │ │ │ +
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
│ │ │ │ -
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 }
│ │ │ │ -
│ │ │ │ +
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 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
│ │ │ │ +
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
│ │ │ │ -
│ │ │ │ -
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.
│ │ │ │ +
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 using Data = std::tuple<T...>;
│ │ │ │ -
167 Data _data;
│ │ │ │ -
168
│ │ │ │ -
169#endif // DOXYGEN
│ │ │ │ -
170
│ │ │ │ -
171 };
│ │ │ │ -
│ │ │ │ -
172
│ │ │ │ -
173
│ │ │ │ +
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
│ │ │ │ -
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))
│ │ │ │ +
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 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
│ │ │ │ +
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,
│ │ │ │ +
300 TreePath
│ │ │ │ +
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,
│ │ │ │ +
383 NodeTag<child>
│ │ │ │ +
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
│ │ │ │ -
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 };
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
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 };
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
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>
│ │ │ │ - │ │ │ │ +
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
│ │ │ │ -
527
│ │ │ │ -
528 } // namespace TypeTree
│ │ │ │ -
529} //namespace Dune
│ │ │ │ -
530
│ │ │ │ -
531#endif // DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ +
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 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 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
│ │ │ │ +
HybridTreePath< Dune::index_constant< i >... > TreePath
Definition treepath.hh:521
│ │ │ │
Definition accumulate_static.hh:13
│ │ │ │ -
Type
Definition treepath.hh:30
│ │ │ │ -
@ fullyStatic
Definition treepath.hh:30
│ │ │ │ -
@ dynamic
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
│ │ │ │ -
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 {} │ │ │ │ │ @@ -1,611 +1,695 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -treepath.hh │ │ │ │ │ +accumulate_static.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_TREEPATH_HH │ │ │ │ │ -5#define DUNE_TYPETREE_TREEPATH_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 <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_x_e_d_c_a_p_a_c_i_t_y_s_t_a_c_k_._h_h> │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -17 │ │ │ │ │ -18 │ │ │ │ │ -19namespace _D_u_n_e { │ │ │ │ │ -20 namespace TypeTree { │ │ │ │ │ -21 │ │ │ │ │ -22 template │ │ │ │ │ -23 class HybridTreePath; │ │ │ │ │ -24 │ │ │ │ │ -28 │ │ │ │ │ -_2_9 namespace TreePathType { │ │ │ │ │ -_3_0 enum _T_y_p_e { _f_u_l_l_y_S_t_a_t_i_c, _d_y_n_a_m_i_c }; │ │ │ │ │ -31 } │ │ │ │ │ -32 │ │ │ │ │ -33 template │ │ │ │ │ -_3_4 struct _T_r_e_e_P_a_t_h_S_i_z_e; │ │ │ │ │ -35 │ │ │ │ │ -36 template │ │ │ │ │ -_3_7 struct _T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k; │ │ │ │ │ -38 │ │ │ │ │ -39 template │ │ │ │ │ -_4_0 struct _T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t; │ │ │ │ │ -41 │ │ │ │ │ -42 template │ │ │ │ │ -_4_3 struct _T_r_e_e_P_a_t_h_B_a_c_k; │ │ │ │ │ -44 │ │ │ │ │ -45 template │ │ │ │ │ -_4_6 struct _T_r_e_e_P_a_t_h_F_r_o_n_t; │ │ │ │ │ -47 │ │ │ │ │ -48 template │ │ │ │ │ -_4_9 struct _T_r_e_e_P_a_t_h_P_o_p_B_a_c_k; │ │ │ │ │ -50 │ │ │ │ │ -51 template │ │ │ │ │ -_5_2 struct _T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t; │ │ │ │ │ +7#include │ │ │ │ │ +8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +11 │ │ │ │ │ +12 │ │ │ │ │ +_1_3namespace _D_u_n_e { │ │ │ │ │ +_1_4 namespace TypeTree { │ │ │ │ │ +15 │ │ │ │ │ +22 template │ │ │ │ │ +_2_3 struct _o_r__ │ │ │ │ │ +24 { │ │ │ │ │ +25 template │ │ │ │ │ +_2_6 struct _r_e_d_u_c_e │ │ │ │ │ +27 { │ │ │ │ │ +_2_8 static const result_type _r_e_s_u_l_t = r1 || r2; │ │ │ │ │ +29 }; │ │ │ │ │ +30 }; │ │ │ │ │ +31 │ │ │ │ │ +33 template │ │ │ │ │ +_3_4 struct _a_n_d__ │ │ │ │ │ +35 { │ │ │ │ │ +36 template │ │ │ │ │ +_3_7 struct _r_e_d_u_c_e │ │ │ │ │ +38 { │ │ │ │ │ +_3_9 static const result_type _r_e_s_u_l_t = r1 && r2; │ │ │ │ │ +40 }; │ │ │ │ │ +41 }; │ │ │ │ │ +42 │ │ │ │ │ +44 template │ │ │ │ │ +_4_5 struct _p_l_u_s │ │ │ │ │ +46 { │ │ │ │ │ +47 template │ │ │ │ │ +_4_8 struct _r_e_d_u_c_e │ │ │ │ │ +49 { │ │ │ │ │ +_5_0 static const result_type _r_e_s_u_l_t = r1 + r2; │ │ │ │ │ +51 }; │ │ │ │ │ +52 }; │ │ │ │ │ 53 │ │ │ │ │ -54 template │ │ │ │ │ -_5_5 struct _T_r_e_e_P_a_t_h_C_o_n_c_a_t; │ │ │ │ │ -56 │ │ │ │ │ -57 template │ │ │ │ │ -_5_8 void _p_r_i_n_t___t_r_e_e___p_a_t_h(std::ostream& os) │ │ │ │ │ -59 {} │ │ │ │ │ -60 │ │ │ │ │ -61 template │ │ │ │ │ -_6_2 void _p_r_i_n_t___t_r_e_e___p_a_t_h(std::ostream& os) │ │ │ │ │ -63 { │ │ │ │ │ -64 os << k << " "; │ │ │ │ │ -65 _p_r_i_n_t___t_r_e_e___p_a_t_h(os); │ │ │ │ │ -66 } │ │ │ │ │ -67 │ │ │ │ │ -69 │ │ │ │ │ -77 template │ │ │ │ │ -_7_8 class _H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +55 template │ │ │ │ │ +_5_6 struct _m_i_n_u_s │ │ │ │ │ +57 { │ │ │ │ │ +58 template │ │ │ │ │ +_5_9 struct _r_e_d_u_c_e │ │ │ │ │ +60 { │ │ │ │ │ +_6_1 static const result_type _r_e_s_u_l_t = r1 - r2; │ │ │ │ │ +62 }; │ │ │ │ │ +63 }; │ │ │ │ │ +64 │ │ │ │ │ +66 template │ │ │ │ │ +_6_7 struct _m_u_l_t_i_p_l_y │ │ │ │ │ +68 { │ │ │ │ │ +69 template │ │ │ │ │ +_7_0 struct _r_e_d_u_c_e │ │ │ │ │ +71 { │ │ │ │ │ +_7_2 static const result_type _r_e_s_u_l_t = r1 * r2; │ │ │ │ │ +73 }; │ │ │ │ │ +74 }; │ │ │ │ │ +75 │ │ │ │ │ +77 template │ │ │ │ │ +_7_8 struct _m_i_n │ │ │ │ │ 79 { │ │ │ │ │ -80 │ │ │ │ │ -81 public: │ │ │ │ │ -82 │ │ │ │ │ -_8_4 using _i_n_d_e_x___s_e_q_u_e_n_c_e = std::index_sequence_for; │ │ │ │ │ -85 │ │ │ │ │ -_8_7 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h() │ │ │ │ │ -88 {} │ │ │ │ │ -89 │ │ │ │ │ -_9_0 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h& tp) = default; │ │ │ │ │ -_9_1 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(_H_y_b_r_i_d_T_r_e_e_P_a_t_h&& tp) = default; │ │ │ │ │ -92 │ │ │ │ │ -_9_3 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h& _o_p_e_r_a_t_o_r_=(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h& tp) = default; │ │ │ │ │ -_9_4 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h& _o_p_e_r_a_t_o_r_=(_H_y_b_r_i_d_T_r_e_e_P_a_t_h&& tp) = default; │ │ │ │ │ -95 │ │ │ │ │ -_9_7 explicit constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(std::tuple t) │ │ │ │ │ -98 : _data(t) │ │ │ │ │ -99 {} │ │ │ │ │ +80 template │ │ │ │ │ +_8_1 struct _r_e_d_u_c_e │ │ │ │ │ +82 { │ │ │ │ │ +_8_3 static const result_type _r_e_s_u_l_t = r1 < r2 ? r1 : r2; │ │ │ │ │ +84 }; │ │ │ │ │ +85 }; │ │ │ │ │ +86 │ │ │ │ │ +88 template │ │ │ │ │ +_8_9 struct _m_a_x │ │ │ │ │ +90 { │ │ │ │ │ +91 template │ │ │ │ │ +_9_2 struct _r_e_d_u_c_e │ │ │ │ │ +93 { │ │ │ │ │ +_9_4 static const result_type _r_e_s_u_l_t = r1 > r2 ? r1 : r2; │ │ │ │ │ +95 }; │ │ │ │ │ +96 }; │ │ │ │ │ +97 │ │ │ │ │ +98 │ │ │ │ │ +99 namespace { │ │ │ │ │ 100 │ │ │ │ │ -102 template 0 && │ │ │ │ │ -sizeof...(U) == sizeof...(T)),bool>::type = true> │ │ │ │ │ -_1_0_3 explicit constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(U... t) │ │ │ │ │ -104 : _data(t...) │ │ │ │ │ -105 {} │ │ │ │ │ -106 │ │ │ │ │ -_1_0_8 constexpr static _i_n_d_e_x___s_e_q_u_e_n_c_e _e_n_u_m_e_r_a_t_e() │ │ │ │ │ -109 { │ │ │ │ │ -110 return {}; │ │ │ │ │ -111 } │ │ │ │ │ -112 │ │ │ │ │ -_1_1_4 constexpr static std::size_t _s_i_z_e() │ │ │ │ │ -115 { │ │ │ │ │ -116 return sizeof...(T); │ │ │ │ │ -117 } │ │ │ │ │ +101 // implementation of the traversal algorithm │ │ │ │ │ +102 │ │ │ │ │ +104 template │ │ │ │ │ +105 struct accumulate_node_helper │ │ │ │ │ +106 { │ │ │ │ │ +107 │ │ │ │ │ +108 typedef typename Functor::result_type result_type; │ │ │ │ │ +109 │ │ │ │ │ +_1_1_0 static const result_type _r_e_s_u_l_t = current_value; │ │ │ │ │ +111 │ │ │ │ │ +112 }; │ │ │ │ │ +113 │ │ │ │ │ +115 template │ │ │ │ │ +116 struct │ │ │ │ │ +accumulate_node_helper │ │ │ │ │ +117 { │ │ │ │ │ 118 │ │ │ │ │ -120 template │ │ │ │ │ -_1_2_1 constexpr auto _o_p_e_r_a_t_o_r_[_](Dune::index_constant) const │ │ │ │ │ -122 { │ │ │ │ │ -123 return std::get(_data); │ │ │ │ │ -124 } │ │ │ │ │ -125 │ │ │ │ │ -_1_2_7 constexpr std::size_t _o_p_e_r_a_t_o_r_[_](std::size_t pos) const │ │ │ │ │ -128 { │ │ │ │ │ -129 std::size_t entry = 0; │ │ │ │ │ -130 Dune::Hybrid::forEach(_e_n_u_m_e_r_a_t_e(), [&] (auto i) { │ │ │ │ │ -131 if (i==pos) │ │ │ │ │ -132 entry = this->_e_l_e_m_e_n_t(i); │ │ │ │ │ -133 }); │ │ │ │ │ -134 return entry; │ │ │ │ │ -135 } │ │ │ │ │ -136 │ │ │ │ │ -138 template │ │ │ │ │ -_1_3_9 constexpr auto _e_l_e_m_e_n_t(Dune::index_constant pos = {}) const │ │ │ │ │ -140 { │ │ │ │ │ -141 return std::get(_data); │ │ │ │ │ -142 } │ │ │ │ │ -143 │ │ │ │ │ -_1_4_5 constexpr std::size_t _e_l_e_m_e_n_t(std::size_t pos) const │ │ │ │ │ -146 { │ │ │ │ │ -147 std::size_t entry = 0; │ │ │ │ │ -148 Dune::Hybrid::forEach(_e_n_u_m_e_r_a_t_e(), [&] (auto i) { │ │ │ │ │ -149 if (i==pos) │ │ │ │ │ -150 entry = this->_e_l_e_m_e_n_t(i); │ │ │ │ │ -151 }); │ │ │ │ │ -152 return entry; │ │ │ │ │ -153 } │ │ │ │ │ +119 typedef typename Functor::result_type result_type; │ │ │ │ │ +120 │ │ │ │ │ +121 static const result_type _r_e_s_u_l_t = Reduction::template │ │ │ │ │ +reduce::result>::result; │ │ │ │ │ +122 │ │ │ │ │ +123 }; │ │ │ │ │ +124 │ │ │ │ │ +126 template │ │ │ │ │ +127 struct accumulate_value; │ │ │ │ │ +128 │ │ │ │ │ +130 template │ │ │ │ │ +131 struct │ │ │ │ │ +accumulate_value │ │ │ │ │ +132 { │ │ │ │ │ +133 │ │ │ │ │ +134 typedef typename Functor::result_type result_type; │ │ │ │ │ +135 │ │ │ │ │ +136 static const result_type _r_e_s_u_l_t = │ │ │ │ │ +137 │ │ │ │ │ +138 │ │ │ │ │ +accumulate_node_helper::value>_:_:_r_e_s_u_l_t; │ │ │ │ │ +139 │ │ │ │ │ +140 }; │ │ │ │ │ +141 │ │ │ │ │ +143 template │ │ │ │ │ +144 struct accumulate_over_children │ │ │ │ │ +145 { │ │ │ │ │ +146 │ │ │ │ │ +147 typedef typename Functor::result_type result_type; │ │ │ │ │ +148 │ │ │ │ │ +149 typedef decltype(_p_u_s_h___b_a_c_k(_T_r_e_e_P_a_t_h{},index_constant{})) │ │ │ │ │ +child_tree_path; │ │ │ │ │ +150 │ │ │ │ │ +151 typedef typename Node::template _C_h_i_l_d::Type child; │ │ │ │ │ +152 │ │ │ │ │ +_1_5_3 static const result_type child_result = │ │ │ │ │ +accumulate_value>:: │ │ │ │ │ +result; │ │ │ │ │ 154 │ │ │ │ │ -_1_5_6 auto _b_a_c_k() 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. │ │ │ │ │ +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 using Data = std::tuple; │ │ │ │ │ -167 Data _data; │ │ │ │ │ -168 │ │ │ │ │ -169#endif // DOXYGEN │ │ │ │ │ -170 │ │ │ │ │ -171 }; │ │ │ │ │ -172 │ │ │ │ │ -173 │ │ │ │ │ +166 static const result_type _r_e_s_u_l_t = current_value; │ │ │ │ │ +167 │ │ │ │ │ +168 }; │ │ │ │ │ +169 │ │ │ │ │ +172 template │ │ │ │ │ +173 struct accumulate_value_generic_composite_node │ │ │ │ │ +174 { │ │ │ │ │ 175 │ │ │ │ │ -179 template │ │ │ │ │ -_1_8_0 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _h_y_b_r_i_d_T_r_e_e_P_a_t_h(const T&... t) │ │ │ │ │ -181 { │ │ │ │ │ -182 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(t...); │ │ │ │ │ -183 } │ │ │ │ │ -184 │ │ │ │ │ -186 │ │ │ │ │ -190 template │ │ │ │ │ -_1_9_1 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h(const T&... t) │ │ │ │ │ -192 { │ │ │ │ │ -193 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(t...); │ │ │ │ │ -194 } │ │ │ │ │ -195 │ │ │ │ │ -196 │ │ │ │ │ -198 template │ │ │ │ │ -_1_9_9 constexpr std::size_t _t_r_e_e_P_a_t_h_S_i_z_e(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>&) │ │ │ │ │ -200 { │ │ │ │ │ -201 return sizeof...(T); │ │ │ │ │ -202 } │ │ │ │ │ -203 │ │ │ │ │ -205 │ │ │ │ │ -221 template │ │ │ │ │ -_2_2_2 constexpr auto _t_r_e_e_P_a_t_h_E_n_t_r_y(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, │ │ │ │ │ -index_constant = {}) │ │ │ │ │ -223 -> typename std::decay(tp._data))>::type │ │ │ │ │ -224 { │ │ │ │ │ -225 return std::get(tp._data); │ │ │ │ │ -226 } │ │ │ │ │ -227 │ │ │ │ │ -229 │ │ │ │ │ -244 template │ │ │ │ │ -_2_4_5 constexpr std::size_t _t_r_e_e_P_a_t_h_I_n_d_e_x(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, │ │ │ │ │ -index_constant = {}) │ │ │ │ │ -246 { │ │ │ │ │ -247 return std::get(tp._data); │ │ │ │ │ -248 } │ │ │ │ │ -249 │ │ │ │ │ -251 │ │ │ │ │ -256 template 0),bool>:: │ │ │ │ │ -type = true> │ │ │ │ │ -_2_5_7 constexpr auto _b_a_c_k(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ -258 -> decltype(_t_r_e_e_P_a_t_h_E_n_t_r_y(tp)) │ │ │ │ │ +176 typedef typename Functor::result_type result_type; │ │ │ │ │ +177 │ │ │ │ │ +178 static const result_type _c_h_i_l_d___r_e_s_u_l_t = │ │ │ │ │ +accumulate_over_children:: │ │ │ │ │ +value>_:_:_r_e_s_u_l_t; │ │ │ │ │ +179 │ │ │ │ │ +180 static const result_type _r_e_s_u_l_t = │ │ │ │ │ +181 │ │ │ │ │ +accumulate_node_helper::value>_:_:_r_e_s_u_l_t; │ │ │ │ │ +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 │ │ │ │ │ +_2_5_8 struct _A_c_c_u_m_u_l_a_t_e_V_a_l_u_e │ │ │ │ │ 259 { │ │ │ │ │ -260 return _t_r_e_e_P_a_t_h_E_n_t_r_y(tp); │ │ │ │ │ -261 } │ │ │ │ │ -262 │ │ │ │ │ -264 │ │ │ │ │ -269 template │ │ │ │ │ -_2_7_0 constexpr auto _f_r_o_n_t(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ -271 -> decltype(treePathEntry<0>(tp)) │ │ │ │ │ -272 { │ │ │ │ │ -273 return treePathEntry<0>(tp); │ │ │ │ │ -274 } │ │ │ │ │ -275 │ │ │ │ │ -277 │ │ │ │ │ -280 template │ │ │ │ │ -_2_8_1 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _p_u_s_h___b_a_c_k(const │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, std::size_t i) │ │ │ │ │ -282 { │ │ │ │ │ -283 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(std::tuple_cat(tp._data,std:: │ │ │ │ │ -make_tuple(i))); │ │ │ │ │ -284 } │ │ │ │ │ -285 │ │ │ │ │ -287 │ │ │ │ │ -301 template │ │ │ │ │ -_3_0_2 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h> _p_u_s_h___b_a_c_k(const │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, index_constant i_ = {}) │ │ │ │ │ -303 { │ │ │ │ │ -304 return HybridTreePath >(std::tuple_cat │ │ │ │ │ -(tp._data,std::make_tuple(i_))); │ │ │ │ │ -305 } │ │ │ │ │ -306 │ │ │ │ │ -308 │ │ │ │ │ -311 template │ │ │ │ │ -_3_1_2 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _p_u_s_h___f_r_o_n_t(const │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, std::size_t element) │ │ │ │ │ +260 │ │ │ │ │ +_2_6_2 typedef typename Functor::result_type _r_e_s_u_l_t___t_y_p_e; │ │ │ │ │ +263 │ │ │ │ │ +_2_6_5 static const _r_e_s_u_l_t___t_y_p_e _r_e_s_u_l_t = │ │ │ │ │ +accumulate_value,_N_o_d_e_T_a_g_<_T_r_e_e_>>_:_: │ │ │ │ │ +_r_e_s_u_l_t; │ │ │ │ │ +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 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(std::tuple_cat(std::make_tuple │ │ │ │ │ -(element),tp._data)); │ │ │ │ │ -315 } │ │ │ │ │ -316 │ │ │ │ │ -318 │ │ │ │ │ -332 template │ │ │ │ │ -_3_3_3 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>,T...> _p_u_s_h___f_r_o_n_t(const │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, index_constant _i = {}) │ │ │ │ │ -334 { │ │ │ │ │ -335 return HybridTreePath,T...>(std::tuple_cat(std:: │ │ │ │ │ -make_tuple(_i),tp._data)); │ │ │ │ │ -336 } │ │ │ │ │ -337 │ │ │ │ │ -339 │ │ │ │ │ -342 template │ │ │ │ │ -_3_4_3 constexpr auto _p_o_p___f_r_o_n_t(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ -344 { │ │ │ │ │ -345 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ -346 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ -347 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ -348 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ -349 } │ │ │ │ │ -350 │ │ │ │ │ -352 │ │ │ │ │ -355 template │ │ │ │ │ -_3_5_6 constexpr auto _p_o_p___b_a_c_k(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ -357 { │ │ │ │ │ -358 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ -359 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ -360 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ -361 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ -362 } │ │ │ │ │ -363 │ │ │ │ │ -365 │ │ │ │ │ -373 template │ │ │ │ │ -_3_7_4 constexpr bool _o_p_e_r_a_t_o_r_=_=( │ │ │ │ │ -375 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_S_._._._>& lhs, │ │ │ │ │ -376 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& 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 │ │ │ │ │ -_3_9_8 constexpr auto _o_p_e_r_a_t_o_r_=_=( │ │ │ │ │ -399 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&, │ │ │ │ │ -400 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&) │ │ │ │ │ -401 { │ │ │ │ │ -402 return std::bool_constant<_h_y_b_r_i_d_T_r_e_e_P_a_t_h(lhs...) == _h_y_b_r_i_d_T_r_e_e_P_a_t_h(rhs...)> │ │ │ │ │ -{}; │ │ │ │ │ -403 } │ │ │ │ │ -404 │ │ │ │ │ +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(_p_u_s_h___b_a_c_k(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 │ │ │ │ │ -407 template │ │ │ │ │ -_4_0_8 constexpr auto _o_p_e_r_a_t_o_r_!_=( │ │ │ │ │ -409 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_S_._._._>& lhs, │ │ │ │ │ -410 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& rhs) │ │ │ │ │ +406 │ │ │ │ │ +409 template │ │ │ │ │ +410 struct accumulate_type_generic_composite_node │ │ │ │ │ 411 { │ │ │ │ │ -412 return !(lhs == rhs); │ │ │ │ │ -413 } │ │ │ │ │ -414 │ │ │ │ │ -416 template │ │ │ │ │ -_4_1_7 constexpr auto _o_p_e_r_a_t_o_r_!_=( │ │ │ │ │ -418 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&, │ │ │ │ │ -419 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&) │ │ │ │ │ -420 { │ │ │ │ │ -421 return std::bool_constant<_h_y_b_r_i_d_T_r_e_e_P_a_t_h(lhs...) != _h_y_b_r_i_d_T_r_e_e_P_a_t_h(rhs...)> │ │ │ │ │ -{}; │ │ │ │ │ -422 } │ │ │ │ │ -423 │ │ │ │ │ -424 template │ │ │ │ │ -_4_2_5 struct _T_r_e_e_P_a_t_h_S_i_z_e<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...> > │ │ │ │ │ -426 : public index_constant │ │ │ │ │ -427 {}; │ │ │ │ │ -428 │ │ │ │ │ -429 │ │ │ │ │ -430 template │ │ │ │ │ -_4_3_1 struct _T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...>,k> │ │ │ │ │ -432 { │ │ │ │ │ -_4_3_3 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...,index_constant> _t_y_p_e; │ │ │ │ │ +412 │ │ │ │ │ +413 typedef typename accumulate_type_over_children< │ │ │ │ │ +414 Node, │ │ │ │ │ +415 Policy, │ │ │ │ │ +416 current_type, │ │ │ │ │ +417 _T_r_e_e_P_a_t_h, │ │ │ │ │ +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 _T_r_e_e_P_a_t_h, │ │ │ │ │ +428 Policy::functor::template doVisit< │ │ │ │ │ +429 Node, │ │ │ │ │ +430 _T_r_e_e_P_a_t_h │ │ │ │ │ +431 >::value │ │ │ │ │ +432 >::type type; │ │ │ │ │ +433 │ │ │ │ │ 434 }; │ │ │ │ │ 435 │ │ │ │ │ -436 template │ │ │ │ │ -_4_3_7 struct _T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...>,k> │ │ │ │ │ -438 { │ │ │ │ │ -_4_3_9 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_k_>,index_constant...> _t_y_p_e; │ │ │ │ │ -440 }; │ │ │ │ │ +437 template │ │ │ │ │ +438 struct accumulate_type │ │ │ │ │ +439 : public │ │ │ │ │ +accumulate_type_generic_composite_node │ │ │ │ │ +440 {}; │ │ │ │ │ 441 │ │ │ │ │ -442 template │ │ │ │ │ -_4_4_3 struct _T_r_e_e_P_a_t_h_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h>> │ │ │ │ │ -444 : public index_constant │ │ │ │ │ -445 {}; │ │ │ │ │ -446 │ │ │ │ │ -447 template │ │ │ │ │ -_4_4_8 struct │ │ │ │ │ -_T_r_e_e_P_a_t_h_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant,index_constant...>> │ │ │ │ │ -449 : public │ │ │ │ │ -_T_r_e_e_P_a_t_h_B_a_c_k,index_constant...>> │ │ │ │ │ -450 {}; │ │ │ │ │ -451 │ │ │ │ │ -452 template │ │ │ │ │ -_4_5_3 struct │ │ │ │ │ -_T_r_e_e_P_a_t_h_F_r_o_n_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant...>> │ │ │ │ │ -454 : public index_constant │ │ │ │ │ -455 {}; │ │ │ │ │ -456 │ │ │ │ │ -457 template │ │ │ │ │ -_4_5_8 struct _T_r_e_e_P_a_t_h_P_o_p_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h>,i...> │ │ │ │ │ -459 { │ │ │ │ │ -_4_6_0 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...> _t_y_p_e; │ │ │ │ │ -461 }; │ │ │ │ │ -462 │ │ │ │ │ -463 template │ │ │ │ │ -_4_6_7 struct │ │ │ │ │ -_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant,index_constant...>,i...> │ │ │ │ │ -468 : public │ │ │ │ │ -_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k,index_constant...>,i...,j> │ │ │ │ │ -469 {}; │ │ │ │ │ -470 │ │ │ │ │ -471 template │ │ │ │ │ -_4_7_2 struct │ │ │ │ │ -_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant...> > │ │ │ │ │ -473 { │ │ │ │ │ -_4_7_4 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...> _t_y_p_e; │ │ │ │ │ -475 }; │ │ │ │ │ -476 │ │ │ │ │ -477 template │ │ │ │ │ -_4_7_8 struct │ │ │ │ │ -_T_r_e_e_P_a_t_h_C_o_n_c_a_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...>,_H_y_b_r_i_d_T_r_e_e_P_a_t_h...> │ │ │ │ │ -> │ │ │ │ │ -479 { │ │ │ │ │ -_4_8_0 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...,index_constant...> _t_y_p_e; │ │ │ │ │ -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 _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& 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 << _t_r_e_e_P_a_t_h_I_n_d_e_x(tp,_i) << " "; │ │ │ │ │ -503 print_hybrid_tree_path(os,tp,index_constant{}); │ │ │ │ │ -504 } │ │ │ │ │ -505 │ │ │ │ │ -506 } // namespace impl │ │ │ │ │ -507 │ │ │ │ │ -508#endif // DOXYGEN │ │ │ │ │ -509 │ │ │ │ │ -511 template │ │ │ │ │ -_5_1_2 std::ostream& _o_p_e_r_a_t_o_r_<_<(std::ostream& os, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_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 │ │ │ │ │ -_5_2_1 using _T_r_e_e_P_a_t_h [[deprecated("use StaticTreePath, this type will be removed │ │ │ │ │ -after DUNE 2.7")]] = _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_D_u_n_e_:_:_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...>; │ │ │ │ │ -522 │ │ │ │ │ -523 template │ │ │ │ │ -_5_2_4 using _S_t_a_t_i_c_T_r_e_e_P_a_t_h = _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_D_u_n_e_:_:_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...>; │ │ │ │ │ +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 > │ │ │ │ │ +_4_6_5 struct _T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y │ │ │ │ │ +466 { │ │ │ │ │ +467 │ │ │ │ │ +_4_9_5 typedef Functor _f_u_n_c_t_o_r; │ │ │ │ │ +496 │ │ │ │ │ +_5_1_6 typedef Reduction _s_i_b_l_i_n_g___r_e_d_u_c_t_i_o_n; │ │ │ │ │ +517 │ │ │ │ │ +_5_2_4 typedef ParentChildReduction _p_a_r_e_n_t___c_h_i_l_d___r_e_d_u_c_t_i_o_n; │ │ │ │ │ 525 │ │ │ │ │ -527 │ │ │ │ │ -528 } // namespace TypeTree │ │ │ │ │ -529} //namespace Dune │ │ │ │ │ -530 │ │ │ │ │ -531#endif // DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ -_f_i_x_e_d_c_a_p_a_c_i_t_y_s_t_a_c_k_._h_h │ │ │ │ │ +_5_3_2 typedef StartType _s_t_a_r_t___t_y_p_e; │ │ │ │ │ +533 │ │ │ │ │ +_5_3_8 typedef ReductionAlgorithm _r_e_d_u_c_t_i_o_n___s_t_r_a_t_e_g_y; │ │ │ │ │ +539 }; │ │ │ │ │ +540 │ │ │ │ │ +541 │ │ │ │ │ +543 │ │ │ │ │ +551 template │ │ │ │ │ +_5_5_2 struct _A_c_c_u_m_u_l_a_t_e_T_y_p_e │ │ │ │ │ +553 { │ │ │ │ │ +554 │ │ │ │ │ +556 typedef typename accumulate_type< │ │ │ │ │ +557 Tree, │ │ │ │ │ +558 Policy, │ │ │ │ │ +559 typename Policy::start_type, │ │ │ │ │ +560 _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_>, │ │ │ │ │ +561 _N_o_d_e_T_a_g_<_T_r_e_e_> │ │ │ │ │ +_5_6_2 >::type _t_y_p_e; │ │ │ │ │ +563 │ │ │ │ │ +564 }; │ │ │ │ │ +565 │ │ │ │ │ +566 │ │ │ │ │ +567 │ │ │ │ │ +568 │ │ │ │ │ +569 │ │ │ │ │ +570 /***************************************************/ │ │ │ │ │ +571 │ │ │ │ │ +_5_7_2 namespace Experimental { │ │ │ │ │ +573 namespace Impl { │ │ │ │ │ +574 │ │ │ │ │ +576 template::isLeaf, int> = 0> │ │ │ │ │ +578 auto hybridApplyToTree(T&& tree, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, V&& visitor, U&& │ │ │ │ │ +current_val) │ │ │ │ │ +579 { │ │ │ │ │ +580 return visitor.leaf(tree, _t_r_e_e_P_a_t_h, std::forward(current_val)); │ │ │ │ │ +581 } │ │ │ │ │ +582 │ │ │ │ │ +584 template::isLeaf, int> = 0> │ │ │ │ │ +586 auto hybridApplyToTree(T&& tree, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h, 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&& _c_h_i_l_d = tree.child(i); │ │ │ │ │ +605 using _C_h_i_l_d = std::decay_t; │ │ │ │ │ +606 │ │ │ │ │ +607 auto val_before = visitor.beforeChild(tree, _c_h_i_l_d, _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h, 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 = _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k(_t_r_e_e_P_a_t_h, i); │ │ │ │ │ +620 return hybridApplyToTree(_c_h_i_l_d, childTreePath, visitor, std::move(val_in)); │ │ │ │ │ +621 } │ │ │ │ │ +622 else │ │ │ │ │ +623 return std::move(val_in); │ │ │ │ │ +624 }(); │ │ │ │ │ +625 │ │ │ │ │ +626 return visitor.afterChild(tree, _c_h_i_l_d, _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h, in_val); │ │ │ │ │ +670 } │ │ │ │ │ +671 │ │ │ │ │ +672 } │ │ │ │ │ +673 │ │ │ │ │ +697 template │ │ │ │ │ +_6_9_8 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init) │ │ │ │ │ +699 { │ │ │ │ │ +700 return Impl::hybridApplyToTree(tree, _h_y_b_r_i_d_T_r_e_e_P_a_t_h(), visitor, init); │ │ │ │ │ +701 } │ │ │ │ │ +702 │ │ │ │ │ +703 } // namespace Experimental │ │ │ │ │ +704 │ │ │ │ │ +706 } // namespace TypeTree │ │ │ │ │ +707} //namespace Dune │ │ │ │ │ +708 │ │ │ │ │ +709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_c_h_i_l_d___r_e_s_u_l_t │ │ │ │ │ +static const result_type child_result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:153 │ │ │ │ │ +_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:110 │ │ │ │ │ +_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d │ │ │ │ │ +typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ +Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:223 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ T... > &tp, std::size_t i) │ │ │ │ │ Appends a run time index to a HybridTreePath. │ │ │ │ │ DDeeffiinniittiioonn treepath.hh:281 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___f_r_o_n_t │ │ │ │ │ -constexpr auto pop_front(const HybridTreePath< T... > &tp) │ │ │ │ │ -Removes first index on a HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:343 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ │ -std::ostream & operator<<(std::ostream &os, const HybridTreePath< T... > &tp) │ │ │ │ │ -Dumps a HybridTreePath to a stream. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:512 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_b_a_c_k │ │ │ │ │ -constexpr auto back(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ -(treePathEntry< sizeof...(T) -1 >(tp)) │ │ │ │ │ -Returns a copy of the last element of the HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:257 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ -constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ -Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:199 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___f_r_o_n_t │ │ │ │ │ -constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t element) │ │ │ │ │ -Prepends a run time index to a HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:312 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ Constructs a new HybridTreePath from the given indices. │ │ │ │ │ DDeeffiinniittiioonn treepath.hh:180 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_r_o_n_t │ │ │ │ │ -constexpr auto front(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ -(treePathEntry< 0 >(tp)) │ │ │ │ │ -Returns a copy of the first element of the HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:270 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_E_n_t_r_y │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:222 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_!_= │ │ │ │ │ -constexpr auto operator!=(const HybridTreePath< S... > &lhs, const │ │ │ │ │ -HybridTreePath< T... > &rhs) │ │ │ │ │ -Compare two HybridTreePaths for unequality. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:408 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_I_n_d_e_x │ │ │ │ │ -constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, │ │ │ │ │ -index_constant< i >={}) │ │ │ │ │ -Returns the index value of the i-th element of the HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:245 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___b_a_c_k │ │ │ │ │ -constexpr auto pop_back(const HybridTreePath< T... > &tp) │ │ │ │ │ -Removes last index on a HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:356 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ Constructs a new HybridTreePath from the given indices. │ │ │ │ │ DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_=_= │ │ │ │ │ -constexpr bool operator==(const HybridTreePath< S... > &lhs, const │ │ │ │ │ -HybridTreePath< T... > &rhs) │ │ │ │ │ -Compare two HybridTreePaths for value equality. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:374 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_r_i_n_t___t_r_e_e___p_a_t_h │ │ │ │ │ -void print_tree_path(std::ostream &os) │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:58 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h │ │ │ │ │ +HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:521 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e │ │ │ │ │ -Type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_f_u_l_l_y_S_t_a_t_i_c │ │ │ │ │ -@ fullyStatic │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c │ │ │ │ │ -@ dynamic │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r__ │ │ │ │ │ +Statically combine two values of type result_type using ||. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:24 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:27 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_r___:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:28 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d__ │ │ │ │ │ +Statically combine two values of type result_type using &&. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:35 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_n_d___:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:39 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s │ │ │ │ │ +Statically combine two values of type result_type using +. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_l_u_s_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s │ │ │ │ │ +Statically combine two values of type result_type using -. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:57 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:60 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_u_s_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:61 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y │ │ │ │ │ +Statically combine two values of type result_type using *. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:68 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:71 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_u_l_t_i_p_l_y_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:72 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n │ │ │ │ │ +Statically combine two values of type result_type by returning their minimum. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:82 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_i_n_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:83 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x │ │ │ │ │ +Statically combine two values of type result_type by returning their maximum. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:90 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_:_:_r_e_d_u_c_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:93 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_a_x_:_:_r_e_d_u_c_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:94 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e │ │ │ │ │ +Statically accumulate a value over the nodes of a TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:259 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e_:_:_r_e_s_u_l_t___t_y_p_e │ │ │ │ │ +Functor::result_type result_type │ │ │ │ │ +The result type of the computation. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:262 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_V_a_l_u_e_:_:_r_e_s_u_l_t │ │ │ │ │ +static const result_type result │ │ │ │ │ +The accumulated result of the computation. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:265 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:466 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_p_a_r_e_n_t___c_h_i_l_d___r_e_d_u_c_t_i_o_n │ │ │ │ │ +ParentChildReduction parent_child_reduction │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:524 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_f_u_n_c_t_o_r │ │ │ │ │ +Functor functor │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:495 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_s_t_a_r_t___t_y_p_e │ │ │ │ │ +StartType start_type │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:532 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_r_e_d_u_c_t_i_o_n___s_t_r_a_t_e_g_y │ │ │ │ │ +ReductionAlgorithm reduction_strategy │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:538 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_y_p_e_A_c_c_u_m_u_l_a_t_i_o_n_P_o_l_i_c_y_:_:_s_i_b_l_i_n_g___r_e_d_u_c_t_i_o_n │ │ │ │ │ +Reduction sibling_reduction │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:516 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_T_y_p_e │ │ │ │ │ +Statically accumulate a type over the nodes of a TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:553 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_c_c_u_m_u_l_a_t_e_T_y_p_e_:_:_t_y_p_e │ │ │ │ │ +accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, │ │ │ │ │ +NodeTag< Tree > >::type type │ │ │ │ │ +The accumulated result of the computation. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:562 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath(HybridTreePath &&tp)=default │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ │ -constexpr HybridTreePath & operator=(const HybridTreePath &tp)=default │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_e_l_e_m_e_n_t │ │ │ │ │ -constexpr std::size_t element(std::size_t pos) const │ │ │ │ │ -Get the index value at position pos. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:145 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath(std::tuple< T... > t) │ │ │ │ │ -Constructor from a std::tuple │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:97 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ │ -constexpr HybridTreePath & operator=(HybridTreePath &&tp)=default │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath(U... t) │ │ │ │ │ -Constructor from arguments. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:103 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath() │ │ │ │ │ -Default constructor. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:87 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_s_i_z_e │ │ │ │ │ -static constexpr std::size_t size() │ │ │ │ │ -Get the size (length) of this path. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:114 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -constexpr auto operator[](Dune::index_constant< i >) const │ │ │ │ │ -Get the index value at position pos. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:121 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_e_l_e_m_e_n_t │ │ │ │ │ -constexpr auto element(Dune::index_constant< i > pos={}) const │ │ │ │ │ -Get the last index value. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:139 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_e_n_u_m_e_r_a_t_e │ │ │ │ │ -static constexpr index_sequence enumerate() │ │ │ │ │ -Returns an index_sequence for enumerating the components of this │ │ │ │ │ -HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:108 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath(const HybridTreePath &tp)=default │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ -constexpr std::size_t operator[](std::size_t pos) const │ │ │ │ │ -Get the index value at position pos. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:127 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_b_a_c_k │ │ │ │ │ -auto back() const │ │ │ │ │ -Get the last index value. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:156 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_i_n_d_e_x___s_e_q_u_e_n_c_e │ │ │ │ │ -std::index_sequence_for< T... > index_sequence │ │ │ │ │ -An index_sequence for the entries in this HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:84 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:34 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:37 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:40 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_B_a_c_k │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:43 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_F_r_o_n_t │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:52 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_C_o_n_c_a_t │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:55 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_,_ _k │ │ │ │ │ -_>_:_:_t_y_p_e │ │ │ │ │ -HybridTreePath< index_constant< i >..., index_constant< k > > type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:433 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_,_ _k │ │ │ │ │ -_>_:_:_t_y_p_e │ │ │ │ │ -HybridTreePath< index_constant< k >, index_constant< i >... > type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:439 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_ _>_,_ _i_._._. │ │ │ │ │ -_>_:_:_t_y_p_e │ │ │ │ │ -HybridTreePath< index_constant< i >... > type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:460 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_, │ │ │ │ │ -_i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_ _>_:_:_t_y_p_e │ │ │ │ │ -HybridTreePath< index_constant< i >... > type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:474 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_C_o_n_c_a_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_, │ │ │ │ │ -_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_._._._ _>_ _>_:_:_t_y_p_e │ │ │ │ │ -HybridTreePath< index_constant< i >..., index_constant< k >... > type │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:480 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filteredcompositenode.hh File Reference │ │ │ │ +dune-typetree: visitor.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,44 +71,109 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
filteredcompositenode.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions | │ │ │ │ +Variables
│ │ │ │ +
visitor.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 <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ +
#include <dune/typetree/treepath.hh>
│ │ │ │ +#include <dune/typetree/utility.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::DefaultVisitor
 Visitor interface and base class for TypeTree visitors. More...
 
struct  Dune::TypeTree::FilteredCompositeNode< Node, Filter >::Child< k >
 Access to the type and storage type of the i-th child. 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::Experimental
 
namespace  Dune::TypeTree::Experimental::Info
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Functions

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

│ │ │ │ +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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,32 +1,106 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -filteredcompositenode.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_l_t_e_r_s_._h_h> │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s | _V_a_r_i_a_b_l_e_s │ │ │ │ │ +visitor.hh File Reference │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ - class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _N_o_d_e_,_ _F_i_l_t_e_r_ _> │ │ │ │ │ -  Base class for composite nodes representing a filtered view on an │ │ │ │ │ - underlying composite node. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ +  Visitor interface and base class for _T_y_p_e_T_r_e_e visitors. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _N_o_d_e_,_ _F_i_l_t_e_r_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ │ -  Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +  Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ +  Hybrid visitor interface and base class for _T_y_p_e_T_r_e_e hybrid visitors. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ +  Mixin base class for visitors that only want to visit the direct │ │ │ │ │ + children of a node. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n_:_:_V_i_s_i_t_C_h_i_l_d_<_ _N_o_d_e_1_,_ _C_h_i_l_d_1_,_ _N_o_d_e_2_, │ │ │ │ │ + _C_h_i_l_d_2_,_ _T_r_e_e_P_a_t_h_ _> │ │ │ │ │ +  Template struct for determining whether or not to visit a given child. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e │ │ │ │ │ +  Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e_:_:_V_i_s_i_t_C_h_i_l_d_<_ _N_o_d_e_1_,_ _C_h_i_l_d_1_,_ _N_o_d_e_2_,_ _C_h_i_l_d_2_, │ │ │ │ │ + _T_r_e_e_P_a_t_h_ _> │ │ │ │ │ +  Template struct for determining whether or not to visit a given child. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +  Mixin base class for visitors that require a static TreePath during │ │ │ │ │ + traversal. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +  Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ + traversal. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_V_i_s_i_t_o_r │ │ │ │ │ +  Convenience base class for visiting the entire tree. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_V_i_s_i_t_o_r │ │ │ │ │ +  Convenience base class for visiting the direct children of a node. │ │ │ │ │ + _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +  Convenience base class for visiting an entire tree pair. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +  Convenience base class for visiting the direct children of a node │ │ │ │ │ + pair. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l │ │ │ │ │ +  │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o │ │ │ │ │ +  │ │ │ │ │ +FFuunnccttiioonnss │ │ │ │ │ +template │ │ │ │ │ + auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h (const Tree &tree) │ │ │ │ │ +  The depth of the _T_y_p_e_T_r_e_e. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h () │ │ │ │ │ +  The depth of the Tree. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t (const Tree │ │ │ │ │ + &tree) │ │ │ │ │ +  The total number of nodes in the Tree. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t (const Tree │ │ │ │ │ + &tree) │ │ │ │ │ +  The number of leaf nodes in the Tree. │ │ │ │ │ +  │ │ │ │ │ +VVaarriiaabblleess │ │ │ │ │ +template │ │ │ │ │ +constexpr bool  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_i_s_D_y_n_a_m_i_c = std:: │ │ │ │ │ + is_same()))> │ │ │ │ │ + {} │ │ │ │ │ +  true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: filteredcompositenode.hh Source File │ │ │ │ +dune-typetree: visitor.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,289 +74,385 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
filteredcompositenode.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_FILTEREDCOMPOSITENODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_VISITOR_HH
│ │ │ │ +
5#define DUNE_TYPETREE_VISITOR_HH
│ │ │ │
6
│ │ │ │ -
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
│ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ +
9
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11 namespace TypeTree {
│ │ │ │ +
12
│ │ │ │
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 };
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
47 {
│ │ │ │ +
48
│ │ │ │ +
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
│ │ │ │ -
74 } // anonymous namespace
│ │ │ │ -
75#endif // DOXYGEN
│ │ │ │ -
76
│ │ │ │ -
77
│ │ │ │ -
79 template<typename Node, typename Filter>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
81 {
│ │ │ │ +
80 template<typename T, typename TreePath>
│ │ │ │ +
81 void post(T&&, TreePath) const {}
│ │ │ │
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 };
│ │ │ │ +
84
│ │ │ │ +
90 template<typename T, typename TreePath>
│ │ │ │ +
91 void leaf(T&&, TreePath) const {}
│ │ │ │ +
92
│ │ │ │
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;
│ │ │ │ +
104 template<typename T, typename Child, typename TreePath, typename ChildIndex>
│ │ │ │ +
105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}
│ │ │ │ +
106
│ │ │ │
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 }
│ │ │ │ +
119 template<typename T, typename Child, typename TreePath, typename ChildIndex>
│ │ │ │ +
120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}
│ │ │ │ +
121
│ │ │ │ +
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 }
│ │ │ │ -
│ │ │ │ +
124
│ │ │ │ +
126
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
162 {
│ │ │ │ +
163
│ │ │ │ +
165
│ │ │ │ +
173 template<typename T1, typename T2, typename TreePath>
│ │ │ │ +
174 void pre(T1&&, T2&&, TreePath) const {}
│ │ │ │ +
175
│ │ │ │
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
│ │ │ │ - │ │ │ │ - │ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ +
constexpr auto depth()
The depth of the Tree.
Definition visitor.hh:514
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,336 +1,482 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -filteredcompositenode.hh │ │ │ │ │ +visitor.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ -5#define DUNE_TYPETREE_FILTEREDCOMPOSITENODE_HH │ │ │ │ │ +4#ifndef DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ +5#define DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_l_t_e_r_s_._h_h> │ │ │ │ │ -13#include │ │ │ │ │ -14#include │ │ │ │ │ -15#include │ │ │ │ │ -16 │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_l_t_e_r_s_._h_h> │ │ │ │ │ -18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ +8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +9 │ │ │ │ │ +10namespace _D_u_n_e { │ │ │ │ │ +11 namespace TypeTree { │ │ │ │ │ +12 │ │ │ │ │ 19 │ │ │ │ │ -20namespace _D_u_n_e { │ │ │ │ │ -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 }; │ │ │ │ │ +_4_6 struct _D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ +47 { │ │ │ │ │ +48 │ │ │ │ │ +50 │ │ │ │ │ +57 template │ │ │ │ │ +_5_8 void _p_r_e(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +59 │ │ │ │ │ +61 │ │ │ │ │ +69 template │ │ │ │ │ +_7_0 void _i_n(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +71 │ │ │ │ │ 73 │ │ │ │ │ -74 } // anonymous namespace │ │ │ │ │ -75#endif // DOXYGEN │ │ │ │ │ -76 │ │ │ │ │ -77 │ │ │ │ │ -79 template │ │ │ │ │ -_8_0 class _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -81 { │ │ │ │ │ +80 template │ │ │ │ │ +_8_1 void _p_o_s_t(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ 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 }; │ │ │ │ │ +84 │ │ │ │ │ +90 template │ │ │ │ │ +_9_1 void _l_e_a_f(T&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +92 │ │ │ │ │ 94 │ │ │ │ │ -95 public: │ │ │ │ │ -96 │ │ │ │ │ -_9_8 typedef _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ -99 │ │ │ │ │ -_1_0_1 typedef typename mapped_children::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ -102 │ │ │ │ │ -_1_0_4 typedef typename mapped_children::ChildTypes _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ -105 │ │ │ │ │ -_1_0_7 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ +104 template │ │ │ │ │ +_1_0_5 void _b_e_f_o_r_e_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex) const {} │ │ │ │ │ +106 │ │ │ │ │ 108 │ │ │ │ │ -_1_1_0 static const bool _i_s_P_o_w_e_r = false; │ │ │ │ │ -111 │ │ │ │ │ -_1_1_3 static const bool _i_s_C_o_m_p_o_s_i_t_e = true; │ │ │ │ │ -114 │ │ │ │ │ -116 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -_1_1_7 static const std::size_t _C_H_I_L_D_R_E_N = filter_result::size; │ │ │ │ │ -118 │ │ │ │ │ -_1_1_9 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ -120 { │ │ │ │ │ -121 return std::integral_constant{}; │ │ │ │ │ -122 } │ │ │ │ │ +119 template │ │ │ │ │ +_1_2_0 void _a_f_t_e_r_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex) const {} │ │ │ │ │ +121 │ │ │ │ │ +122 }; │ │ │ │ │ 123 │ │ │ │ │ -125 template │ │ │ │ │ -_1_2_6 struct _C_h_i_l_d { │ │ │ │ │ -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 │ │ │ │ │ -_1_3_7 typedef typename OriginalChild::Type _T_y_p_e; │ │ │ │ │ -138 │ │ │ │ │ -_1_4_0 typedef typename OriginalChild::type _t_y_p_e; │ │ │ │ │ -141 }; │ │ │ │ │ -142 │ │ │ │ │ -145 │ │ │ │ │ -147 │ │ │ │ │ -150 template::value, int>::type = 0> │ │ │ │ │ -_1_5_2 auto& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ -153 { │ │ │ │ │ -154 return _node->template child::mapped_index>(); │ │ │ │ │ -155 } │ │ │ │ │ -156 │ │ │ │ │ -158 │ │ │ │ │ -161 template │ │ │ │ │ -_1_6_2 const auto& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ -163 { │ │ │ │ │ -164 return _node->template child::mapped_index>(); │ │ │ │ │ -165 } │ │ │ │ │ -166 │ │ │ │ │ -168 │ │ │ │ │ -171 template::value, int>::type = 0> │ │ │ │ │ -_1_7_3 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) │ │ │ │ │ -174 { │ │ │ │ │ -175 return _node->template childStorage::mapped_index>(); │ │ │ │ │ -176 } │ │ │ │ │ +124 │ │ │ │ │ +126 │ │ │ │ │ +_1_6_1 struct _D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +162 { │ │ │ │ │ +163 │ │ │ │ │ +165 │ │ │ │ │ +173 template │ │ │ │ │ +_1_7_4 void _p_r_e(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +175 │ │ │ │ │ 177 │ │ │ │ │ -179 │ │ │ │ │ -182 template │ │ │ │ │ -_1_8_3 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) const │ │ │ │ │ -184 { │ │ │ │ │ -185 return _node->template childStorage::mapped_index>(); │ │ │ │ │ -186 } │ │ │ │ │ -187 │ │ │ │ │ -189 template │ │ │ │ │ -_1_9_0 void _s_e_t_C_h_i_l_d (ChildType&& _c_h_i_l_d, typename std::enable_if:: │ │ │ │ │ -value,void*>::type = 0) │ │ │ │ │ -191 { │ │ │ │ │ -192 _node->template setChild::mapped_index>(std::forward │ │ │ │ │ -(_c_h_i_l_d)); │ │ │ │ │ -193 } │ │ │ │ │ -194 │ │ │ │ │ -196 │ │ │ │ │ -199 │ │ │ │ │ -200 protected: │ │ │ │ │ -201 │ │ │ │ │ -203 │ │ │ │ │ -206 template │ │ │ │ │ -207 typename std::enable_if::type │ │ │ │ │ -_2_0_8 _u_n_f_i_l_t_e_r_e_d () │ │ │ │ │ -209 { │ │ │ │ │ -210 return *_node; │ │ │ │ │ -211 } │ │ │ │ │ -212 │ │ │ │ │ -214 │ │ │ │ │ -_2_1_7 const Node& _u_n_f_i_l_t_e_r_e_d () const │ │ │ │ │ -218 { │ │ │ │ │ -219 return *_node; │ │ │ │ │ -220 } │ │ │ │ │ -221 │ │ │ │ │ -223 │ │ │ │ │ -226 template │ │ │ │ │ -227 typename std::enable_if >::type │ │ │ │ │ -_2_2_8 _u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e () │ │ │ │ │ -229 { │ │ │ │ │ -230 return _node; │ │ │ │ │ -231 } │ │ │ │ │ -232 │ │ │ │ │ -234 │ │ │ │ │ -_2_3_7 std::shared_ptr _u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e () const │ │ │ │ │ -238 { │ │ │ │ │ -239 return _node; │ │ │ │ │ -240 } │ │ │ │ │ -241 │ │ │ │ │ -243 │ │ │ │ │ -244 public: │ │ │ │ │ -245 │ │ │ │ │ -248 │ │ │ │ │ -_2_5_0 _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e (std::shared_ptr node) │ │ │ │ │ -251 : _node(std::move(node)) │ │ │ │ │ -252 {} │ │ │ │ │ -253 │ │ │ │ │ -_2_5_5 _F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e (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 │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_f_i_l_t_e_r_s_._h_h │ │ │ │ │ +186 template │ │ │ │ │ +_1_8_7 void _i_n(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +188 │ │ │ │ │ +190 │ │ │ │ │ +198 template │ │ │ │ │ +_1_9_9 void _p_o_s_t(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +200 │ │ │ │ │ +202 │ │ │ │ │ +213 template │ │ │ │ │ +_2_1_4 void _l_e_a_f(T1&&, T2&&, _T_r_e_e_P_a_t_h) const {} │ │ │ │ │ +215 │ │ │ │ │ +217 │ │ │ │ │ +229 template │ │ │ │ │ +_2_3_0 void _b_e_f_o_r_e_C_h_i_l_d(T1&&, Child1&&, T2&&, Child2&&, _T_r_e_e_P_a_t_h, ChildIndex) │ │ │ │ │ +const {} │ │ │ │ │ +231 │ │ │ │ │ +233 │ │ │ │ │ +245 template │ │ │ │ │ +_2_4_6 void _a_f_t_e_r_C_h_i_l_d(T1&&, Child1&&, T2&&, Child2&&, _T_r_e_e_P_a_t_h, ChildIndex) const │ │ │ │ │ +{} │ │ │ │ │ +247 │ │ │ │ │ +248 }; │ │ │ │ │ +249 │ │ │ │ │ +250 │ │ │ │ │ +251 namespace Experimental { │ │ │ │ │ +252 │ │ │ │ │ +_2_8_3 struct _D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ +284 { │ │ │ │ │ +285 │ │ │ │ │ +293 template │ │ │ │ │ +_2_9_4 auto _p_r_e(T&&, _T_r_e_e_P_a_t_h, const U& u) const { return u;} │ │ │ │ │ +295 │ │ │ │ │ +303 template │ │ │ │ │ +_3_0_4 auto _i_n(T&&, _T_r_e_e_P_a_t_h, const U& u) const {return u;} │ │ │ │ │ +305 │ │ │ │ │ +313 template │ │ │ │ │ +_3_1_4 auto _p_o_s_t(T&&, _T_r_e_e_P_a_t_h, const U& u) const {return u;} │ │ │ │ │ +315 │ │ │ │ │ +323 template │ │ │ │ │ +_3_2_4 auto _l_e_a_f(T&&, _T_r_e_e_P_a_t_h, const U& u) const { return u;} │ │ │ │ │ +325 │ │ │ │ │ +333 template │ │ │ │ │ +_3_3_4 auto _b_e_f_o_r_e_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex, const U& u) const │ │ │ │ │ +{return u;} │ │ │ │ │ +335 │ │ │ │ │ +343 template │ │ │ │ │ +_3_4_4 auto _a_f_t_e_r_C_h_i_l_d(T&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex, const U& u) const │ │ │ │ │ +{return u;} │ │ │ │ │ +345 │ │ │ │ │ +346 }; │ │ │ │ │ +347 } // namespace Experimental │ │ │ │ │ +348 │ │ │ │ │ +350 │ │ │ │ │ +_3_5_5 struct _V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ +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 │ │ │ │ │ +_3_6_7 struct _V_i_s_i_t_C_h_i_l_d │ │ │ │ │ +368 { │ │ │ │ │ +_3_7_0 static const bool _v_a_l_u_e = false; │ │ │ │ │ +371 }; │ │ │ │ │ +372 │ │ │ │ │ +373 }; │ │ │ │ │ +374 │ │ │ │ │ +375 │ │ │ │ │ +377 │ │ │ │ │ +_3_8_1 struct _V_i_s_i_t_T_r_e_e │ │ │ │ │ +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 │ │ │ │ │ +_3_9_3 struct _V_i_s_i_t_C_h_i_l_d │ │ │ │ │ +394 { │ │ │ │ │ +_3_9_6 static const bool _v_a_l_u_e = true; │ │ │ │ │ +397 }; │ │ │ │ │ +398 │ │ │ │ │ +399 }; │ │ │ │ │ +400 │ │ │ │ │ +402 │ │ │ │ │ +_4_0_9 struct _S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +410 { │ │ │ │ │ +_4_1_2 static const _T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e _t_r_e_e_P_a_t_h_T_y_p_e = _T_r_e_e_P_a_t_h_T_y_p_e_:_:_f_u_l_l_y_S_t_a_t_i_c; │ │ │ │ │ +413 }; │ │ │ │ │ +414 │ │ │ │ │ +416 │ │ │ │ │ +_4_2_3 struct _D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +424 { │ │ │ │ │ +_4_2_6 static const _T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e _t_r_e_e_P_a_t_h_T_y_p_e = _T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c; │ │ │ │ │ +427 }; │ │ │ │ │ +428 │ │ │ │ │ +_4_3_0 struct _T_r_e_e_V_i_s_i_t_o_r │ │ │ │ │ +431 : public _D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ +432 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ +433 {}; │ │ │ │ │ +434 │ │ │ │ │ +_4_3_6 struct _D_i_r_e_c_t_C_h_i_l_d_r_e_n_V_i_s_i_t_o_r │ │ │ │ │ +437 : public _D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ +438 , public _V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ +439 {}; │ │ │ │ │ +440 │ │ │ │ │ +_4_4_2 struct _T_r_e_e_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +443 : public _D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +444 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ +445 {}; │ │ │ │ │ +446 │ │ │ │ │ +_4_4_8 struct _D_i_r_e_c_t_C_h_i_l_d_r_e_n_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +449 : public _D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +450 , public _V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ +451 {}; │ │ │ │ │ +452 │ │ │ │ │ +_4_5_3 namespace Experimental::Info { │ │ │ │ │ +454 │ │ │ │ │ +_4_5_5 struct _L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +456 : public _D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ +457 , public _S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +458 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ +459 { │ │ │ │ │ +460 template │ │ │ │ │ +_4_6_1 auto _b_e_f_o_r_e_C_h_i_l_d(Tree&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, ChildIndex, U u) const { │ │ │ │ │ +462 // in this case child index is an integral constant: forward u │ │ │ │ │ +463 return u; │ │ │ │ │ +464 } │ │ │ │ │ +465 │ │ │ │ │ +466 template │ │ │ │ │ +_4_6_7 std::size_t _b_e_f_o_r_e_C_h_i_l_d(Tree&&, _C_h_i_l_d&&, _T_r_e_e_P_a_t_h, 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 │ │ │ │ │ +_4_7_3 auto _l_e_a_f(Tree&&, _T_r_e_e_P_a_t_h, U u) const │ │ │ │ │ +474 { │ │ │ │ │ +475 return Hybrid::plus(u,Dune::Indices::_1); │ │ │ │ │ +476 } │ │ │ │ │ +477 │ │ │ │ │ +478 }; │ │ │ │ │ +479 │ │ │ │ │ +_4_8_0 struct _N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +481 : public _L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +482 { │ │ │ │ │ +483 template │ │ │ │ │ +_4_8_4 auto _p_r_e(Tree&&, _T_r_e_e_P_a_t_h, U u) const { │ │ │ │ │ +485 return Hybrid::plus(u,Indices::_1); │ │ │ │ │ +486 } │ │ │ │ │ +487 }; │ │ │ │ │ +488 │ │ │ │ │ +_4_8_9 struct _D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ +490 : public _D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ +491 , public _S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +492 , public _V_i_s_i_t_T_r_e_e │ │ │ │ │ +493 { │ │ │ │ │ +494 template │ │ │ │ │ +_4_9_5 auto _l_e_a_f(Tree&&, _T_r_e_e_P_a_t_h, U u) const │ │ │ │ │ +496 { │ │ │ │ │ +497 auto path_size = index_constant<_t_r_e_e_P_a_t_h_S_i_z_e(_T_r_e_e_P_a_t_h{})>{}; │ │ │ │ │ +498 auto _d_e_p_t_h = Hybrid::plus(path_size,Indices::_1); │ │ │ │ │ +499 return Hybrid::max(_d_e_p_t_h,u); │ │ │ │ │ +500 } │ │ │ │ │ +501 }; │ │ │ │ │ +502 │ │ │ │ │ +504 // result is alwayas an integral constant │ │ │ │ │ +505 template │ │ │ │ │ +_5_0_6 auto _d_e_p_t_h(const Tree& tree) │ │ │ │ │ +507 { │ │ │ │ │ +508 return _h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(tree,_D_e_p_t_h_V_i_s_i_t_o_r{},Indices::_0); │ │ │ │ │ +509 } │ │ │ │ │ +510 │ │ │ │ │ +512 // return types is std::integral_constant. │ │ │ │ │ +513 template │ │ │ │ │ +_5_1_4 constexpr auto _d_e_p_t_h() │ │ │ │ │ +515 { │ │ │ │ │ +516 return decltype(_h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(std::declval(),_D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ +{},Indices::_0)){}; │ │ │ │ │ +517 } │ │ │ │ │ +518 │ │ │ │ │ +520 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +521 template │ │ │ │ │ +_5_2_2 auto _n_o_d_e_C_o_u_n_t(const Tree& tree) │ │ │ │ │ +523 { │ │ │ │ │ +524 return _h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(tree,_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r{},Indices::_0); │ │ │ │ │ +525 } │ │ │ │ │ +526 │ │ │ │ │ +528 // if Tree is dynamic, return type is std::size_t, otherwise std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +529 template │ │ │ │ │ +_5_3_0 auto _l_e_a_f_C_o_u_n_t(const Tree& tree) │ │ │ │ │ +531 { │ │ │ │ │ +532 return _h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e(tree,_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r{},Dune::Indices::_0); │ │ │ │ │ +533 } │ │ │ │ │ +534 │ │ │ │ │ +536 template │ │ │ │ │ +_5_3_7 constexpr bool _i_s_D_y_n_a_m_i_c = std::is_same()))>{}; │ │ │ │ │ +538 │ │ │ │ │ +539 } // namespace Experimental::Info │ │ │ │ │ +540 │ │ │ │ │ +542 │ │ │ │ │ +543 } // namespace TypeTree │ │ │ │ │ +544} //namespace Dune │ │ │ │ │ +545 │ │ │ │ │ +546#endif // DUNE_TYPETREE_VISITOR_HH │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_h_i_l_d │ │ │ │ │ +typename impl::_Child< Node, indices... >::type Child │ │ │ │ │ +Template alias for the type of a child node given by a list of child indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:223 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ +constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ +Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:199 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -Base class for composite nodes representing a filtered view on an underlying │ │ │ │ │ -composite node. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:81 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -auto childStorage(index_constant< k >={}) const │ │ │ │ │ -Returns the storage of the k-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:183 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ -static constexpr auto degree() │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:119 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ -mapped_children::NodeStorage NodeStorage │ │ │ │ │ -The type used for storing the children. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:101 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ -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. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:190 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ -static const bool isLeaf │ │ │ │ │ -Mark this class as non leaf in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:107 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d │ │ │ │ │ -const Node & unfiltered() const │ │ │ │ │ -Returns the unfiltered node (const version). │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:217 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a composite in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:113 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e │ │ │ │ │ -std::enable_if< enabled, std::shared_ptr< Node > >::type unfilteredStorage() │ │ │ │ │ -Returns the storage object of the unfiltered node. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:228 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ -static const bool isPower │ │ │ │ │ -Mark this class as a non power in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:110 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -FilteredCompositeNode(Node &node) │ │ │ │ │ -Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:255 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ -FilteredCompositeNode(std::shared_ptr< Node > node) │ │ │ │ │ -Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:250 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ -auto childStorage(index_constant< k >={}) │ │ │ │ │ -Returns the storage of the k-th child. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:173 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -const auto & child(index_constant< k >={}) const │ │ │ │ │ -Returns the k-th child (const version). │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:162 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ -auto & child(index_constant< k >={}) │ │ │ │ │ -Returns the k-th child. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:152 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -CompositeNodeTag NodeTag │ │ │ │ │ -The type tag that describes a CompositeNode. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:98 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ -mapped_children::ChildTypes ChildTypes │ │ │ │ │ -A tuple storing the types of all children. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:104 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d │ │ │ │ │ -std::enable_if< enabled, Node & >::type unfiltered() │ │ │ │ │ -Returns the unfiltered node. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:208 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -The number of children. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:117 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_u_n_f_i_l_t_e_r_e_d_S_t_o_r_a_g_e │ │ │ │ │ -std::shared_ptr< const Node > unfilteredStorage() const │ │ │ │ │ -Returns the storage object of the unfiltered node (const version). │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:237 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ │ -Access to the type and storage type of the i-th child. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ │ -OriginalChild::type type │ │ │ │ │ -The type of the child. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:140 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_F_i_l_t_e_r_e_d_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ │ -OriginalChild::Type Type │ │ │ │ │ -The type of the child. │ │ │ │ │ -DDeeffiinniittiioonn filteredcompositenode.hh:137 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a composite node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_h_y_b_r_i_d_A_p_p_l_y_T_o_T_r_e_e │ │ │ │ │ +auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init) │ │ │ │ │ +Apply hybrid visitor to TypeTree. │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:698 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e │ │ │ │ │ +Type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_f_u_l_l_y_S_t_a_t_i_c │ │ │ │ │ +@ fullyStatic │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c │ │ │ │ │ +@ dynamic │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_i_s_D_y_n_a_m_i_c │ │ │ │ │ +constexpr bool isDynamic │ │ │ │ │ +true if any of the nodes in the tree only has dynamic degree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:537 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_l_e_a_f_C_o_u_n_t │ │ │ │ │ +auto leafCount(const Tree &tree) │ │ │ │ │ +The number of leaf nodes in the Tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:530 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_n_o_d_e_C_o_u_n_t │ │ │ │ │ +auto nodeCount(const Tree &tree) │ │ │ │ │ +The total number of nodes in the Tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:522 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_d_e_p_t_h │ │ │ │ │ +constexpr auto depth() │ │ │ │ │ +The depth of the Tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:514 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r │ │ │ │ │ +Visitor interface and base class for TypeTree visitors. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:47 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_i_n │ │ │ │ │ +void in(T &&, TreePath) const │ │ │ │ │ +Method for infix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:70 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_a_f_t_e_r_C_h_i_l_d │ │ │ │ │ +void afterChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ +Method for child-parent traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:120 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ +void beforeChild(T &&, Child &&, TreePath, ChildIndex) const │ │ │ │ │ +Method for parent-child traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:105 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_p_o_s_t │ │ │ │ │ +void post(T &&, TreePath) const │ │ │ │ │ +Method for postfix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:81 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +void leaf(T &&, TreePath) const │ │ │ │ │ +Method for leaf traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:91 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ +void pre(T &&, TreePath) const │ │ │ │ │ +Method for prefix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:58 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +Visitor interface and base class for visitors of pairs of TypeTrees. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:162 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +void leaf(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for leaf traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:214 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ +void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) │ │ │ │ │ +const │ │ │ │ │ +Method for parent-child traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:230 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ +void pre(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for prefix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:174 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_p_o_s_t │ │ │ │ │ +void post(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for postfix traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:199 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_i_n │ │ │ │ │ +void in(T1 &&, T2 &&, TreePath) const │ │ │ │ │ +Method for infix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:187 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_f_a_u_l_t_P_a_i_r_V_i_s_i_t_o_r_:_:_a_f_t_e_r_C_h_i_l_d │ │ │ │ │ +void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const │ │ │ │ │ +Method for child-parent traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:246 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r │ │ │ │ │ +Hybrid visitor interface and base class for TypeTree hybrid visitors. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:284 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_p_o_s_t │ │ │ │ │ +auto post(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for postfix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:314 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ +auto pre(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for prefix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:294 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +auto leaf(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for leaf traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:324 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_a_f_t_e_r_C_h_i_l_d │ │ │ │ │ +auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ +Method for child-parent traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:344 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_i_n │ │ │ │ │ +auto in(T &&, TreePath, const U &u) const │ │ │ │ │ +Method for infix tree traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:304 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_D_e_f_a_u_l_t_H_y_b_r_i_d_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ +auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const │ │ │ │ │ +Method for parent-child traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:334 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n │ │ │ │ │ +Mixin base class for visitors that only want to visit the direct children of a │ │ │ │ │ +node. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:356 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n_:_:_V_i_s_i_t_C_h_i_l_d │ │ │ │ │ +Template struct for determining whether or not to visit a given child. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:368 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_D_i_r_e_c_t_C_h_i_l_d_r_e_n_:_:_V_i_s_i_t_C_h_i_l_d_:_:_v_a_l_u_e │ │ │ │ │ +static const bool value │ │ │ │ │ +Do not visit any child. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:370 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e │ │ │ │ │ +Mixin base class for visitors that want to visit the complete tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:382 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e_:_:_V_i_s_i_t_C_h_i_l_d │ │ │ │ │ +Template struct for determining whether or not to visit a given child. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:394 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_V_i_s_i_t_T_r_e_e_:_:_V_i_s_i_t_C_h_i_l_d_:_:_v_a_l_u_e │ │ │ │ │ +static const bool value │ │ │ │ │ +Visit any child. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:396 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +Mixin base class for visitors that require a static TreePath during traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:410 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_a_v_e_r_s_a_l_:_:_t_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ +static const TreePathType::Type treePathType │ │ │ │ │ +Use the static tree traversal algorithm. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:412 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l │ │ │ │ │ +Mixin base class for visitors that only need a dynamic TreePath during │ │ │ │ │ +traversal. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:424 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_T_r_a_v_e_r_s_a_l_:_:_t_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ +static const TreePathType::Type treePathType │ │ │ │ │ +Use the dynamic tree traversal algorithm. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:426 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_V_i_s_i_t_o_r │ │ │ │ │ +Convenience base class for visiting the entire tree. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:433 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_V_i_s_i_t_o_r │ │ │ │ │ +Convenience base class for visiting the direct children of a node. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:439 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +Convenience base class for visiting an entire tree pair. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:445 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_i_r_e_c_t_C_h_i_l_d_r_e_n_P_a_i_r_V_i_s_i_t_o_r │ │ │ │ │ +Convenience base class for visiting the direct children of a node pair. │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:451 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:459 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:473 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ +auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:461 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_L_e_a_f_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_b_e_f_o_r_e_C_h_i_l_d │ │ │ │ │ +std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:467 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:482 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_N_o_d_e_C_o_u_n_t_e_r_V_i_s_i_t_o_r_:_:_p_r_e │ │ │ │ │ +auto pre(Tree &&, TreePath, U u) const │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:484 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_D_e_p_t_h_V_i_s_i_t_o_r │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:493 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_p_e_r_i_m_e_n_t_a_l_:_:_I_n_f_o_:_:_D_e_p_t_h_V_i_s_i_t_o_r_:_:_l_e_a_f │ │ │ │ │ +auto leaf(Tree &&, TreePath, U u) const │ │ │ │ │ +DDeeffiinniittiioonn visitor.hh:495 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html │ │ │ │ @@ -79,18 +79,18 @@ │ │ │ │ Functions
│ │ │ │
traversal.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/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.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00071_source.html │ │ │ │ @@ -88,18 +88,18 @@ │ │ │ │
5#define DUNE_TYPETREE_TRAVERSAL_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 {
│ │ │ │
19
│ │ │ │
25#ifndef DOXYGEN
│ │ │ │
27 struct NoOp
│ │ │ │
28 {
│ │ │ │ @@ -334,18 +334,18 @@ │ │ │ │ │ │ │ │
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
│ │ │ │
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
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -267,17 +267,17 @@ │ │ │ │ │ 307 } │ │ │ │ │ 308 │ │ │ │ │ 310 │ │ │ │ │ 311 } // namespace TypeTree │ │ │ │ │ 312} //namespace Dune │ │ │ │ │ 313 │ │ │ │ │ 314#endif // DUNE_TYPETREE_TRAVERSAL_HH │ │ │ │ │ -_v_i_s_i_t_o_r_._h_h │ │ │ │ │ -_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ +_v_i_s_i_t_o_r_._h_h │ │ │ │ │ _t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_o_r_E_a_c_h_N_o_d_e │ │ │ │ │ void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc │ │ │ │ │ &&postFunc) │ │ │ │ │ Traverse tree and visit each node. │ │ │ │ │ DDeeffiinniittiioonn traversal.hh:256 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_e_a_f_T_r_e_e_P_a_t_h_T_u_p_l_e │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetraits.hh File Reference │ │ │ │ +dune-typetree: treepath.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,99 +72,162 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ +Typedefs | │ │ │ │ +Enumerations | │ │ │ │ Functions
│ │ │ │ -
typetraits.hh File Reference
│ │ │ │ +
treepath.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ +
#include <cstddef>
│ │ │ │ +#include <iostream>
│ │ │ │ +#include <dune/common/documentation.hh>
│ │ │ │ #include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/typetree/treepath.hh>
│ │ │ │ -#include <dune/typetree/nodeinterface.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
 
│ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Dune::first_type< T0, T... >
class  Dune::TypeTree::HybridTreePath< T >
 A hybrid version of TreePath that supports both compile time and run time indices. More...
 
struct  Dune::TypeTree::has_node_tag< T >
struct  Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >
 
struct  Dune::TypeTree::has_node_tag< T >::yes
struct  Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k >
 
struct  Dune::TypeTree::has_node_tag< T >::no
struct  Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::maybe< N >
struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::yes
struct  Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
 
struct  Dune::TypeTree::has_node_tag_value< T, V >::no
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... >
 
struct  Dune::TypeTree::has_implementation_tag< T >
struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >
 
struct  Dune::TypeTree::has_implementation_tag< T >::yes
struct  Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
 
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...
struct  Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::impl
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<typename T >
T * Dune::TypeTree::declptr ()
 Helper function for generating a pointer to a value of type T in an unevaluated operand setting.
 
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.
 
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.
 
template<typename... T>
constexpr HybridTreePath< T... > Dune::TypeTree::treePath (const T &... t)
 Constructs a new HybridTreePath from the given indices.
 
template<typename... T>
constexpr std::size_t Dune::TypeTree::treePathSize (const HybridTreePath< T... > &)
 Returns the size (number of components) of the given HybridTreePath.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
template<class... T>
constexpr auto Dune::TypeTree::pop_front (const HybridTreePath< T... > &tp)
 Removes first index on a HybridTreePath.
 
template<class... T>
constexpr auto Dune::TypeTree::pop_back (const HybridTreePath< T... > &tp)
 Removes last index on a HybridTreePath.
 
template<class... S, class... T>
constexpr bool Dune::TypeTree::operator== (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for value equality.
 
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.
 
template<class... S, class... T>
constexpr auto Dune::TypeTree::operator!= (const HybridTreePath< S... > &lhs, const HybridTreePath< T... > &rhs)
 Compare two HybridTreePaths for unequality.
 
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.
 
template<typename... T>
std::ostream & Dune::TypeTree::operator<< (std::ostream &os, const HybridTreePath< T... > &tp)
 Dumps a HybridTreePath to a stream.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,87 +1,204 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -typetraits.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s | _T_y_p_e_d_e_f_s | _E_n_u_m_e_r_a_t_i_o_n_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ +treepath.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_x_e_d_c_a_p_a_c_i_t_y_s_t_a_c_k_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_f_i_r_s_t___t_y_p_e_<_ _T_0_,_ _T_._._._ _> │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _T_ _> │ │ │ │ │ +  A hybrid version of TreePath that supports both compile time and run │ │ │ │ │ + time indices. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_<_ _T_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_S_i_z_e_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _> │ │ │ │ │ + _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_<_ _T_ _>_:_:_y_e_s │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i │ │ │ │ │ + _>_._._._ _>_,_ _k_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_<_ _T_ _>_:_:_n_o │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i │ │ │ │ │ + _>_._._._ _>_,_ _k_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_ _>_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_m_a_y_b_e_<_ _N_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _j_ _>_, │ │ │ │ │ + _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_,_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _l_ _>_._._._ _>_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_y_e_s │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_, │ │ │ │ │ + _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_n_o │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _> │ │ │ │ │ + _>_,_ _i_._._._ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_<_ _T_ _> │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _j_ _>_, │ │ │ │ │ + _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_,_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _l_ _>_._._._ _>_,_ _i_._._._ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_<_ _T_ _>_:_:_y_e_s │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_, │ │ │ │ │ + _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_ _> │ │ │ │ │   │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_<_ _T_ _>_:_:_n_o │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_m_a_y_b_e_<_ _N_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_y_e_s │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_<_ _T_,_ _V_ _>_:_:_n_o │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_l_w_a_y_s_V_o_i_d_<_ _t_y_p_e_n_a_m_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ -  Marker tag declaring a meta function. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___e_v_a_l_u_a_t_e_<_ _F_ _> │ │ │ │ │ -  Helper meta function to delay evaluation of F. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___i_d_e_n_t_i_t_y_<_ _F_ _> │ │ │ │ │ -  Identity function. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n_<_ _F_ _> │ │ │ │ │ -  Meta function that evaluates its argument iff it inherits from │ │ │ │ │ - _m_e_t_a___f_u_n_c_t_i_o_n. _M_o_r_e_._._. │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h_<_ _T_ _> │ │ │ │ │ -  Check if type represents a tree path. _M_o_r_e_._._. │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_C_o_n_c_a_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._. │ │ │ │ │ + _>_,_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_._._._ _>_ _> │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e │ │ │ │ │ +  │ │ │ │ │ +TTyyppeeddeeffss │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h = _H_y_b_r_i_d_T_r_e_e_P_a_t_h< Dune::index_constant< i >... │ │ │ │ │ + > │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +using  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_T_r_e_e_P_a_t_h = _H_y_b_r_i_d_T_r_e_e_P_a_t_h< Dune::index_constant< i │ │ │ │ │ + >... > │ │ │ │ │ +  │ │ │ │ │ +EEnnuummeerraattiioonnss │ │ │ │ │ +enum   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e { _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_: │ │ │ │ │ + _f_u_l_l_y_S_t_a_t_i_c , _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c } │ │ │ │ │   │ │ │ │ │ FFuunnccttiioonnss │ │ │ │ │ -template │ │ │ │ │ - T *  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_c_l_p_t_r () │ │ │ │ │ -  Helper function for generating a pointer to a value of type T │ │ │ │ │ - in an unevaluated operand setting. │ │ │ │ │ -  │ │ │ │ │ -constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l_:_:_i_s_T_r_e_e_P_a_t_h (void *) -> std::false_type │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l_:_:_i_s_T_r_e_e_P_a_t_h (const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< I... > │ │ │ │ │ - *) -> std::true_type │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s_T_r_e_e_P_a_t_h (const T &) -> _I_s_T_r_e_e_P_a_t_h< T > │ │ │ │ │ -  Check if given object represents a tree path. │ │ │ │ │ +template │ │ │ │ │ + void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_r_i_n_t___t_r_e_e___p_a_t_h (std:: │ │ │ │ │ + ostream &os) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_r_i_n_t___t_r_e_e___p_a_t_h (std:: │ │ │ │ │ + ostream &os) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... >  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h (const T │ │ │ │ │ + &... t) │ │ │ │ │ +  Constructs a new _H_y_b_r_i_d_T_r_e_e_P_a_t_h from the │ │ │ │ │ + given indices. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... >  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h (const T &... │ │ │ │ │ + t) │ │ │ │ │ +  Constructs a new _H_y_b_r_i_d_T_r_e_e_P_a_t_h from the │ │ │ │ │ + given indices. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr std::size_t  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &) │ │ │ │ │ +  Returns the size (number of components) │ │ │ │ │ + of the given _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_E_n_t_r_y (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< 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 _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr std::size_t  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_I_n_d_e_x (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, │ │ │ │ │ + index_constant< i >={}) │ │ │ │ │ +  Returns the index value of the i-th │ │ │ │ │ + element of the _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template 0), bool >:: │ │ │ │ │ +type = true> │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_b_a_c_k (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) -> decltype │ │ │ │ │ + (_t_r_e_e_P_a_t_h_E_n_t_r_y< sizeof...(T) -1 >(tp)) │ │ │ │ │ +  Returns a copy of the last element of │ │ │ │ │ + the _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_r_o_n_t (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) -> decltype │ │ │ │ │ + (_t_r_e_e_P_a_t_h_E_n_t_r_y< 0 >(tp)) │ │ │ │ │ +  Returns a copy of the first element of │ │ │ │ │ + the _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T..., std:: _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k (const │ │ │ │ │ + size_t >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, std::size_t │ │ │ │ │ + i) │ │ │ │ │ +  Appends a run time index to a │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T..., _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k (const │ │ │ │ │ + index_constant< i > >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, │ │ │ │ │ + index_constant< i > i_={}) │ │ │ │ │ +  Appends a compile time index to a │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< std::size_t, _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___f_r_o_n_t (const │ │ │ │ │ + T... >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, std::size_t │ │ │ │ │ + element) │ │ │ │ │ +  Prepends a run time index to a │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h< _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___f_r_o_n_t (const │ │ │ │ │ + index_constant< i >, T... >  _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp, │ │ │ │ │ + index_constant< i > _i={}) │ │ │ │ │ +  Prepends a compile time index to a │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___f_r_o_n_t (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) │ │ │ │ │ +  Removes first index on a _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___b_a_c_k (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) │ │ │ │ │ +  Removes last index on a _H_y_b_r_i_d_T_r_e_e_P_a_t_h. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr bool  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_=_= (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< S... > &lhs, const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &rhs) │ │ │ │ │ +  Compare two _H_y_b_r_i_d_T_r_e_e_P_a_t_hs for value │ │ │ │ │ + equality. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_=_= (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< std::integral_constant< │ │ │ │ │ + S, lhs >... > &, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< │ │ │ │ │ + std::integral_constant< T, rhs >... > &) │ │ │ │ │ +  Overload for purely static │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_hs. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_!_= (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< S... > &lhs, const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &rhs) │ │ │ │ │ +  Compare two _H_y_b_r_i_d_T_r_e_e_P_a_t_hs for │ │ │ │ │ + unequality. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + constexpr auto  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_!_= (const │ │ │ │ │ + _H_y_b_r_i_d_T_r_e_e_P_a_t_h< std::integral_constant< │ │ │ │ │ + S, lhs >... > &, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< │ │ │ │ │ + std::integral_constant< T, rhs >... > &) │ │ │ │ │ +  Compare two static _H_y_b_r_i_d_T_r_e_e_P_a_t_hs for │ │ │ │ │ + unequality. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + std::ostream &  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_<_< (std::ostream │ │ │ │ │ + &os, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h< T... > &tp) │ │ │ │ │ +  Dumps a _H_y_b_r_i_d_T_r_e_e_P_a_t_h to a stream. │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00074_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetraits.hh Source File │ │ │ │ +dune-typetree: treepath.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,276 +74,553 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
typetraits.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_TYPETRAITS_HH
│ │ │ │ -
5#define DUNE_TYPETREE_TYPETRAITS_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_TREEPATH_HH
│ │ │ │ +
5#define DUNE_TYPETREE_TREEPATH_HH
│ │ │ │
6
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <dune/common/typetraits.hh>
│ │ │ │ +
7#include <cstddef>
│ │ │ │ +
8#include <iostream>
│ │ │ │
9
│ │ │ │ - │ │ │ │ - │ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ +
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
│ │ │ │ -
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 {
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20 namespace TypeTree {
│ │ │ │ +
21
│ │ │ │ +
22 template<typename... T>
│ │ │ │ +
23 class HybridTreePath;
│ │ │ │ +
24
│ │ │ │
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 };
│ │ │ │ +
│ │ │ │ +
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 }
│ │ │ │
│ │ │ │ -
76
│ │ │ │ -
77 template<typename T, typename V>
│ │ │ │ +
67
│ │ │ │ +
69
│ │ │ │ +
77 template<typename... T>
│ │ │ │
│ │ │ │ - │ │ │ │ + │ │ │ │
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 };
│ │ │ │ +
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
│ │ │ │ -
101
│ │ │ │ -
103 template<typename T>
│ │ │ │ - │ │ │ │ -
105
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
│ │ │ │ +
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
│ │ │ │ -
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 };
│ │ │ │ +
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<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 }
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ -
179 template<class T>
│ │ │ │ -
│ │ │ │ -
180 struct IsTreePath :
│ │ │ │ -
181 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
│ │ │ │ -
182 {};
│ │ │ │ -
│ │ │ │ -
183
│ │ │ │ -
190 template<class T>
│ │ │ │ +
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 auto isTreePath(const T&)
│ │ │ │ - │ │ │ │ -
193 {
│ │ │ │ -
194 return IsTreePath<T>();
│ │ │ │ -
195 }
│ │ │ │ +
191 constexpr HybridTreePath<T...> treePath(const T&... t)
│ │ │ │ +
192 {
│ │ │ │ +
193 return HybridTreePath<T...>(t...);
│ │ │ │ +
194 }
│ │ │ │
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ - │ │ │ │ - │ │ │ │ -
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
│ │ │ │ - │ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,342 +1,611 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -typetraits.hh │ │ │ │ │ +treepath.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ -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_TYPETRAITS_HH │ │ │ │ │ -5#define DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ +4#ifndef DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ +5#define DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8#include │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ 9 │ │ │ │ │ -10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -12 │ │ │ │ │ -13namespace _D_u_n_e { │ │ │ │ │ +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. │ │ │ │ │ +15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_f_i_x_e_d_c_a_p_a_c_i_t_y_s_t_a_c_k_._h_h> │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ 17 │ │ │ │ │ -18 template │ │ │ │ │ -_1_9 struct _f_i_r_s_t___t_y_p_e; │ │ │ │ │ -20 │ │ │ │ │ -21 template │ │ │ │ │ -_2_2 struct _f_i_r_s_t___t_y_p_e │ │ │ │ │ -23 { │ │ │ │ │ -_2_4 typedef T0 _t_y_p_e; │ │ │ │ │ -25 }; │ │ │ │ │ -26 │ │ │ │ │ -27 namespace TypeTree { │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +20 namespace TypeTree { │ │ │ │ │ +21 │ │ │ │ │ +22 template │ │ │ │ │ +23 class HybridTreePath; │ │ │ │ │ +24 │ │ │ │ │ 28 │ │ │ │ │ -29 template │ │ │ │ │ -_3_0 struct _h_a_s___n_o_d_e___t_a_g │ │ │ │ │ -31 { │ │ │ │ │ -_3_2 struct _y_e_s { char _d_u_m_m_y[1]; }; │ │ │ │ │ -_3_3 struct _n_o { char _d_u_m_m_y[2]; }; │ │ │ │ │ -34 │ │ │ │ │ -35 template │ │ │ │ │ -_3_6 static _y_e_s _t_e_s_t(_N_o_d_e_T_a_g_<_X_> *); │ │ │ │ │ -37 template │ │ │ │ │ -_3_8 static _n_o _t_e_s_t(...); │ │ │ │ │ -39 │ │ │ │ │ -_4_1 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ -42 }; │ │ │ │ │ -43 │ │ │ │ │ -44 template │ │ │ │ │ -_4_5 struct _h_a_s___n_o_d_e___t_a_g___v_a_l_u_e │ │ │ │ │ -46 { │ │ │ │ │ -47 template │ │ │ │ │ -_4_8 struct _m_a_y_b_e { char _d_u_m_m_y[N+1]; }; │ │ │ │ │ -_4_9 struct _y_e_s { char _d_u_m_m_y[2]; }; │ │ │ │ │ -_5_0 struct _n_o { char _d_u_m_m_y[1]; }; │ │ │ │ │ -51 │ │ │ │ │ -52 template │ │ │ │ │ -53 static _m_a_y_b_e_<_s_t_d_:_:_i_s___b_a_s_e___o_f_<_V_,_ _N_o_d_e_T_a_g_<_X_>>_:_:_v_a_l_u_e> │ │ │ │ │ -_5_4 _t_e_s_t(_N_o_d_e_T_a_g_<_X_> * a); │ │ │ │ │ -55 template │ │ │ │ │ -_5_6 static _n_o _t_e_s_t(...); │ │ │ │ │ -57 │ │ │ │ │ -_5_9 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ -60 }; │ │ │ │ │ -61 │ │ │ │ │ -62 template │ │ │ │ │ -_6_3 struct _h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g │ │ │ │ │ -64 { │ │ │ │ │ -_6_5 struct _y_e_s { char _d_u_m_m_y[1]; }; │ │ │ │ │ -_6_6 struct _n_o { char _d_u_m_m_y[2]; }; │ │ │ │ │ +_2_9 namespace TreePathType { │ │ │ │ │ +_3_0 enum _T_y_p_e { _f_u_l_l_y_S_t_a_t_i_c, _d_y_n_a_m_i_c }; │ │ │ │ │ +31 } │ │ │ │ │ +32 │ │ │ │ │ +33 template │ │ │ │ │ +_3_4 struct _T_r_e_e_P_a_t_h_S_i_z_e; │ │ │ │ │ +35 │ │ │ │ │ +36 template │ │ │ │ │ +_3_7 struct _T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k; │ │ │ │ │ +38 │ │ │ │ │ +39 template │ │ │ │ │ +_4_0 struct _T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t; │ │ │ │ │ +41 │ │ │ │ │ +42 template │ │ │ │ │ +_4_3 struct _T_r_e_e_P_a_t_h_B_a_c_k; │ │ │ │ │ +44 │ │ │ │ │ +45 template │ │ │ │ │ +_4_6 struct _T_r_e_e_P_a_t_h_F_r_o_n_t; │ │ │ │ │ +47 │ │ │ │ │ +48 template │ │ │ │ │ +_4_9 struct _T_r_e_e_P_a_t_h_P_o_p_B_a_c_k; │ │ │ │ │ +50 │ │ │ │ │ +51 template │ │ │ │ │ +_5_2 struct _T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t; │ │ │ │ │ +53 │ │ │ │ │ +54 template │ │ │ │ │ +_5_5 struct _T_r_e_e_P_a_t_h_C_o_n_c_a_t; │ │ │ │ │ +56 │ │ │ │ │ +57 template │ │ │ │ │ +_5_8 void _p_r_i_n_t___t_r_e_e___p_a_t_h(std::ostream& os) │ │ │ │ │ +59 {} │ │ │ │ │ +60 │ │ │ │ │ +61 template │ │ │ │ │ +_6_2 void _p_r_i_n_t___t_r_e_e___p_a_t_h(std::ostream& os) │ │ │ │ │ +63 { │ │ │ │ │ +64 os << k << " "; │ │ │ │ │ +65 _p_r_i_n_t___t_r_e_e___p_a_t_h(os); │ │ │ │ │ +66 } │ │ │ │ │ 67 │ │ │ │ │ -68 template │ │ │ │ │ -_6_9 static _y_e_s _t_e_s_t(_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g_<_X_> *); │ │ │ │ │ -70 template │ │ │ │ │ -_7_1 static _n_o _t_e_s_t(...); │ │ │ │ │ -72 │ │ │ │ │ -_7_4 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ -75 }; │ │ │ │ │ -76 │ │ │ │ │ -77 template │ │ │ │ │ -_7_8 struct _h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e │ │ │ │ │ +69 │ │ │ │ │ +77 template │ │ │ │ │ +_7_8 class _H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ 79 { │ │ │ │ │ -80 template │ │ │ │ │ -_8_1 struct _m_a_y_b_e { char _d_u_m_m_y[N+1]; }; │ │ │ │ │ -_8_2 struct _y_e_s { char _d_u_m_m_y[2]; }; │ │ │ │ │ -_8_3 struct _n_o { char _d_u_m_m_y[1]; }; │ │ │ │ │ -84 │ │ │ │ │ -85 template │ │ │ │ │ -86 static _m_a_y_b_e_<_s_t_d_:_:_i_s___b_a_s_e___o_f_<_V_,_ _I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g_<_X_>>_:_:_v_a_l_u_e> │ │ │ │ │ -_8_7 _t_e_s_t(_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g_<_X_> * a); │ │ │ │ │ -88 template │ │ │ │ │ -_8_9 static _n_o _t_e_s_t(...); │ │ │ │ │ -90 │ │ │ │ │ -_9_2 constexpr static bool _v_a_l_u_e = sizeof(test(0)) == sizeof(_y_e_s); │ │ │ │ │ -93 }; │ │ │ │ │ -94 │ │ │ │ │ -95 template │ │ │ │ │ -_9_6 struct _A_l_w_a_y_s_V_o_i_d │ │ │ │ │ -97 { │ │ │ │ │ -_9_8 typedef void _t_y_p_e; │ │ │ │ │ -99 }; │ │ │ │ │ +80 │ │ │ │ │ +81 public: │ │ │ │ │ +82 │ │ │ │ │ +_8_4 using _i_n_d_e_x___s_e_q_u_e_n_c_e = std::index_sequence_for; │ │ │ │ │ +85 │ │ │ │ │ +_8_7 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h() │ │ │ │ │ +88 {} │ │ │ │ │ +89 │ │ │ │ │ +_9_0 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h& tp) = default; │ │ │ │ │ +_9_1 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(_H_y_b_r_i_d_T_r_e_e_P_a_t_h&& tp) = default; │ │ │ │ │ +92 │ │ │ │ │ +_9_3 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h& _o_p_e_r_a_t_o_r_=(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h& tp) = default; │ │ │ │ │ +_9_4 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h& _o_p_e_r_a_t_o_r_=(_H_y_b_r_i_d_T_r_e_e_P_a_t_h&& tp) = default; │ │ │ │ │ +95 │ │ │ │ │ +_9_7 explicit constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(std::tuple t) │ │ │ │ │ +98 : _data(t) │ │ │ │ │ +99 {} │ │ │ │ │ 100 │ │ │ │ │ -101 │ │ │ │ │ -103 template │ │ │ │ │ -_1_0_4 T* _d_e_c_l_p_t_r(); │ │ │ │ │ -105 │ │ │ │ │ +102 template 0 && │ │ │ │ │ +sizeof...(U) == sizeof...(T)),bool>::type = true> │ │ │ │ │ +_1_0_3 explicit constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h(U... t) │ │ │ │ │ +104 : _data(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 │ │ │ │ │ +_1_0_8 constexpr static _i_n_d_e_x___s_e_q_u_e_n_c_e _e_n_u_m_e_r_a_t_e() │ │ │ │ │ +109 { │ │ │ │ │ +110 return {}; │ │ │ │ │ +111 } │ │ │ │ │ +112 │ │ │ │ │ +_1_1_4 constexpr static std::size_t _s_i_z_e() │ │ │ │ │ +115 { │ │ │ │ │ +116 return sizeof...(T); │ │ │ │ │ +117 } │ │ │ │ │ 118 │ │ │ │ │ -_1_2_1 struct _m_e_t_a___f_u_n_c_t_i_o_n {}; │ │ │ │ │ -122 │ │ │ │ │ -124 template │ │ │ │ │ -_1_2_5 struct _l_a_z_y___e_v_a_l_u_a_t_e │ │ │ │ │ -126 { │ │ │ │ │ -_1_2_7 typedef typename F::type _t_y_p_e; │ │ │ │ │ -128 }; │ │ │ │ │ -129 │ │ │ │ │ -131 template │ │ │ │ │ -_1_3_2 struct _l_a_z_y___i_d_e_n_t_i_t_y │ │ │ │ │ -133 { │ │ │ │ │ -_1_3_4 typedef F _t_y_p_e; │ │ │ │ │ -135 }; │ │ │ │ │ +120 template │ │ │ │ │ +_1_2_1 constexpr auto _o_p_e_r_a_t_o_r_[_](Dune::index_constant) const │ │ │ │ │ +122 { │ │ │ │ │ +123 return std::get(_data); │ │ │ │ │ +124 } │ │ │ │ │ +125 │ │ │ │ │ +_1_2_7 constexpr std::size_t _o_p_e_r_a_t_o_r_[_](std::size_t pos) const │ │ │ │ │ +128 { │ │ │ │ │ +129 std::size_t entry = 0; │ │ │ │ │ +130 Dune::Hybrid::forEach(_e_n_u_m_e_r_a_t_e(), [&] (auto i) { │ │ │ │ │ +131 if (i==pos) │ │ │ │ │ +132 entry = this->_e_l_e_m_e_n_t(i); │ │ │ │ │ +133 }); │ │ │ │ │ +134 return entry; │ │ │ │ │ +135 } │ │ │ │ │ 136 │ │ │ │ │ -138 template │ │ │ │ │ -_1_3_9 struct _e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ +138 template │ │ │ │ │ +_1_3_9 constexpr auto _e_l_e_m_e_n_t(Dune::index_constant pos = {}) const │ │ │ │ │ 140 { │ │ │ │ │ -141 typedef typename std::conditional< │ │ │ │ │ -142 std::is_base_of::value, │ │ │ │ │ -143 _l_a_z_y___e_v_a_l_u_a_t_e_<_F_>, │ │ │ │ │ -144 _l_a_z_y___i_d_e_n_t_i_t_y_<_F_> │ │ │ │ │ -_1_4_5 >::type::type _t_y_p_e; │ │ │ │ │ -146 }; │ │ │ │ │ -147 │ │ │ │ │ -_1_4_8 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 │ │ │ │ │ -_1_5_3 constexpr auto _i_s_T_r_e_e_P_a_t_h(void*) │ │ │ │ │ -154 -> std::false_type │ │ │ │ │ -155 { │ │ │ │ │ -156 return std::false_type(); │ │ │ │ │ -157 } │ │ │ │ │ -158 │ │ │ │ │ -159 // Overload for instances of HybridTreePath<...> │ │ │ │ │ -160 template │ │ │ │ │ -_1_6_1 constexpr auto _i_s_T_r_e_e_P_a_t_h(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_I_._._._>*) │ │ │ │ │ -162 -> std::true_type │ │ │ │ │ -163 { │ │ │ │ │ -164 return std::true_type(); │ │ │ │ │ -165 } │ │ │ │ │ -166 │ │ │ │ │ -167 } │ │ │ │ │ +141 return std::get(_data); │ │ │ │ │ +142 } │ │ │ │ │ +143 │ │ │ │ │ +_1_4_5 constexpr std::size_t _e_l_e_m_e_n_t(std::size_t pos) const │ │ │ │ │ +146 { │ │ │ │ │ +147 std::size_t entry = 0; │ │ │ │ │ +148 Dune::Hybrid::forEach(_e_n_u_m_e_r_a_t_e(), [&] (auto i) { │ │ │ │ │ +149 if (i==pos) │ │ │ │ │ +150 entry = this->_e_l_e_m_e_n_t(i); │ │ │ │ │ +151 }); │ │ │ │ │ +152 return entry; │ │ │ │ │ +153 } │ │ │ │ │ +154 │ │ │ │ │ +_1_5_6 auto _b_a_c_k() 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 │ │ │ │ │ -179 template │ │ │ │ │ -_1_8_0 struct _I_s_T_r_e_e_P_a_t_h : │ │ │ │ │ -181 public decltype(impl::isTreePath((typename std::decay::type*)(nullptr))) │ │ │ │ │ -182 {}; │ │ │ │ │ -183 │ │ │ │ │ -190 template │ │ │ │ │ -_1_9_1 constexpr auto _i_s_T_r_e_e_P_a_t_h(const T&) │ │ │ │ │ -192 -> _I_s_T_r_e_e_P_a_t_h_<_T_> │ │ │ │ │ -193 { │ │ │ │ │ -194 return _I_s_T_r_e_e_P_a_t_h_<_T_>(); │ │ │ │ │ -195 } │ │ │ │ │ +169#endif // DOXYGEN │ │ │ │ │ +170 │ │ │ │ │ +171 }; │ │ │ │ │ +172 │ │ │ │ │ +173 │ │ │ │ │ +175 │ │ │ │ │ +179 template │ │ │ │ │ +_1_8_0 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _h_y_b_r_i_d_T_r_e_e_P_a_t_h(const T&... t) │ │ │ │ │ +181 { │ │ │ │ │ +182 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(t...); │ │ │ │ │ +183 } │ │ │ │ │ +184 │ │ │ │ │ +186 │ │ │ │ │ +190 template │ │ │ │ │ +_1_9_1 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h(const T&... t) │ │ │ │ │ +192 { │ │ │ │ │ +193 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(t...); │ │ │ │ │ +194 } │ │ │ │ │ +195 │ │ │ │ │ 196 │ │ │ │ │ -197 │ │ │ │ │ -198 } // end namespace TypeTree │ │ │ │ │ -199} // end namespace Dune │ │ │ │ │ -200 │ │ │ │ │ -201#endif // DUNE_TYPETREE_TYPETRAITS_HH │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ -Returns the node tag of the given Node. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_m_p_l_e_m_e_n_t_a_t_i_o_n_T_a_g │ │ │ │ │ -typename std::decay_t< T >::ImplementationTag ImplementationTag │ │ │ │ │ -Returns the implementation tag of the given Node. │ │ │ │ │ -DDeeffiinniittiioonn nodeinterface.hh:80 │ │ │ │ │ +198 template │ │ │ │ │ +_1_9_9 constexpr std::size_t _t_r_e_e_P_a_t_h_S_i_z_e(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>&) │ │ │ │ │ +200 { │ │ │ │ │ +201 return sizeof...(T); │ │ │ │ │ +202 } │ │ │ │ │ +203 │ │ │ │ │ +205 │ │ │ │ │ +221 template │ │ │ │ │ +_2_2_2 constexpr auto _t_r_e_e_P_a_t_h_E_n_t_r_y(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, │ │ │ │ │ +index_constant = {}) │ │ │ │ │ +223 -> typename std::decay(tp._data))>::type │ │ │ │ │ +224 { │ │ │ │ │ +225 return std::get(tp._data); │ │ │ │ │ +226 } │ │ │ │ │ +227 │ │ │ │ │ +229 │ │ │ │ │ +244 template │ │ │ │ │ +_2_4_5 constexpr std::size_t _t_r_e_e_P_a_t_h_I_n_d_e_x(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, │ │ │ │ │ +index_constant = {}) │ │ │ │ │ +246 { │ │ │ │ │ +247 return std::get(tp._data); │ │ │ │ │ +248 } │ │ │ │ │ +249 │ │ │ │ │ +251 │ │ │ │ │ +256 template 0),bool>:: │ │ │ │ │ +type = true> │ │ │ │ │ +_2_5_7 constexpr auto _b_a_c_k(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ +258 -> decltype(_t_r_e_e_P_a_t_h_E_n_t_r_y(tp)) │ │ │ │ │ +259 { │ │ │ │ │ +260 return _t_r_e_e_P_a_t_h_E_n_t_r_y(tp); │ │ │ │ │ +261 } │ │ │ │ │ +262 │ │ │ │ │ +264 │ │ │ │ │ +269 template │ │ │ │ │ +_2_7_0 constexpr auto _f_r_o_n_t(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ +271 -> decltype(treePathEntry<0>(tp)) │ │ │ │ │ +272 { │ │ │ │ │ +273 return treePathEntry<0>(tp); │ │ │ │ │ +274 } │ │ │ │ │ +275 │ │ │ │ │ +277 │ │ │ │ │ +280 template │ │ │ │ │ +_2_8_1 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _p_u_s_h___b_a_c_k(const │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, std::size_t i) │ │ │ │ │ +282 { │ │ │ │ │ +283 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(std::tuple_cat(tp._data,std:: │ │ │ │ │ +make_tuple(i))); │ │ │ │ │ +284 } │ │ │ │ │ +285 │ │ │ │ │ +287 │ │ │ │ │ +301 template │ │ │ │ │ +_3_0_2 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h> _p_u_s_h___b_a_c_k(const │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, index_constant i_ = {}) │ │ │ │ │ +303 { │ │ │ │ │ +304 return HybridTreePath >(std::tuple_cat │ │ │ │ │ +(tp._data,std::make_tuple(i_))); │ │ │ │ │ +305 } │ │ │ │ │ +306 │ │ │ │ │ +308 │ │ │ │ │ +311 template │ │ │ │ │ +_3_1_2 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h _p_u_s_h___f_r_o_n_t(const │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, std::size_t element) │ │ │ │ │ +313 { │ │ │ │ │ +314 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h(std::tuple_cat(std::make_tuple │ │ │ │ │ +(element),tp._data)); │ │ │ │ │ +315 } │ │ │ │ │ +316 │ │ │ │ │ +318 │ │ │ │ │ +332 template │ │ │ │ │ +_3_3_3 constexpr _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>,T...> _p_u_s_h___f_r_o_n_t(const │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp, index_constant _i = {}) │ │ │ │ │ +334 { │ │ │ │ │ +335 return HybridTreePath,T...>(std::tuple_cat(std:: │ │ │ │ │ +make_tuple(_i),tp._data)); │ │ │ │ │ +336 } │ │ │ │ │ +337 │ │ │ │ │ +339 │ │ │ │ │ +342 template │ │ │ │ │ +_3_4_3 constexpr auto _p_o_p___f_r_o_n_t(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ +344 { │ │ │ │ │ +345 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ +346 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ +347 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ +348 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ +349 } │ │ │ │ │ +350 │ │ │ │ │ +352 │ │ │ │ │ +355 template │ │ │ │ │ +_3_5_6 constexpr auto _p_o_p___b_a_c_k(const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& tp) │ │ │ │ │ +357 { │ │ │ │ │ +358 static_assert(sizeof...(T) != 0, "HybridTreePath must not be empty"); │ │ │ │ │ +359 return unpackIntegerSequence([&](auto... i){ │ │ │ │ │ +360 return _H_y_b_r_i_d_T_r_e_e_P_a_t_h{std::make_tuple(std::get(tp._data)...)}; │ │ │ │ │ +361 }, std::make_index_sequence<(sizeof...(T) - 1)>{}); │ │ │ │ │ +362 } │ │ │ │ │ +363 │ │ │ │ │ +365 │ │ │ │ │ +373 template │ │ │ │ │ +_3_7_4 constexpr bool _o_p_e_r_a_t_o_r_=_=( │ │ │ │ │ +375 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_S_._._._>& lhs, │ │ │ │ │ +376 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& 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 │ │ │ │ │ +_3_9_8 constexpr auto _o_p_e_r_a_t_o_r_=_=( │ │ │ │ │ +399 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&, │ │ │ │ │ +400 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&) │ │ │ │ │ +401 { │ │ │ │ │ +402 return std::bool_constant<_h_y_b_r_i_d_T_r_e_e_P_a_t_h(lhs...) == _h_y_b_r_i_d_T_r_e_e_P_a_t_h(rhs...)> │ │ │ │ │ +{}; │ │ │ │ │ +403 } │ │ │ │ │ +404 │ │ │ │ │ +405 │ │ │ │ │ +407 template │ │ │ │ │ +_4_0_8 constexpr auto _o_p_e_r_a_t_o_r_!_=( │ │ │ │ │ +409 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_S_._._._>& lhs, │ │ │ │ │ +410 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& rhs) │ │ │ │ │ +411 { │ │ │ │ │ +412 return !(lhs == rhs); │ │ │ │ │ +413 } │ │ │ │ │ +414 │ │ │ │ │ +416 template │ │ │ │ │ +_4_1_7 constexpr auto _o_p_e_r_a_t_o_r_!_=( │ │ │ │ │ +418 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&, │ │ │ │ │ +419 const _H_y_b_r_i_d_T_r_e_e_P_a_t_h...>&) │ │ │ │ │ +420 { │ │ │ │ │ +421 return std::bool_constant<_h_y_b_r_i_d_T_r_e_e_P_a_t_h(lhs...) != _h_y_b_r_i_d_T_r_e_e_P_a_t_h(rhs...)> │ │ │ │ │ +{}; │ │ │ │ │ +422 } │ │ │ │ │ +423 │ │ │ │ │ +424 template │ │ │ │ │ +_4_2_5 struct _T_r_e_e_P_a_t_h_S_i_z_e<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...> > │ │ │ │ │ +426 : public index_constant │ │ │ │ │ +427 {}; │ │ │ │ │ +428 │ │ │ │ │ +429 │ │ │ │ │ +430 template │ │ │ │ │ +_4_3_1 struct _T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...>,k> │ │ │ │ │ +432 { │ │ │ │ │ +_4_3_3 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...,index_constant> _t_y_p_e; │ │ │ │ │ +434 }; │ │ │ │ │ +435 │ │ │ │ │ +436 template │ │ │ │ │ +_4_3_7 struct _T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...>,k> │ │ │ │ │ +438 { │ │ │ │ │ +_4_3_9 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_k_>,index_constant...> _t_y_p_e; │ │ │ │ │ +440 }; │ │ │ │ │ +441 │ │ │ │ │ +442 template │ │ │ │ │ +_4_4_3 struct _T_r_e_e_P_a_t_h_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h>> │ │ │ │ │ +444 : public index_constant │ │ │ │ │ +445 {}; │ │ │ │ │ +446 │ │ │ │ │ +447 template │ │ │ │ │ +_4_4_8 struct │ │ │ │ │ +_T_r_e_e_P_a_t_h_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant,index_constant...>> │ │ │ │ │ +449 : public │ │ │ │ │ +_T_r_e_e_P_a_t_h_B_a_c_k,index_constant...>> │ │ │ │ │ +450 {}; │ │ │ │ │ +451 │ │ │ │ │ +452 template │ │ │ │ │ +_4_5_3 struct │ │ │ │ │ +_T_r_e_e_P_a_t_h_F_r_o_n_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant...>> │ │ │ │ │ +454 : public index_constant │ │ │ │ │ +455 {}; │ │ │ │ │ +456 │ │ │ │ │ +457 template │ │ │ │ │ +_4_5_8 struct _T_r_e_e_P_a_t_h_P_o_p_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h>,i...> │ │ │ │ │ +459 { │ │ │ │ │ +_4_6_0 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...> _t_y_p_e; │ │ │ │ │ +461 }; │ │ │ │ │ +462 │ │ │ │ │ +463 template │ │ │ │ │ +_4_6_7 struct │ │ │ │ │ +_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant,index_constant...>,i...> │ │ │ │ │ +468 : public │ │ │ │ │ +_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k,index_constant...>,i...,j> │ │ │ │ │ +469 {}; │ │ │ │ │ +470 │ │ │ │ │ +471 template │ │ │ │ │ +_4_7_2 struct │ │ │ │ │ +_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h,index_constant...> > │ │ │ │ │ +473 { │ │ │ │ │ +_4_7_4 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...> _t_y_p_e; │ │ │ │ │ +475 }; │ │ │ │ │ +476 │ │ │ │ │ +477 template │ │ │ │ │ +_4_7_8 struct │ │ │ │ │ +_T_r_e_e_P_a_t_h_C_o_n_c_a_t<_H_y_b_r_i_d_T_r_e_e_P_a_t_h...>,_H_y_b_r_i_d_T_r_e_e_P_a_t_h...> │ │ │ │ │ +> │ │ │ │ │ +479 { │ │ │ │ │ +_4_8_0 typedef _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...,index_constant...> _t_y_p_e; │ │ │ │ │ +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 _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_T_._._._>& 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 << _t_r_e_e_P_a_t_h_I_n_d_e_x(tp,_i) << " "; │ │ │ │ │ +503 print_hybrid_tree_path(os,tp,index_constant{}); │ │ │ │ │ +504 } │ │ │ │ │ +505 │ │ │ │ │ +506 } // namespace impl │ │ │ │ │ +507 │ │ │ │ │ +508#endif // DOXYGEN │ │ │ │ │ +509 │ │ │ │ │ +511 template │ │ │ │ │ +_5_1_2 std::ostream& _o_p_e_r_a_t_o_r_<_<(std::ostream& os, const _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_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 │ │ │ │ │ +_5_2_1 using _T_r_e_e_P_a_t_h [[deprecated("use StaticTreePath, this type will be removed │ │ │ │ │ +after DUNE 2.7")]] = _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_D_u_n_e_:_:_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...>; │ │ │ │ │ +522 │ │ │ │ │ +523 template │ │ │ │ │ +_5_2_4 using _S_t_a_t_i_c_T_r_e_e_P_a_t_h = _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_D_u_n_e_:_:_i_n_d_e_x___c_o_n_s_t_a_n_t_<_i_>...>; │ │ │ │ │ +525 │ │ │ │ │ +527 │ │ │ │ │ +528 } // namespace TypeTree │ │ │ │ │ +529} //namespace Dune │ │ │ │ │ +530 │ │ │ │ │ +531#endif // DUNE_TYPETREE_TREEPATH_HH │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ +_f_i_x_e_d_c_a_p_a_c_i_t_y_s_t_a_c_k_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ +constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t i) │ │ │ │ │ +Appends a run time index to a HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:281 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___f_r_o_n_t │ │ │ │ │ +constexpr auto pop_front(const HybridTreePath< T... > &tp) │ │ │ │ │ +Removes first index on a HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:343 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_<_< │ │ │ │ │ +std::ostream & operator<<(std::ostream &os, const HybridTreePath< T... > &tp) │ │ │ │ │ +Dumps a HybridTreePath to a stream. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:512 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_b_a_c_k │ │ │ │ │ +constexpr auto back(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ +(treePathEntry< sizeof...(T) -1 >(tp)) │ │ │ │ │ +Returns a copy of the last element of the HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:257 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ +constexpr std::size_t treePathSize(const HybridTreePath< T... > &) │ │ │ │ │ +Returns the size (number of components) of the given HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:199 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___f_r_o_n_t │ │ │ │ │ +constexpr HybridTreePath< std::size_t, T... > push_front(const HybridTreePath< │ │ │ │ │ +T... > &tp, std::size_t element) │ │ │ │ │ +Prepends a run time index to a HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:312 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:180 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_f_r_o_n_t │ │ │ │ │ +constexpr auto front(const HybridTreePath< T... > &tp) -> decltype │ │ │ │ │ +(treePathEntry< 0 >(tp)) │ │ │ │ │ +Returns a copy of the first element of the HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:270 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_E_n_t_r_y │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:222 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_!_= │ │ │ │ │ +constexpr auto operator!=(const HybridTreePath< S... > &lhs, const │ │ │ │ │ +HybridTreePath< T... > &rhs) │ │ │ │ │ +Compare two HybridTreePaths for unequality. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:408 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h_I_n_d_e_x │ │ │ │ │ +constexpr std::size_t treePathIndex(const HybridTreePath< T... > &tp, │ │ │ │ │ +index_constant< i >={}) │ │ │ │ │ +Returns the index value of the i-th element of the HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:245 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_o_p___b_a_c_k │ │ │ │ │ +constexpr auto pop_back(const HybridTreePath< T... > &tp) │ │ │ │ │ +Removes last index on a HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:356 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ +Constructs a new HybridTreePath from the given indices. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_o_p_e_r_a_t_o_r_=_= │ │ │ │ │ +constexpr bool operator==(const HybridTreePath< S... > &lhs, const │ │ │ │ │ +HybridTreePath< T... > &rhs) │ │ │ │ │ +Compare two HybridTreePaths for value equality. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:374 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_r_i_n_t___t_r_e_e___p_a_t_h │ │ │ │ │ +void print_tree_path(std::ostream &os) │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:58 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_s_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr auto isTreePath(const T &) -> IsTreePath< T > │ │ │ │ │ -Check if given object represents a tree path. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:191 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_d_e_c_l_p_t_r │ │ │ │ │ -T * declptr() │ │ │ │ │ -Helper function for generating a pointer to a value of type T in an unevaluated │ │ │ │ │ -operand setting. │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_i_m_p_l_:_:_i_s_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr auto isTreePath(void *) -> std::false_type │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:153 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_T_y_p_e │ │ │ │ │ +Type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_f_u_l_l_y_S_t_a_t_i_c │ │ │ │ │ +@ fullyStatic │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_T_y_p_e_:_:_d_y_n_a_m_i_c │ │ │ │ │ +@ dynamic │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:30 │ │ │ │ │ _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ indices. │ │ │ │ │ DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_f_i_r_s_t___t_y_p_e │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:19 │ │ │ │ │ -_D_u_n_e_:_:_f_i_r_s_t___t_y_p_e_<_ _T_0_,_ _T_._._._ _>_:_:_t_y_p_e │ │ │ │ │ -T0 type │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:24 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:31 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_v_a_l_u_e │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines a NodeTag. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:41 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_t_e_s_t │ │ │ │ │ -static yes test(NodeTag< X > *) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_t_e_s_t │ │ │ │ │ -static no test(...) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_y_e_s │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:32 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[1] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:32 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_n_o │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:33 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[2] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:33 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ -static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_v_a_l_u_e │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines a NodeTag of type V. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:59 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ -static no test(...) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:48 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[N+1] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:48 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_y_e_s │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[2] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:49 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_n_o │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___n_o_d_e___t_a_g___v_a_l_u_e_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[1] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:50 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:64 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_t_e_s_t │ │ │ │ │ -static yes test(ImplementationTag< X > *) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_t_e_s_t │ │ │ │ │ -static no test(...) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_v_a_l_u_e │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines an ImplementationTag. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:74 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_y_e_s │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:65 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[1] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:65 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_n_o │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:66 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[2] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:66 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:79 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ -static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test │ │ │ │ │ -(ImplementationTag< X > *a) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_t_e_s_t │ │ │ │ │ -static no test(...) │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_v_a_l_u_e │ │ │ │ │ -static constexpr bool value │ │ │ │ │ -True if class T defines an ImplementationTag of type V. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:92 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:81 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_m_a_y_b_e_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[N+1] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:81 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_y_e_s │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:82 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_y_e_s_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[2] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:82 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_n_o │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:83 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_a_s___i_m_p_l_e_m_e_n_t_a_t_i_o_n___t_a_g___v_a_l_u_e_:_:_n_o_:_:_d_u_m_m_y │ │ │ │ │ -char dummy[1] │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:83 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_l_w_a_y_s_V_o_i_d │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:97 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_A_l_w_a_y_s_V_o_i_d_:_:_t_y_p_e │ │ │ │ │ -void type │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:98 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ -Marker tag declaring a meta function. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:121 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___e_v_a_l_u_a_t_e │ │ │ │ │ -Helper meta function to delay evaluation of F. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___e_v_a_l_u_a_t_e_:_:_t_y_p_e │ │ │ │ │ -F::type type │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:127 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___i_d_e_n_t_i_t_y │ │ │ │ │ -Identity function. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:133 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_l_a_z_y___i_d_e_n_t_i_t_y_:_:_t_y_p_e │ │ │ │ │ -F type │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:134 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n │ │ │ │ │ -Meta function that evaluates its argument iff it inherits from meta_function. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:140 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_e_v_a_l_u_a_t_e___i_f___m_e_t_a___f_u_n_c_t_i_o_n_:_:_t_y_p_e │ │ │ │ │ -std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F │ │ │ │ │ ->, lazy_identity< F > >::type::type type │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:145 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h │ │ │ │ │ -Check if type represents a tree path. │ │ │ │ │ -DDeeffiinniittiioonn typetraits.hh:182 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath(HybridTreePath &&tp)=default │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ │ +constexpr HybridTreePath & operator=(const HybridTreePath &tp)=default │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_e_l_e_m_e_n_t │ │ │ │ │ +constexpr std::size_t element(std::size_t pos) const │ │ │ │ │ +Get the index value at position pos. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:145 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath(std::tuple< T... > t) │ │ │ │ │ +Constructor from a std::tuple │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:97 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_= │ │ │ │ │ +constexpr HybridTreePath & operator=(HybridTreePath &&tp)=default │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath(U... t) │ │ │ │ │ +Constructor from arguments. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:103 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath() │ │ │ │ │ +Default constructor. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:87 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_s_i_z_e │ │ │ │ │ +static constexpr std::size_t size() │ │ │ │ │ +Get the size (length) of this path. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:114 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +constexpr auto operator[](Dune::index_constant< i >) const │ │ │ │ │ +Get the index value at position pos. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:121 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_e_l_e_m_e_n_t │ │ │ │ │ +constexpr auto element(Dune::index_constant< i > pos={}) const │ │ │ │ │ +Get the last index value. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:139 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_e_n_u_m_e_r_a_t_e │ │ │ │ │ +static constexpr index_sequence enumerate() │ │ │ │ │ +Returns an index_sequence for enumerating the components of this │ │ │ │ │ +HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:108 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ +constexpr HybridTreePath(const HybridTreePath &tp)=default │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_o_p_e_r_a_t_o_r_[_] │ │ │ │ │ +constexpr std::size_t operator[](std::size_t pos) const │ │ │ │ │ +Get the index value at position pos. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:127 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_b_a_c_k │ │ │ │ │ +auto back() const │ │ │ │ │ +Get the last index value. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:156 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h_:_:_i_n_d_e_x___s_e_q_u_e_n_c_e │ │ │ │ │ +std::index_sequence_for< T... > index_sequence │ │ │ │ │ +An index_sequence for the entries in this HybridTreePath. │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:84 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_S_i_z_e │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:34 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:37 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:40 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_B_a_c_k │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:43 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_F_r_o_n_t │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:49 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:52 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_C_o_n_c_a_t │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:55 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_,_ _k │ │ │ │ │ +_>_:_:_t_y_p_e │ │ │ │ │ +HybridTreePath< index_constant< i >..., index_constant< k > > type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:433 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_u_s_h_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_,_ _k │ │ │ │ │ +_>_:_:_t_y_p_e │ │ │ │ │ +HybridTreePath< index_constant< k >, index_constant< i >... > type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:439 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_B_a_c_k_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_ _>_,_ _i_._._. │ │ │ │ │ +_>_:_:_t_y_p_e │ │ │ │ │ +HybridTreePath< index_constant< i >... > type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:460 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_P_o_p_F_r_o_n_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_, │ │ │ │ │ +_i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_ _>_:_:_t_y_p_e │ │ │ │ │ +HybridTreePath< index_constant< i >... > type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:474 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h_C_o_n_c_a_t_<_ _H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _i_ _>_._._._ _>_, │ │ │ │ │ +_H_y_b_r_i_d_T_r_e_e_P_a_t_h_<_ _i_n_d_e_x___c_o_n_s_t_a_n_t_<_ _k_ _>_._._._ _>_ _>_:_:_t_y_p_e │ │ │ │ │ +HybridTreePath< index_constant< i >..., index_constant< k >... > type │ │ │ │ │ +DDeeffiinniittiioonn treepath.hh:480 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: leafnode.hh File Reference │ │ │ │ +dune-typetree: proxynode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,27 +72,51 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
leafnode.hh File Reference
│ │ │ │ +
proxynode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/typetree/nodetags.hh>
│ │ │ │ -#include <cstddef>
│ │ │ │ -#include <type_traits>
│ │ │ │ +
#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::LeafNode
 Base class for leaf nodes in a dune-typetree. 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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,22 +1,48 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -leafnode.hh File Reference │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include │ │ │ │ │ +proxynode.hh File Reference │ │ │ │ │ #include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e │ │ │ │ │ -  Base class for leaf nodes in a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_<_ _P_r_o_x_i_e_d_N_o_d_e_ _> │ │ │ │ │ +  Mixin class providing methods for child access with compile-time │ │ │ │ │ + parameter. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_<_ _P_r_o_x_i_e_d_N_o_d_e_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ │ +  Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_<_ _P_r_o_x_i_e_d_N_o_d_e_ _> │ │ │ │ │ +  Mixin class providing methods for child access with run-time │ │ │ │ │ + parameter. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _L_e_a_f_N_o_d_e_T_a_g_ _> │ │ │ │ │ +  _P_r_o_x_y_N_o_d_e base class for _L_e_a_f_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g_ _> │ │ │ │ │ +  _P_r_o_x_y_N_o_d_e base class for _C_o_m_p_o_s_i_t_e_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _P_o_w_e_r_N_o_d_e_T_a_g_ _> │ │ │ │ │ +  _P_r_o_x_y_N_o_d_e base class for _P_o_w_e_r_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g_ _> │ │ │ │ │ +  _P_r_o_x_y_N_o_d_e base class for _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_<_ _N_o_d_e_ _> │ │ │ │ │ +  Base class for nodes acting as a proxy for an existing node. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: leafnode.hh Source File │ │ │ │ +dune-typetree: proxynode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,77 +74,404 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
leafnode.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
│ │ │ │ -
4#ifndef DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │ -
5#define DUNE_TYPETREE_LEAFNODE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_PROXYNODE_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ -
8#include <cstddef>
│ │ │ │ -
9#include <type_traits>
│ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12 namespace TypeTree {
│ │ │ │ +
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
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
26 {
│ │ │ │ -
27
│ │ │ │ -
28 public:
│ │ │ │ +
14namespace Dune {
│ │ │ │ +
15 namespace TypeTree {
│ │ │ │ +
16
│ │ │ │ +
22 template<typename Node>
│ │ │ │ +
23 class ProxyNode;
│ │ │ │ +
24
│ │ │ │ +
26 template<typename ProxiedNode>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
28 {
│ │ │ │
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
│ │ │ │ - │ │ │ │ +
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
│ │ │ │ + │ │ │ │ + │ │ │ │ +
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 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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,91 +1,459 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -leafnode.hh │ │ │ │ │ +proxynode.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_PROXYNODE_HH │ │ │ │ │ +5#define DUNE_TYPETREE_PROXYNODE_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -8#include │ │ │ │ │ -9#include │ │ │ │ │ -10 │ │ │ │ │ -11namespace _D_u_n_e { │ │ │ │ │ -12 namespace TypeTree { │ │ │ │ │ +7#include │ │ │ │ │ +8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +10#include │ │ │ │ │ +11#include │ │ │ │ │ +12#include │ │ │ │ │ 13 │ │ │ │ │ -_2_5 class _L_e_a_f_N_o_d_e │ │ │ │ │ -26 { │ │ │ │ │ -27 │ │ │ │ │ -28 public: │ │ │ │ │ +14namespace _D_u_n_e { │ │ │ │ │ +15 namespace TypeTree { │ │ │ │ │ +16 │ │ │ │ │ +22 template │ │ │ │ │ +23 class ProxyNode; │ │ │ │ │ +24 │ │ │ │ │ +26 template │ │ │ │ │ +_2_7 class _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +28 { │ │ │ │ │ 29 │ │ │ │ │ -_3_1 static const bool _i_s_L_e_a_f = true; │ │ │ │ │ -32 │ │ │ │ │ -_3_4 static const bool _i_s_P_o_w_e_r = false; │ │ │ │ │ -35 │ │ │ │ │ -_3_7 static const bool _i_s_C_o_m_p_o_s_i_t_e = false; │ │ │ │ │ -38 │ │ │ │ │ -40 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ -_4_1 static const std::size_t _C_H_I_L_D_R_E_N = 0; │ │ │ │ │ -42 │ │ │ │ │ -_4_4 typedef _L_e_a_f_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ -45 │ │ │ │ │ -_4_6 static constexpr auto _d_e_g_r_e_e() │ │ │ │ │ -47 { │ │ │ │ │ -48 return std::integral_constant{}; │ │ │ │ │ -49 } │ │ │ │ │ -50 │ │ │ │ │ -51 protected: │ │ │ │ │ -52 │ │ │ │ │ -54 │ │ │ │ │ -_5_9 _L_e_a_f_N_o_d_e() {} │ │ │ │ │ -60 }; │ │ │ │ │ -61 │ │ │ │ │ -63 │ │ │ │ │ -64 } // namespace TypeTree │ │ │ │ │ -65} //namespace Dune │ │ │ │ │ -66 │ │ │ │ │ -67#endif // DUNE_TYPETREE_POWERNODE_HH │ │ │ │ │ +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 _P_r_o_x_y_N_o_d_e_<_P_r_o_x_i_e_d_N_o_d_e_> _N_o_d_e; │ │ │ │ │ +39 │ │ │ │ │ +40 template │ │ │ │ │ +41 typename std::enable_if::type │ │ │ │ │ +42 node () │ │ │ │ │ +43 { │ │ │ │ │ +44 return static_cast<_N_o_d_e&>(*this); │ │ │ │ │ +45 } │ │ │ │ │ +46 │ │ │ │ │ +47 const _N_o_d_e& node () const │ │ │ │ │ +48 { │ │ │ │ │ +49 return static_cast(*this); │ │ │ │ │ +50 } │ │ │ │ │ +51 │ │ │ │ │ +52 public: │ │ │ │ │ +53 │ │ │ │ │ +55 template │ │ │ │ │ +_5_6 struct _C_h_i_l_d │ │ │ │ │ +57 : public ProxiedNode::template _C_h_i_l_d │ │ │ │ │ +58 {}; │ │ │ │ │ +59 │ │ │ │ │ +62 │ │ │ │ │ +64 │ │ │ │ │ +67 template::value, int>::type = 0> │ │ │ │ │ +_6_9 auto& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ +70 { │ │ │ │ │ +71 return node().proxiedNode().template child(); │ │ │ │ │ +72 } │ │ │ │ │ +73 │ │ │ │ │ +75 │ │ │ │ │ +78 template │ │ │ │ │ +_7_9 const auto& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ +80 { │ │ │ │ │ +81 return node().proxiedNode().template child(); │ │ │ │ │ +82 } │ │ │ │ │ +83 │ │ │ │ │ +85 │ │ │ │ │ +88 template::value, int>::type = 0> │ │ │ │ │ +_9_0 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) │ │ │ │ │ +91 { │ │ │ │ │ +92 return node().proxiedNode().template childStorage(); │ │ │ │ │ +93 } │ │ │ │ │ +94 │ │ │ │ │ +96 │ │ │ │ │ +102 template │ │ │ │ │ +_1_0_3 auto _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = {}) const │ │ │ │ │ +104 { │ │ │ │ │ +105 return node().proxiedNode().template childStorage(); │ │ │ │ │ +106 } │ │ │ │ │ +107 │ │ │ │ │ +109 template │ │ │ │ │ +_1_1_0 void _s_e_t_C_h_i_l_d (ProxyChild&& _c_h_i_l_d, typename std:: │ │ │ │ │ +enable_if::value,void*>::type = 0) │ │ │ │ │ +111 { │ │ │ │ │ +112 node().proxiedNode().template setChild(std::forward(_c_h_i_l_d)); │ │ │ │ │ +113 } │ │ │ │ │ +114 │ │ │ │ │ +_1_1_5 const typename ProxiedNode::NodeStorage& _n_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ +116 { │ │ │ │ │ +117 return node().proxiedNode().nodeStorage(); │ │ │ │ │ +118 } │ │ │ │ │ +119 │ │ │ │ │ +120 }; │ │ │ │ │ +121 │ │ │ │ │ +123 │ │ │ │ │ +128 template │ │ │ │ │ +_1_2_9 class _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +130 : public _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +131 { │ │ │ │ │ +132 │ │ │ │ │ +133 typedef _P_r_o_x_y_N_o_d_e_<_P_r_o_x_i_e_d_N_o_d_e_> _N_o_d_e; │ │ │ │ │ +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<_N_o_d_e&>(*this); │ │ │ │ │ +142 } │ │ │ │ │ +143 │ │ │ │ │ +144 const _N_o_d_e& node () const │ │ │ │ │ +145 { │ │ │ │ │ +146 return static_cast(*this); │ │ │ │ │ +147 } │ │ │ │ │ +148 │ │ │ │ │ +149 public: │ │ │ │ │ +150 │ │ │ │ │ +153 │ │ │ │ │ +155 │ │ │ │ │ +158 template::type = 0> │ │ │ │ │ +_1_6_0 auto& _c_h_i_l_d (std::size_t i) │ │ │ │ │ +161 { │ │ │ │ │ +162 return node().proxiedNode().child(i); │ │ │ │ │ +163 } │ │ │ │ │ +164 │ │ │ │ │ +166 │ │ │ │ │ +_1_6_9 const auto& _c_h_i_l_d (std::size_t i) const │ │ │ │ │ +170 { │ │ │ │ │ +171 return node().proxiedNode().child(i); │ │ │ │ │ +172 } │ │ │ │ │ +173 │ │ │ │ │ +175 │ │ │ │ │ +178 template::type = 0> │ │ │ │ │ +_1_8_0 auto _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) │ │ │ │ │ +181 { │ │ │ │ │ +182 return node().proxiedNode().childStorage(i); │ │ │ │ │ +183 } │ │ │ │ │ +184 │ │ │ │ │ +186 │ │ │ │ │ +_1_9_2 auto _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) const │ │ │ │ │ +193 { │ │ │ │ │ +194 return node().proxiedNode().childStorage(i); │ │ │ │ │ +195 } │ │ │ │ │ +196 │ │ │ │ │ +198 template │ │ │ │ │ +_1_9_9 void _s_e_t_C_h_i_l_d (std::size_t i, ProxyChild&& _c_h_i_l_d, typename std:: │ │ │ │ │ +enable_if::type = 0) │ │ │ │ │ +200 { │ │ │ │ │ +201 node().proxiedNode().setChild(i, std::forward(_c_h_i_l_d)); │ │ │ │ │ +202 } │ │ │ │ │ +203 │ │ │ │ │ +204 }; │ │ │ │ │ +205 │ │ │ │ │ +207 template │ │ │ │ │ +_2_0_8 struct _P_r_o_x_y_N_o_d_e_B_a_s_e; │ │ │ │ │ +209 │ │ │ │ │ +211 template │ │ │ │ │ +_2_1_2 struct _P_r_o_x_y_N_o_d_e_B_a_s_e │ │ │ │ │ +213 { │ │ │ │ │ +214 }; │ │ │ │ │ +215 │ │ │ │ │ +217 template │ │ │ │ │ +_2_1_8 struct _P_r_o_x_y_N_o_d_e_B_a_s_e<_N_o_d_e,_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g> │ │ │ │ │ +219 : public _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +220 { │ │ │ │ │ +_2_2_1 typedef typename Node::ChildTypes _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ +_2_2_2 typedef typename Node::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +223 }; │ │ │ │ │ +224 │ │ │ │ │ +226 template │ │ │ │ │ +_2_2_7 struct _P_r_o_x_y_N_o_d_e_B_a_s_e<_N_o_d_e,_P_o_w_e_r_N_o_d_e_T_a_g> │ │ │ │ │ +228 : public _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +229 { │ │ │ │ │ +_2_3_0 typedef typename Node::ChildType _C_h_i_l_d_T_y_p_e; │ │ │ │ │ +_2_3_1 typedef typename Node::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +232 }; │ │ │ │ │ +233 │ │ │ │ │ +235 template │ │ │ │ │ +_2_3_6 struct _P_r_o_x_y_N_o_d_e_B_a_s_e<_N_o_d_e,_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g> │ │ │ │ │ +237 : public _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +238 { │ │ │ │ │ +_2_3_9 typedef typename Node::ChildType _C_h_i_l_d_T_y_p_e; │ │ │ │ │ +_2_4_0 typedef typename Node::NodeStorage _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +241 }; │ │ │ │ │ +242 │ │ │ │ │ +244 │ │ │ │ │ +250 template │ │ │ │ │ +_2_5_1 class _P_r_o_x_y_N_o_d_e │ │ │ │ │ +252 : public _P_r_o_x_y_N_o_d_e_B_a_s_e> │ │ │ │ │ +253 { │ │ │ │ │ +254 static const bool proxiedNodeIsConst = std::is_const::type>::value; │ │ │ │ │ +255 │ │ │ │ │ +256 template │ │ │ │ │ +257 using HasStaticDegree = index_constant; │ │ │ │ │ +258 │ │ │ │ │ +259 template │ │ │ │ │ +_2_6_0 static constexpr bool hasStaticDegree = Std::is_detected::value; │ │ │ │ │ +261 │ │ │ │ │ +262 // accessor mixins need to be friends for access to proxiedNode() │ │ │ │ │ +263 friend class _S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s; │ │ │ │ │ +264 friend class _D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s; │ │ │ │ │ +265 │ │ │ │ │ +266 public: │ │ │ │ │ +267 │ │ │ │ │ +_2_6_8 typedef Node _P_r_o_x_i_e_d_N_o_d_e; │ │ │ │ │ +269 │ │ │ │ │ +_2_7_0 typedef _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g_<_N_o_d_e_> _N_o_d_e_T_a_g; │ │ │ │ │ +271 │ │ │ │ │ +_2_7_3 static const bool _i_s_L_e_a_f = Node::isLeaf; │ │ │ │ │ +274 │ │ │ │ │ +_2_7_6 static const bool _i_s_P_o_w_e_r = Node::isPower; │ │ │ │ │ +277 │ │ │ │ │ +_2_7_9 static const bool _i_s_C_o_m_p_o_s_i_t_e = Node::isComposite; │ │ │ │ │ +280 │ │ │ │ │ +282 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +_2_8_3 static const std::size_t _C_H_I_L_D_R_E_N = Dune::Std::detected_or_t< │ │ │ │ │ +284 std::integral_constant::max │ │ │ │ │ +()>, │ │ │ │ │ +285 _S_t_a_t_i_c_D_e_g_r_e_e, │ │ │ │ │ +286 Node │ │ │ │ │ +287 >::value; │ │ │ │ │ +288 │ │ │ │ │ +289 template , int> = 0> │ │ │ │ │ +_2_9_1 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ +292 { │ │ │ │ │ +293 return N::degree(); │ │ │ │ │ +294 } │ │ │ │ │ +295 │ │ │ │ │ +296 template , int> = 0> │ │ │ │ │ +_2_9_8 auto _d_e_g_r_e_e () const │ │ │ │ │ +299 { │ │ │ │ │ +300 return _p_r_o_x_i_e_d_N_o_d_e().degree(); │ │ │ │ │ +301 } │ │ │ │ │ +302 │ │ │ │ │ +303 │ │ │ │ │ +304 protected: │ │ │ │ │ +305 │ │ │ │ │ +308 │ │ │ │ │ +310 template │ │ │ │ │ +311 typename std::enable_if::type │ │ │ │ │ +_3_1_2 _p_r_o_x_i_e_d_N_o_d_e () │ │ │ │ │ +313 { │ │ │ │ │ +314 return *_node; │ │ │ │ │ +315 } │ │ │ │ │ +316 │ │ │ │ │ +_3_1_8 const Node& _p_r_o_x_i_e_d_N_o_d_e () const │ │ │ │ │ +319 { │ │ │ │ │ +320 return *_node; │ │ │ │ │ +321 } │ │ │ │ │ +322 │ │ │ │ │ +324 template │ │ │ │ │ +325 typename std::enable_if >::type │ │ │ │ │ +_3_2_6 _p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e () │ │ │ │ │ +327 { │ │ │ │ │ +328 return _node; │ │ │ │ │ +329 } │ │ │ │ │ +330 │ │ │ │ │ +_3_3_2 std::shared_ptr _p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ +333 { │ │ │ │ │ +334 return _node; │ │ │ │ │ +335 } │ │ │ │ │ +336 │ │ │ │ │ +338 │ │ │ │ │ +341 │ │ │ │ │ +_3_4_2 _P_r_o_x_y_N_o_d_e (Node& node) │ │ │ │ │ +343 : _node(stackobject_to_shared_ptr(node)) │ │ │ │ │ +344 {} │ │ │ │ │ +345 │ │ │ │ │ +_3_4_6 _P_r_o_x_y_N_o_d_e (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 │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +typename std::decay_t< Node >::NodeTag NodeTag │ │ │ │ │ +Returns the node tag of the given Node. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:76 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_D_e_g_r_e_e │ │ │ │ │ +decltype(Node::degree()) StaticDegree │ │ │ │ │ +Returns the statically known degree of the given Node type as a std:: │ │ │ │ │ +integral_constant. │ │ │ │ │ +DDeeffiinniittiioonn nodeinterface.hh:113 │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e │ │ │ │ │ -Base class for leaf nodes in a dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:26 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ -LeafNodeTag NodeTag │ │ │ │ │ -The type tag that describes a LeafNode. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:44 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a leaf node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a power node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:19 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a power node with runtime degree. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:22 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e │ │ │ │ │ +Base class for nodes acting as a proxy for an existing node. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:253 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_P_r_o_x_y_N_o_d_e │ │ │ │ │ +ProxyNode(Node &node) │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:342 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +Dune::TypeTree::NodeTag< Node > NodeTag │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:270 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a composite in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:279 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ static const bool isLeaf │ │ │ │ │ -Mark this class as a leaf in a dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:31 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ -static const std::size_t CHILDREN │ │ │ │ │ -Leafs have no children. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:41 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:273 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ static const bool isPower │ │ │ │ │ Mark this class as a non power in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:34 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_L_e_a_f_N_o_d_e │ │ │ │ │ -LeafNode() │ │ │ │ │ -Default constructor. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:59 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ -static const bool isComposite │ │ │ │ │ -Mark this class as a non composite in the dune-typetree. │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:37 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:276 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +auto degree() const │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:298 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e │ │ │ │ │ +std::enable_if< enabled, Node & >::type proxiedNode() │ │ │ │ │ +Returns the proxied node. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:312 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:283 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< const Node > proxiedNodeStorage() const │ │ │ │ │ +Returns the storage of the proxied node (const version). │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:332 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_P_r_o_x_i_e_d_N_o_d_e │ │ │ │ │ +Node ProxiedNode │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:268 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage() │ │ │ │ │ +Returns the storage of the proxied node. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:326 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ static constexpr auto degree() │ │ │ │ │ -DDeeffiinniittiioonn leafnode.hh:46 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_L_e_a_f_N_o_d_e_T_a_g │ │ │ │ │ -Tag designating a leaf node. │ │ │ │ │ -DDeeffiinniittiioonn nodetags.hh:16 │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:291 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_P_r_o_x_y_N_o_d_e │ │ │ │ │ +ProxyNode(std::shared_ptr< Node > node) │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:346 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_:_:_p_r_o_x_i_e_d_N_o_d_e │ │ │ │ │ +const Node & proxiedNode() const │ │ │ │ │ +Returns the proxied node (const version). │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:318 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +Mixin class providing methods for child access with compile-time parameter. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:28 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ +auto & child(index_constant< k >={}) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:69 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:110 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +const ProxiedNode::NodeStorage & nodeStorage() const │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:115 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +auto childStorage(index_constant< k >={}) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:90 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ +const auto & child(index_constant< k >={}) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +auto childStorage(index_constant< k >={}) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:103 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_S_t_a_t_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_C_h_i_l_d │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:58 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s │ │ │ │ │ +Mixin class providing methods for child access with run-time parameter. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:131 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ +auto & child(std::size_t i) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:160 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +auto childStorage(std::size_t i) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:192 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:199 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d │ │ │ │ │ +const auto & child(std::size_t i) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:169 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_C_h_i_l_d_A_c_c_e_s_s_o_r_s_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +auto childStorage(std::size_t i) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:180 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e │ │ │ │ │ +Tag-based dispatch to appropriate base class that provides necessary │ │ │ │ │ +functionality. │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:208 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g_ _>_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +Node::NodeStorage NodeStorage │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:222 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g_ _>_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ +Node::ChildTypes ChildTypes │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:221 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +Node::NodeStorage NodeStorage │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:231 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ +Node::ChildType ChildType │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:230 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +Node::NodeStorage NodeStorage │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:240 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_P_r_o_x_y_N_o_d_e_B_a_s_e_<_ _N_o_d_e_,_ _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g_ _>_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ +Node::ChildType ChildType │ │ │ │ │ +DDeeffiinniittiioonn proxynode.hh:239 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: pairtraversal.hh File Reference │ │ │ │ +dune-typetree: exceptions.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,47 +70,41 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
pairtraversal.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
exceptions.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>
│ │ │ │ + │ │ │ │ +

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::Exception
 Base class for all TypeTree exceptions. 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.
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

TypeTree-specific exceptions.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,35 +1,24 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -_N_a_m_e_s_p_a_c_e_s | _F_u_n_c_t_i_o_n_s │ │ │ │ │ -pairtraversal.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_v_i_s_i_t_o_r_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +exceptions.hh File Reference │ │ │ │ │ +TypeTree-specific exceptions. _M_o_r_e_._._. │ │ │ │ │ +#include │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ +CCllaasssseess │ │ │ │ │ +class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_c_e_p_t_i_o_n │ │ │ │ │ +  Base class for all _T_y_p_e_T_r_e_e exceptions. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ -namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l │ │ │ │ │ -  │ │ │ │ │ -FFuunnccttiioonnss │ │ │ │ │ -template::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0> │ │ │ │ │ -void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r (T1 &&tree1, T2 &&tree2, _T_r_e_e_P_a_t_h │ │ │ │ │ - _t_r_e_e_P_a_t_h, V &&visitor) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void  _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r (Tree1 &&tree1, Tree2 &&tree2, Visitor │ │ │ │ │ - &&visitor) │ │ │ │ │ -  Apply visitor to a pair of TypeTrees. │ │ │ │ │ -  │ │ │ │ │ +********** DDeettaaiilleedd DDeessccrriippttiioonn ********** │ │ │ │ │ +TypeTree-specific exceptions. │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00080_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: pairtraversal.hh Source File │ │ │ │ +dune-typetree: exceptions.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,152 +74,39 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
pairtraversal.hh
│ │ │ │ +
exceptions.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
│ │ │ │ -
6
│ │ │ │ -
7#include <dune/common/std/type_traits.hh>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
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 */
│ │ │ │ -
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
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
Base class for all TypeTree exceptions.
Definition exceptions.hh:19
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,164 +1,33 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -pairtraversal.hh │ │ │ │ │ +exceptions.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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 │ │ │ │ │ -6 │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_e_e_p_a_t_h_._h_h> │ │ │ │ │ -12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_v_i_s_i_t_o_r_._h_h> │ │ │ │ │ -13#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ -14 │ │ │ │ │ -15namespace _D_u_n_e { │ │ │ │ │ -16 namespace TypeTree { │ │ │ │ │ -17 │ │ │ │ │ -_2_3 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> │ │ │ │ │ -_3_8 void _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(T1&& tree1, T2&& tree2, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, V&& visitor) │ │ │ │ │ -39 { │ │ │ │ │ -40 visitor.leaf(tree1, tree2, _t_r_e_e_P_a_t_h); │ │ │ │ │ -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 _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(T1&& tree1, T2&& tree2, _T_r_e_e_P_a_t_h _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h); │ │ │ │ │ -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, _t_r_e_e_P_a_t_h, 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, _t_r_e_e_P_a_t_h); │ │ │ │ │ -95 │ │ │ │ │ -96 constexpr bool visitChild = Visitor::template │ │ │ │ │ -VisitChild::value; │ │ │ │ │ -97 if constexpr(visitChild) { │ │ │ │ │ -98 auto childTreePath = _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k(_t_r_e_e_P_a_t_h, i); │ │ │ │ │ -99 _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(child1, child2, childTreePath, visitor); │ │ │ │ │ -100 } │ │ │ │ │ -101 │ │ │ │ │ -102 visitor.afterChild(tree1, child1, tree2, child2, _t_r_e_e_P_a_t_h, i); │ │ │ │ │ -103 }); │ │ │ │ │ -104 } │ │ │ │ │ -105 visitor.post(tree1, tree2, _t_r_e_e_P_a_t_h); │ │ │ │ │ -106 } │ │ │ │ │ -107 │ │ │ │ │ -108 } // namespace Detail │ │ │ │ │ -109 │ │ │ │ │ -111 │ │ │ │ │ -125 template │ │ │ │ │ -_1_2_6 void _a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor) │ │ │ │ │ -127 { │ │ │ │ │ -128 _D_e_t_a_i_l_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r(tree1, tree2, _h_y_b_r_i_d_T_r_e_e_P_a_t_h(), visitor); │ │ │ │ │ -129 } │ │ │ │ │ -130 │ │ │ │ │ -132 │ │ │ │ │ -133 } // namespace TypeTree │ │ │ │ │ -134} //namespace Dune │ │ │ │ │ -135 │ │ │ │ │ -136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH │ │ │ │ │ -_v_i_s_i_t_o_r_._h_h │ │ │ │ │ -_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ -_t_r_e_e_p_a_t_h_._h_h │ │ │ │ │ -_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r │ │ │ │ │ -void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor) │ │ │ │ │ -Apply visitor to a pair of TypeTrees. │ │ │ │ │ -DDeeffiinniittiioonn pairtraversal.hh:126 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_p_u_s_h___b_a_c_k │ │ │ │ │ -constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath< │ │ │ │ │ -T... > &tp, std::size_t i) │ │ │ │ │ -Appends a run time index to a HybridTreePath. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:281 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_h_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > hybridTreePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:180 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_t_r_e_e_P_a_t_h │ │ │ │ │ -constexpr HybridTreePath< T... > treePath(const T &... t) │ │ │ │ │ -Constructs a new HybridTreePath from the given indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:191 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_T_r_e_e_P_a_t_h │ │ │ │ │ -HybridTreePath< Dune::index_constant< i >... > TreePath │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:521 │ │ │ │ │ +3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ +4#define DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ +5 │ │ │ │ │ +6#include │ │ │ │ │ +7 │ │ │ │ │ +13namespace _D_u_n_e { │ │ │ │ │ +14 namespace TypeTree { │ │ │ │ │ +15 │ │ │ │ │ +_1_7 class _E_x_c_e_p_t_i_o_n │ │ │ │ │ +18 : public Dune::Exception │ │ │ │ │ +19 {}; │ │ │ │ │ +20 │ │ │ │ │ +21 } // namespace TypeTree │ │ │ │ │ +22} // namespace Dune │ │ │ │ │ +23 │ │ │ │ │ +24#endif // DUNE_TYPETREE_EXCEPTIONS_HH │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_e_t_a_i_l_:_:_a_p_p_l_y_T_o_T_r_e_e_P_a_i_r │ │ │ │ │ -void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor) │ │ │ │ │ -DDeeffiinniittiioonn pairtraversal.hh:38 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_H_y_b_r_i_d_T_r_e_e_P_a_t_h │ │ │ │ │ -A hybrid version of TreePath that supports both compile time and run time │ │ │ │ │ -indices. │ │ │ │ │ -DDeeffiinniittiioonn treepath.hh:79 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_E_x_c_e_p_t_i_o_n │ │ │ │ │ +Base class for all TypeTree exceptions. │ │ │ │ │ +DDeeffiinniittiioonn exceptions.hh:19 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powercompositenodetransformationtemplates.hh File Reference │ │ │ │ +dune-typetree: dynamicpowernode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,35 +72,33 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
powercompositenodetransformationtemplates.hh File Reference
│ │ │ │ +
dynamicpowernode.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <dune/typetree/nodeinterface.hh>
│ │ │ │ +
#include <cassert>
│ │ │ │ +#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/typetraits.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

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 >
class  Dune::TypeTree::DynamicPowerNode< T >
 Collect multiple instances of type T within a dune-typetree. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,36 +1,28 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ _C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ -powercompositenodetransformationtemplates.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ +dynamicpowernode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ CCllaasssseess │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_<_ _S_o_u_r_c_e_N_o_d_e_, │ │ │ │ │ - _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _> │ │ │ │ │ -  │ │ │ │ │ -struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_< │ │ │ │ │ - _S_o_u_r_c_e_N_o_d_e_,_ _T_r_a_n_s_f_o_r_m_a_t_i_o_n_,_ _T_r_a_n_s_f_o_r_m_e_d_N_o_d_e_ _>_:_:_r_e_s_u_l_t_<_ _T_C_ _> │ │ │ │ │ +class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_<_ _T_ _> │ │ │ │ │ +  Collect multiple instances of type T within a _d_u_n_e_-_t_y_p_e_t_r_e_e. _M_o_r_e_._._. │ │ │ │ │   │ │ │ │ │ NNaammeessppaacceess │ │ │ │ │ namespace   _D_u_n_e │ │ │ │ │   │ │ │ │ │ namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │   │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: powercompositenodetransformationtemplates.hh Source File │ │ │ │ +dune-typetree: dynamicpowernode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,89 +74,219 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
powercompositenodetransformationtemplates.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_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ -
5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_DYNAMICPOWERNODE_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 };
│ │ │ │ -
│ │ │ │ -
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 };
│ │ │ │ -
│ │ │ │ +
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
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20 namespace TypeTree {
│ │ │ │ +
21
│ │ │ │ +
31 template<typename T>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
33 {
│ │ │ │ +
34
│ │ │ │ +
35 public:
│ │ │ │ +
36
│ │ │ │ +
38 static const bool isLeaf = false;
│ │ │ │
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 };
│ │ │ │ +
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 }
│ │ │ │
│ │ │ │ -
49
│ │ │ │
51
│ │ │ │ -
52 } // namespace TypeTree
│ │ │ │ -
53} //namespace Dune
│ │ │ │ + │ │ │ │
54
│ │ │ │ -
55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
│ │ │ │ - │ │ │ │ +
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
│ │ │ │ +
141
│ │ │ │ +
144
│ │ │ │ +
145 protected:
│ │ │ │ +
146
│ │ │ │ +
149 DynamicPowerNode () = delete;
│ │ │ │ +
150
│ │ │ │ +
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
│ │ │ │ +
194
│ │ │ │ +
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
│ │ │ │ -
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,86 +1,253 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -powercompositenodetransformationtemplates.hh │ │ │ │ │ +dynamicpowernode.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ -5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ +4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ +5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include │ │ │ │ │ -8 │ │ │ │ │ -9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h> │ │ │ │ │ -10 │ │ │ │ │ -11namespace _D_u_n_e { │ │ │ │ │ -12 namespace TypeTree { │ │ │ │ │ -13 │ │ │ │ │ -19 template class TransformedNode> │ │ │ │ │ -_2_0 struct _G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ -21 { │ │ │ │ │ -22 template │ │ │ │ │ -_2_3 struct _r_e_s_u_l_t │ │ │ │ │ -24 { │ │ │ │ │ -_2_5 typedef TransformedNode::value> _t_y_p_e; │ │ │ │ │ -26 }; │ │ │ │ │ -27 }; │ │ │ │ │ -28 │ │ │ │ │ -29 │ │ │ │ │ -30 template class TransformedNode> │ │ │ │ │ -_3_1 struct _G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ -32 { │ │ │ │ │ -33 template │ │ │ │ │ -_3_4 struct _r_e_s_u_l_t │ │ │ │ │ -35 { │ │ │ │ │ -_3_6 typedef TransformedNode _t_y_p_e; │ │ │ │ │ -37 }; │ │ │ │ │ -38 }; │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10#include │ │ │ │ │ +11 │ │ │ │ │ +12#include │ │ │ │ │ +13#include │ │ │ │ │ +14 │ │ │ │ │ +15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ +17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +18 │ │ │ │ │ +19namespace _D_u_n_e { │ │ │ │ │ +20 namespace TypeTree { │ │ │ │ │ +21 │ │ │ │ │ +31 template │ │ │ │ │ +_3_2 class _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ +33 { │ │ │ │ │ +34 │ │ │ │ │ +35 public: │ │ │ │ │ +36 │ │ │ │ │ +_3_8 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ 39 │ │ │ │ │ -40 template class TransformedNode> │ │ │ │ │ -_4_1 struct _G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ -42 { │ │ │ │ │ -43 template │ │ │ │ │ -_4_4 struct _r_e_s_u_l_t │ │ │ │ │ -45 { │ │ │ │ │ -_4_6 typedef TransformedNode _t_y_p_e; │ │ │ │ │ -47 }; │ │ │ │ │ -48 }; │ │ │ │ │ -49 │ │ │ │ │ +_4_1 static const bool _i_s_P_o_w_e_r = true; │ │ │ │ │ +42 │ │ │ │ │ +_4_4 static const bool _i_s_C_o_m_p_o_s_i_t_e = false; │ │ │ │ │ +45 │ │ │ │ │ +_4_7 std::size_t _d_e_g_r_e_e() const │ │ │ │ │ +48 { │ │ │ │ │ +49 return _children.size(); │ │ │ │ │ +50 } │ │ │ │ │ 51 │ │ │ │ │ -52 } // namespace TypeTree │ │ │ │ │ -53} //namespace Dune │ │ │ │ │ +_5_3 typedef _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ 54 │ │ │ │ │ -55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH │ │ │ │ │ -_n_o_d_e_i_n_t_e_r_f_a_c_e_._h_h │ │ │ │ │ +_5_6 typedef T _C_h_i_l_d_T_y_p_e; │ │ │ │ │ +57 │ │ │ │ │ +_5_9 typedef std::shared_ptr _C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e; │ │ │ │ │ +60 │ │ │ │ │ +_6_2 typedef std::shared_ptr _C_h_i_l_d_C_o_n_s_t_S_t_o_r_a_g_e_T_y_p_e; │ │ │ │ │ +63 │ │ │ │ │ +_6_5 typedef std::vector _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +66 │ │ │ │ │ +67 │ │ │ │ │ +70 │ │ │ │ │ +72 │ │ │ │ │ +_7_5 _C_h_i_l_d_T_y_p_e& _c_h_i_l_d (std::size_t i) │ │ │ │ │ +76 { │ │ │ │ │ +77 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +78 return *_children[i]; │ │ │ │ │ +79 } │ │ │ │ │ +80 │ │ │ │ │ +82 │ │ │ │ │ +_8_5 const _C_h_i_l_d_T_y_p_e& _c_h_i_l_d (std::size_t i) const │ │ │ │ │ +86 { │ │ │ │ │ +87 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +88 return *_children[i]; │ │ │ │ │ +89 } │ │ │ │ │ +90 │ │ │ │ │ +92 │ │ │ │ │ +_9_5 _C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) │ │ │ │ │ +96 { │ │ │ │ │ +97 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +98 return _children[i]; │ │ │ │ │ +99 } │ │ │ │ │ +100 │ │ │ │ │ +102 │ │ │ │ │ +_1_0_8 _C_h_i_l_d_C_o_n_s_t_S_t_o_r_a_g_e_T_y_p_e _c_h_i_l_d_S_t_o_r_a_g_e (std::size_t i) const │ │ │ │ │ +109 { │ │ │ │ │ +110 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +111 return _children[i]; │ │ │ │ │ +112 } │ │ │ │ │ +113 │ │ │ │ │ +_1_1_5 void _s_e_t_C_h_i_l_d (std::size_t i, _C_h_i_l_d_T_y_p_e& t) │ │ │ │ │ +116 { │ │ │ │ │ +117 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +118 _children[i] = stackobject_to_shared_ptr(t); │ │ │ │ │ +119 } │ │ │ │ │ +120 │ │ │ │ │ +_1_2_2 void _s_e_t_C_h_i_l_d (std::size_t i, _C_h_i_l_d_T_y_p_e&& t) │ │ │ │ │ +123 { │ │ │ │ │ +124 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +125 _children[i] = convert_arg(std::move(t)); │ │ │ │ │ +126 } │ │ │ │ │ +127 │ │ │ │ │ +_1_2_9 void _s_e_t_C_h_i_l_d (std::size_t i, _C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e st) │ │ │ │ │ +130 { │ │ │ │ │ +131 assert(i < _d_e_g_r_e_e() && "child index out of range"); │ │ │ │ │ +132 _children[i] = std::move(st); │ │ │ │ │ +133 } │ │ │ │ │ +134 │ │ │ │ │ +_1_3_5 const _N_o_d_e_S_t_o_r_a_g_e& _n_o_d_e_S_t_o_r_a_g_e () const │ │ │ │ │ +136 { │ │ │ │ │ +137 return _children; │ │ │ │ │ +138 } │ │ │ │ │ +139 │ │ │ │ │ +141 │ │ │ │ │ +144 │ │ │ │ │ +145 protected: │ │ │ │ │ +146 │ │ │ │ │ +_1_4_9 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e () = delete; │ │ │ │ │ +150 │ │ │ │ │ +152 │ │ │ │ │ +_1_6_0 explicit _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (std::size_t size) │ │ │ │ │ +161 : _children(size) │ │ │ │ │ +162 {} │ │ │ │ │ +163 │ │ │ │ │ +_1_6_5 explicit _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (_N_o_d_e_S_t_o_r_a_g_e children) │ │ │ │ │ +166 : _children(std::move(children)) │ │ │ │ │ +167 {} │ │ │ │ │ +168 │ │ │ │ │ +169#ifdef DOXYGEN │ │ │ │ │ +170 │ │ │ │ │ +_1_7_2 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (T& t1, T& t2, ...) │ │ │ │ │ +173 {} │ │ │ │ │ +174 │ │ │ │ │ +175#else │ │ │ │ │ +176 │ │ │ │ │ +177 template> &&...), │ │ │ │ │ +bool> = true> │ │ │ │ │ +179 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (Children&&... children) │ │ │ │ │ +180 { │ │ │ │ │ +181 _children = _N_o_d_e_S_t_o_r_a_g_e{convert_arg(std::forward(children))...}; │ │ │ │ │ +182 } │ │ │ │ │ +183 │ │ │ │ │ +184 template> &&...), │ │ │ │ │ +bool> = true> │ │ │ │ │ +186 _D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e (std::shared_ptr... children) │ │ │ │ │ +187 { │ │ │ │ │ +188 _children = _N_o_d_e_S_t_o_r_a_g_e{std::move(children)...}; │ │ │ │ │ +189 } │ │ │ │ │ +190 │ │ │ │ │ +191#endif // DOXYGEN │ │ │ │ │ +192 │ │ │ │ │ +194 │ │ │ │ │ +195 private: │ │ │ │ │ +196 _N_o_d_e_S_t_o_r_a_g_e _children; │ │ │ │ │ +197 }; │ │ │ │ │ +198 │ │ │ │ │ +200 │ │ │ │ │ +201 } // namespace TypeTree │ │ │ │ │ +202} //namespace Dune │ │ │ │ │ +203 │ │ │ │ │ +204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH │ │ │ │ │ +_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ +_n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ +_u_t_i_l_i_t_y_._h_h │ │ │ │ │ _D_u_n_e │ │ │ │ │ DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:21 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:24 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:25 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:32 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:35 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNode< SourceNode, TC > type │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:36 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:42 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:45 │ │ │ │ │ -_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_G_e_n_e_r_i_c_C_o_m_p_o_s_i_t_e_N_o_d_e_T_r_a_n_s_f_o_r_m_a_t_i_o_n_T_e_m_p_l_a_t_e_:_:_r_e_s_u_l_t_:_:_t_y_p_e │ │ │ │ │ -TransformedNode< SourceNode, TC... > type │ │ │ │ │ -DDeeffiinniittiioonn powercompositenodetransformationtemplates.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ +Collect multiple instances of type T within a dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:33 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a power in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:41 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +std::vector< ChildStorageType > NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:65 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +const NodeStorage & nodeStorage() const │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:135 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +ChildConstStorageType childStorage(std::size_t i) const │ │ │ │ │ +Returns the storage of the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:108 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const ChildType & child(std::size_t i) const │ │ │ │ │ +Returns the i-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:85 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_S_t_o_r_a_g_e_T_y_p_e │ │ │ │ │ +std::shared_ptr< T > ChildStorageType │ │ │ │ │ +The storage type of each child. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:59 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ +DynamicPowerNode(T &t1, T &t2,...) │ │ │ │ │ +Initialize all children with the passed-in objects. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:172 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_C_o_n_s_t_S_t_o_r_a_g_e_T_y_p_e │ │ │ │ │ +std::shared_ptr< const T > ChildConstStorageType │ │ │ │ │ +The const version of the storage type of each child. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:62 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ +DynamicPowerNode(NodeStorage children) │ │ │ │ │ +Initialize the DynamicPowerNode with a copy of the passed-in storage type. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:165 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +DynamicPowerNodeTag NodeTag │ │ │ │ │ +The type tag that describes the node. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:53 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e │ │ │ │ │ +T ChildType │ │ │ │ │ +The type of each child. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:56 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(std::size_t i, ChildType &t) │ │ │ │ │ +Sets the i-th child to the passed-in value. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:115 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(std::size_t i, ChildStorageType st) │ │ │ │ │ +Sets the stored value representing the i-th child to the passed-in value. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:129 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ +DynamicPowerNode(std::size_t size) │ │ │ │ │ +Construct a node with the given number of children. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:160 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a non composite in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:44 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(std::size_t i, ChildType &&t) │ │ │ │ │ +Store the passed value in i-th child. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:122 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +ChildType & child(std::size_t i) │ │ │ │ │ +Returns the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:75 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +std::size_t degree() const │ │ │ │ │ +The number of children. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:47 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +ChildStorageType childStorage(std::size_t i) │ │ │ │ │ +Returns the storage of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:95 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn dynamicpowernode.hh:38 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e │ │ │ │ │ +DynamicPowerNode()=delete │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_D_y_n_a_m_i_c_P_o_w_e_r_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a power node with runtime degree. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:22 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetree.hh File Reference │ │ │ │ +dune-typetree: compositenode.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -69,32 +69,45 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
typetree.hh File Reference
│ │ │ │ +
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
compositenode.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 <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.

│ │ │ │ +

│ │ │ │ Namespaces

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

│ │ │ │ +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
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -1,23 +1,29 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -typetree.hh File Reference │ │ │ │ │ +_C_l_a_s_s_e_s | _N_a_m_e_s_p_a_c_e_s │ │ │ │ │ +compositenode.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_l_e_a_f_n_o_d_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_d_y_n_a_m_i_c_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_o_m_p_o_s_i_t_e_n_o_d_e_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_a_i_r_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ -#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_a_c_c_u_m_u_l_a_t_e___s_t_a_t_i_c_._h_h> │ │ │ │ │ #include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ +#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _s_o_u_r_c_e_ _c_o_d_e_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ +CCllaasssseess │ │ │ │ │ + class   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _C_h_i_l_d_r_e_n_ _> │ │ │ │ │ +  Base class for composite nodes based on variadic templates. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +struct   _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_<_ _C_h_i_l_d_r_e_n_ _>_:_:_C_h_i_l_d_<_ _k_ _> │ │ │ │ │ +  Access to the type and storage type of the i-th child. _M_o_r_e_._._. │ │ │ │ │ +  │ │ │ │ │ +NNaammeessppaacceess │ │ │ │ │ +namespace   _D_u_n_e │ │ │ │ │ +  │ │ │ │ │ +namespace   _D_u_n_e_:_:_T_y_p_e_T_r_e_e │ │ │ │ │ +  │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00086_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-typetree: typetree.hh Source File │ │ │ │ +dune-typetree: compositenode.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,51 +74,270 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
typetree.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_HH
│ │ │ │ -
5#define DUNE_TYPETREE_HH
│ │ │ │ +
4#ifndef DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │ +
5#define DUNE_TYPETREE_COMPOSITENODE_HH
│ │ │ │
6
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
20
│ │ │ │ -
21#endif // DUNE_TYPETREE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
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:
│ │ │ │ +
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);
│ │ │ │ +
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>
│ │ │ │ +
│ │ │ │ +
98 std::shared_ptr<typename Child<k>::Type> childStorage (index_constant<k> = {})
│ │ │ │ +
99 {
│ │ │ │ +
100 return std::get<k>(_children);
│ │ │ │ +
101 }
│ │ │ │ +
│ │ │ │ +
102
│ │ │ │ +
104
│ │ │ │ +
107 template<std::size_t k>
│ │ │ │ +
│ │ │ │ +
108 std::shared_ptr<const typename Child<k>::Type> childStorage (index_constant<k> = {}) const
│ │ │ │ +
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
│ │ │ │ +
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 {} │ │ │ │ │ @@ -1,44 +1,326 @@ │ │ │ │ │ dune-typetree 2.9 │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * _d_u_n_e │ │ │ │ │ * _t_y_p_e_t_r_e_e │ │ │ │ │ -typetree.hh │ │ │ │ │ +compositenode.hh │ │ │ │ │ _G_o_ _t_o_ _t_h_e_ _d_o_c_u_m_e_n_t_a_t_i_o_n_ _o_f_ _t_h_i_s_ _f_i_l_e_. │ │ │ │ │ 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_COMPOSITENODE_HH │ │ │ │ │ +5#define DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ 6 │ │ │ │ │ -7#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ -8#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_u_t_i_l_i_t_y_._h_h> │ │ │ │ │ -9#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_l_e_a_f_n_o_d_e_._h_h> │ │ │ │ │ -10#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ -11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_d_y_n_a_m_i_c_p_o_w_e_r_n_o_d_e_._h_h> │ │ │ │ │ -12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_o_m_p_o_s_i_t_e_n_o_d_e_._h_h> │ │ │ │ │ -13#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ -14#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_p_a_i_r_t_r_a_v_e_r_s_a_l_._h_h> │ │ │ │ │ -15#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_v_e_r_s_a_l_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ -16#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_._h_h> │ │ │ │ │ -17#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_r_a_n_s_f_o_r_m_a_t_i_o_n_u_t_i_l_i_t_i_e_s_._h_h> │ │ │ │ │ -18#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_a_c_c_u_m_u_l_a_t_e___s_t_a_t_i_c_._h_h> │ │ │ │ │ -19#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ -20 │ │ │ │ │ -21#endif // DUNE_TYPETREE_HH │ │ │ │ │ -_c_o_m_p_o_s_i_t_e_n_o_d_e_._h_h │ │ │ │ │ -_p_o_w_e_r_n_o_d_e_._h_h │ │ │ │ │ -_u_t_i_l_i_t_y_._h_h │ │ │ │ │ -_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ -_a_c_c_u_m_u_l_a_t_e___s_t_a_t_i_c_._h_h │ │ │ │ │ -_t_r_a_n_s_f_o_r_m_a_t_i_o_n_._h_h │ │ │ │ │ -_t_r_a_n_s_f_o_r_m_a_t_i_o_n_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ │ +7#include │ │ │ │ │ +8#include │ │ │ │ │ +9#include │ │ │ │ │ +10 │ │ │ │ │ +11#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_n_o_d_e_t_a_g_s_._h_h> │ │ │ │ │ +12#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h> │ │ │ │ │ +13#include <_d_u_n_e_/_t_y_p_e_t_r_e_e_/_t_y_p_e_t_r_a_i_t_s_._h_h> │ │ │ │ │ +14 │ │ │ │ │ +15namespace _D_u_n_e { │ │ │ │ │ +16 namespace TypeTree { │ │ │ │ │ +17 │ │ │ │ │ +24 template │ │ │ │ │ +_2_5 class _C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +26 { │ │ │ │ │ +27 │ │ │ │ │ +28 public: │ │ │ │ │ +29 │ │ │ │ │ +_3_1 typedef _C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g _N_o_d_e_T_a_g; │ │ │ │ │ +32 │ │ │ │ │ +_3_4 typedef std::tuple... > _N_o_d_e_S_t_o_r_a_g_e; │ │ │ │ │ +35 │ │ │ │ │ +_3_7 typedef std::tuple _C_h_i_l_d_T_y_p_e_s; │ │ │ │ │ +38 │ │ │ │ │ +_4_0 static const bool _i_s_L_e_a_f = false; │ │ │ │ │ +41 │ │ │ │ │ +_4_3 static const bool _i_s_P_o_w_e_r = false; │ │ │ │ │ +44 │ │ │ │ │ +_4_6 static const bool _i_s_C_o_m_p_o_s_i_t_e = true; │ │ │ │ │ +47 │ │ │ │ │ +49 [[deprecated("Will be removed after release 2.9. Use degree()")]] │ │ │ │ │ +_5_0 static const std::size_t _C_H_I_L_D_R_E_N = sizeof...(Children); │ │ │ │ │ +51 │ │ │ │ │ +_5_2 static constexpr auto _d_e_g_r_e_e () │ │ │ │ │ +53 { │ │ │ │ │ +54 return std::integral_constant{}; │ │ │ │ │ +55 } │ │ │ │ │ +56 │ │ │ │ │ +58 template │ │ │ │ │ +_5_9 struct _C_h_i_l_d { │ │ │ │ │ +60 │ │ │ │ │ +61 static_assert((k < _d_e_g_r_e_e()), "child index out of range"); │ │ │ │ │ +62 │ │ │ │ │ +_6_4 typedef typename std::tuple_element::type _T_y_p_e; │ │ │ │ │ +65 │ │ │ │ │ +_6_7 typedef typename std::tuple_element::type _t_y_p_e; │ │ │ │ │ +68 }; │ │ │ │ │ +69 │ │ │ │ │ +72 │ │ │ │ │ +74 │ │ │ │ │ +77 template │ │ │ │ │ +_7_8 typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e& _c_h_i_l_d (index_constant = {}) │ │ │ │ │ +79 { │ │ │ │ │ +80 return *std::get(_children); │ │ │ │ │ +81 } │ │ │ │ │ +82 │ │ │ │ │ +84 │ │ │ │ │ +87 template │ │ │ │ │ +_8_8 const typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e& _c_h_i_l_d (index_constant = {}) const │ │ │ │ │ +89 { │ │ │ │ │ +90 return *std::get(_children); │ │ │ │ │ +91 } │ │ │ │ │ +92 │ │ │ │ │ +94 │ │ │ │ │ +97 template │ │ │ │ │ +_9_8 std::shared_ptr::Type> _c_h_i_l_d_S_t_o_r_a_g_e (index_constant = │ │ │ │ │ +{}) │ │ │ │ │ +99 { │ │ │ │ │ +100 return std::get(_children); │ │ │ │ │ +101 } │ │ │ │ │ +102 │ │ │ │ │ +104 │ │ │ │ │ +107 template │ │ │ │ │ +_1_0_8 std::shared_ptr::Type> _c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +(index_constant = {}) const │ │ │ │ │ +109 { │ │ │ │ │ +110 return std::get(_children); │ │ │ │ │ +111 } │ │ │ │ │ +112 │ │ │ │ │ +114 template │ │ │ │ │ +_1_1_5 void _s_e_t_C_h_i_l_d (typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e& _c_h_i_l_d, index_constant = {}) │ │ │ │ │ +116 { │ │ │ │ │ +117 std::get(_children) = stackobject_to_shared_ptr(_c_h_i_l_d); │ │ │ │ │ +118 } │ │ │ │ │ +119 │ │ │ │ │ +121 template │ │ │ │ │ +_1_2_2 void _s_e_t_C_h_i_l_d (typename _C_h_i_l_d_<_k_>_:_:_T_y_p_e&& _c_h_i_l_d, index_constant = {}) │ │ │ │ │ +123 { │ │ │ │ │ +124 std::get(_children) = convert_arg(std::move(_c_h_i_l_d)); │ │ │ │ │ +125 } │ │ │ │ │ +126 │ │ │ │ │ +128 template │ │ │ │ │ +_1_2_9 void _s_e_t_C_h_i_l_d (std::shared_ptr_:_:_T_y_p_e> _c_h_i_l_d, │ │ │ │ │ +index_constant = {}) │ │ │ │ │ +130 { │ │ │ │ │ +131 std::get(_children) = std::move(_c_h_i_l_d); │ │ │ │ │ +132 } │ │ │ │ │ +133 │ │ │ │ │ +_1_3_4 const _N_o_d_e_S_t_o_r_a_g_e& _n_o_d_e_S_t_o_r_a_g_e () 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 │ │ │ │ │ +_1_6_8 ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ +169#else │ │ │ │ │ +170 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ +172 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ +179 } │ │ │ │ │ +180 │ │ │ │ │ +182 │ │ │ │ │ +186#ifdef DOXYGEN │ │ │ │ │ +187 template │ │ │ │ │ +_1_8_8 const ImplementationDefined& _c_h_i_l_d (Indices... indices) │ │ │ │ │ +189#else │ │ │ │ │ +190 template 0) || _I_s_T_r_e_e_P_a_t_h_<_I_0_>_:_:_v_a_l_u_e, int > = 0> │ │ │ │ │ +192 decltype(auto) _c_h_i_l_d (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 _D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d(*this,i0,i...); │ │ │ │ │ +199 } │ │ │ │ │ +200 │ │ │ │ │ +202 │ │ │ │ │ +203 protected: │ │ │ │ │ +204 │ │ │ │ │ +207 │ │ │ │ │ +209 │ │ │ │ │ +_2_1_6 _C_o_m_p_o_s_i_t_e_N_o_d_e () │ │ │ │ │ +217 {} │ │ │ │ │ +218 │ │ │ │ │ +220 template::type> │ │ │ │ │ +_2_2_1 _C_o_m_p_o_s_i_t_e_N_o_d_e (Args&&... args) │ │ │ │ │ +222 : _children(convert_arg(std::forward(args))...) │ │ │ │ │ +223 {} │ │ │ │ │ +224 │ │ │ │ │ +_2_2_6 _C_o_m_p_o_s_i_t_e_N_o_d_e (std::shared_ptr... children) │ │ │ │ │ +227 : _children(std::move(children)...) │ │ │ │ │ +228 {} │ │ │ │ │ +229 │ │ │ │ │ +_2_3_1 _C_o_m_p_o_s_i_t_e_N_o_d_e (const _N_o_d_e_S_t_o_r_a_g_e& children) │ │ │ │ │ +232 : _children(children) │ │ │ │ │ +233 {} │ │ │ │ │ +234 │ │ │ │ │ +236 │ │ │ │ │ +237 private: │ │ │ │ │ +238 _N_o_d_e_S_t_o_r_a_g_e _children; │ │ │ │ │ +239 }; │ │ │ │ │ +240 │ │ │ │ │ +242 │ │ │ │ │ +243 } // namespace TypeTree │ │ │ │ │ +244} //namespace Dune │ │ │ │ │ +245 │ │ │ │ │ +246#endif // DUNE_TYPETREE_COMPOSITENODE_HH │ │ │ │ │ +_t_y_p_e_t_r_a_i_t_s_._h_h │ │ │ │ │ _n_o_d_e_t_a_g_s_._h_h │ │ │ │ │ -_d_y_n_a_m_i_c_p_o_w_e_r_n_o_d_e_._h_h │ │ │ │ │ -_t_r_a_v_e_r_s_a_l_u_t_i_l_i_t_i_e_s_._h_h │ │ │ │ │ -_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ -_l_e_a_f_n_o_d_e_._h_h │ │ │ │ │ -_p_a_i_r_t_r_a_v_e_r_s_a_l_._h_h │ │ │ │ │ +_c_h_i_l_d_e_x_t_r_a_c_t_i_o_n_._h_h │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined child(Node &&node, Indices... indices) │ │ │ │ │ +Extracts the child of a node given by a sequence of compile-time and run-time │ │ │ │ │ +indices. │ │ │ │ │ +DDeeffiinniittiioonn childextraction.hh:126 │ │ │ │ │ +_D_u_n_e │ │ │ │ │ +DDeeffiinniittiioonn accumulate_static.hh:13 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +Base class for composite nodes based on variadic templates. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:26 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_L_e_a_f │ │ │ │ │ +static const bool isLeaf │ │ │ │ │ +Mark this class as non leaf in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:40 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:168 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_C_o_m_p_o_s_i_t_e │ │ │ │ │ +static const bool isComposite │ │ │ │ │ +Mark this class as a composite in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:46 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_H_I_L_D_R_E_N │ │ │ │ │ +static const std::size_t CHILDREN │ │ │ │ │ +The number of children. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:50 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +CompositeNode() │ │ │ │ │ +Default constructor. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:216 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_T_a_g │ │ │ │ │ +CompositeNodeTag NodeTag │ │ │ │ │ +The type tag that describes a CompositeNode. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:31 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(typename Child< k >::Type &child, index_constant< k >={}) │ │ │ │ │ +Sets the k-th child to the passed-in value. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:115 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +void setChild(typename Child< k >::Type &&child, index_constant< k >={}) │ │ │ │ │ +Store the passed value in k-th child. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:122 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_d_e_g_r_e_e │ │ │ │ │ +static constexpr auto degree() │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:52 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_n_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +const NodeStorage & nodeStorage() const │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:134 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +CompositeNode(std::shared_ptr< Children >... children) │ │ │ │ │ +Initialize the CompositeNode with copies of the passed in Storage objects. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:226 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< typename Child< k >::Type > childStorage(index_constant< k >= │ │ │ │ │ +{}) │ │ │ │ │ +Returns the storage of the k-th child. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:98 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_T_y_p_e_s │ │ │ │ │ +std::tuple< Children... > ChildTypes │ │ │ │ │ +A tuple storing the types of all children. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:37 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_s_e_t_C_h_i_l_d │ │ │ │ │ +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. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:129 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const ImplementationDefined & child(Indices... indices) │ │ │ │ │ +Returns the child given by the list of indices. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:188 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_i_s_P_o_w_e_r │ │ │ │ │ +static const bool isPower │ │ │ │ │ +Mark this class as a non power in the dune-typetree. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:43 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d_S_t_o_r_a_g_e │ │ │ │ │ +std::shared_ptr< const typename Child< k >::Type > childStorage(index_constant< │ │ │ │ │ +k >={}) const │ │ │ │ │ +Returns the storage of the k-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:108 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +Child< k >::Type & child(index_constant< k >={}) │ │ │ │ │ +Returns the k-th child. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:78 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e │ │ │ │ │ +CompositeNode(const NodeStorage &children) │ │ │ │ │ +Initialize the CompositeNode with a copy of the passed-in storage type. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:231 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_N_o_d_e_S_t_o_r_a_g_e │ │ │ │ │ +std::tuple< std::shared_ptr< Children >... > NodeStorage │ │ │ │ │ +The type used for storing the children. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:34 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_c_h_i_l_d │ │ │ │ │ +const Child< k >::Type & child(index_constant< k >={}) const │ │ │ │ │ +Returns the k-th child (const version). │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:88 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d │ │ │ │ │ +Access to the type and storage type of the i-th child. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:59 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_T_y_p_e │ │ │ │ │ +std::tuple_element< k, ChildTypes >::type Type │ │ │ │ │ +The type of the child. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:64 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_:_:_C_h_i_l_d_:_:_t_y_p_e │ │ │ │ │ +std::tuple_element< k, ChildTypes >::type type │ │ │ │ │ +The type of the child. │ │ │ │ │ +DDeeffiinniittiioonn compositenode.hh:67 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_C_o_m_p_o_s_i_t_e_N_o_d_e_T_a_g │ │ │ │ │ +Tag designating a composite node. │ │ │ │ │ +DDeeffiinniittiioonn nodetags.hh:25 │ │ │ │ │ +_D_u_n_e_:_:_T_y_p_e_T_r_e_e_:_:_I_s_T_r_e_e_P_a_t_h │ │ │ │ │ +Check if type represents a tree path. │ │ │ │ │ +DDeeffiinniittiioonn typetraits.hh:182 │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by _[_d_o_x_y_g_e_n_] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00923.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00931.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00939.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00947.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00955.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00963.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a00971.html │ │ │ │ @@ -78,26 +78,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -111,15 +111,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01015.html │ │ │ │ @@ -80,15 +80,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.
 
│ │ │ │ @@ -124,19 +124,19 @@ │ │ │ │
static const bool value = true;
│ │ │ │
};
│ │ │ │
│ │ │ │
// Calculate the per-node result.
│ │ │ │
template<typename Node, typename TreePath>
│ │ │ │
struct visit
│ │ │ │
{
│ │ │ │ -
static const result_type result = ...;
│ │ │ │ +
static const result_type result = ...;
│ │ │ │
};
│ │ │ │
│ │ │ │
};
│ │ │ │ -
static const result_type result
Definition accumulate_static.hh:110
│ │ │ │ +
static const result_type result
Definition accumulate_static.hh:110
│ │ │ │
Functor::result_type result_type
The result type of the computation.
Definition accumulate_static.hh:262
│ │ │ │
Template Parameters
│ │ │ │
│ │ │ │ │ │ │ │
ReductionThe reduction operator used to accumulate the per-node results.
│ │ │ │ │ │ │ │ │ │ │ │ @@ -145,15 +145,15 @@ │ │ │ │
struct ReductionOperator
│ │ │ │
{
│ │ │ │
│ │ │ │
// combine two per-node results
│ │ │ │
template<result_type r1, result_type r2>
│ │ │ │
struct reduce
│ │ │ │
{
│ │ │ │ -
static const result_type result = ...;
│ │ │ │ +
static const result_type result = ...;
│ │ │ │
};
│ │ │ │
│ │ │ │
};
│ │ │ │
Template Parameters
│ │ │ │ │ │ │ │ │ │ │ │
startValueThe starting value fed into the initial accumulation step.
│ │ │ │ @@ -202,15 +202,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 │ │ │ │ @@ -76,15 +76,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -220,15 +220,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 │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -118,15 +118,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 │ │ │ │ @@ -82,15 +82,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...
 
│ │ │ │ @@ -848,15 +848,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 │ │ │ │ @@ -79,15 +79,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>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,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 │ │ │ │ @@ -81,15 +81,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.
 
typedef std::tuple_element< k, ChildTypes >::type type
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -776,15 +776,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 │ │ │ │ @@ -76,29 +76,29 @@ │ │ │ │
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 │ │ │ │ @@ -82,15 +82,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.
 
typedef T ChildType
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  Child
 Access to the type and storage type of the i-th child. More...
 
│ │ │ │ @@ -722,15 +722,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 │ │ │ │ @@ -79,15 +79,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>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,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 │ │ │ │ @@ -76,20 +76,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 │ │ │ │ @@ -81,15 +81,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.
 
typedef OriginalChild::type type
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Classes

struct  apply
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -144,15 +144,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01111.html │ │ │ │ @@ -76,15 +76,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -143,15 +143,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 │ │ │ │ @@ -76,19 +76,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 │ │ │ │ @@ -76,19 +76,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 │ │ │ │ @@ -80,15 +80,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -124,15 +124,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 │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -111,15 +111,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 │ │ │ │ @@ -80,15 +80,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -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/a01135.html │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -118,15 +118,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 │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -127,15 +127,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -126,15 +126,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 │ │ │ │ @@ -78,27 +78,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 │ │ │ │ @@ -79,15 +79,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

│ │ │ │ @@ -110,15 +110,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01187.html │ │ │ │ @@ -77,15 +77,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -481,15 +481,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01195.html │ │ │ │ @@ -76,15 +76,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -478,15 +478,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01199.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::GenericLeafNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -275,15 +275,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/a01203.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

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

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -156,15 +156,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

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

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::GenericPowerNodeTransformation< SourceNode, Transformation, TransformedNode >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -93,19 +93,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
 
│ │ │ │ @@ -116,29 +116,29 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -158,29 +158,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 
)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -200,29 +200,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 
)
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -243,28 +243,28 @@ │ │ │ │
│ │ │ │
│ │ │ │
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
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01215.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -279,15 +279,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01219.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

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

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::GenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -93,19 +93,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
 
│ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -158,15 +158,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,
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -200,15 +200,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,
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -243,28 +243,28 @@ │ │ │ │
│ │ │ │
│ │ │ │
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
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01227.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -279,15 +279,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01231.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
│ │ │ │ Public Types | │ │ │ │ List of all members
│ │ │ │
Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

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

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │ +

#include <dune/typetree/generictransformationdescriptors.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::TypeTree::GenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -93,19 +93,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
 
│ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -158,15 +158,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,
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -200,15 +200,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,
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -243,28 +243,28 @@ │ │ │ │
│ │ │ │
│ │ │ │
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
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01239.html │ │ │ │ @@ -82,15 +82,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.
 
│ │ │ │ @@ -289,15 +289,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 │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
Dune::TypeTree::NodeInterface Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

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

│ │ │ │ │ │ │ │ -

#include <dune/typetree/nodeinterface.hh>

│ │ │ │ +

#include <dune/typetree/nodeinterface.hh>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -284,15 +284,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 │ │ │ │ @@ -76,19 +76,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 │ │ │ │ @@ -76,19 +76,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 │ │ │ │ @@ -76,19 +76,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 │ │ │ │ @@ -76,19 +76,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 │ │ │ │ @@ -75,23 +75,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.
 
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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01271.html │ │ │ │ @@ -75,23 +75,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01279.html │ │ │ │ @@ -75,23 +75,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01287.html │ │ │ │ @@ -82,15 +82,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...
 
│ │ │ │ @@ -1145,15 +1145,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 │ │ │ │ @@ -79,15 +79,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>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -136,15 +136,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 │ │ │ │ @@ -82,15 +82,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -538,15 +538,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -340,15 +340,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 │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -92,15 +92,15 @@ │ │ │ │ │ │ │ │
│ │ │ │

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 │ │ │ │ @@ -78,15 +78,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -524,15 +524,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 │ │ │ │ @@ -91,15 +91,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 │ │ │ │ @@ -76,20 +76,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -338,15 +338,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -545,15 +545,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -545,15 +545,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 │ │ │ │ @@ -78,15 +78,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.
 
typedef T type
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -235,15 +235,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 │ │ │ │ @@ -78,15 +78,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
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -218,15 +218,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01343.html │ │ │ │ @@ -77,15 +77,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -156,15 +156,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef TransformedNode< TC, StaticDegree< SourceNode >::value > type
 
typedef std::shared_ptr< typestorage_type
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01347.html │ │ │ │ @@ -78,15 +78,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
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -218,15 +218,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01351.html │ │ │ │ @@ -76,15 +76,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef TransformedNode< TC > type
 
typedef std::shared_ptr< typestorage_type
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01355.html │ │ │ │ @@ -78,15 +78,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
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -218,15 +218,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01359.html │ │ │ │ @@ -76,15 +76,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef TransformedNode< TC... > type
 
typedef std::shared_ptr< typestorage_type
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01363.html │ │ │ │ @@ -80,15 +80,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -397,15 +397,15 @@ │ │ │ │

│ │ │ │ Public Types

typedef transformed_type type
 The type of the transformed tree.
 
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 │ │ │ │ @@ -76,15 +76,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -157,15 +157,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 ContainerFactory (LeafToValue leafToValue)
 Create ContainerFactory.
 
template<class Node >
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01375.html │ │ │ │ @@ -76,15 +76,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -348,15 +348,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 │ │ │ │ @@ -76,15 +76,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.
 
template<class Tree , TypeTreeConcept< Tree > = true>
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

template<class Node >
auto operator() (const Node &node) const
 
│ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01383.html │ │ │ │ @@ -81,15 +81,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.
 
│ │ │ │ @@ -576,15 +576,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 │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -85,15 +85,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01403.html │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -85,15 +85,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01411.html │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -73,27 +73,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01427.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01431.html │ │ │ │ @@ -73,27 +73,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
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 │ │ │ │ @@ -73,29 +73,29 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
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 │ │ │ │ @@ -73,27 +73,27 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01447.html │ │ │ │ @@ -73,29 +73,29 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01455.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01459.html │ │ │ │ @@ -73,15 +73,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01467.html │ │ │ │ @@ -78,15 +78,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -191,15 +191,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01475.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01479.html │ │ │ │ @@ -78,15 +78,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -193,15 +193,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01487.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01491.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01495.html │ │ │ │ @@ -78,15 +78,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -191,15 +191,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01503.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01507.html │ │ │ │ @@ -78,15 +78,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -193,15 +193,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 │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -103,15 +103,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01515.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01519.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01523.html │ │ │ │ @@ -76,15 +76,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

│ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01527.html │ │ │ │ @@ -76,20 +76,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 │ │ │ │ @@ -79,15 +79,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

│ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01535.html │ │ │ │ @@ -79,15 +79,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

│ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01539.html │ │ │ │ @@ -79,15 +79,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

│ │ │ │ @@ -107,15 +107,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01543.html │ │ │ │ @@ -76,15 +76,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -98,15 +98,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 │ │ │ │ @@ -79,15 +79,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>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -184,15 +184,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -451,15 +451,15 @@ │ │ │ │

│ │ │ │ Static Public Attributes

static const std::size_t depth = NodeInfo::depth
 The depth of the TypeTree.
 
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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -515,15 +515,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01559.html │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -501,15 +501,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 │ │ │ │ @@ -78,15 +78,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -102,15 +102,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 │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -118,15 +118,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 │ │ │ │ @@ -78,15 +78,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -108,15 +108,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 │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -118,15 +118,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

Visit any child.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01579.html │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -131,15 +131,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 │ │ │ │ @@ -79,15 +79,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.
 
│ │ │ │ @@ -117,15 +117,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 │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -442,15 +442,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01591.html │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -442,15 +442,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01595.html │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -499,15 +499,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01599.html │ │ │ │ @@ -79,15 +79,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -499,15 +499,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/a01603.html │ │ │ │ @@ -77,15 +77,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -686,15 +686,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 │ │ │ │ @@ -77,15 +77,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -733,15 +733,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 │ │ │ │ @@ -77,15 +77,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
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -566,15 +566,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 │ │ │ │ @@ -84,68 +84,68 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

 accumulate_static.hh
 accumulate_static.hh
 
 childextraction.hh
 childextraction.hh
 
 compositenode.hh
 compositenode.hh
 
 dynamicpowernode.hh
 dynamicpowernode.hh
 
 exceptions.hh
 TypeTree-specific exceptions.
 exceptions.hh
 TypeTree-specific exceptions.
 
 filteredcompositenode.hh
 filteredcompositenode.hh
 
 filters.hh
 filters.hh
 
 fixedcapacitystack.hh
 fixedcapacitystack.hh
 
 generictransformationdescriptors.hh
 generictransformationdescriptors.hh
 
 leafnode.hh
 leafnode.hh
 
 nodeinterface.hh
 nodeinterface.hh
 
 nodetags.hh
 nodetags.hh
 
 pairtraversal.hh
 pairtraversal.hh
 
 powercompositenodetransformationtemplates.hh
 powercompositenodetransformationtemplates.hh
 
 powernode.hh
 powernode.hh
 
 proxynode.hh
 proxynode.hh
 
 simpletransformationdescriptors.hh
 simpletransformationdescriptors.hh
 
 transformation.hh
 transformation.hh
 
 transformationutilities.hh
 
 traversal.hh
 
 traversalutilities.hh
 traversalutilities.hh
 
 treecontainer.hh
 treecontainer.hh
 
 treepath.hh
 treepath.hh
 
 typetraits.hh
 typetraits.hh
 
 typetree.hh
 typetree.hh
 
 utility.hh
 utility.hh
 
 visitor.hh
 visitor.hh
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./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/ │ │ │ │ │ │ - a00032.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ + a00065.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 │ │ │ │ │ │ @@ -36,81 +36,81 @@ │ │ │ │ │ │ Dune::TypeTree::AccumulateType │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::Experimental │ │ │ │ │ │ │ │ │ │ │ │ static const result_type │ │ │ │ │ │ result │ │ │ │ │ │ - a00032.html │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ acd23380b12c1509b3b3f31b893af75c8 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ static const result_type │ │ │ │ │ │ child_result │ │ │ │ │ │ - a00032.html │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ a5c902ae13e1b03f88e252f9fd9f85952 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ childextraction.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00026.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ + a00041.html │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ compositenode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00008.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ + a00086.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 │ │ │ │ │ │ + a00083.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/ │ │ │ │ │ │ - a00029.html │ │ │ │ │ │ + a00080.html │ │ │ │ │ │ Dune::TypeTree::Exception │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ filteredcompositenode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/filters.hh │ │ │ │ │ │ + a00014.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/ │ │ │ │ │ │ - a00059.html │ │ │ │ │ │ + a00035.html │ │ │ │ │ │ Dune::TypeTree::FilterEntry │ │ │ │ │ │ Dune::TypeTree::FilterResult │ │ │ │ │ │ Dune::TypeTree::FilterResult::apply │ │ │ │ │ │ Dune::TypeTree::SimpleFilterTag │ │ │ │ │ │ Dune::TypeTree::AdvancedFilterTag │ │ │ │ │ │ Dune::TypeTree::AdvancedFilter │ │ │ │ │ │ Dune::TypeTree::AdvancedFilter::apply │ │ │ │ │ │ @@ -122,27 +122,27 @@ │ │ │ │ │ │ Dune::TypeTree::filter::apply │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ fixedcapacitystack.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00023.html │ │ │ │ │ │ + a00056.html │ │ │ │ │ │ Dune::TypeTree::FixedCapacityStackView │ │ │ │ │ │ Dune::TypeTree::FixedCapacityStack │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ generictransformationdescriptors.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00041.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/powercompositenodetransformationtemplates.hh │ │ │ │ │ │ + a00050.html │ │ │ │ │ │ + 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 │ │ │ │ │ │ @@ -151,197 +151,197 @@ │ │ │ │ │ │ Dune::TypeTree::GenericCompositeNodeTransformation │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ leafnode.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00077.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00038.html │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ Dune::TypeTree::LeafNode │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ nodeinterface.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00062.html │ │ │ │ │ │ + a00059.html │ │ │ │ │ │ Dune::TypeTree::NodeInterface │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ nodetags.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00047.html │ │ │ │ │ │ + a00026.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/ │ │ │ │ │ │ - a00080.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/visitor.hh │ │ │ │ │ │ + a00011.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 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ powercompositenodetransformationtemplates.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00083.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ + a00008.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/ │ │ │ │ │ │ - a00014.html │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ + a00047.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/ │ │ │ │ │ │ - a00017.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00077.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/ │ │ │ │ │ │ - a00056.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00053.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/ │ │ │ │ │ │ - a00035.html │ │ │ │ │ │ - dune/typetree/typetraits.hh │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ + a00017.html │ │ │ │ │ │ + dune/typetree/typetraits.hh │ │ │ │ │ │ + dune/typetree/nodeinterface.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/utility.hh │ │ │ │ │ │ Dune::TypeTree::TransformTree │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ transformationutilities.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ a00044.html │ │ │ │ │ │ - dune/typetree/simpletransformationdescriptors.hh │ │ │ │ │ │ - dune/typetree/generictransformationdescriptors.hh │ │ │ │ │ │ + dune/typetree/simpletransformationdescriptors.hh │ │ │ │ │ │ + dune/typetree/generictransformationdescriptors.hh │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ traversal.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ a00071.html │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/visitor.hh │ │ │ │ │ │ + dune/typetree/childextraction.hh │ │ │ │ │ │ + dune/typetree/nodetags.hh │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ + dune/typetree/visitor.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::Detail │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ traversalutilities.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ dune/typetree/traversal.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ │ │ │ │ │ │ static const TreePathType::Type │ │ │ │ │ │ treePathType │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ ac933f134e17da9e8dbf18be15134df40 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ F │ │ │ │ │ │ _functor │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ a925ce4fb47f35dbaf1550d896578184f │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ R │ │ │ │ │ │ _reduction │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ a3399305aa17d4bcec74944e962ff3a12 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ResultType │ │ │ │ │ │ _value │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ ad4dc401736cbecb52f1afd1c8c8d359f │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ treecontainer.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00038.html │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ + a00062.html │ │ │ │ │ │ + dune/typetree/treepath.hh │ │ │ │ │ │ Dune::TypeTree::Detail::ContainerFactory │ │ │ │ │ │ Dune::TypeTree::Detail::TreeContainerVectorBackend │ │ │ │ │ │ Dune::TypeTree::Detail::LeafToDefaultConstructibleValue │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::Detail │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ treepath.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00065.html │ │ │ │ │ │ - dune/typetree/fixedcapacitystack.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ + a00074.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 >... > > │ │ │ │ │ │ @@ -352,17 +352,17 @@ │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::TreePathType │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ typetraits.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00074.html │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ + a00023.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 │ │ │ │ │ │ @@ -383,45 +383,45 @@ │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::TypeTree │ │ │ │ │ │ Dune::TypeTree::impl │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ typetree.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00086.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 │ │ │ │ │ │ + a00032.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/pairtraversal.hh │ │ │ │ │ │ + dune/typetree/traversalutilities.hh │ │ │ │ │ │ + dune/typetree/transformation.hh │ │ │ │ │ │ dune/typetree/transformationutilities.hh │ │ │ │ │ │ - dune/typetree/accumulate_static.hh │ │ │ │ │ │ - dune/typetree/childextraction.hh │ │ │ │ │ │ + dune/typetree/accumulate_static.hh │ │ │ │ │ │ + dune/typetree/childextraction.hh │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ utility.hh │ │ │ │ │ │ /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/ │ │ │ │ │ │ - a00020.html │ │ │ │ │ │ - dune/typetree/nodeinterface.hh │ │ │ │ │ │ - dune/typetree/nodetags.hh │ │ │ │ │ │ + a00029.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/ │ │ │ │ │ │ - a00011.html │ │ │ │ │ │ - dune/typetree/treepath.hh │ │ │ │ │ │ - dune/typetree/utility.hh │ │ │ │ │ │ + a00068.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 │ │ │ │ @@ -74,41 +74,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
 generictransformationdescriptors.hh
 leafnode.hh
 nodeinterface.hh
 nodetags.hh
 pairtraversal.hh
 powercompositenodetransformationtemplates.hh
 powernode.hh
 proxynode.hh
 simpletransformationdescriptors.hh
 transformation.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
 traversalutilities.hh
 treecontainer.hh
 treepath.hh
 typetraits.hh
 typetree.hh
 utility.hh
 visitor.hh
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-typetree-doc/doxygen/globals.html │ │ │ │ @@ -66,20 +66,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 │ │ │ │ @@ -66,20 +66,20 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
Here is a list of all variables with links to the files they belong to:
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │