{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.5MhYvCoW/b1/dune-typetree_2.9.0-2_i386.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.5MhYvCoW/b2/dune-typetree_2.9.0-2_i386.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,3 +1,3 @@\n \n 800eb722c270d1f75624a663298f0ff5 38684 libdevel optional libdune-typetree-dev_2.9.0-2_i386.deb\n- b93ecfd2399b4af7def6fa80c674ff57 989872 doc optional libdune-typetree-doc_2.9.0-2_all.deb\n+ 590ffa2f4701b131668ef27c997a921a 990100 doc optional libdune-typetree-doc_2.9.0-2_all.deb\n"}, {"source1": "libdune-typetree-doc_2.9.0-2_all.deb", "source2": "libdune-typetree-doc_2.9.0-2_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2023-01-12 22:23:12.000000 debian-binary\n--rw-r--r-- 0 0 0 9700 2023-01-12 22:23:12.000000 control.tar.xz\n--rw-r--r-- 0 0 0 979980 2023-01-12 22:23:12.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 9740 2023-01-12 22:23:12.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 980168 2023-01-12 22:23:12.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -5,68 +5,68 @@\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/\n -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\n -rw-r--r-- 0 root (0) root (0) 2362 2022-11-16 12:31:04.000000 ./usr/share/doc/libdune-typetree-doc/changelog.gz\n -rw-r--r-- 0 root (0) root (0) 3031 2023-01-12 15:07:35.000000 ./usr/share/doc/libdune-typetree-doc/copyright\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/\n -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\n -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\n--rw-r--r-- 0 root (0) root (0) 9727 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html\n--rw-r--r-- 0 root (0) root (0) 69137 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html\n--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\n--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\n--rw-r--r-- 0 root (0) root (0) 11110 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html\n--rw-r--r-- 0 root (0) root (0) 55685 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html\n--rw-r--r-- 0 root (0) root (0) 6910 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html\n--rw-r--r-- 0 root (0) root (0) 15552 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html\n--rw-r--r-- 0 root (0) root (0) 6859 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html\n--rw-r--r-- 0 root (0) root (0) 87085 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00020_source.html\n--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\n--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\n--rw-r--r-- 0 root (0) root (0) 5909 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html\n--rw-r--r-- 0 root (0) root (0) 49270 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026_source.html\n--rw-r--r-- 0 root (0) root (0) 8711 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html\n--rw-r--r-- 0 root (0) root (0) 19928 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html\n--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\n--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\n--rw-r--r-- 0 root (0) root (0) 7398 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html\n--rw-r--r-- 0 root (0) root (0) 41083 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html\n--rw-r--r-- 0 root (0) root (0) 6194 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html\n--rw-r--r-- 0 root (0) root (0) 69306 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038_source.html\n--rw-r--r-- 0 root (0) root (0) 32652 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html\n--rw-r--r-- 0 root (0) root (0) 96059 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041_source.html\n--rw-r--r-- 0 root (0) root (0) 15417 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html\n--rw-r--r-- 0 root (0) root (0) 53082 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html\n--rw-r--r-- 0 root (0) root (0) 5600 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html\n--rw-r--r-- 0 root (0) root (0) 46149 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047_source.html\n--rw-r--r-- 0 root (0) root (0) 3694 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html\n--rw-r--r-- 0 root (0) root (0) 5507 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050_source.html\n--rw-r--r-- 0 root (0) root (0) 10695 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html\n--rw-r--r-- 0 root (0) root (0) 46415 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html\n--rw-r--r-- 0 root (0) root (0) 6233 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html\n--rw-r--r-- 0 root (0) root (0) 8874 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html\n--rw-r--r-- 0 root (0) root (0) 4849 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html\n--rw-r--r-- 0 root (0) root (0) 8864 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059_source.html\n--rw-r--r-- 0 root (0) root (0) 8736 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html\n--rw-r--r-- 0 root (0) root (0) 57016 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062_source.html\n--rw-r--r-- 0 root (0) root (0) 7208 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065.html\n--rw-r--r-- 0 root (0) root (0) 27369 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html\n--rw-r--r-- 0 root (0) root (0) 5125 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html\n--rw-r--r-- 0 root (0) root (0) 14382 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html\n--rw-r--r-- 0 root (0) root (0) 6049 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html\n--rw-r--r-- 0 root (0) root (0) 49440 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071_source.html\n--rw-r--r-- 0 root (0) root (0) 11230 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html\n--rw-r--r-- 0 root (0) root (0) 43051 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074_source.html\n--rw-r--r-- 0 root (0) root (0) 5603 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html\n--rw-r--r-- 0 root (0) root (0) 39037 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html\n--rw-r--r-- 0 root (0) root (0) 15770 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html\n--rw-r--r-- 0 root (0) root (0) 56207 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080_source.html\n--rw-r--r-- 0 root (0) root (0) 7478 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html\n--rw-r--r-- 0 root (0) root (0) 17536 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html\n--rw-r--r-- 0 root (0) root (0) 5211 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html\n--rw-r--r-- 0 root (0) root (0) 6649 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086_source.html\n+-rw-r--r-- 0 root (0) root (0) 15417 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html\n+-rw-r--r-- 0 root (0) root (0) 53082 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html\n+-rw-r--r-- 0 root (0) root (0) 6233 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html\n+-rw-r--r-- 0 root (0) root (0) 8874 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html\n+-rw-r--r-- 0 root (0) root (0) 10695 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html\n+-rw-r--r-- 0 root (0) root (0) 46415 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html\n+-rw-r--r-- 0 root (0) root (0) 5125 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html\n+-rw-r--r-- 0 root (0) root (0) 14382 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html\n+-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\n+-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\n+-rw-r--r-- 0 root (0) root (0) 9727 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023.html\n+-rw-r--r-- 0 root (0) root (0) 69137 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00023_source.html\n+-rw-r--r-- 0 root (0) root (0) 6194 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026.html\n+-rw-r--r-- 0 root (0) root (0) 69306 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00026_source.html\n+-rw-r--r-- 0 root (0) root (0) 7398 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029.html\n+-rw-r--r-- 0 root (0) root (0) 41083 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html\n+-rw-r--r-- 0 root (0) root (0) 15770 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html\n+-rw-r--r-- 0 root (0) root (0) 56207 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html\n+-rw-r--r-- 0 root (0) root (0) 17252 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html\n+-rw-r--r-- 0 root (0) root (0) 74924 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html\n+-rw-r--r-- 0 root (0) root (0) 6049 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html\n+-rw-r--r-- 0 root (0) root (0) 49440 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00038_source.html\n+-rw-r--r-- 0 root (0) root (0) 3694 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041.html\n+-rw-r--r-- 0 root (0) root (0) 5507 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00041_source.html\n+-rw-r--r-- 0 root (0) root (0) 11110 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044.html\n+-rw-r--r-- 0 root (0) root (0) 55685 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html\n+-rw-r--r-- 0 root (0) root (0) 6910 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html\n+-rw-r--r-- 0 root (0) root (0) 15552 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00047_source.html\n+-rw-r--r-- 0 root (0) root (0) 32652 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050.html\n+-rw-r--r-- 0 root (0) root (0) 96059 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00050_source.html\n+-rw-r--r-- 0 root (0) root (0) 8711 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053.html\n+-rw-r--r-- 0 root (0) root (0) 19928 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html\n+-rw-r--r-- 0 root (0) root (0) 8736 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html\n+-rw-r--r-- 0 root (0) root (0) 57016 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html\n+-rw-r--r-- 0 root (0) root (0) 5909 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html\n+-rw-r--r-- 0 root (0) root (0) 49270 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00059_source.html\n+-rw-r--r-- 0 root (0) root (0) 6859 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062.html\n+-rw-r--r-- 0 root (0) root (0) 87085 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00062_source.html\n+-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\n+-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\n+-rw-r--r-- 0 root (0) root (0) 7208 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html\n+-rw-r--r-- 0 root (0) root (0) 27369 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html\n+-rw-r--r-- 0 root (0) root (0) 5603 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html\n+-rw-r--r-- 0 root (0) root (0) 39037 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00071_source.html\n+-rw-r--r-- 0 root (0) root (0) 5149 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074.html\n+-rw-r--r-- 0 root (0) root (0) 32272 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00074_source.html\n+-rw-r--r-- 0 root (0) root (0) 4849 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077.html\n+-rw-r--r-- 0 root (0) root (0) 8864 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html\n+-rw-r--r-- 0 root (0) root (0) 7478 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html\n+-rw-r--r-- 0 root (0) root (0) 17536 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00080_source.html\n+-rw-r--r-- 0 root (0) root (0) 5211 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083.html\n+-rw-r--r-- 0 root (0) root (0) 6649 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html\n+-rw-r--r-- 0 root (0) root (0) 11230 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html\n+-rw-r--r-- 0 root (0) root (0) 43051 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/a00086_source.html\n -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\n -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\n -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\n -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\n -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\n -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\n -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\n@@ -372,15 +372,15 @@\n -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\n -rw-r--r-- 0 root (0) root (0) 2277 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_04f2ecc425faf0d475a3caf484e551f3_dep.png\n -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\n -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\n -rw-r--r-- 0 root (0) root (0) 2105 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e74c06688912037f4b476b8dc05fab9_dep.png\n -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\n -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\n--rw-r--r-- 0 root (0) root (0) 23460 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz\n+-rw-r--r-- 0 root (0) root (0) 23466 2023-01-12 22:23:12.000000 ./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz\n -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\n -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\n -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\n -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\n -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\n -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\n -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\n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00008.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: proxynode.hh File Reference\n+dune-typetree: typetraits.hh File Reference\n \n \n \n \n \n \n \n@@ -71,60 +71,100 @@\n \n \n \n
\n
\n Classes |\n-Namespaces
\n-
proxynode.hh File Reference
\n+Namespaces |\n+Functions
\n+
typetraits.hh File Reference
\n \n
\n
#include <type_traits>
\n-#include <dune/typetree/nodeinterface.hh>
\n-#include <dune/typetree/nodetags.hh>
\n-#include <dune/common/shared_ptr.hh>
\n-#include <dune/common/indices.hh>
\n-#include <dune/common/std/type_traits.hh>
\n+#include <dune/common/typetraits.hh>
\n+#include <dune/typetree/treepath.hh>
\n+#include <dune/typetree/nodeinterface.hh>
\n
\n

Go to the source code of this file.

\n \n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

\n Classes

class  Dune::TypeTree::StaticChildAccessors< ProxiedNode >
 Mixin class providing methods for child access with compile-time parameter. More...
struct  Dune::first_type< T0, T... >
 
struct  Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k >
 Access to the type and storage type of the i-th child. More...
struct  Dune::TypeTree::has_node_tag< T >
 
class  Dune::TypeTree::DynamicChildAccessors< ProxiedNode >
 Mixin class providing methods for child access with run-time parameter. More...
struct  Dune::TypeTree::has_node_tag< T >::yes
 
struct  Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag >
 ProxyNode base class for LeafNode. More...
struct  Dune::TypeTree::has_node_tag< T >::no
 
struct  Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag >
 ProxyNode base class for CompositeNode. More...
struct  Dune::TypeTree::has_node_tag_value< T, V >
 
struct  Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag >
 ProxyNode base class for PowerNode. More...
struct  Dune::TypeTree::has_node_tag_value< T, V >::maybe< N >
 
struct  Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag >
 ProxyNode base class for DynamicPowerNode. More...
struct  Dune::TypeTree::has_node_tag_value< T, V >::yes
 
class  Dune::TypeTree::ProxyNode< Node >
 Base class for nodes acting as a proxy for an existing node. More...
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...
 
\n \n \n \n \n \n+\n+\n+

\n Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::impl
 
\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

\n+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.
 
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,51 +6,89 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces\n-proxynode.hh File Reference\n+Classes | Namespaces | Functions\n+typetraits.hh File Reference\n #include \n+#include \n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::TypeTree::StaticChildAccessors<_ProxiedNode_>\n-\u00a0 Mixin class providing methods for child access with compile-time\n- parameter. More...\n+struct \u00a0Dune::first_type<_T0,_T..._>\n \u00a0\n-struct \u00a0Dune::TypeTree::StaticChildAccessors<_ProxiedNode_>::Child<_k_>\n-\u00a0 Access to the type and storage type of the i-th child. More...\n+struct \u00a0Dune::TypeTree::has_node_tag<_T_>\n \u00a0\n- class \u00a0Dune::TypeTree::DynamicChildAccessors<_ProxiedNode_>\n-\u00a0 Mixin class providing methods for child access with run-time\n- parameter. More...\n+struct \u00a0Dune::TypeTree::has_node_tag<_T_>::yes\n \u00a0\n-struct \u00a0Dune::TypeTree::ProxyNodeBase<_Node,_LeafNodeTag_>\n-\u00a0 ProxyNode base class for LeafNode. More...\n+struct \u00a0Dune::TypeTree::has_node_tag<_T_>::no\n \u00a0\n-struct \u00a0Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>\n-\u00a0 ProxyNode base class for CompositeNode. More...\n+struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>\n \u00a0\n-struct \u00a0Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>\n-\u00a0 ProxyNode base class for PowerNode. More...\n+struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>::maybe<_N_>\n \u00a0\n-struct \u00a0Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>\n-\u00a0 ProxyNode base class for DynamicPowerNode. More...\n+struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>::yes\n \u00a0\n- class \u00a0Dune::TypeTree::ProxyNode<_Node_>\n-\u00a0 Base class for nodes acting as a proxy for an existing node. More...\n+struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>::no\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag<_T_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag<_T_>::yes\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag<_T_>::no\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>::maybe<_N_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>::yes\n+\u00a0\n+struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>::no\n+\u00a0\n+struct \u00a0Dune::TypeTree::AlwaysVoid<_typename_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::meta_function\n+\u00a0 Marker tag declaring a meta function. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::lazy_evaluate<_F_>\n+\u00a0 Helper meta function to delay evaluation of F. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::lazy_identity<_F_>\n+\u00a0 Identity function. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::evaluate_if_meta_function<_F_>\n+\u00a0 Meta function that evaluates its argument iff it inherits from\n+ meta_function. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::IsTreePath<_T_>\n+\u00a0 Check if type represents a tree path. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n+namespace \u00a0Dune::TypeTree::impl\n+\u00a0\n+ Functions\n+template\n+ T *\u00a0Dune::TypeTree::declptr ()\n+\u00a0 Helper function for generating a pointer to a value of type T\n+ in an unevaluated operand setting.\n+\u00a0\n+constexpr auto\u00a0Dune::TypeTree::impl::isTreePath (void *) -> std::false_type\n+\u00a0\n+template\n+constexpr auto\u00a0Dune::TypeTree::impl::isTreePath (const HybridTreePath< I... >\n+ *) -> std::true_type\n+\u00a0\n+template\n+constexpr auto\u00a0Dune::TypeTree::isTreePath (const T &) -> IsTreePath< T >\n+\u00a0 Check if given object represents a tree path.\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00008_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: proxynode.hh Source File\n+dune-typetree: typetraits.hh Source File\n \n \n \n \n \n \n \n@@ -74,404 +74,276 @@\n \n
\n \n
\n \n
\n-
proxynode.hh
\n+
typetraits.hh
\n
\n
\n Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
\n
2// vi: set et ts=4 sw=2 sts=2:
\n
3
\n-
4#ifndef DUNE_TYPETREE_PROXYNODE_HH
\n-
5#define DUNE_TYPETREE_PROXYNODE_HH
\n+
4#ifndef DUNE_TYPETREE_TYPETRAITS_HH
\n+
5#define DUNE_TYPETREE_TYPETRAITS_HH
\n
6
\n
7#include <type_traits>
\n-\n-\n-
10#include <dune/common/shared_ptr.hh>
\n-
11#include <dune/common/indices.hh>
\n-
12#include <dune/common/std/type_traits.hh>
\n-
13
\n-
14namespace Dune {
\n-
15 namespace TypeTree {
\n-
16
\n-
22 template<typename Node>
\n-
23 class ProxyNode;
\n-
24
\n-
26 template<typename ProxiedNode>
\n-
\n-\n-
28 {
\n-
29
\n-
30 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
\n-
31
\n-
32 template<std::size_t k>
\n-
33 struct lazy_enabled
\n-
34 {
\n-
35 static const bool value = !proxiedNodeIsConst;
\n-
36 };
\n-
37
\n-\n+
8#include <dune/common/typetraits.hh>
\n+
9
\n+\n+\n+
12
\n+
13namespace Dune {
\n+
14
\n+
15 // Provide some more C++11 TMP helpers.
\n+
16 // These should be upstreamed to dune-common ASAP.
\n+
17
\n+
18 template<typename... T>
\n+
19 struct first_type;
\n+
20
\n+
21 template<typename T0, typename... T>
\n+
\n+
22 struct first_type<T0,T...>
\n+
23 {
\n+
24 typedef T0 type;
\n+
25 };
\n+
\n+
26
\n+
27 namespace TypeTree {
\n+
28
\n+
29 template<typename T>
\n+
\n+\n+
31 {
\n+
32 struct yes { char dummy[1]; };
\n+
33 struct no { char dummy[2]; };
\n+
34
\n+
35 template<typename X>
\n+
36 static yes test(NodeTag<X> *);
\n+
37 template<typename X>
\n+
38 static no test(...);
\n
39
\n-
40 template<bool enabled = !proxiedNodeIsConst>
\n-
41 typename std::enable_if<enabled,Node&>::type
\n-
42 node ()
\n-
43 {
\n-
44 return static_cast<Node&>(*this);
\n-
45 }
\n-
46
\n-
47 const Node& node () const
\n-
48 {
\n-
49 return static_cast<const Node&>(*this);
\n-
50 }
\n+
41 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
\n+
42 };
\n+
\n+
43
\n+
44 template<typename T, typename V>
\n+
\n+\n+
46 {
\n+
47 template<int N>
\n+
48 struct maybe { char dummy[N+1]; };
\n+
49 struct yes { char dummy[2]; };
\n+
50 struct no { char dummy[1]; };
\n
51
\n-
52 public:
\n-
53
\n-
55 template<std::size_t k>
\n-
\n-
56 struct Child
\n-
57 : public ProxiedNode::template Child<k>
\n-
58 {};
\n-
\n-
59
\n-
62
\n-
64
\n-
67 template<std::size_t k,
\n-
68 typename std::enable_if<lazy_enabled<k>::value, int>::type = 0>
\n-
\n-
69 auto& child (index_constant<k> = {})
\n-
70 {
\n-
71 return node().proxiedNode().template child<k>();
\n-
72 }
\n-
\n-
73
\n-
75
\n-
78 template<std::size_t k>
\n-
\n-
79 const auto& child (index_constant<k> = {}) const
\n-
80 {
\n-
81 return node().proxiedNode().template child<k>();
\n-
82 }
\n-
\n-
83
\n-
85
\n-
88 template<std::size_t k,
\n-
89 typename std::enable_if<lazy_enabled<k>::value, int>::type = 0>
\n-
\n-
90 auto childStorage (index_constant<k> = {})
\n-
91 {
\n-
92 return node().proxiedNode().template childStorage<k>();
\n-
93 }
\n+
52 template<typename X>
\n+\n+\n+
55 template<typename X>
\n+
56 static no test(...);
\n+
57
\n+
59 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
\n+
60 };
\n+
\n+
61
\n+
62 template<typename T>
\n+
\n+\n+
64 {
\n+
65 struct yes { char dummy[1]; };
\n+
66 struct no { char dummy[2]; };
\n+
67
\n+
68 template<typename X>
\n+\n+
70 template<typename X>
\n+
71 static no test(...);
\n+
72
\n+
74 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
\n+
75 };
\n+
\n+
76
\n+
77 template<typename T, typename V>
\n+
\n+\n+
79 {
\n+
80 template<int N>
\n+
81 struct maybe { char dummy[N+1]; };
\n+
82 struct yes { char dummy[2]; };
\n+
83 struct no { char dummy[1]; };
\n+
84
\n+
85 template<typename X>
\n+\n+\n+
88 template<typename X>
\n+
89 static no test(...);
\n+
90
\n+
92 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
\n+
93 };
\n
\n
94
\n-
96
\n-
102 template<std::size_t k>
\n-
\n-
103 auto childStorage (index_constant<k> = {}) const
\n-
104 {
\n-
105 return node().proxiedNode().template childStorage<k>();
\n-
106 }
\n-
\n-
107
\n-
109 template<std::size_t k, class ProxyChild>
\n-
\n-
110 void setChild (ProxyChild&& child, typename std::enable_if<lazy_enabled<k>::value,void*>::type = 0)
\n-
111 {
\n-
112 node().proxiedNode().template setChild<k>(std::forward<ProxyChild>(child));
\n-
113 }
\n-
\n-
114
\n-
\n-
115 const typename ProxiedNode::NodeStorage& nodeStorage () const
\n-
116 {
\n-
117 return node().proxiedNode().nodeStorage();
\n-
118 }
\n-
\n-
119
\n-
120 };
\n-
\n-
121
\n-
123
\n-
128 template<typename ProxiedNode>
\n-
\n-\n-
130 : public StaticChildAccessors<ProxiedNode>
\n-
131 {
\n-
132
\n-\n-
134
\n-
135 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<ProxiedNode>::type>::value;
\n+
95 template<typename>
\n+
\n+\n+
97 {
\n+
98 typedef void type;
\n+
99 };
\n+
\n+
100
\n+
101
\n+
103 template<typename T>
\n+\n+
105
\n+
106
\n+
107 // Support for lazy evaluation of meta functions. This is required when doing
\n+
108 // nested tag dispatch without C++11-style typedefs (based on using syntax).
\n+
109 // The standard struct-based meta functions cause premature evaluation in a
\n+
110 // context that is not SFINAE-compatible. We thus have to return the meta function
\n+
111 // without evaluating it, placing that burden on the caller. On the other hand,
\n+
112 // the lookup will often directly be the target type, so here is some helper code
\n+
113 // to automatically do the additional evaluation if necessary.
\n+
114 // Too bad that the new syntax is GCC 4.6+...
\n+
115
\n+
116
\n+
118
\n+
121 struct meta_function {};
\n+
122
\n+
124 template<typename F>
\n+
\n+\n+
126 {
\n+
127 typedef typename F::type type;
\n+
128 };
\n+
\n+
129
\n+
131 template<typename F>
\n+
\n+\n+
133 {
\n+
134 typedef F type;
\n+
135 };
\n+
\n
136
\n-
137 template<bool enabled = !proxiedNodeIsConst>
\n-
138 typename std::enable_if<enabled,Node&>::type
\n-
139 node ()
\n-
140 {
\n-
141 return static_cast<Node&>(*this);
\n-
142 }
\n-
143
\n-
144 const Node& node () const
\n-
145 {
\n-
146 return static_cast<const Node&>(*this);
\n-
147 }
\n-
148
\n-
149 public:
\n-
150
\n-
153
\n-
155
\n-
158 template<bool enabled = !proxiedNodeIsConst,
\n-
159 typename std::enable_if<enabled, int>::type = 0>
\n-
\n-
160 auto& child (std::size_t i)
\n-
161 {
\n-
162 return node().proxiedNode().child(i);
\n-
163 }
\n+
138 template<typename F>
\n+
\n+\n+
140 {
\n+
141 typedef typename std::conditional<
\n+
142 std::is_base_of<meta_function,F>::value,
\n+\n+\n+
145 >::type::type type;
\n+
146 };
\n+
\n+
147
\n+
\n+
148 namespace impl {
\n+
149
\n+
150 // Check if type is a or is derived from one of the tree path types
\n+
151
\n+
152 // Default overload for types not representing a tree path
\n+
\n+
153 constexpr auto isTreePath(void*)
\n+
154 -> std::false_type
\n+
155 {
\n+
156 return std::false_type();
\n+
157 }
\n+
\n+
158
\n+
159 // Overload for instances of HybridTreePath<...>
\n+
160 template<class... I>
\n+
\n+
161 constexpr auto isTreePath(const HybridTreePath<I...>*)
\n+
162 -> std::true_type
\n+
163 {
\n+
164 return std::true_type();
\n+
165 }
\n
\n-
164
\n
166
\n-
\n-
169 const auto& child (std::size_t i) const
\n-
170 {
\n-
171 return node().proxiedNode().child(i);
\n-
172 }
\n-
\n-
173
\n-
175
\n-
178 template<bool enabled = !proxiedNodeIsConst,
\n-
179 typename std::enable_if<enabled, int>::type = 0>
\n-
\n-
180 auto childStorage (std::size_t i)
\n-
181 {
\n-
182 return node().proxiedNode().childStorage(i);
\n-
183 }
\n-
\n-
184
\n-
186
\n-
\n-
192 auto childStorage (std::size_t i) const
\n-
193 {
\n-
194 return node().proxiedNode().childStorage(i);
\n-
195 }
\n+
167 }
\n+
\n+
168
\n+
179 template<class T>
\n+
\n+
180 struct IsTreePath :
\n+
181 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
\n+
182 {};
\n+
\n+
183
\n+
190 template<class T>
\n+
\n+
191 constexpr auto isTreePath(const T&)
\n+\n+
193 {
\n+
194 return IsTreePath<T>();
\n+
195 }
\n
\n
196
\n-
198 template<class ProxyChild, bool enabled = !proxiedNodeIsConst>
\n-
\n-
199 void setChild (std::size_t i, ProxyChild&& child, typename std::enable_if<enabled,void*>::type = 0)
\n-
200 {
\n-
201 node().proxiedNode().setChild(i, std::forward<ProxyChild>(child));
\n-
202 }
\n-
\n-
203
\n-
204 };
\n-
\n-
205
\n-
207 template<typename Node, typename NodeTag>
\n-\n-
209
\n-
211 template<typename Node>
\n-
\n-\n-
213 {
\n-
214 };
\n-
\n-
215
\n-
217 template<typename Node>
\n-
\n-\n-
219 : public StaticChildAccessors<Node>
\n-
220 {
\n-
221 typedef typename Node::ChildTypes ChildTypes;
\n-
222 typedef typename Node::NodeStorage NodeStorage;
\n-
223 };
\n-
\n-
224
\n-
226 template<typename Node>
\n-
\n-\n-
228 : public DynamicChildAccessors<Node>
\n-
229 {
\n-
230 typedef typename Node::ChildType ChildType;
\n-
231 typedef typename Node::NodeStorage NodeStorage;
\n-
232 };
\n-
\n-
233
\n-
235 template<typename Node>
\n-
\n-\n-
237 : public DynamicChildAccessors<Node>
\n-
238 {
\n-
239 typedef typename Node::ChildType ChildType;
\n-
240 typedef typename Node::NodeStorage NodeStorage;
\n-
241 };
\n-
\n-
242
\n-
244
\n-
250 template<typename Node>
\n-
\n-\n-
252 : public ProxyNodeBase<Node,NodeTag<Node>>
\n-
253 {
\n-
254 static const bool proxiedNodeIsConst = std::is_const<typename std::remove_reference<Node>::type>::value;
\n-
255
\n-
256 template <class N>
\n-
257 using HasStaticDegree = index_constant<N::degree()>;
\n-
258
\n-
259 template <class N>
\n-
260 static constexpr bool hasStaticDegree = Std::is_detected<HasStaticDegree, N>::value;
\n-
261
\n-
262 // accessor mixins need to be friends for access to proxiedNode()
\n-
263 friend class StaticChildAccessors<Node>;
\n-
264 friend class DynamicChildAccessors<Node>;
\n-
265
\n-
266 public:
\n-
267
\n-
268 typedef Node ProxiedNode;
\n-
269
\n-\n-
271
\n-
273 static const bool isLeaf = Node::isLeaf;
\n-
274
\n-
276 static const bool isPower = Node::isPower;
\n-
277
\n-
279 static const bool isComposite = Node::isComposite;
\n-
280
\n-
282 [[deprecated("Will be removed after release 2.9. Use degree()")]]
\n-
283 static const std::size_t CHILDREN = Dune::Std::detected_or_t<
\n-
284 std::integral_constant<std::size_t,std::numeric_limits<std::size_t>::max()>,
\n-\n-
286 Node
\n-
287 >::value;
\n-
288
\n-
289 template <class N = Node,
\n-
290 std::enable_if_t<hasStaticDegree<N>, int> = 0>
\n-
\n-
291 static constexpr auto degree ()
\n-
292 {
\n-
293 return N::degree();
\n-
294 }
\n-
\n-
295
\n-
296 template <class N = Node,
\n-
297 std::enable_if_t<not hasStaticDegree<N>, int> = 0>
\n-
\n-
298 auto degree () const
\n-
299 {
\n-
300 return proxiedNode().degree();
\n-
301 }
\n-
\n-
302
\n-
303
\n-
304 protected:
\n-
305
\n-
308
\n-
310 template<bool enabled = !proxiedNodeIsConst>
\n-
311 typename std::enable_if<enabled,Node&>::type
\n-
\n-\n-
313 {
\n-
314 return *_node;
\n-
315 }
\n-
\n-
316
\n-
\n-
318 const Node& proxiedNode () const
\n-
319 {
\n-
320 return *_node;
\n-
321 }
\n-
\n-
322
\n-
324 template<bool enabled = !proxiedNodeIsConst>
\n-
325 typename std::enable_if<enabled,std::shared_ptr<Node> >::type
\n-
\n-\n-
327 {
\n-
328 return _node;
\n-
329 }
\n-
\n-
330
\n-
\n-
332 std::shared_ptr<const Node> proxiedNodeStorage () const
\n-
333 {
\n-
334 return _node;
\n-
335 }
\n-
\n-
336
\n-
338
\n-
341
\n-
\n-
342 ProxyNode (Node& node)
\n-
343 : _node(stackobject_to_shared_ptr(node))
\n-
344 {}
\n-
\n-
345
\n-
\n-
346 ProxyNode (std::shared_ptr<Node> node)
\n-
347 : _node(std::move(node))
\n-
348 {}
\n-
\n-
349
\n-
351
\n-
352 private:
\n-
353
\n-
354 std::shared_ptr<Node> _node;
\n-
355 };
\n-
\n-
356
\n-
358
\n-
359 } // namespace TypeTree
\n-
360} //namespace Dune
\n-
361
\n-
362#endif // DUNE_TYPETREE_PROXYNODE_HH
\n-\n-\n+
197
\n+
198 } // end namespace TypeTree
\n+
199} // end namespace Dune
\n+
200
\n+
201#endif // DUNE_TYPETREE_TYPETRAITS_HH
\n+\n+\n
typename std::decay_t< Node >::NodeTag NodeTag
Returns the node tag of the given Node.
Definition nodeinterface.hh:76
\n-
decltype(Node::degree()) StaticDegree
Returns the statically known degree of the given Node type as a std::integral_constant.
Definition nodeinterface.hh:113
\n+
typename std::decay_t< T >::ImplementationTag ImplementationTag
Returns the implementation tag of the given Node.
Definition nodeinterface.hh:80
\n
Definition accumulate_static.hh:13
\n-
Tag designating a leaf node.
Definition nodetags.hh:16
\n-
Tag designating a power node.
Definition nodetags.hh:19
\n-
Tag designating a power node with runtime degree.
Definition nodetags.hh:22
\n-
Tag designating a composite node.
Definition nodetags.hh:25
\n-
Base class for nodes acting as a proxy for an existing node.
Definition proxynode.hh:253
\n-
ProxyNode(Node &node)
Definition proxynode.hh:342
\n-
Dune::TypeTree::NodeTag< Node > NodeTag
Definition proxynode.hh:270
\n-
static const bool isComposite
Mark this class as a composite in the dune-typetree.
Definition proxynode.hh:279
\n-
static const bool isLeaf
Mark this class as non leaf in the dune-typetree.
Definition proxynode.hh:273
\n-
static const bool isPower
Mark this class as a non power in the dune-typetree.
Definition proxynode.hh:276
\n-
auto degree() const
Definition proxynode.hh:298
\n-
std::enable_if< enabled, Node & >::type proxiedNode()
Returns the proxied node.
Definition proxynode.hh:312
\n-
static const std::size_t CHILDREN
The number of children.
Definition proxynode.hh:283
\n-
std::shared_ptr< const Node > proxiedNodeStorage() const
Returns the storage of the proxied node (const version).
Definition proxynode.hh:332
\n-
Node ProxiedNode
Definition proxynode.hh:268
\n-
std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage()
Returns the storage of the proxied node.
Definition proxynode.hh:326
\n-
static constexpr auto degree()
Definition proxynode.hh:291
\n-
ProxyNode(std::shared_ptr< Node > node)
Definition proxynode.hh:346
\n-
const Node & proxiedNode() const
Returns the proxied node (const version).
Definition proxynode.hh:318
\n-
Mixin class providing methods for child access with compile-time parameter.
Definition proxynode.hh:28
\n-
auto & child(index_constant< k >={})
Returns the i-th child.
Definition proxynode.hh:69
\n-
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
\n-
const ProxiedNode::NodeStorage & nodeStorage() const
Definition proxynode.hh:115
\n-
auto childStorage(index_constant< k >={})
Returns the storage of the i-th child.
Definition proxynode.hh:90
\n-
const auto & child(index_constant< k >={}) const
Returns the i-th child (const version).
Definition proxynode.hh:79
\n-
auto childStorage(index_constant< k >={}) const
Returns the storage of the i-th child (const version).
Definition proxynode.hh:103
\n-
Access to the type and storage type of the i-th child.
Definition proxynode.hh:58
\n-
Mixin class providing methods for child access with run-time parameter.
Definition proxynode.hh:131
\n-
auto & child(std::size_t i)
Returns the i-th child.
Definition proxynode.hh:160
\n-
auto childStorage(std::size_t i) const
Returns the storage of the i-th child (const version).
Definition proxynode.hh:192
\n-
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
\n-
const auto & child(std::size_t i) const
Returns the i-th child (const version).
Definition proxynode.hh:169
\n-
auto childStorage(std::size_t i)
Returns the storage of the i-th child.
Definition proxynode.hh:180
\n-
Tag-based dispatch to appropriate base class that provides necessary functionality.
Definition proxynode.hh:208
\n-
Node::NodeStorage NodeStorage
Definition proxynode.hh:222
\n-
Node::ChildTypes ChildTypes
Definition proxynode.hh:221
\n-
Node::NodeStorage NodeStorage
Definition proxynode.hh:231
\n-
Node::ChildType ChildType
Definition proxynode.hh:230
\n-
Node::NodeStorage NodeStorage
Definition proxynode.hh:240
\n-
Node::ChildType ChildType
Definition proxynode.hh:239
\n+
constexpr auto isTreePath(const T &) -> IsTreePath< T >
Check if given object represents a tree path.
Definition typetraits.hh:191
\n+
T * declptr()
Helper function for generating a pointer to a value of type T in an unevaluated operand setting.
\n+
constexpr auto isTreePath(void *) -> std::false_type
Definition typetraits.hh:153
\n+
A hybrid version of TreePath that supports both compile time and run time indices.
Definition treepath.hh:79
\n+
Definition typetraits.hh:19
\n+
T0 type
Definition typetraits.hh:24
\n+
Definition typetraits.hh:31
\n+
static constexpr bool value
True if class T defines a NodeTag.
Definition typetraits.hh:41
\n+
static yes test(NodeTag< X > *)
\n+\n+
Definition typetraits.hh:32
\n+
char dummy[1]
Definition typetraits.hh:32
\n+
Definition typetraits.hh:33
\n+
char dummy[2]
Definition typetraits.hh:33
\n+
Definition typetraits.hh:46
\n+
static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a)
\n+
static constexpr bool value
True if class T defines a NodeTag of type V.
Definition typetraits.hh:59
\n+\n+\n+
char dummy[N+1]
Definition typetraits.hh:48
\n+
Definition typetraits.hh:49
\n+
char dummy[2]
Definition typetraits.hh:49
\n+
Definition typetraits.hh:50
\n+
char dummy[1]
Definition typetraits.hh:50
\n+
Definition typetraits.hh:64
\n+
static yes test(ImplementationTag< X > *)
\n+\n+
static constexpr bool value
True if class T defines an ImplementationTag.
Definition typetraits.hh:74
\n+\n+
char dummy[1]
Definition typetraits.hh:65
\n+\n+
char dummy[2]
Definition typetraits.hh:66
\n+\n+
static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test(ImplementationTag< X > *a)
\n+\n+
static constexpr bool value
True if class T defines an ImplementationTag of type V.
Definition typetraits.hh:92
\n+\n+
char dummy[N+1]
Definition typetraits.hh:81
\n+\n+
char dummy[2]
Definition typetraits.hh:82
\n+\n+
char dummy[1]
Definition typetraits.hh:83
\n+
Definition typetraits.hh:97
\n+
void type
Definition typetraits.hh:98
\n+
Marker tag declaring a meta function.
Definition typetraits.hh:121
\n+
Helper meta function to delay evaluation of F.
Definition typetraits.hh:126
\n+
F::type type
Definition typetraits.hh:127
\n+
Identity function.
Definition typetraits.hh:133
\n+
F type
Definition typetraits.hh:134
\n+
Meta function that evaluates its argument iff it inherits from meta_function.
Definition typetraits.hh:140
\n+
std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
Definition typetraits.hh:145
\n+
Check if type represents a tree path.
Definition typetraits.hh:182
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,462 +7,346 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-proxynode.hh\n+typetraits.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_PROXYNODE_HH\n- 5#define DUNE_TYPETREE_PROXYNODE_HH\n+ 4#ifndef DUNE_TYPETREE_TYPETRAITS_HH\n+ 5#define DUNE_TYPETREE_TYPETRAITS_HH\n 6\n 7#include \n- 8#include \n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14namespace Dune {\n- 15 namespace TypeTree {\n- 16\n- 22 template\n- 23 class ProxyNode;\n- 24\n- 26 template\n-27 class StaticChildAccessors\n- 28 {\n- 29\n- 30 static const bool proxiedNodeIsConst = std::is_const::type>::value;\n- 31\n- 32 template\n- 33 struct lazy_enabled\n- 34 {\n- 35 static const bool value = !proxiedNodeIsConst;\n- 36 };\n- 37\n- 38 typedef ProxyNode Node;\n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12\n+ 13namespace Dune {\n+ 14\n+ 15 // Provide some more C++11 TMP helpers.\n+ 16 // These should be upstreamed to dune-common ASAP.\n+ 17\n+ 18 template\n+19 struct first_type;\n+ 20\n+ 21 template\n+22 struct first_type\n+ 23 {\n+24 typedef T0 type;\n+ 25 };\n+ 26\n+ 27 namespace TypeTree {\n+ 28\n+ 29 template\n+30 struct has_node_tag\n+ 31 {\n+32 struct yes { char dummy[1]; };\n+33 struct no { char dummy[2]; };\n+ 34\n+ 35 template\n+36 static yes test(NodeTag *);\n+ 37 template\n+38 static no test(...);\n 39\n- 40 template\n- 41 typename std::enable_if::type\n- 42 node ()\n- 43 {\n- 44 return static_cast(*this);\n- 45 }\n- 46\n- 47 const Node& node () const\n- 48 {\n- 49 return static_cast(*this);\n- 50 }\n+41 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n+ 42 };\n+ 43\n+ 44 template\n+45 struct has_node_tag_value\n+ 46 {\n+ 47 template\n+48 struct maybe { char dummy[N+1]; };\n+49 struct yes { char dummy[2]; };\n+50 struct no { char dummy[1]; };\n 51\n- 52 public:\n- 53\n- 55 template\n-56 struct Child\n- 57 : public ProxiedNode::template Child\n- 58 {};\n- 59\n- 62\n- 64\n- 67 template::value, int>::type = 0>\n-69 auto& child (index_constant = {})\n- 70 {\n- 71 return node().proxiedNode().template child();\n- 72 }\n- 73\n- 75\n- 78 template\n-79 const auto& child (index_constant = {}) const\n- 80 {\n- 81 return node().proxiedNode().template child();\n- 82 }\n- 83\n- 85\n- 88 template::value, int>::type = 0>\n-90 auto childStorage (index_constant = {})\n- 91 {\n- 92 return node().proxiedNode().template childStorage();\n- 93 }\n+ 52 template\n+ 53 static maybe>::value>\n+54 test(NodeTag * a);\n+ 55 template\n+56 static no test(...);\n+ 57\n+59 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n+ 60 };\n+ 61\n+ 62 template\n+63 struct has_implementation_tag\n+ 64 {\n+65 struct yes { char dummy[1]; };\n+66 struct no { char dummy[2]; };\n+ 67\n+ 68 template\n+69 static yes test(ImplementationTag *);\n+ 70 template\n+71 static no test(...);\n+ 72\n+74 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n+ 75 };\n+ 76\n+ 77 template\n+78 struct has_implementation_tag_value\n+ 79 {\n+ 80 template\n+81 struct maybe { char dummy[N+1]; };\n+82 struct yes { char dummy[2]; };\n+83 struct no { char dummy[1]; };\n+ 84\n+ 85 template\n+ 86 static maybe>::value>\n+87 test(ImplementationTag * a);\n+ 88 template\n+89 static no test(...);\n+ 90\n+92 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n+ 93 };\n 94\n- 96\n- 102 template\n-103 auto childStorage (index_constant = {}) const\n- 104 {\n- 105 return node().proxiedNode().template childStorage();\n- 106 }\n- 107\n- 109 template\n-110 void setChild (ProxyChild&& child, typename std::\n-enable_if::value,void*>::type = 0)\n- 111 {\n- 112 node().proxiedNode().template setChild(std::forward\n-(child));\n- 113 }\n- 114\n-115 const typename ProxiedNode::NodeStorage& nodeStorage () const\n- 116 {\n- 117 return node().proxiedNode().nodeStorage();\n- 118 }\n- 119\n- 120 };\n- 121\n- 123\n- 128 template\n-129 class DynamicChildAccessors\n- 130 : public StaticChildAccessors\n- 131 {\n- 132\n- 133 typedef ProxyNode Node;\n- 134\n- 135 static const bool proxiedNodeIsConst = std::is_const::type>::value;\n+ 95 template\n+96 struct AlwaysVoid\n+ 97 {\n+98 typedef void type;\n+ 99 };\n+ 100\n+ 101\n+ 103 template\n+104 T* declptr();\n+ 105\n+ 106\n+ 107 // Support for lazy evaluation of meta functions. This is required when\n+doing\n+ 108 // nested tag dispatch without C++11-style typedefs (based on using\n+syntax).\n+ 109 // The standard struct-based meta functions cause premature evaluation in\n+a\n+ 110 // context that is not SFINAE-compatible. We thus have to return the meta\n+function\n+ 111 // without evaluating it, placing that burden on the caller. On the other\n+hand,\n+ 112 // the lookup will often directly be the target type, so here is some\n+helper code\n+ 113 // to automatically do the additional evaluation if necessary.\n+ 114 // Too bad that the new syntax is GCC 4.6+...\n+ 115\n+ 116\n+ 118\n+121 struct meta_function {};\n+ 122\n+ 124 template\n+125 struct lazy_evaluate\n+ 126 {\n+127 typedef typename F::type type;\n+ 128 };\n+ 129\n+ 131 template\n+132 struct lazy_identity\n+ 133 {\n+134 typedef F type;\n+ 135 };\n 136\n- 137 template\n- 138 typename std::enable_if::type\n- 139 node ()\n+ 138 template\n+139 struct evaluate_if_meta_function\n 140 {\n- 141 return static_cast(*this);\n- 142 }\n- 143\n- 144 const Node& node () const\n- 145 {\n- 146 return static_cast(*this);\n- 147 }\n- 148\n- 149 public:\n- 150\n- 153\n- 155\n- 158 template::type = 0>\n-160 auto& child (std::size_t i)\n- 161 {\n- 162 return node().proxiedNode().child(i);\n- 163 }\n- 164\n+ 141 typedef typename std::conditional<\n+ 142 std::is_base_of::value,\n+ 143 lazy_evaluate,\n+ 144 lazy_identity\n+145 >::type::type type;\n+ 146 };\n+ 147\n+148 namespace impl {\n+ 149\n+ 150 // Check if type is a or is derived from one of the tree path types\n+ 151\n+ 152 // Default overload for types not representing a tree path\n+153 constexpr auto isTreePath(void*)\n+ 154 -> std::false_type\n+ 155 {\n+ 156 return std::false_type();\n+ 157 }\n+ 158\n+ 159 // Overload for instances of HybridTreePath<...>\n+ 160 template\n+161 constexpr auto isTreePath(const HybridTreePath*)\n+ 162 -> std::true_type\n+ 163 {\n+ 164 return std::true_type();\n+ 165 }\n 166\n-169 const auto& child (std::size_t i) const\n- 170 {\n- 171 return node().proxiedNode().child(i);\n- 172 }\n- 173\n- 175\n- 178 template::type = 0>\n-180 auto childStorage (std::size_t i)\n- 181 {\n- 182 return node().proxiedNode().childStorage(i);\n- 183 }\n- 184\n- 186\n-192 auto childStorage (std::size_t i) const\n+ 167 }\n+ 168\n+ 179 template\n+180 struct IsTreePath :\n+ 181 public decltype(impl::isTreePath((typename std::decay::type*)\n+(nullptr)))\n+ 182 {};\n+ 183\n+ 190 template\n+191 constexpr auto isTreePath(const T&)\n+ 192 -> IsTreePath\n 193 {\n- 194 return node().proxiedNode().childStorage(i);\n+ 194 return IsTreePath();\n 195 }\n 196\n- 198 template\n-199 void setChild (std::size_t i, ProxyChild&& child, typename std::\n-enable_if::type = 0)\n- 200 {\n- 201 node().proxiedNode().setChild(i, std::forward(child));\n- 202 }\n- 203\n- 204 };\n- 205\n- 207 template\n-208 struct ProxyNodeBase;\n- 209\n- 211 template\n-212 struct ProxyNodeBase\n- 213 {\n- 214 };\n- 215\n- 217 template\n-218 struct ProxyNodeBase\n- 219 : public StaticChildAccessors\n- 220 {\n-221 typedef typename Node::ChildTypes ChildTypes;\n-222 typedef typename Node::NodeStorage NodeStorage;\n- 223 };\n- 224\n- 226 template\n-227 struct ProxyNodeBase\n- 228 : public DynamicChildAccessors\n- 229 {\n-230 typedef typename Node::ChildType ChildType;\n-231 typedef typename Node::NodeStorage NodeStorage;\n- 232 };\n- 233\n- 235 template\n-236 struct ProxyNodeBase\n- 237 : public DynamicChildAccessors\n- 238 {\n-239 typedef typename Node::ChildType ChildType;\n-240 typedef typename Node::NodeStorage NodeStorage;\n- 241 };\n- 242\n- 244\n- 250 template\n-251 class ProxyNode\n- 252 : public ProxyNodeBase>\n- 253 {\n- 254 static const bool proxiedNodeIsConst = std::is_const::type>::value;\n- 255\n- 256 template \n- 257 using HasStaticDegree = index_constant;\n- 258\n- 259 template \n-260 static constexpr bool hasStaticDegree = Std::is_detected::value;\n- 261\n- 262 // accessor mixins need to be friends for access to proxiedNode()\n- 263 friend class StaticChildAccessors;\n- 264 friend class DynamicChildAccessors;\n- 265\n- 266 public:\n- 267\n-268 typedef Node ProxiedNode;\n- 269\n-270 typedef Dune::TypeTree::NodeTag NodeTag;\n- 271\n-273 static const bool isLeaf = Node::isLeaf;\n- 274\n-276 static const bool isPower = Node::isPower;\n- 277\n-279 static const bool isComposite = Node::isComposite;\n- 280\n- 282 [[deprecated(\"Will be removed after release 2.9. Use degree()\")]]\n-283 static const std::size_t CHILDREN = Dune::Std::detected_or_t<\n- 284 std::integral_constant::max\n-()>,\n- 285 StaticDegree,\n- 286 Node\n- 287 >::value;\n- 288\n- 289 template , int> = 0>\n-291 static constexpr auto degree ()\n- 292 {\n- 293 return N::degree();\n- 294 }\n- 295\n- 296 template , int> = 0>\n-298 auto degree () const\n- 299 {\n- 300 return proxiedNode().degree();\n- 301 }\n- 302\n- 303\n- 304 protected:\n- 305\n- 308\n- 310 template\n- 311 typename std::enable_if::type\n-312 proxiedNode ()\n- 313 {\n- 314 return *_node;\n- 315 }\n- 316\n-318 const Node& proxiedNode () const\n- 319 {\n- 320 return *_node;\n- 321 }\n- 322\n- 324 template\n- 325 typename std::enable_if >::type\n-326 proxiedNodeStorage ()\n- 327 {\n- 328 return _node;\n- 329 }\n- 330\n-332 std::shared_ptr proxiedNodeStorage () const\n- 333 {\n- 334 return _node;\n- 335 }\n- 336\n- 338\n- 341\n-342 ProxyNode (Node& node)\n- 343 : _node(stackobject_to_shared_ptr(node))\n- 344 {}\n- 345\n-346 ProxyNode (std::shared_ptr node)\n- 347 : _node(std::move(node))\n- 348 {}\n- 349\n- 351\n- 352 private:\n- 353\n- 354 std::shared_ptr _node;\n- 355 };\n- 356\n- 358\n- 359 } // namespace TypeTree\n- 360} //namespace Dune\n- 361\n- 362#endif // DUNE_TYPETREE_PROXYNODE_HH\n+ 197\n+ 198 } // end namespace TypeTree\n+ 199} // end namespace Dune\n+ 200\n+ 201#endif // DUNE_TYPETREE_TYPETRAITS_HH\n+treepath.hh\n nodeinterface.hh\n-nodetags.hh\n Dune::TypeTree::NodeTag\n typename std::decay_t< Node >::NodeTag NodeTag\n Returns the node tag of the given Node.\n Definition nodeinterface.hh:76\n-Dune::TypeTree::StaticDegree\n-decltype(Node::degree()) StaticDegree\n-Returns the statically known degree of the given Node type as a std::\n-integral_constant.\n-Definition nodeinterface.hh:113\n+Dune::TypeTree::ImplementationTag\n+typename std::decay_t< T >::ImplementationTag ImplementationTag\n+Returns the implementation tag of the given Node.\n+Definition nodeinterface.hh:80\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::LeafNodeTag\n-Tag designating a leaf node.\n-Definition nodetags.hh:16\n-Dune::TypeTree::PowerNodeTag\n-Tag designating a power node.\n-Definition nodetags.hh:19\n-Dune::TypeTree::DynamicPowerNodeTag\n-Tag designating a power node with runtime degree.\n-Definition nodetags.hh:22\n-Dune::TypeTree::CompositeNodeTag\n-Tag designating a composite node.\n-Definition nodetags.hh:25\n-Dune::TypeTree::ProxyNode\n-Base class for nodes acting as a proxy for an existing node.\n-Definition proxynode.hh:253\n-Dune::TypeTree::ProxyNode::ProxyNode\n-ProxyNode(Node &node)\n-Definition proxynode.hh:342\n-Dune::TypeTree::ProxyNode::NodeTag\n-Dune::TypeTree::NodeTag< Node > NodeTag\n-Definition proxynode.hh:270\n-Dune::TypeTree::ProxyNode::isComposite\n-static const bool isComposite\n-Mark this class as a composite in the dune-typetree.\n-Definition proxynode.hh:279\n-Dune::TypeTree::ProxyNode::isLeaf\n-static const bool isLeaf\n-Mark this class as non leaf in the dune-typetree.\n-Definition proxynode.hh:273\n-Dune::TypeTree::ProxyNode::isPower\n-static const bool isPower\n-Mark this class as a non power in the dune-typetree.\n-Definition proxynode.hh:276\n-Dune::TypeTree::ProxyNode::degree\n-auto degree() const\n-Definition proxynode.hh:298\n-Dune::TypeTree::ProxyNode::proxiedNode\n-std::enable_if< enabled, Node & >::type proxiedNode()\n-Returns the proxied node.\n-Definition proxynode.hh:312\n-Dune::TypeTree::ProxyNode::CHILDREN\n-static const std::size_t CHILDREN\n-The number of children.\n-Definition proxynode.hh:283\n-Dune::TypeTree::ProxyNode::proxiedNodeStorage\n-std::shared_ptr< const Node > proxiedNodeStorage() const\n-Returns the storage of the proxied node (const version).\n-Definition proxynode.hh:332\n-Dune::TypeTree::ProxyNode::ProxiedNode\n-Node ProxiedNode\n-Definition proxynode.hh:268\n-Dune::TypeTree::ProxyNode::proxiedNodeStorage\n-std::enable_if< enabled, std::shared_ptr< Node > >::type proxiedNodeStorage()\n-Returns the storage of the proxied node.\n-Definition proxynode.hh:326\n-Dune::TypeTree::ProxyNode::degree\n-static constexpr auto degree()\n-Definition proxynode.hh:291\n-Dune::TypeTree::ProxyNode::ProxyNode\n-ProxyNode(std::shared_ptr< Node > node)\n-Definition proxynode.hh:346\n-Dune::TypeTree::ProxyNode::proxiedNode\n-const Node & proxiedNode() const\n-Returns the proxied node (const version).\n-Definition proxynode.hh:318\n-Dune::TypeTree::StaticChildAccessors\n-Mixin class providing methods for child access with compile-time parameter.\n-Definition proxynode.hh:28\n-Dune::TypeTree::StaticChildAccessors::child\n-auto & child(index_constant< k >={})\n-Returns the i-th child.\n-Definition proxynode.hh:69\n-Dune::TypeTree::StaticChildAccessors::setChild\n-void setChild(ProxyChild &&child, typename std::enable_if< lazy_enabled< k >::\n-value, void * >::type=0)\n-Sets the i-th child to the passed-in value.\n-Definition proxynode.hh:110\n-Dune::TypeTree::StaticChildAccessors::nodeStorage\n-const ProxiedNode::NodeStorage & nodeStorage() const\n-Definition proxynode.hh:115\n-Dune::TypeTree::StaticChildAccessors::childStorage\n-auto childStorage(index_constant< k >={})\n-Returns the storage of the i-th child.\n-Definition proxynode.hh:90\n-Dune::TypeTree::StaticChildAccessors::child\n-const auto & child(index_constant< k >={}) const\n-Returns the i-th child (const version).\n-Definition proxynode.hh:79\n-Dune::TypeTree::StaticChildAccessors::childStorage\n-auto childStorage(index_constant< k >={}) const\n-Returns the storage of the i-th child (const version).\n-Definition proxynode.hh:103\n-Dune::TypeTree::StaticChildAccessors::Child\n-Access to the type and storage type of the i-th child.\n-Definition proxynode.hh:58\n-Dune::TypeTree::DynamicChildAccessors\n-Mixin class providing methods for child access with run-time parameter.\n-Definition proxynode.hh:131\n-Dune::TypeTree::DynamicChildAccessors::child\n-auto & child(std::size_t i)\n-Returns the i-th child.\n-Definition proxynode.hh:160\n-Dune::TypeTree::DynamicChildAccessors::childStorage\n-auto childStorage(std::size_t i) const\n-Returns the storage of the i-th child (const version).\n-Definition proxynode.hh:192\n-Dune::TypeTree::DynamicChildAccessors::setChild\n-void setChild(std::size_t i, ProxyChild &&child, typename std::enable_if<\n-enabled, void * >::type=0)\n-Sets the i-th child to the passed-in value.\n-Definition proxynode.hh:199\n-Dune::TypeTree::DynamicChildAccessors::child\n-const auto & child(std::size_t i) const\n-Returns the i-th child (const version).\n-Definition proxynode.hh:169\n-Dune::TypeTree::DynamicChildAccessors::childStorage\n-auto childStorage(std::size_t i)\n-Returns the storage of the i-th child.\n-Definition proxynode.hh:180\n-Dune::TypeTree::ProxyNodeBase\n-Tag-based dispatch to appropriate base class that provides necessary\n-functionality.\n-Definition proxynode.hh:208\n-Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>::NodeStorage\n-Node::NodeStorage NodeStorage\n-Definition proxynode.hh:222\n-Dune::TypeTree::ProxyNodeBase<_Node,_CompositeNodeTag_>::ChildTypes\n-Node::ChildTypes ChildTypes\n-Definition proxynode.hh:221\n-Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>::NodeStorage\n-Node::NodeStorage NodeStorage\n-Definition proxynode.hh:231\n-Dune::TypeTree::ProxyNodeBase<_Node,_PowerNodeTag_>::ChildType\n-Node::ChildType ChildType\n-Definition proxynode.hh:230\n-Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>::NodeStorage\n-Node::NodeStorage NodeStorage\n-Definition proxynode.hh:240\n-Dune::TypeTree::ProxyNodeBase<_Node,_DynamicPowerNodeTag_>::ChildType\n-Node::ChildType ChildType\n-Definition proxynode.hh:239\n+Dune::TypeTree::isTreePath\n+constexpr auto isTreePath(const T &) -> IsTreePath< T >\n+Check if given object represents a tree path.\n+Definition typetraits.hh:191\n+Dune::TypeTree::declptr\n+T * declptr()\n+Helper function for generating a pointer to a value of type T in an unevaluated\n+operand setting.\n+Dune::TypeTree::impl::isTreePath\n+constexpr auto isTreePath(void *) -> std::false_type\n+Definition typetraits.hh:153\n+Dune::TypeTree::HybridTreePath\n+A hybrid version of TreePath that supports both compile time and run time\n+indices.\n+Definition treepath.hh:79\n+Dune::first_type\n+Definition typetraits.hh:19\n+Dune::first_type<_T0,_T..._>::type\n+T0 type\n+Definition typetraits.hh:24\n+Dune::TypeTree::has_node_tag\n+Definition typetraits.hh:31\n+Dune::TypeTree::has_node_tag::value\n+static constexpr bool value\n+True if class T defines a NodeTag.\n+Definition typetraits.hh:41\n+Dune::TypeTree::has_node_tag::test\n+static yes test(NodeTag< X > *)\n+Dune::TypeTree::has_node_tag::test\n+static no test(...)\n+Dune::TypeTree::has_node_tag::yes\n+Definition typetraits.hh:32\n+Dune::TypeTree::has_node_tag::yes::dummy\n+char dummy[1]\n+Definition typetraits.hh:32\n+Dune::TypeTree::has_node_tag::no\n+Definition typetraits.hh:33\n+Dune::TypeTree::has_node_tag::no::dummy\n+char dummy[2]\n+Definition typetraits.hh:33\n+Dune::TypeTree::has_node_tag_value\n+Definition typetraits.hh:46\n+Dune::TypeTree::has_node_tag_value::test\n+static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a)\n+Dune::TypeTree::has_node_tag_value::value\n+static constexpr bool value\n+True if class T defines a NodeTag of type V.\n+Definition typetraits.hh:59\n+Dune::TypeTree::has_node_tag_value::test\n+static no test(...)\n+Dune::TypeTree::has_node_tag_value::maybe\n+Definition typetraits.hh:48\n+Dune::TypeTree::has_node_tag_value::maybe::dummy\n+char dummy[N+1]\n+Definition typetraits.hh:48\n+Dune::TypeTree::has_node_tag_value::yes\n+Definition typetraits.hh:49\n+Dune::TypeTree::has_node_tag_value::yes::dummy\n+char dummy[2]\n+Definition typetraits.hh:49\n+Dune::TypeTree::has_node_tag_value::no\n+Definition typetraits.hh:50\n+Dune::TypeTree::has_node_tag_value::no::dummy\n+char dummy[1]\n+Definition typetraits.hh:50\n+Dune::TypeTree::has_implementation_tag\n+Definition typetraits.hh:64\n+Dune::TypeTree::has_implementation_tag::test\n+static yes test(ImplementationTag< X > *)\n+Dune::TypeTree::has_implementation_tag::test\n+static no test(...)\n+Dune::TypeTree::has_implementation_tag::value\n+static constexpr bool value\n+True if class T defines an ImplementationTag.\n+Definition typetraits.hh:74\n+Dune::TypeTree::has_implementation_tag::yes\n+Definition typetraits.hh:65\n+Dune::TypeTree::has_implementation_tag::yes::dummy\n+char dummy[1]\n+Definition typetraits.hh:65\n+Dune::TypeTree::has_implementation_tag::no\n+Definition typetraits.hh:66\n+Dune::TypeTree::has_implementation_tag::no::dummy\n+char dummy[2]\n+Definition typetraits.hh:66\n+Dune::TypeTree::has_implementation_tag_value\n+Definition typetraits.hh:79\n+Dune::TypeTree::has_implementation_tag_value::test\n+static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test\n+(ImplementationTag< X > *a)\n+Dune::TypeTree::has_implementation_tag_value::test\n+static no test(...)\n+Dune::TypeTree::has_implementation_tag_value::value\n+static constexpr bool value\n+True if class T defines an ImplementationTag of type V.\n+Definition typetraits.hh:92\n+Dune::TypeTree::has_implementation_tag_value::maybe\n+Definition typetraits.hh:81\n+Dune::TypeTree::has_implementation_tag_value::maybe::dummy\n+char dummy[N+1]\n+Definition typetraits.hh:81\n+Dune::TypeTree::has_implementation_tag_value::yes\n+Definition typetraits.hh:82\n+Dune::TypeTree::has_implementation_tag_value::yes::dummy\n+char dummy[2]\n+Definition typetraits.hh:82\n+Dune::TypeTree::has_implementation_tag_value::no\n+Definition typetraits.hh:83\n+Dune::TypeTree::has_implementation_tag_value::no::dummy\n+char dummy[1]\n+Definition typetraits.hh:83\n+Dune::TypeTree::AlwaysVoid\n+Definition typetraits.hh:97\n+Dune::TypeTree::AlwaysVoid::type\n+void type\n+Definition typetraits.hh:98\n+Dune::TypeTree::meta_function\n+Marker tag declaring a meta function.\n+Definition typetraits.hh:121\n+Dune::TypeTree::lazy_evaluate\n+Helper meta function to delay evaluation of F.\n+Definition typetraits.hh:126\n+Dune::TypeTree::lazy_evaluate::type\n+F::type type\n+Definition typetraits.hh:127\n+Dune::TypeTree::lazy_identity\n+Identity function.\n+Definition typetraits.hh:133\n+Dune::TypeTree::lazy_identity::type\n+F type\n+Definition typetraits.hh:134\n+Dune::TypeTree::evaluate_if_meta_function\n+Meta function that evaluates its argument iff it inherits from meta_function.\n+Definition typetraits.hh:140\n+Dune::TypeTree::evaluate_if_meta_function::type\n+std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F\n+>, lazy_identity< F > >::type::type type\n+Definition typetraits.hh:145\n+Dune::TypeTree::IsTreePath\n+Check if type represents a tree path.\n+Definition typetraits.hh:182\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00011.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: visitor.hh File Reference\n+dune-typetree: nodetags.hh File Reference\n \n \n \n \n \n \n \n@@ -71,109 +71,42 @@\n \n
\n
\n
\n \n-
visitor.hh File Reference
\n+Namespaces
\n+
nodetags.hh File Reference
\n
\n
\n-\n+\n

Go to the source code of this file.

\n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

\n 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::LeafNodeTag
 Tag designating a leaf node. More...
 
struct  Dune::TypeTree::DynamicTraversal
 Mixin base class for visitors that only need a dynamic TreePath during traversal. More...
struct  Dune::TypeTree::PowerNodeTag
 Tag designating a power node. More...
 
struct  Dune::TypeTree::TreeVisitor
 Convenience base class for visiting the entire tree. More...
struct  Dune::TypeTree::DynamicPowerNodeTag
 Tag designating a power node with runtime degree. More...
 
struct  Dune::TypeTree::DirectChildrenVisitor
 Convenience base class for visiting the direct children of a node. More...
 
struct  Dune::TypeTree::TreePairVisitor
 Convenience base class for visiting an entire tree pair. More...
 
struct  Dune::TypeTree::DirectChildrenPairVisitor
 Convenience base class for visiting the direct children of a node pair. More...
 
struct  Dune::TypeTree::Experimental::Info::LeafCounterVisitor
 
struct  Dune::TypeTree::Experimental::Info::NodeCounterVisitor
 
struct  Dune::TypeTree::Experimental::Info::DepthVisitor
struct  Dune::TypeTree::CompositeNodeTag
 Tag designating a composite node. More...
 
\n \n \n \n \n \n-\n-\n-\n-\n-

\n Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Experimental
 
namespace  Dune::TypeTree::Experimental::Info
 
\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

\n-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.
 
\n-\n-\n-\n-\n-\n

\n-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.
 
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,108 +6,31 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces | Functions | Variables\n-visitor.hh File Reference\n-#include \n-#include \n+Classes | Namespaces\n+nodetags.hh File Reference\n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::TypeTree::DefaultVisitor\n-\u00a0 Visitor interface and base class for TypeTree visitors. More...\n+struct \u00a0Dune::TypeTree::LeafNodeTag\n+\u00a0 Tag designating a leaf node. More...\n \u00a0\n-struct \u00a0Dune::TypeTree::DefaultPairVisitor\n-\u00a0 Visitor interface and base class for visitors of pairs of TypeTrees.\n- More...\n+struct \u00a0Dune::TypeTree::PowerNodeTag\n+\u00a0 Tag designating a power node. More...\n \u00a0\n-struct \u00a0Dune::TypeTree::Experimental::DefaultHybridVisitor\n-\u00a0 Hybrid visitor interface and base class for TypeTree hybrid visitors.\n- More...\n+struct \u00a0Dune::TypeTree::DynamicPowerNodeTag\n+\u00a0 Tag designating a power node with runtime degree. More...\n \u00a0\n-struct \u00a0Dune::TypeTree::VisitDirectChildren\n-\u00a0 Mixin base class for visitors that only want to visit the direct\n- children of a node. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::VisitDirectChildren::VisitChild<_Node1,_Child1,_Node2,\n- Child2,_TreePath_>\n-\u00a0 Template struct for determining whether or not to visit a given child.\n- More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::VisitTree\n-\u00a0 Mixin base class for visitors that want to visit the complete tree.\n- More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::VisitTree::VisitChild<_Node1,_Child1,_Node2,_Child2,\n- TreePath_>\n-\u00a0 Template struct for determining whether or not to visit a given child.\n- More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::StaticTraversal\n-\u00a0 Mixin base class for visitors that require a static TreePath during\n- traversal. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::DynamicTraversal\n-\u00a0 Mixin base class for visitors that only need a dynamic TreePath during\n- traversal. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::TreeVisitor\n-\u00a0 Convenience base class for visiting the entire tree. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::DirectChildrenVisitor\n-\u00a0 Convenience base class for visiting the direct children of a node.\n- More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::TreePairVisitor\n-\u00a0 Convenience base class for visiting an entire tree pair. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::DirectChildrenPairVisitor\n-\u00a0 Convenience base class for visiting the direct children of a node\n- pair. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::Experimental::Info::LeafCounterVisitor\n-\u00a0\n-struct \u00a0Dune::TypeTree::Experimental::Info::NodeCounterVisitor\n-\u00a0\n-struct \u00a0Dune::TypeTree::Experimental::Info::DepthVisitor\n+struct \u00a0Dune::TypeTree::CompositeNodeTag\n+\u00a0 Tag designating a composite node. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n-namespace \u00a0Dune::TypeTree::Experimental\n-\u00a0\n-namespace \u00a0Dune::TypeTree::Experimental::Info\n-\u00a0\n- Functions\n-template\n- auto\u00a0Dune::TypeTree::Experimental::Info::depth (const Tree &tree)\n-\u00a0 The depth of the TypeTree.\n-\u00a0\n-template\n-constexpr auto\u00a0Dune::TypeTree::Experimental::Info::depth ()\n-\u00a0 The depth of the Tree.\n-\u00a0\n-template\n- auto\u00a0Dune::TypeTree::Experimental::Info::nodeCount (const Tree\n- &tree)\n-\u00a0 The total number of nodes in the Tree.\n-\u00a0\n-template\n- auto\u00a0Dune::TypeTree::Experimental::Info::leafCount (const Tree\n- &tree)\n-\u00a0 The number of leaf nodes in the Tree.\n-\u00a0\n- Variables\n-template\n-constexpr bool\u00a0Dune::TypeTree::Experimental::Info::isDynamic = std::\n- is_same()))>\n- {}\n-\u00a0 true if any of the nodes in the tree only has dynamic degree.\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00011_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: visitor.hh Source File\n+dune-typetree: nodetags.hh Source File\n \n \n \n \n \n \n \n@@ -74,385 +74,52 @@\n \n
\n \n
\n \n
\n-
visitor.hh
\n+
nodetags.hh
\n
\n
\n Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
\n
2// vi: set et ts=4 sw=2 sts=2:
\n
3
\n-
4#ifndef DUNE_TYPETREE_VISITOR_HH
\n-
5#define DUNE_TYPETREE_VISITOR_HH
\n+
4#ifndef DUNE_TYPETREE_NODETAGS_HH
\n+
5#define DUNE_TYPETREE_NODETAGS_HH
\n
6
\n-\n-\n+
7namespace Dune {
\n+
8 namespace TypeTree {
\n
9
\n-
10namespace Dune {
\n-
11 namespace TypeTree {
\n-
12
\n-
19
\n-
\n-\n-
47 {
\n-
48
\n-
50
\n-
57 template<typename T, typename TreePath>
\n-
58 void pre(T&&, TreePath) const {}
\n-
59
\n-
61
\n-
69 template<typename T, typename TreePath>
\n-
70 void in(T&&, TreePath) const {}
\n-
71
\n-
73
\n-
80 template<typename T, typename TreePath>
\n-
81 void post(T&&, TreePath) const {}
\n-
82
\n-
84
\n-
90 template<typename T, typename TreePath>
\n-
91 void leaf(T&&, TreePath) const {}
\n-
92
\n-
94
\n-
104 template<typename T, typename Child, typename TreePath, typename ChildIndex>
\n-
105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}
\n-
106
\n-
108
\n-
119 template<typename T, typename Child, typename TreePath, typename ChildIndex>
\n-
120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}
\n-
121
\n-
122 };
\n-
\n-
123
\n-
124
\n-
126
\n-
\n-\n-
162 {
\n-
163
\n-
165
\n-
173 template<typename T1, typename T2, typename TreePath>
\n-
174 void pre(T1&&, T2&&, TreePath) const {}
\n-
175
\n-
177
\n-
186 template<typename T1, typename T2, typename TreePath>
\n-
187 void in(T1&&, T2&&, TreePath) const {}
\n-
188
\n-
190
\n-
198 template<typename T1, typename T2, typename TreePath>
\n-
199 void post(T1&&, T2&&, TreePath) const {}
\n-
200
\n-
202
\n-
213 template<typename T1, typename T2, typename TreePath>
\n-
214 void leaf(T1&&, T2&&, TreePath) const {}
\n-
215
\n-
217
\n-
229 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
\n-
230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
\n-
231
\n-
233
\n-
245 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
\n-
246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
\n-
247
\n-
248 };
\n-
\n-
249
\n-
250
\n-
251 namespace Experimental {
\n-
252
\n-
\n-\n-
284 {
\n-
285
\n-
293 template<typename T, typename TreePath, typename U>
\n-
294 auto pre(T&&, TreePath, const U& u) const { return u;}
\n-
295
\n-
303 template<typename T, typename TreePath, typename U>
\n-
304 auto in(T&&, TreePath, const U& u) const {return u;}
\n-
305
\n-
313 template<typename T, typename TreePath, typename U>
\n-
314 auto post(T&&, TreePath, const U& u) const {return u;}
\n-
315
\n-
323 template<typename T, typename TreePath, typename U>
\n-
324 auto leaf(T&&, TreePath, const U& u) const { return u;}
\n-
325
\n-
333 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
\n-
334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
\n-
335
\n-
343 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
\n-
344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
\n-
345
\n-
346 };
\n-
\n-
347 } // namespace Experimental
\n-
348
\n-
350
\n-
\n-\n-
356 {
\n-
357
\n-
358 // the little trick with the default template arguments
\n-
359 // makes the class usable for both single-tree visitors
\n-
360 // and visitors for pairs of trees
\n-
362 template<typename Node1,
\n-
363 typename Child1,
\n-
364 typename Node2,
\n-
365 typename Child2 = void,
\n-
366 typename TreePath = void>
\n-
\n-\n-
368 {
\n-
370 static const bool value = false;
\n-
371 };
\n-
\n-
372
\n-
373 };
\n-
\n-
374
\n-
375
\n-
377
\n-
\n-\n-
382 {
\n-
383
\n-
384 // the little trick with the default template arguments
\n-
385 // makes the class usable for both single-tree visitors
\n-
386 // and visitors for pairs of trees
\n-
388 template<typename Node1,
\n-
389 typename Child1,
\n-
390 typename Node2,
\n-
391 typename Child2 = void,
\n-
392 typename TreePath = void>
\n-
\n-\n-
394 {
\n-
396 static const bool value = true;
\n-
397 };
\n-
\n-
398
\n-
399 };
\n-
\n-
400
\n-
402
\n-
\n-\n-
410 {
\n-\n-
413 };
\n-
\n-
414
\n-
416
\n-
\n-\n-
424 {
\n-\n-
427 };
\n-
\n-
428
\n-
\n-\n-
431 : public DefaultVisitor
\n-
432 , public VisitTree
\n-
433 {};
\n-
\n-
434
\n-
\n-\n-
437 : public DefaultVisitor
\n-
438 , public VisitDirectChildren
\n-
439 {};
\n-
\n-
440
\n-
\n-\n-
443 : public DefaultPairVisitor
\n-
444 , public VisitTree
\n-
445 {};
\n-
\n-
446
\n-
\n-\n-
449 : public DefaultPairVisitor
\n-
450 , public VisitDirectChildren
\n-
451 {};
\n-
\n-
452
\n-
\n-
453 namespace Experimental::Info {
\n-
454
\n-
\n-\n-
456 : public DefaultHybridVisitor
\n-
457 , public StaticTraversal
\n-
458 , public VisitTree
\n-
459 {
\n-
460 template<class Tree, class Child, class TreePath, class ChildIndex, class U>
\n-
\n-
461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const {
\n-
462 // in this case child index is an integral constant: forward u
\n-
463 return u;
\n-
464 }
\n-
\n-
465
\n-
466 template<class Tree, class Child, class TreePath, class U>
\n-
\n-
467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t /*childIndex*/, U u) const {
\n-
468 // in this case child index is a run-time index: cast accumulated u to std::size_t
\n-
469 return std::size_t{u};
\n-
470 }
\n-
\n-
471
\n-
472 template<class Tree, class TreePath, class U>
\n-
\n-
473 auto leaf(Tree&&, TreePath, U u) const
\n-
474 {
\n-
475 return Hybrid::plus(u,Dune::Indices::_1);
\n-
476 }
\n-
\n-
477
\n-
478 };
\n-
\n-
479
\n-
\n-\n-
481 : public LeafCounterVisitor
\n-
482 {
\n-
483 template<typename Tree, typename TreePath, typename U>
\n-
\n-
484 auto pre(Tree&&, TreePath, U u) const {
\n-
485 return Hybrid::plus(u,Indices::_1);
\n-
486 }
\n-
\n-
487 };
\n-
\n-
488
\n-
\n-\n-
490 : public DefaultHybridVisitor
\n-
491 , public StaticTraversal
\n-
492 , public VisitTree
\n-
493 {
\n-
494 template<class Tree, class TreePath, class U>
\n-
\n-
495 auto leaf(Tree&&, TreePath, U u) const
\n-
496 {
\n-
497 auto path_size = index_constant<treePathSize(TreePath{})>{};
\n-
498 auto depth = Hybrid::plus(path_size,Indices::_1);
\n-
499 return Hybrid::max(depth,u);
\n-
500 }
\n-
\n-
501 };
\n-
\n-
502
\n-
504 // result is alwayas an integral constant
\n-
505 template<typename Tree>
\n-
\n-
506 auto depth(const Tree& tree)
\n-
507 {
\n-
508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0);
\n-
509 }
\n-
\n-
510
\n-
512 // return types is std::integral_constant.
\n-
513 template<typename Tree>
\n-
\n-
514 constexpr auto depth()
\n-
515 {
\n-
516 return decltype(hybridApplyToTree(std::declval<Tree>(),DepthVisitor{},Indices::_0)){};
\n-
517 }
\n-
\n-
518
\n-
520 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
\n-
521 template<typename Tree>
\n-
\n-
522 auto nodeCount(const Tree& tree)
\n-
523 {
\n-
524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0);
\n-
525 }
\n-
\n-
526
\n-
528 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
\n-
529 template<typename Tree>
\n-
\n-
530 auto leafCount(const Tree& tree)
\n-
531 {
\n-
532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0);
\n-
533 }
\n-
\n-
534
\n-
536 template<typename Tree>
\n-
537 constexpr bool isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{};
\n-
538
\n-
539 } // namespace Experimental::Info
\n-
\n-
540
\n-
542
\n-
543 } // namespace TypeTree
\n-
544} //namespace Dune
\n-
545
\n-
546#endif // DUNE_TYPETREE_VISITOR_HH
\n-\n-\n-
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
\n-
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition treepath.hh:199
\n+
16 struct LeafNodeTag {};
\n+
17
\n+
19 struct PowerNodeTag {};
\n+
20
\n+\n+
23
\n+\n+
26
\n+
27#ifndef DOXYGEN
\n+
28
\n+
30 struct StartTag {};
\n+
31
\n+
32
\n+
33
\n+
34#endif // DOXYGEN
\n+
35
\n+
37
\n+
38 } // namespace TypeTree
\n+
39} //namespace Dune
\n+
40
\n+
41#endif // DUNE_TYPETREE_NODETAGS_HH
\n
Definition accumulate_static.hh:13
\n-
auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
Apply hybrid visitor to TypeTree.
Definition accumulate_static.hh:698
\n-
Type
Definition treepath.hh:30
\n-
@ fullyStatic
Definition treepath.hh:30
\n-
@ dynamic
Definition treepath.hh:30
\n-
constexpr bool isDynamic
true if any of the nodes in the tree only has dynamic degree.
Definition visitor.hh:537
\n-
auto leafCount(const Tree &tree)
The number of leaf nodes in the Tree.
Definition visitor.hh:530
\n-
auto nodeCount(const Tree &tree)
The total number of nodes in the Tree.
Definition visitor.hh:522
\n-
constexpr auto depth()
The depth of the Tree.
Definition visitor.hh:514
\n-
A hybrid version of TreePath that supports both compile time and run time indices.
Definition treepath.hh:79
\n-
Visitor interface and base class for TypeTree visitors.
Definition visitor.hh:47
\n-
void in(T &&, TreePath) const
Method for infix tree traversal.
Definition visitor.hh:70
\n-
void afterChild(T &&, Child &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition visitor.hh:120
\n-
void beforeChild(T &&, Child &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition visitor.hh:105
\n-
void post(T &&, TreePath) const
Method for postfix tree traversal.
Definition visitor.hh:81
\n-
void leaf(T &&, TreePath) const
Method for leaf traversal.
Definition visitor.hh:91
\n-
void pre(T &&, TreePath) const
Method for prefix tree traversal.
Definition visitor.hh:58
\n-
Visitor interface and base class for visitors of pairs of TypeTrees.
Definition visitor.hh:162
\n-
void leaf(T1 &&, T2 &&, TreePath) const
Method for leaf traversal.
Definition visitor.hh:214
\n-
void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition visitor.hh:230
\n-
void pre(T1 &&, T2 &&, TreePath) const
Method for prefix tree traversal.
Definition visitor.hh:174
\n-
void post(T1 &&, T2 &&, TreePath) const
Method for postfix traversal.
Definition visitor.hh:199
\n-
void in(T1 &&, T2 &&, TreePath) const
Method for infix tree traversal.
Definition visitor.hh:187
\n-
void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition visitor.hh:246
\n-
Hybrid visitor interface and base class for TypeTree hybrid visitors.
Definition visitor.hh:284
\n-
auto post(T &&, TreePath, const U &u) const
Method for postfix tree traversal.
Definition visitor.hh:314
\n-
auto pre(T &&, TreePath, const U &u) const
Method for prefix tree traversal.
Definition visitor.hh:294
\n-
auto leaf(T &&, TreePath, const U &u) const
Method for leaf traversal.
Definition visitor.hh:324
\n-
auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for child-parent traversal.
Definition visitor.hh:344
\n-
auto in(T &&, TreePath, const U &u) const
Method for infix tree traversal.
Definition visitor.hh:304
\n-
auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for parent-child traversal.
Definition visitor.hh:334
\n-
Mixin base class for visitors that only want to visit the direct children of a node.
Definition visitor.hh:356
\n-
Template struct for determining whether or not to visit a given child.
Definition visitor.hh:368
\n-
static const bool value
Do not visit any child.
Definition visitor.hh:370
\n-
Mixin base class for visitors that want to visit the complete tree.
Definition visitor.hh:382
\n-
Template struct for determining whether or not to visit a given child.
Definition visitor.hh:394
\n-
static const bool value
Visit any child.
Definition visitor.hh:396
\n-
Mixin base class for visitors that require a static TreePath during traversal.
Definition visitor.hh:410
\n-
static const TreePathType::Type treePathType
Use the static tree traversal algorithm.
Definition visitor.hh:412
\n-
Mixin base class for visitors that only need a dynamic TreePath during traversal.
Definition visitor.hh:424
\n-
static const TreePathType::Type treePathType
Use the dynamic tree traversal algorithm.
Definition visitor.hh:426
\n-
Convenience base class for visiting the entire tree.
Definition visitor.hh:433
\n-
Convenience base class for visiting the direct children of a node.
Definition visitor.hh:439
\n-
Convenience base class for visiting an entire tree pair.
Definition visitor.hh:445
\n-
Convenience base class for visiting the direct children of a node pair.
Definition visitor.hh:451
\n-\n-
auto leaf(Tree &&, TreePath, U u) const
Definition visitor.hh:473
\n-
auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const
Definition visitor.hh:461
\n-
std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const
Definition visitor.hh:467
\n-\n-
auto pre(Tree &&, TreePath, U u) const
Definition visitor.hh:484
\n-\n-
auto leaf(Tree &&, TreePath, U u) const
Definition visitor.hh:495
\n+
Tag designating a leaf node.
Definition nodetags.hh:16
\n+
Tag designating a power node.
Definition nodetags.hh:19
\n+
Tag designating a power node with runtime degree.
Definition nodetags.hh:22
\n+
Tag designating a composite node.
Definition nodetags.hh:25
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,484 +7,56 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-visitor.hh\n+nodetags.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_VISITOR_HH\n- 5#define DUNE_TYPETREE_VISITOR_HH\n+ 4#ifndef DUNE_TYPETREE_NODETAGS_HH\n+ 5#define DUNE_TYPETREE_NODETAGS_HH\n 6\n- 7#include \n- 8#include \n+ 7namespace Dune {\n+ 8 namespace TypeTree {\n 9\n- 10namespace Dune {\n- 11 namespace TypeTree {\n- 12\n- 19\n-46 struct DefaultVisitor\n- 47 {\n- 48\n- 50\n- 57 template\n-58 void pre(T&&, TreePath) const {}\n- 59\n- 61\n- 69 template\n-70 void in(T&&, TreePath) const {}\n- 71\n- 73\n- 80 template\n-81 void post(T&&, TreePath) const {}\n- 82\n- 84\n- 90 template\n-91 void leaf(T&&, TreePath) const {}\n- 92\n- 94\n- 104 template\n-105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}\n- 106\n- 108\n- 119 template\n-120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}\n- 121\n- 122 };\n- 123\n- 124\n- 126\n-161 struct DefaultPairVisitor\n- 162 {\n- 163\n- 165\n- 173 template\n-174 void pre(T1&&, T2&&, TreePath) const {}\n- 175\n- 177\n- 186 template\n-187 void in(T1&&, T2&&, TreePath) const {}\n- 188\n- 190\n- 198 template\n-199 void post(T1&&, T2&&, TreePath) const {}\n- 200\n- 202\n- 213 template\n-214 void leaf(T1&&, T2&&, TreePath) const {}\n- 215\n- 217\n- 229 template\n-230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex)\n-const {}\n- 231\n- 233\n- 245 template\n-246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const\n-{}\n- 247\n- 248 };\n- 249\n- 250\n- 251 namespace Experimental {\n- 252\n-283 struct DefaultHybridVisitor\n- 284 {\n- 285\n- 293 template\n-294 auto pre(T&&, TreePath, const U& u) const { return u;}\n- 295\n- 303 template\n-304 auto in(T&&, TreePath, const U& u) const {return u;}\n- 305\n- 313 template\n-314 auto post(T&&, TreePath, const U& u) const {return u;}\n- 315\n- 323 template\n-324 auto leaf(T&&, TreePath, const U& u) const { return u;}\n- 325\n- 333 template\n-334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const\n-{return u;}\n- 335\n- 343 template\n-344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const\n-{return u;}\n- 345\n- 346 };\n- 347 } // namespace Experimental\n- 348\n- 350\n-355 struct VisitDirectChildren\n- 356 {\n- 357\n- 358 // the little trick with the default template arguments\n- 359 // makes the class usable for both single-tree visitors\n- 360 // and visitors for pairs of trees\n- 362 template\n-367 struct VisitChild\n- 368 {\n-370 static const bool value = false;\n- 371 };\n- 372\n- 373 };\n- 374\n- 375\n- 377\n-381 struct VisitTree\n- 382 {\n- 383\n- 384 // the little trick with the default template arguments\n- 385 // makes the class usable for both single-tree visitors\n- 386 // and visitors for pairs of trees\n- 388 template\n-393 struct VisitChild\n- 394 {\n-396 static const bool value = true;\n- 397 };\n- 398\n- 399 };\n- 400\n- 402\n-409 struct StaticTraversal\n- 410 {\n-412 static const TreePathType::Type treePathType = TreePathType::fullyStatic;\n- 413 };\n- 414\n- 416\n-423 struct DynamicTraversal\n- 424 {\n-426 static const TreePathType::Type treePathType = TreePathType::dynamic;\n- 427 };\n- 428\n-430 struct TreeVisitor\n- 431 : public DefaultVisitor\n- 432 , public VisitTree\n- 433 {};\n- 434\n-436 struct DirectChildrenVisitor\n- 437 : public DefaultVisitor\n- 438 , public VisitDirectChildren\n- 439 {};\n- 440\n-442 struct TreePairVisitor\n- 443 : public DefaultPairVisitor\n- 444 , public VisitTree\n- 445 {};\n- 446\n-448 struct DirectChildrenPairVisitor\n- 449 : public DefaultPairVisitor\n- 450 , public VisitDirectChildren\n- 451 {};\n- 452\n-453 namespace Experimental::Info {\n- 454\n-455 struct LeafCounterVisitor\n- 456 : public DefaultHybridVisitor\n- 457 , public StaticTraversal\n- 458 , public VisitTree\n- 459 {\n- 460 template\n-461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const {\n- 462 // in this case child index is an integral constant: forward u\n- 463 return u;\n- 464 }\n- 465\n- 466 template\n-467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t /\n-*childIndex*/, U u) const {\n- 468 // in this case child index is a run-time index: cast accumulated u to\n-std::size_t\n- 469 return std::size_t{u};\n- 470 }\n- 471\n- 472 template\n-473 auto leaf(Tree&&, TreePath, U u) const\n- 474 {\n- 475 return Hybrid::plus(u,Dune::Indices::_1);\n- 476 }\n- 477\n- 478 };\n- 479\n-480 struct NodeCounterVisitor\n- 481 : public LeafCounterVisitor\n- 482 {\n- 483 template\n-484 auto pre(Tree&&, TreePath, U u) const {\n- 485 return Hybrid::plus(u,Indices::_1);\n- 486 }\n- 487 };\n- 488\n-489 struct DepthVisitor\n- 490 : public DefaultHybridVisitor\n- 491 , public StaticTraversal\n- 492 , public VisitTree\n- 493 {\n- 494 template\n-495 auto leaf(Tree&&, TreePath, U u) const\n- 496 {\n- 497 auto path_size = index_constant{};\n- 498 auto depth = Hybrid::plus(path_size,Indices::_1);\n- 499 return Hybrid::max(depth,u);\n- 500 }\n- 501 };\n- 502\n- 504 // result is alwayas an integral constant\n- 505 template\n-506 auto depth(const Tree& tree)\n- 507 {\n- 508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0);\n- 509 }\n- 510\n- 512 // return types is std::integral_constant.\n- 513 template\n-514 constexpr auto depth()\n- 515 {\n- 516 return decltype(hybridApplyToTree(std::declval(),DepthVisitor\n-{},Indices::_0)){};\n- 517 }\n- 518\n- 520 // if Tree is dynamic, return type is std::size_t, otherwise std::\n-integral_constant.\n- 521 template\n-522 auto nodeCount(const Tree& tree)\n- 523 {\n- 524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0);\n- 525 }\n- 526\n- 528 // if Tree is dynamic, return type is std::size_t, otherwise std::\n-integral_constant.\n- 529 template\n-530 auto leafCount(const Tree& tree)\n- 531 {\n- 532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0);\n- 533 }\n- 534\n- 536 template\n-537 constexpr bool isDynamic = std::is_same()))>{};\n- 538\n- 539 } // namespace Experimental::Info\n- 540\n- 542\n- 543 } // namespace TypeTree\n- 544} //namespace Dune\n- 545\n- 546#endif // DUNE_TYPETREE_VISITOR_HH\n-treepath.hh\n-utility.hh\n-Dune::TypeTree::Child\n-typename impl::_Child< Node, indices... >::type Child\n-Template alias for the type of a child node given by a list of child indices.\n-Definition childextraction.hh:223\n-Dune::TypeTree::treePathSize\n-constexpr std::size_t treePathSize(const HybridTreePath< T... > &)\n-Returns the size (number of components) of the given HybridTreePath.\n-Definition treepath.hh:199\n+16 struct LeafNodeTag {};\n+ 17\n+19 struct PowerNodeTag {};\n+ 20\n+22 struct DynamicPowerNodeTag {};\n+ 23\n+25 struct CompositeNodeTag {};\n+ 26\n+ 27#ifndef DOXYGEN\n+ 28\n+ 30 struct StartTag {};\n+ 31\n+ 32\n+ 33\n+ 34#endif // DOXYGEN\n+ 35\n+ 37\n+ 38 } // namespace TypeTree\n+ 39} //namespace Dune\n+ 40\n+ 41#endif // DUNE_TYPETREE_NODETAGS_HH\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::Experimental::hybridApplyToTree\n-auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)\n-Apply hybrid visitor to TypeTree.\n-Definition accumulate_static.hh:698\n-Dune::TypeTree::TreePathType::Type\n-Type\n-Definition treepath.hh:30\n-Dune::TypeTree::TreePathType::fullyStatic\n-@ fullyStatic\n-Definition treepath.hh:30\n-Dune::TypeTree::TreePathType::dynamic\n-@ dynamic\n-Definition treepath.hh:30\n-Dune::TypeTree::Experimental::Info::isDynamic\n-constexpr bool isDynamic\n-true if any of the nodes in the tree only has dynamic degree.\n-Definition visitor.hh:537\n-Dune::TypeTree::Experimental::Info::leafCount\n-auto leafCount(const Tree &tree)\n-The number of leaf nodes in the Tree.\n-Definition visitor.hh:530\n-Dune::TypeTree::Experimental::Info::nodeCount\n-auto nodeCount(const Tree &tree)\n-The total number of nodes in the Tree.\n-Definition visitor.hh:522\n-Dune::TypeTree::Experimental::Info::depth\n-constexpr auto depth()\n-The depth of the Tree.\n-Definition visitor.hh:514\n-Dune::TypeTree::HybridTreePath\n-A hybrid version of TreePath that supports both compile time and run time\n-indices.\n-Definition treepath.hh:79\n-Dune::TypeTree::DefaultVisitor\n-Visitor interface and base class for TypeTree visitors.\n-Definition visitor.hh:47\n-Dune::TypeTree::DefaultVisitor::in\n-void in(T &&, TreePath) const\n-Method for infix tree traversal.\n-Definition visitor.hh:70\n-Dune::TypeTree::DefaultVisitor::afterChild\n-void afterChild(T &&, Child &&, TreePath, ChildIndex) const\n-Method for child-parent traversal.\n-Definition visitor.hh:120\n-Dune::TypeTree::DefaultVisitor::beforeChild\n-void beforeChild(T &&, Child &&, TreePath, ChildIndex) const\n-Method for parent-child traversal.\n-Definition visitor.hh:105\n-Dune::TypeTree::DefaultVisitor::post\n-void post(T &&, TreePath) const\n-Method for postfix tree traversal.\n-Definition visitor.hh:81\n-Dune::TypeTree::DefaultVisitor::leaf\n-void leaf(T &&, TreePath) const\n-Method for leaf traversal.\n-Definition visitor.hh:91\n-Dune::TypeTree::DefaultVisitor::pre\n-void pre(T &&, TreePath) const\n-Method for prefix tree traversal.\n-Definition visitor.hh:58\n-Dune::TypeTree::DefaultPairVisitor\n-Visitor interface and base class for visitors of pairs of TypeTrees.\n-Definition visitor.hh:162\n-Dune::TypeTree::DefaultPairVisitor::leaf\n-void leaf(T1 &&, T2 &&, TreePath) const\n-Method for leaf traversal.\n-Definition visitor.hh:214\n-Dune::TypeTree::DefaultPairVisitor::beforeChild\n-void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex)\n-const\n-Method for parent-child traversal.\n-Definition visitor.hh:230\n-Dune::TypeTree::DefaultPairVisitor::pre\n-void pre(T1 &&, T2 &&, TreePath) const\n-Method for prefix tree traversal.\n-Definition visitor.hh:174\n-Dune::TypeTree::DefaultPairVisitor::post\n-void post(T1 &&, T2 &&, TreePath) const\n-Method for postfix traversal.\n-Definition visitor.hh:199\n-Dune::TypeTree::DefaultPairVisitor::in\n-void in(T1 &&, T2 &&, TreePath) const\n-Method for infix tree traversal.\n-Definition visitor.hh:187\n-Dune::TypeTree::DefaultPairVisitor::afterChild\n-void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const\n-Method for child-parent traversal.\n-Definition visitor.hh:246\n-Dune::TypeTree::Experimental::DefaultHybridVisitor\n-Hybrid visitor interface and base class for TypeTree hybrid visitors.\n-Definition visitor.hh:284\n-Dune::TypeTree::Experimental::DefaultHybridVisitor::post\n-auto post(T &&, TreePath, const U &u) const\n-Method for postfix tree traversal.\n-Definition visitor.hh:314\n-Dune::TypeTree::Experimental::DefaultHybridVisitor::pre\n-auto pre(T &&, TreePath, const U &u) const\n-Method for prefix tree traversal.\n-Definition visitor.hh:294\n-Dune::TypeTree::Experimental::DefaultHybridVisitor::leaf\n-auto leaf(T &&, TreePath, const U &u) const\n-Method for leaf traversal.\n-Definition visitor.hh:324\n-Dune::TypeTree::Experimental::DefaultHybridVisitor::afterChild\n-auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const\n-Method for child-parent traversal.\n-Definition visitor.hh:344\n-Dune::TypeTree::Experimental::DefaultHybridVisitor::in\n-auto in(T &&, TreePath, const U &u) const\n-Method for infix tree traversal.\n-Definition visitor.hh:304\n-Dune::TypeTree::Experimental::DefaultHybridVisitor::beforeChild\n-auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const\n-Method for parent-child traversal.\n-Definition visitor.hh:334\n-Dune::TypeTree::VisitDirectChildren\n-Mixin base class for visitors that only want to visit the direct children of a\n-node.\n-Definition visitor.hh:356\n-Dune::TypeTree::VisitDirectChildren::VisitChild\n-Template struct for determining whether or not to visit a given child.\n-Definition visitor.hh:368\n-Dune::TypeTree::VisitDirectChildren::VisitChild::value\n-static const bool value\n-Do not visit any child.\n-Definition visitor.hh:370\n-Dune::TypeTree::VisitTree\n-Mixin base class for visitors that want to visit the complete tree.\n-Definition visitor.hh:382\n-Dune::TypeTree::VisitTree::VisitChild\n-Template struct for determining whether or not to visit a given child.\n-Definition visitor.hh:394\n-Dune::TypeTree::VisitTree::VisitChild::value\n-static const bool value\n-Visit any child.\n-Definition visitor.hh:396\n-Dune::TypeTree::StaticTraversal\n-Mixin base class for visitors that require a static TreePath during traversal.\n-Definition visitor.hh:410\n-Dune::TypeTree::StaticTraversal::treePathType\n-static const TreePathType::Type treePathType\n-Use the static tree traversal algorithm.\n-Definition visitor.hh:412\n-Dune::TypeTree::DynamicTraversal\n-Mixin base class for visitors that only need a dynamic TreePath during\n-traversal.\n-Definition visitor.hh:424\n-Dune::TypeTree::DynamicTraversal::treePathType\n-static const TreePathType::Type treePathType\n-Use the dynamic tree traversal algorithm.\n-Definition visitor.hh:426\n-Dune::TypeTree::TreeVisitor\n-Convenience base class for visiting the entire tree.\n-Definition visitor.hh:433\n-Dune::TypeTree::DirectChildrenVisitor\n-Convenience base class for visiting the direct children of a node.\n-Definition visitor.hh:439\n-Dune::TypeTree::TreePairVisitor\n-Convenience base class for visiting an entire tree pair.\n-Definition visitor.hh:445\n-Dune::TypeTree::DirectChildrenPairVisitor\n-Convenience base class for visiting the direct children of a node pair.\n-Definition visitor.hh:451\n-Dune::TypeTree::Experimental::Info::LeafCounterVisitor\n-Definition visitor.hh:459\n-Dune::TypeTree::Experimental::Info::LeafCounterVisitor::leaf\n-auto leaf(Tree &&, TreePath, U u) const\n-Definition visitor.hh:473\n-Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild\n-auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const\n-Definition visitor.hh:461\n-Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild\n-std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const\n-Definition visitor.hh:467\n-Dune::TypeTree::Experimental::Info::NodeCounterVisitor\n-Definition visitor.hh:482\n-Dune::TypeTree::Experimental::Info::NodeCounterVisitor::pre\n-auto pre(Tree &&, TreePath, U u) const\n-Definition visitor.hh:484\n-Dune::TypeTree::Experimental::Info::DepthVisitor\n-Definition visitor.hh:493\n-Dune::TypeTree::Experimental::Info::DepthVisitor::leaf\n-auto leaf(Tree &&, TreePath, U u) const\n-Definition visitor.hh:495\n+Dune::TypeTree::LeafNodeTag\n+Tag designating a leaf node.\n+Definition nodetags.hh:16\n+Dune::TypeTree::PowerNodeTag\n+Tag designating a power node.\n+Definition nodetags.hh:19\n+Dune::TypeTree::DynamicPowerNodeTag\n+Tag designating a power node with runtime degree.\n+Definition nodetags.hh:22\n+Dune::TypeTree::CompositeNodeTag\n+Tag designating a composite node.\n+Definition nodetags.hh:25\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00014.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: treecontainer.hh File Reference\n+dune-typetree: childextraction.hh File Reference\n \n \n \n \n \n \n \n@@ -70,75 +70,66 @@\n
\n \n
\n \n
\n \n-
treecontainer.hh File Reference
\n+
childextraction.hh File Reference
\n
\n
\n
#include <type_traits>
\n #include <utility>
\n-#include <functional>
\n-#include <array>
\n-#include <dune/common/indices.hh>
\n-#include <dune/common/hybridutilities.hh>
\n-#include <dune/common/rangeutilities.hh>
\n-#include <dune/common/tuplevector.hh>
\n-#include <dune/typetree/treepath.hh>
\n+#include <dune/common/concept.hh>
\n+#include <dune/common/documentation.hh>
\n+#include <dune/common/typetraits.hh>
\n+#include <dune/common/shared_ptr.hh>
\n+#include <dune/typetree/nodeinterface.hh>
\n+#include <dune/typetree/treepath.hh>
\n
\n

Go to the source code of this file.

\n \n-\n-\n-\n-\n-\n-\n-\n-

\n-Classes

class  Dune::TypeTree::Detail::ContainerFactory< LeafToValue >
 
class  Dune::TypeTree::Detail::TreeContainerVectorBackend< Container >
 
struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue >
 
\n \n \n \n \n \n-\n-\n

\n Namespaces

namespace  Dune
 
namespace  Dune::TypeTree
 
namespace  Dune::TypeTree::Detail
 
\n \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

\n 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.
 
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.
 
\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

\n 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.
 
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.
 
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,64 +6,60 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces | Typedefs | Functions\n-treecontainer.hh File Reference\n+Namespaces | Typedefs | Functions\n+childextraction.hh File Reference\n #include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n #include \n Go_to_the_source_code_of_this_file.\n- Classes\n- class \u00a0Dune::TypeTree::Detail::ContainerFactory<_LeafToValue_>\n-\u00a0\n- class \u00a0Dune::TypeTree::Detail::TreeContainerVectorBackend<_Container_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::Detail::LeafToDefaultConstructibleValue<_LeafToValue_>\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n-namespace \u00a0Dune::TypeTree::Detail\n-\u00a0\n Typedefs\n-template\n-using\u00a0Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype\n- (makeTreeContainer< Value >(std::declval< const Tree & >()))>\n-\u00a0 Alias to container type generated by makeTreeContainer for given tree\n- type and uniform value type.\n-\u00a0\n-template class LeafToValue, class Tree >\n-using\u00a0Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer\n- (std::declval< const Tree & >(), std::declval< Detail::\n- LeafToDefaultConstructibleValue< LeafToValue > >()))>\n-\u00a0 Alias to container type generated by makeTreeContainer for give tree\n- type and when using LeafToValue to create values.\n+template\n+using\u00a0Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type\n+\u00a0 Template alias for the type of a child node given by a list of child\n+ indices.\n+\u00a0\n+template\n+using\u00a0Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath<\n+ Node, TreePath >::type\n+\u00a0 Template alias for the type of a child node given by a TreePath or a\n+ HybridTreePath type.\n+\u00a0\n+template\n+using\u00a0Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std::\n+ decay_t< T > >::type\n+\u00a0 Type trait that determines whether T is a flat index in the context of\n+ child extraction.\n \u00a0\n Functions\n-template\n-auto\u00a0Dune::TypeTree::Detail::makeTreeContainerVectorBackend (Container\n- &&container)\n-\u00a0\n-template\n-auto\u00a0Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue\n- &&leafToValue)\n-\u00a0 Create container havin the same structure as the given tree.\n-\u00a0\n-template\n-auto\u00a0Dune::TypeTree::makeTreeContainer (const Tree &tree)\n-\u00a0 Create container havin the same structure as the given tree.\n+template\n+ImplementationDefined\u00a0Dune::TypeTree::child (Node &&node, Indices... indices)\n+\u00a0 Extracts the child of a node given by a sequence of\n+ compile-time and run-time indices.\n+\u00a0\n+template\n+ImplementationDefined\u00a0Dune::TypeTree::childStorage (Node &&node, Indices...\n+ indices)\n+\u00a0\n+template\n+ImplementationDefined\u00a0Dune::TypeTree::child (Node &&node, HybridTreePath<\n+ Indices... > treePath)\n+\u00a0 Extracts the child of a node given by a HybridTreePath\n+ object.\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00014_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: treecontainer.hh Source File\n+dune-typetree: childextraction.hh Source File\n \n \n \n \n \n \n \n@@ -74,330 +74,287 @@\n \n
\n \n
\n \n
\n-
treecontainer.hh
\n+
childextraction.hh
\n
\n
\n-Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
\n-
2// vi: set et ts=4 sw=2 sts=2:
\n+Go to the documentation of this file.
1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
\n+
2// vi: set et ts=8 sw=2 sts=2:
\n
3
\n-
4#ifndef DUNE_TYPETREE_TREECONTAINER_HH
\n-
5#define DUNE_TYPETREE_TREECONTAINER_HH
\n+
4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH
\n+
5#define DUNE_TYPETREE_CHILDEXTRACTION_HH
\n
6
\n
7#include <type_traits>
\n
8#include <utility>
\n-
9#include <functional>
\n-
10#include <array>
\n-
11
\n-
12#include <dune/common/indices.hh>
\n-
13#include <dune/common/hybridutilities.hh>
\n-
14#include <dune/common/rangeutilities.hh>
\n-
15#include <dune/common/tuplevector.hh>
\n-
16
\n-\n+
9
\n+
10#include <dune/common/concept.hh>
\n+
11#include <dune/common/documentation.hh>
\n+
12#include <dune/common/typetraits.hh>
\n+
13#include <dune/common/shared_ptr.hh>
\n+
14
\n+\n+\n+
17
\n
18
\n
19namespace Dune {
\n
20 namespace TypeTree {
\n
21
\n-
22 namespace Detail {
\n-
23
\n-
24 /*
\n-
25 * \\brief A factory class creating a hybrid container compatible with a type tree
\n-
26 *
\n-
27 * This class allows to create a nested hybrid container having the same structure
\n-
28 * as a given type tree. Power nodes are represented as std::array's while composite
\n-
29 * nodes are represented as Dune::TupleVector's. The stored values for the leaf nodes
\n-
30 * are creating using a given predicate. Once created, the factory provides an
\n-
31 * operator() creating the container for the tree given as argument.
\n-
32 *
\n-
33 * \\tparam LeafToValue Type of a predicate that determines the stored values at the leafs
\n-
34 */
\n-
35 template<class LeafToValue>
\n-
\n-\n-
37 {
\n-
38 template<class N>
\n-
39 using DynamicDegreeConcept = decltype((std::size_t(std::declval<N>().degree()), true));
\n-
40
\n-
41 template<class N>
\n-
42 using StaticDegreeConcept = decltype((std::integral_constant<std::size_t, N::degree()>{}, true));
\n-
43
\n-
44 template<class N>
\n-
45 using DynamicChildAccessConcept = decltype((std::declval<N>().child(0u), true));
\n+
26
\n+
27#ifndef DOXYGEN
\n+
28
\n+
29 namespace Impl {
\n+
30
\n+
31 // check at run time whether index is a valid child index
\n+
32 template <class Node, class Index>
\n+
33 std::true_type checkChildIndex (Node const& node, Index i)
\n+
34 {
\n+
35 assert(std::size_t(i) < node.degree() && "Child index out of range");
\n+
36 return {};
\n+
37 }
\n+
38
\n+
39 // check at compile time whether index is a valid index
\n+
40 template <class Node, std::size_t i>
\n+
41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node, index_constant<i>)
\n+
42 {
\n+
43 static_assert(i < Node::degree(), "Child index out of range");
\n+
44 return {};
\n+
45 }
\n
46
\n-
47 public:
\n-
48
\n-
\n-
56 ContainerFactory(LeafToValue leafToValue) :
\n-
57 leafToValue_(leafToValue)
\n-
58 {}
\n+
47 // finally return the node itself if no further indices are provided. Break condition
\n+
48 // for the recursion over the node childs.
\n+
49 template<class Node>
\n+
50 decltype(auto) childImpl (Node&& node)
\n+
51 {
\n+
52 return std::forward<Node>(node);
\n+
53 }
\n+
54
\n+
55 template<class NodePtr>
\n+
56 auto childStorageImpl (NodePtr&& nodePtr)
\n+
57 {
\n+
58 return std::forward<NodePtr>(nodePtr);
\n+
59 }
\n+
60
\n+
61 // recursively call `node.child(...)` with the given indices
\n+
62 template<class Node, class I0, class... I>
\n+
63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i)
\n+
64 {
\n+
65 auto valid = checkChildIndex(node,i0);
\n+
66 if constexpr (valid)
\n+
67 return childImpl(node.child(i0),i...);
\n+
68 else
\n+
69 return;
\n+
70 }
\n+
71
\n+
72 // recursively call `node.childStorage(...)` with the given indices
\n+
73 template<class NodePtr, class I0, class... I>
\n+
74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]] I... i)
\n+
75 {
\n+
76 auto valid = checkChildIndex(*nodePtr,i0);
\n+
77 if constexpr (valid)
\n+
78 return childStorageImpl(nodePtr->childStorage(i0),i...);
\n+
79 else
\n+
80 return;
\n+
81 }
\n+
82
\n+
83 // forward to the impl methods by extracting the indices from the treepath
\n+
84 template<class Node, class... Indices, std::size_t... i>
\n+
85 decltype(auto) child (Node&& node, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
\n+
86 {
\n+
87 return childImpl(std::forward<Node>(node),treePathEntry<i>(tp)...);
\n+
88 }
\n+
89
\n+
90 // forward to the impl methods by extracting the indices from the treepath
\n+
91 template<class NodePtr, class... Indices, std::size_t... i>
\n+
92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
\n+
93 {
\n+
94 return childStorageImpl(std::forward<NodePtr>(nodePtr),treePathEntry<i>(tp)...);
\n+
95 }
\n+
96
\n+
97 } // end namespace Impl
\n+
98
\n+
99#endif // DOXYGEN
\n+
100
\n+
102
\n+
124 template<typename Node, typename... Indices>
\n+
125#ifdef DOXYGEN
\n+
\n+
126 ImplementationDefined child (Node&& node, Indices... indices)
\n+
127#else
\n+
128 decltype(auto) child (Node&& node, Indices... indices)
\n+
129#endif
\n+
130 {
\n+
131 return Impl::childImpl(std::forward<Node>(node),indices...);
\n+
132 }
\n
\n-
59
\n-
60 template<class Node>
\n-
\n-
61 auto operator()(const Node& node)
\n-
62 {
\n-
63 return (*this)(node, Dune::PriorityTag<5>{});
\n-
64 }
\n-
\n-
65
\n-
66 private:
\n-
67
\n-
68 template<class Node,
\n-
69 std::enable_if_t<Node::isLeaf, bool> = true>
\n-
70 auto operator()(const Node& node, Dune::PriorityTag<4>)
\n-
71 {
\n-
72 return leafToValue_(node);
\n-
73 }
\n-
74
\n-
75 template<class Node,
\n-
76 StaticDegreeConcept<Node> = true,
\n-
77 DynamicChildAccessConcept<Node> = true>
\n-
78 auto operator()(const Node& node, Dune::PriorityTag<3>)
\n-
79 {
\n-
80 return Dune::unpackIntegerSequence([&](auto... indices) {
\n-
81 return std::array{(*this)(node.child(indices))...};
\n-
82 }, std::make_index_sequence<std::size_t(Node::degree())>());
\n-
83 }
\n-
84
\n-
85 template<class Node,
\n-
86 DynamicDegreeConcept<Node> = true,
\n-
87 DynamicChildAccessConcept<Node> = true>
\n-
88 auto operator()(const Node& node, Dune::PriorityTag<2>)
\n-
89 {
\n-
90 using TransformedChild = decltype((*this)(node.child(0)));
\n-
91 std::vector<TransformedChild> container;
\n-
92 container.reserve(node.degree());
\n-
93 for (std::size_t i = 0; i < node.degree(); ++i)
\n-
94 container.emplace_back((*this)(node.child(i)));
\n-
95 return container;
\n-
96 }
\n-
97
\n-
98 template<class Node,
\n-
99 StaticDegreeConcept<Node> = true>
\n-
100 auto operator()(const Node& node, Dune::PriorityTag<1>)
\n-
101 {
\n-
102 return Dune::unpackIntegerSequence([&](auto... indices) {
\n-
103 return Dune::makeTupleVector((*this)(node.child(indices))...);
\n-
104 }, std::make_index_sequence<std::size_t(Node::degree())>());
\n-
105 }
\n-
106
\n-
107 private:
\n-
108 LeafToValue leafToValue_;
\n-
109 };
\n-
\n-
110
\n-
111
\n-
112 /*
\n-
113 * \\brief Wrap nested container to provide a VectorBackend
\n-
114 */
\n-
115 template<class Container>
\n-
\n-\n-
117 {
\n-
118 template<class C>
\n-
119 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<>& path)
\n-
120 {
\n-
121 return container;
\n-
122 }
\n-
123
\n-
124 template<class C, class... T>
\n-
125 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<T...>& path)
\n-
126 {
\n-
127 auto head = path[Dune::Indices::_0];
\n-
128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){
\n-
129 return treePath(path[Dune::index_constant<i+1>{}]...);
\n-
130 }, std::make_index_sequence<sizeof...(T)-1>());
\n-
131 return accessByTreePath(container[head], tailPath);
\n-
132 }
\n
133
\n-
134 template<class C, class Tree,
\n-
135 std::enable_if_t<Tree::isLeaf, bool> = true>
\n-
136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune::PriorityTag<2>)
\n-
137 {
\n-
138 /* do nothing */
\n-
139 }
\n-
140
\n-
141 template<class C, class Tree,
\n-
142 class = decltype(std::declval<C>().resize(0u))>
\n-
143 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<1>)
\n-
144 {
\n-
145 container.resize(tree.degree());
\n-
146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
\n-
147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
\n-
148 });
\n-
149 }
\n-
150
\n-
151 template<class C, class Tree>
\n-
152 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<0>)
\n-
153 {
\n-
154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
\n-
155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
\n-
156 });
\n-
157 }
\n-
158
\n-
159 template<class T>
\n-
160 using TypeTreeConcept = decltype((
\n-
161 std::declval<T>().degree(),
\n-
162 T::isLeaf,
\n-
163 T::isPower,
\n-
164 T::isComposite,
\n-
165 true));
\n-
166
\n-
167 public:
\n-
\n-
169 TreeContainerVectorBackend(Container&& container) :
\n-
170 container_(std::move(container))
\n-
171 {}
\n-
\n-
172
\n-
174 template <class Tree, TypeTreeConcept<Tree> = true>
\n-
\n-
175 TreeContainerVectorBackend(const Tree& tree) :
\n-\n-
177 {
\n-
178 this->resize(tree);
\n-
179 }
\n-
\n-
180
\n-
182 template <class C = Container,
\n-
183 std::enable_if_t<std::is_default_constructible_v<C>, bool> = true>
\n-
\n-\n-
185 container_()
\n-
186 {}
\n-
\n-
187
\n-
188 template<class... T>
\n-
\n-
189 decltype(auto) operator[](const HybridTreePath<T...>& path) const
\n-
190 {
\n-
191 return accessByTreePath(container_, path);
\n-
192 }
\n-
\n-
193
\n-
194 template<class... T>
\n-
\n-
195 decltype(auto) operator[](const HybridTreePath<T...>& path)
\n-
196 {
\n-
197 return accessByTreePath(container_, path);
\n-
198 }
\n-
\n-
199
\n-
201 template<class Tree, TypeTreeConcept<Tree> = true>
\n-
\n-
202 void resize(const Tree& tree)
\n-
203 {
\n-
204 resizeImpl(container_, tree, Dune::PriorityTag<5>{});
\n-
205 }
\n-
\n-
206
\n-
\n-
207 const Container& data() const
\n-
208 {
\n-
209 return container_;
\n-
210 }
\n-
\n+
134 template<typename Node, typename... Indices>
\n+
135#ifdef DOXYGEN
\n+
\n+
136 ImplementationDefined childStorage (Node&& node, Indices... indices)
\n+
137#else
\n+
138 auto childStorage (Node&& node, Indices... indices)
\n+
139#endif
\n+
140 {
\n+
141 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty list of child indices");
\n+
142 return Impl::childStorageImpl(&node,indices...);
\n+
143 }
\n+
\n+
144
\n+
146
\n+
169 template<typename Node, typename... Indices>
\n+
170#ifdef DOXYGEN
\n+
\n+
171 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
\n+
172#else
\n+
173 decltype(auto) child (Node&& node, HybridTreePath<Indices...> tp)
\n+
174#endif
\n+
175 {
\n+
176 return Impl::child(std::forward<Node>(node),tp,std::index_sequence_for<Indices...>{});
\n+
177 }
\n+
\n+
178
\n+
179 template<typename Node, typename... Indices>
\n+
180#ifdef DOXYGEN
\n+
181 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
\n+
182#else
\n+
183 auto childStorage (Node&& node, HybridTreePath<Indices...> tp)
\n+
184#endif
\n+
185 {
\n+
186 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty TreePath");
\n+
187 return Impl::childStorage(&node,tp,std::index_sequence_for<Indices...>{});
\n+
188 }
\n+
189
\n+
190
\n+
191#ifndef DOXYGEN
\n+
192
\n+
193 namespace impl {
\n+
194
\n+
195 template<typename T>
\n+
196 struct filter_void
\n+
197 {
\n+
198 using type = T;
\n+
199 };
\n+
200
\n+
201 template<>
\n+
202 struct filter_void<void>
\n+
203 {};
\n+
204
\n+
205 template<typename Node, std::size_t... indices>
\n+
206 struct _Child
\n+
207 : public filter_void<std::decay_t<decltype(child(std::declval<Node>(),index_constant<indices>{}...))>>
\n+
208 {};
\n+
209
\n+
210 }
\n
211
\n-
\n-
212 Container& data()
\n-
213 {
\n-
214 return container_;
\n-
215 }
\n-
\n-
216
\n-
217 private:
\n-
218 Container container_;
\n-
219 };
\n-
\n-
220
\n-
221 template<class Container>
\n-
\n-
222 auto makeTreeContainerVectorBackend(Container&& container)
\n-
223 {
\n-
224 return TreeContainerVectorBackend<std::decay_t<Container>>(std::forward<Container>(container));
\n-
225 }
\n-
\n-
226
\n-
227 /*
\n-
228 * \\brief A simple lambda for creating default constructible values from a node
\n-
229 *
\n-
230 * This simply returns LeafToValue<Node>{} for a given Node. It's needed
\n-
231 * because using a lambda expression in a using declaration is not allowed
\n-
232 * because it's an unevaluated context.
\n-
233 */
\n-
234 template<template<class Node> class LeafToValue>
\n-
\n-\n-
236 {
\n-
237 template<class Node>
\n-
\n-
238 auto operator()(const Node& node) const
\n-
239 {
\n-
240 return LeafToValue<Node>{};
\n-
241 }
\n-
\n-
242 };
\n-
\n-
243
\n-
244 } // namespace Detail
\n-
245
\n-
265 template<class Tree, class LeafToValue>
\n-
\n-
266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue)
\n-
267 {
\n-
268 auto f = std::ref(leafToValue);
\n-\n-
270 return Detail::makeTreeContainerVectorBackend(factory(tree));
\n+
212#endif // DOXYGEN
\n+
213
\n+
215
\n+
222 template<typename Node, std::size_t... indices>
\n+
223 using Child = typename impl::_Child<Node,indices...>::type;
\n+
224
\n+
225
\n+
226#ifndef DOXYGEN
\n+
227
\n+
228 namespace impl {
\n+
229
\n+
230 template<typename Node, typename TreePath>
\n+
231 struct _ChildForTreePath
\n+
232 {
\n+
233 using type = typename std::decay<decltype(child(std::declval<Node>(),std::declval<TreePath>()))>::type;
\n+
234 };
\n+
235
\n+
236 }
\n+
237
\n+
238#endif // DOXYGEN
\n+
239
\n+
241
\n+
249 template<typename Node, typename TreePath>
\n+
250 using ChildForTreePath = typename impl::_ChildForTreePath<Node,TreePath>::type;
\n+
251
\n+
252
\n+
253#ifndef DOXYGEN
\n+
254
\n+
255 namespace impl {
\n+
256
\n+
257 // By default, types are flat indices if they are integral
\n+
258 template<typename T>
\n+
259 struct _is_flat_index
\n+
260 {
\n+
261 using type = std::is_integral<T>;
\n+
262 };
\n+
263
\n+
264 // And so is any index_constant
\n+
265 template<std::size_t i>
\n+
266 struct _is_flat_index<index_constant<i>>
\n+
267 {
\n+
268 using type = std::true_type;
\n+
269 };
\n+
270
\n
271 }
\n-
\n
272
\n-
288 template<class Value, class Tree>
\n-
\n-
289 auto makeTreeContainer(const Tree& tree)
\n-
290 {
\n-
291 return makeTreeContainer(tree, [](const auto&) {return Value{};});
\n-
292 }
\n-
\n-
293
\n-
297 template<class Value, class Tree>
\n-
298 using UniformTreeContainer = std::decay_t<decltype(makeTreeContainer<Value>(std::declval<const Tree&>()))>;
\n-
299
\n-
303 template<template<class Node> class LeafToValue, class Tree>
\n-
304 using TreeContainer = std::decay_t<decltype(makeTreeContainer(std::declval<const Tree&>(), std::declval<Detail::LeafToDefaultConstructibleValue<LeafToValue>>()))>;
\n-
305
\n-
307
\n-
308 } // namespace TypeTree
\n-
309} //namespace Dune
\n+
273#endif // DOXYGEN
\n+
274
\n+
276 /*
\n+
277 * This type trait can be used to check whether T is a flat index (i.e. either `std::size_t`
\n+
278 * or `index_constant`). The type trait normalizes T before doing the check, so it will also
\n+
279 * work correctly for references and cv-qualified types.
\n+
280 */
\n+
281 template<typename T>
\n+
282 using is_flat_index = typename impl::_is_flat_index<std::decay_t<T>>::type;
\n+
283
\n+
284#ifndef DOXYGEN
\n+
285
\n+
286 namespace impl {
\n+
287
\n+
288 // helper function for check in member child() functions that tolerates being passed something that
\n+
289 // isn't a TreePath. It will just return 0 in that case
\n+
290
\n+
291 template<typename T>
\n+
292 constexpr typename std::enable_if<
\n+\n+
294 bool
\n+
295 >::type
\n+
296 _non_empty_tree_path (T)
\n+
297 {
\n+
298 return false;
\n+
299 }
\n+
300
\n+
301 template<typename T>
\n+
302 constexpr typename std::enable_if<
\n+\n+
304 bool
\n+
305 >::type
\n+
306 _non_empty_tree_path (T t)
\n+
307 {
\n+
308 return treePathSize(t) > 0;
\n+
309 }
\n
310
\n-
311#endif // DUNE_TYPETREE_TREECONTAINER_HH
\n-\n-
auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue)
Create container havin the same structure as the given tree.
Definition treecontainer.hh:266
\n-
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
\n-
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
\n-
std::size_t degree(const Node &node)
Returns the degree of node as run time information.
Definition nodeinterface.hh:85
\n+
311 }
\n+
312
\n+
313#endif // DOXYGEN
\n+
314
\n+
316
\n+
317 } // namespace TypeTree
\n+
318} //namespace Dune
\n+
319
\n+
320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH
\n+\n+\n+
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
\n+
ImplementationDefined childStorage(Node &&node, Indices... indices)
Definition childextraction.hh:136
\n+
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
\n+
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
\n+
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
\n+
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition treepath.hh:199
\n
constexpr HybridTreePath< T... > treePath(const T &... t)
Constructs a new HybridTreePath from the given indices.
Definition treepath.hh:191
\n
Definition accumulate_static.hh:13
\n-
auto makeTreeContainerVectorBackend(Container &&container)
Definition treecontainer.hh:222
\n-
Definition treecontainer.hh:37
\n-
auto operator()(const Node &node)
Definition treecontainer.hh:61
\n-
ContainerFactory(LeafToValue leafToValue)
Create ContainerFactory.
Definition treecontainer.hh:56
\n-\n-
void resize(const Tree &tree)
Resize the (nested) container depending on the degree of the tree nodes.
Definition treecontainer.hh:202
\n-
Container & data()
Definition treecontainer.hh:212
\n-
const Container & data() const
Definition treecontainer.hh:207
\n-
TreeContainerVectorBackend(Container &&container)
Move the passed container into the internal storage.
Definition treecontainer.hh:169
\n-
TreeContainerVectorBackend()
Default constructor. The stored container might need to be resized before usage.
Definition treecontainer.hh:184
\n-
TreeContainerVectorBackend(const Tree &tree)
Default construct the container and perform a resize depending on the tree-node degrees.
Definition treecontainer.hh:175
\n-\n-
auto operator()(const Node &node) const
Definition treecontainer.hh:238
\n
A hybrid version of TreePath that supports both compile time and run time indices.
Definition treepath.hh:79
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,365 +7,321 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-treecontainer.hh\n+childextraction.hh\n Go_to_the_documentation_of_this_file.\n- 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n- 2// vi: set et ts=4 sw=2 sts=2:\n+ 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+ 2// vi: set et ts=8 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_TREECONTAINER_HH\n- 5#define DUNE_TYPETREE_TREECONTAINER_HH\n+ 4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH\n+ 5#define DUNE_TYPETREE_CHILDEXTRACTION_HH\n 6\n 7#include \n 8#include \n- 9#include \n- 10#include \n- 11\n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16\n- 17#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15#include \n+ 16#include \n+ 17\n 18\n 19namespace Dune {\n 20 namespace TypeTree {\n 21\n- 22 namespace Detail {\n- 23\n- 24 /*\n- 25 * \\brief A factory class creating a hybrid container compatible with a type\n-tree\n- 26 *\n- 27 * This class allows to create a nested hybrid container having the same\n-structure\n- 28 * as a given type tree. Power nodes are represented as std::array's while\n-composite\n- 29 * nodes are represented as Dune::TupleVector's. The stored values for the\n-leaf nodes\n- 30 * are creating using a given predicate. Once created, the factory provides\n-an\n- 31 * operator() creating the container for the tree given as argument.\n- 32 *\n- 33 * \\tparam LeafToValue Type of a predicate that determines the stored values\n-at the leafs\n- 34 */\n- 35 template\n-36 class ContainerFactory\n- 37 {\n- 38 template\n- 39 using DynamicDegreeConcept = decltype((std::size_t(std::declval().degree\n-()), true));\n- 40\n- 41 template\n- 42 using StaticDegreeConcept = decltype((std::integral_constant{}, true));\n- 43\n- 44 template\n- 45 using DynamicChildAccessConcept = decltype((std::declval().child(0u),\n-true));\n+ 26\n+ 27#ifndef DOXYGEN\n+ 28\n+ 29 namespace Impl {\n+ 30\n+ 31 // check at run time whether index is a valid child index\n+ 32 template \n+ 33 std::true_type checkChildIndex (Node const& node, Index i)\n+ 34 {\n+ 35 assert(std::size_t(i) < node.degree() && \"Child index out of range\");\n+ 36 return {};\n+ 37 }\n+ 38\n+ 39 // check at compile time whether index is a valid index\n+ 40 template \n+ 41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node,\n+index_constant)\n+ 42 {\n+ 43 static_assert(i < Node::degree(), \"Child index out of range\");\n+ 44 return {};\n+ 45 }\n 46\n- 47 public:\n- 48\n-56 ContainerFactory(LeafToValue leafToValue) :\n- 57 leafToValue_(leafToValue)\n- 58 {}\n- 59\n- 60 template\n-61 auto operator()(const Node& node)\n- 62 {\n- 63 return (*this)(node, Dune::PriorityTag<5>{});\n- 64 }\n- 65\n- 66 private:\n- 67\n- 68 template = true>\n- 70 auto operator()(const Node& node, Dune::PriorityTag<4>)\n- 71 {\n- 72 return leafToValue_(node);\n- 73 }\n- 74\n- 75 template = true,\n- 77 DynamicChildAccessConcept = true>\n- 78 auto operator()(const Node& node, Dune::PriorityTag<3>)\n- 79 {\n- 80 return Dune::unpackIntegerSequence([&](auto... indices) {\n- 81 return std::array{(*this)(node.child(indices))...};\n- 82 }, std::make_index_sequence());\n- 83 }\n- 84\n- 85 template = true,\n- 87 DynamicChildAccessConcept = true>\n- 88 auto operator()(const Node& node, Dune::PriorityTag<2>)\n- 89 {\n- 90 using TransformedChild = decltype((*this)(node.child(0)));\n- 91 std::vector container;\n- 92 container.reserve(node.degree());\n- 93 for (std::size_t i = 0; i < node.degree(); ++i)\n- 94 container.emplace_back((*this)(node.child(i)));\n- 95 return container;\n- 96 }\n- 97\n- 98 template = true>\n- 100 auto operator()(const Node& node, Dune::PriorityTag<1>)\n- 101 {\n- 102 return Dune::unpackIntegerSequence([&](auto... indices) {\n- 103 return Dune::makeTupleVector((*this)(node.child(indices))...);\n- 104 }, std::make_index_sequence());\n- 105 }\n- 106\n- 107 private:\n- 108 LeafToValue leafToValue_;\n- 109 };\n- 110\n- 111\n- 112 /*\n- 113 * \\brief Wrap nested container to provide a VectorBackend\n- 114 */\n- 115 template\n-116 class TreeContainerVectorBackend\n- 117 {\n- 118 template\n- 119 static constexpr decltype(auto) accessByTreePath(C&& container, const\n-HybridTreePath<>& path)\n- 120 {\n- 121 return container;\n- 122 }\n- 123\n- 124 template\n- 125 static constexpr decltype(auto) accessByTreePath(C&& container, const\n-HybridTreePath& path)\n- 126 {\n- 127 auto head = path[Dune::Indices::_0];\n- 128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){\n- 129 return treePath(path[Dune::index_constant{}]...);\n- 130 }, std::make_index_sequence());\n- 131 return accessByTreePath(container[head], tailPath);\n+ 47 // finally return the node itself if no further indices are provided. Break\n+condition\n+ 48 // for the recursion over the node childs.\n+ 49 template\n+ 50 decltype(auto) childImpl (Node&& node)\n+ 51 {\n+ 52 return std::forward(node);\n+ 53 }\n+ 54\n+ 55 template\n+ 56 auto childStorageImpl (NodePtr&& nodePtr)\n+ 57 {\n+ 58 return std::forward(nodePtr);\n+ 59 }\n+ 60\n+ 61 // recursively call `node.child(...)` with the given indices\n+ 62 template\n+ 63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i)\n+ 64 {\n+ 65 auto valid = checkChildIndex(node,i0);\n+ 66 if constexpr (valid)\n+ 67 return childImpl(node.child(i0),i...);\n+ 68 else\n+ 69 return;\n+ 70 }\n+ 71\n+ 72 // recursively call `node.childStorage(...)` with the given indices\n+ 73 template\n+ 74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]]\n+I... i)\n+ 75 {\n+ 76 auto valid = checkChildIndex(*nodePtr,i0);\n+ 77 if constexpr (valid)\n+ 78 return childStorageImpl(nodePtr->childStorage(i0),i...);\n+ 79 else\n+ 80 return;\n+ 81 }\n+ 82\n+ 83 // forward to the impl methods by extracting the indices from the treepath\n+ 84 template\n+ 85 decltype(auto) child (Node&& node, [[maybe_unused]]\n+HybridTreePath tp, std::index_sequence)\n+ 86 {\n+ 87 return childImpl(std::forward(node),treePathEntry(tp)...);\n+ 88 }\n+ 89\n+ 90 // forward to the impl methods by extracting the indices from the treepath\n+ 91 template\n+ 92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]]\n+HybridTreePath tp, std::index_sequence)\n+ 93 {\n+ 94 return childStorageImpl(std::forward(nodePtr),treePathEntry\n+(tp)...);\n+ 95 }\n+ 96\n+ 97 } // end namespace Impl\n+ 98\n+ 99#endif // DOXYGEN\n+ 100\n+ 102\n+ 124 template\n+ 125#ifdef DOXYGEN\n+126 ImplementationDefined child (Node&& node, Indices... indices)\n+ 127#else\n+ 128 decltype(auto) child (Node&& node, Indices... indices)\n+ 129#endif\n+ 130 {\n+ 131 return Impl::childImpl(std::forward(node),indices...);\n 132 }\n 133\n- 134 template = true>\n- 136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune::\n-PriorityTag<2>)\n- 137 {\n- 138 /* do nothing */\n- 139 }\n- 140\n- 141 template().resize(0u))>\n- 143 static void resizeImpl(C& container, const Tree& tree, Dune::\n-PriorityTag<1>)\n- 144 {\n- 145 container.resize(tree.degree());\n- 146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {\n- 147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});\n- 148 });\n- 149 }\n- 150\n- 151 template\n- 152 static void resizeImpl(C& container, const Tree& tree, Dune::\n-PriorityTag<0>)\n- 153 {\n- 154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {\n- 155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});\n- 156 });\n- 157 }\n- 158\n- 159 template\n- 160 using TypeTreeConcept = decltype((\n- 161 std::declval().degree(),\n- 162 T::isLeaf,\n- 163 T::isPower,\n- 164 T::isComposite,\n- 165 true));\n- 166\n- 167 public:\n-169 TreeContainerVectorBackend(Container&& container) :\n- 170 container_(std::move(container))\n- 171 {}\n- 172\n- 174 template = true>\n-175 TreeContainerVectorBackend(const Tree& tree) :\n- 176 TreeContainerVectorBackend()\n- 177 {\n- 178 this->resize(tree);\n- 179 }\n- 180\n- 182 template , bool> = true>\n-184 TreeContainerVectorBackend() :\n- 185 container_()\n- 186 {}\n- 187\n- 188 template\n-189 decltype(auto) operator[](const HybridTreePath& path) const\n- 190 {\n- 191 return accessByTreePath(container_, path);\n- 192 }\n- 193\n- 194 template\n-195 decltype(auto) operator[](const HybridTreePath& path)\n- 196 {\n- 197 return accessByTreePath(container_, path);\n- 198 }\n- 199\n- 201 template = true>\n-202 void resize(const Tree& tree)\n- 203 {\n- 204 resizeImpl(container_, tree, Dune::PriorityTag<5>{});\n- 205 }\n- 206\n-207 const Container& data() const\n- 208 {\n- 209 return container_;\n+ 134 template\n+ 135#ifdef DOXYGEN\n+136 ImplementationDefined childStorage (Node&& node, Indices... indices)\n+ 137#else\n+ 138 auto childStorage (Node&& node, Indices... indices)\n+ 139#endif\n+ 140 {\n+ 141 static_assert(sizeof...(Indices) > 0, \"childStorage() cannot be called\n+with an empty list of child indices\");\n+ 142 return Impl::childStorageImpl(&node,indices...);\n+ 143 }\n+ 144\n+ 146\n+ 169 template\n+ 170#ifdef DOXYGEN\n+171 ImplementationDefined child (Node&& node, HybridTreePath\n+treePath)\n+ 172#else\n+ 173 decltype(auto) child (Node&& node, HybridTreePath tp)\n+ 174#endif\n+ 175 {\n+ 176 return Impl::child(std::forward(node),tp,std::\n+index_sequence_for{});\n+ 177 }\n+ 178\n+ 179 template\n+ 180#ifdef DOXYGEN\n+ 181 ImplementationDefined child (Node&& node, HybridTreePath\n+treePath)\n+ 182#else\n+ 183 auto childStorage (Node&& node, HybridTreePath tp)\n+ 184#endif\n+ 185 {\n+ 186 static_assert(sizeof...(Indices) > 0, \"childStorage() cannot be called\n+with an empty TreePath\");\n+ 187 return Impl::childStorage(&node,tp,std::index_sequence_for{});\n+ 188 }\n+ 189\n+ 190\n+ 191#ifndef DOXYGEN\n+ 192\n+ 193 namespace impl {\n+ 194\n+ 195 template\n+ 196 struct filter_void\n+ 197 {\n+ 198 using type = T;\n+ 199 };\n+ 200\n+ 201 template<>\n+ 202 struct filter_void\n+ 203 {};\n+ 204\n+ 205 template\n+ 206 struct _Child\n+ 207 : public filter_void\n+(),index_constant{}...))>>\n+ 208 {};\n+ 209\n 210 }\n 211\n-212 Container& data()\n- 213 {\n- 214 return container_;\n- 215 }\n- 216\n- 217 private:\n- 218 Container container_;\n- 219 };\n- 220\n- 221 template\n-222 auto makeTreeContainerVectorBackend(Container&& container)\n- 223 {\n- 224 return TreeContainerVectorBackend>(std::\n-forward(container));\n- 225 }\n- 226\n- 227 /*\n- 228 * \\brief A simple lambda for creating default constructible values from a\n-node\n- 229 *\n- 230 * This simply returns LeafToValue{} for a given Node. It's needed\n- 231 * because using a lambda expression in a using declaration is not allowed\n- 232 * because it's an unevaluated context.\n- 233 */\n- 234 template class LeafToValue>\n-235 struct LeafToDefaultConstructibleValue\n- 236 {\n- 237 template\n-238 auto operator()(const Node& node) const\n- 239 {\n- 240 return LeafToValue{};\n- 241 }\n- 242 };\n- 243\n- 244 } // namespace Detail\n- 245\n- 265 template\n-266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue)\n+ 212#endif // DOXYGEN\n+ 213\n+ 215\n+ 222 template\n+223 using Child = typename impl::_Child::type;\n+ 224\n+ 225\n+ 226#ifndef DOXYGEN\n+ 227\n+ 228 namespace impl {\n+ 229\n+ 230 template\n+ 231 struct _ChildForTreePath\n+ 232 {\n+ 233 using type = typename std::decay(),std::\n+declval()))>::type;\n+ 234 };\n+ 235\n+ 236 }\n+ 237\n+ 238#endif // DOXYGEN\n+ 239\n+ 241\n+ 249 template\n+250 using ChildForTreePath = typename impl::_ChildForTreePath::\n+type;\n+ 251\n+ 252\n+ 253#ifndef DOXYGEN\n+ 254\n+ 255 namespace impl {\n+ 256\n+ 257 // By default, types are flat indices if they are integral\n+ 258 template\n+ 259 struct _is_flat_index\n+ 260 {\n+ 261 using type = std::is_integral;\n+ 262 };\n+ 263\n+ 264 // And so is any index_constant\n+ 265 template\n+ 266 struct _is_flat_index>\n 267 {\n- 268 auto f = std::ref(leafToValue);\n- 269 auto factory = Detail::ContainerFactory(f);\n- 270 return Detail::makeTreeContainerVectorBackend(factory(tree));\n+ 268 using type = std::true_type;\n+ 269 };\n+ 270\n 271 }\n 272\n- 288 template\n-289 auto makeTreeContainer(const Tree& tree)\n- 290 {\n- 291 return makeTreeContainer(tree, [](const auto&) {return Value{};});\n- 292 }\n- 293\n- 297 template\n-298 using UniformTreeContainer = std::decay_t\n-(std::declval()))>;\n- 299\n- 303 template class LeafToValue, class Tree>\n-304 using TreeContainer = std::decay_t(), std::declval>()))>;\n- 305\n- 307\n- 308 } // namespace TypeTree\n- 309} //namespace Dune\n+ 273#endif // DOXYGEN\n+ 274\n+ 276 /*\n+ 277 * This type trait can be used to check whether T is a flat index (i.e.\n+either `std::size_t`\n+ 278 * or `index_constant`). The type trait normalizes T before doing the\n+check, so it will also\n+ 279 * work correctly for references and cv-qualified types.\n+ 280 */\n+ 281 template\n+282 using is_flat_index = typename impl::_is_flat_index>::type;\n+ 283\n+ 284#ifndef DOXYGEN\n+ 285\n+ 286 namespace impl {\n+ 287\n+ 288 // helper function for check in member child() functions that tolerates\n+being passed something that\n+ 289 // isn't a TreePath. It will just return 0 in that case\n+ 290\n+ 291 template\n+ 292 constexpr typename std::enable_if<\n+ 293 Dune::TypeTree::is_flat_index::value,\n+ 294 bool\n+ 295 >::type\n+ 296 _non_empty_tree_path (T)\n+ 297 {\n+ 298 return false;\n+ 299 }\n+ 300\n+ 301 template\n+ 302 constexpr typename std::enable_if<\n+ 303 !Dune::TypeTree::is_flat_index::value,\n+ 304 bool\n+ 305 >::type\n+ 306 _non_empty_tree_path (T t)\n+ 307 {\n+ 308 return treePathSize(t) > 0;\n+ 309 }\n 310\n- 311#endif // DUNE_TYPETREE_TREECONTAINER_HH\n+ 311 }\n+ 312\n+ 313#endif // DOXYGEN\n+ 314\n+ 316\n+ 317 } // namespace TypeTree\n+ 318} //namespace Dune\n+ 319\n+ 320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH\n treepath.hh\n-Dune::TypeTree::makeTreeContainer\n-auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue)\n-Create container havin the same structure as the given tree.\n-Definition treecontainer.hh:266\n-Dune::TypeTree::UniformTreeContainer\n-std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >\n-()))> UniformTreeContainer\n-Alias to container type generated by makeTreeContainer for given tree type and\n-uniform value type.\n-Definition treecontainer.hh:298\n-Dune::TypeTree::TreeContainer\n-std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::\n-declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))>\n-TreeContainer\n-Alias to container type generated by makeTreeContainer for give tree type and\n-when using LeafToValue ...\n-Definition treecontainer.hh:304\n-Dune::TypeTree::degree\n-std::size_t degree(const Node &node)\n-Returns the degree of node as run time information.\n-Definition nodeinterface.hh:85\n+nodeinterface.hh\n+Dune::TypeTree::is_flat_index\n+typename impl::_is_flat_index< std::decay_t< T > >::type is_flat_index\n+Type trait that determines whether T is a flat index in the context of child\n+extraction.\n+Definition childextraction.hh:282\n+Dune::TypeTree::childStorage\n+ImplementationDefined childStorage(Node &&node, Indices... indices)\n+Definition childextraction.hh:136\n+Dune::TypeTree::Child\n+typename impl::_Child< Node, indices... >::type Child\n+Template alias for the type of a child node given by a list of child indices.\n+Definition childextraction.hh:223\n+Dune::TypeTree::child\n+ImplementationDefined child(Node &&node, Indices... indices)\n+Extracts the child of a node given by a sequence of compile-time and run-time\n+indices.\n+Definition childextraction.hh:126\n+Dune::TypeTree::ChildForTreePath\n+typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath\n+Template alias for the type of a child node given by a TreePath or a\n+HybridTreePath type.\n+Definition childextraction.hh:250\n+Dune::TypeTree::treePathSize\n+constexpr std::size_t treePathSize(const HybridTreePath< T... > &)\n+Returns the size (number of components) of the given HybridTreePath.\n+Definition treepath.hh:199\n Dune::TypeTree::treePath\n constexpr HybridTreePath< T... > treePath(const T &... t)\n Constructs a new HybridTreePath from the given indices.\n Definition treepath.hh:191\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::Detail::makeTreeContainerVectorBackend\n-auto makeTreeContainerVectorBackend(Container &&container)\n-Definition treecontainer.hh:222\n-Dune::TypeTree::Detail::ContainerFactory\n-Definition treecontainer.hh:37\n-Dune::TypeTree::Detail::ContainerFactory::operator()\n-auto operator()(const Node &node)\n-Definition treecontainer.hh:61\n-Dune::TypeTree::Detail::ContainerFactory::ContainerFactory\n-ContainerFactory(LeafToValue leafToValue)\n-Create ContainerFactory.\n-Definition treecontainer.hh:56\n-Dune::TypeTree::Detail::TreeContainerVectorBackend\n-Definition treecontainer.hh:117\n-Dune::TypeTree::Detail::TreeContainerVectorBackend::resize\n-void resize(const Tree &tree)\n-Resize the (nested) container depending on the degree of the tree nodes.\n-Definition treecontainer.hh:202\n-Dune::TypeTree::Detail::TreeContainerVectorBackend::data\n-Container & data()\n-Definition treecontainer.hh:212\n-Dune::TypeTree::Detail::TreeContainerVectorBackend::data\n-const Container & data() const\n-Definition treecontainer.hh:207\n-Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend\n-TreeContainerVectorBackend(Container &&container)\n-Move the passed container into the internal storage.\n-Definition treecontainer.hh:169\n-Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend\n-TreeContainerVectorBackend()\n-Default constructor. The stored container might need to be resized before\n-usage.\n-Definition treecontainer.hh:184\n-Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend\n-TreeContainerVectorBackend(const Tree &tree)\n-Default construct the container and perform a resize depending on the tree-node\n-degrees.\n-Definition treecontainer.hh:175\n-Dune::TypeTree::Detail::LeafToDefaultConstructibleValue\n-Definition treecontainer.hh:236\n-Dune::TypeTree::Detail::LeafToDefaultConstructibleValue::operator()\n-auto operator()(const Node &node) const\n-Definition treecontainer.hh:238\n Dune::TypeTree::HybridTreePath\n A hybrid version of TreePath that supports both compile time and run time\n indices.\n Definition treepath.hh:79\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00017.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: powercompositenodetransformationtemplates.hh File Reference\n+dune-typetree: leafnode.hh File Reference\n \n \n \n \n \n \n \n@@ -72,35 +72,27 @@\n
  • dune
  • typetree
  • \n
    \n
    \n
    \n \n-
    powercompositenodetransformationtemplates.hh File Reference
    \n+
    leafnode.hh File Reference
    \n
    \n
    \n-
    #include <cstddef>
    \n-#include <dune/typetree/nodeinterface.hh>
    \n+
    #include <dune/typetree/nodetags.hh>
    \n+#include <cstddef>
    \n+#include <type_traits>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n 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::LeafNode
     Base class for leaf nodes in a dune-typetree. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,36 +7,22 @@\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n Classes | Namespaces\n-powercompositenodetransformationtemplates.hh File Reference\n+leafnode.hh File Reference\n+#include \n #include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::TypeTree::GenericPowerNodeTransformationTemplate<_SourceNode,\n- Transformation,_TransformedNode_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::GenericPowerNodeTransformationTemplate<_SourceNode,\n- Transformation,_TransformedNode_>::result<_TC_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate<\n- SourceNode,_Transformation,_TransformedNode_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate<\n- SourceNode,_Transformation,_TransformedNode_>::result<_TC_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::GenericCompositeNodeTransformationTemplate<\n- SourceNode,_Transformation,_TransformedNode_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::GenericCompositeNodeTransformationTemplate<\n- SourceNode,_Transformation,_TransformedNode_>::result<_TC_>\n+class \u00a0Dune::TypeTree::LeafNode\n+\u00a0 Base class for leaf nodes in a dune-typetree. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00017_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: powercompositenodetransformationtemplates.hh Source File\n+dune-typetree: leafnode.hh Source File\n \n \n \n \n \n \n \n@@ -74,89 +74,77 @@\n \n
    \n \n
    \n \n
    \n-
    powercompositenodetransformationtemplates.hh
    \n+
    leafnode.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
    \n-
    5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
    \n+
    4#ifndef DUNE_TYPETREE_LEAFNODE_HH
    \n+
    5#define DUNE_TYPETREE_LEAFNODE_HH
    \n
    6
    \n-
    7#include <cstddef>
    \n-
    8
    \n-\n+\n+
    8#include <cstddef>
    \n+
    9#include <type_traits>
    \n
    10
    \n
    11namespace Dune {
    \n
    12 namespace TypeTree {
    \n
    13
    \n-
    19 template<typename SourceNode, typename Transformation, template<typename,typename,std::size_t> class TransformedNode>
    \n-
    \n-\n-
    21 {
    \n-
    22 template<typename TC>
    \n-
    \n-
    23 struct result
    \n-
    24 {
    \n-
    25 typedef TransformedNode<SourceNode,TC,StaticDegree<SourceNode>::value> type;
    \n-
    26 };
    \n-
    \n-
    27 };
    \n-
    \n-
    28
    \n+
    \n+\n+
    26 {
    \n+
    27
    \n+
    28 public:
    \n
    29
    \n-
    30 template<typename SourceNode, typename Transformation, template<typename,typename> class TransformedNode>
    \n-
    \n-\n-
    32 {
    \n-
    33 template<typename TC>
    \n-
    \n-
    34 struct result
    \n-
    35 {
    \n-
    36 typedef TransformedNode<SourceNode,TC> type;
    \n-
    37 };
    \n-
    \n-
    38 };
    \n-
    \n-
    39
    \n-
    40 template<typename SourceNode, typename Transformation, template<typename,typename...> class TransformedNode>
    \n-
    \n-\n-
    42 {
    \n-
    43 template<typename... TC>
    \n-
    \n-
    44 struct result
    \n-
    45 {
    \n-
    46 typedef TransformedNode<SourceNode,TC...> type;
    \n-
    47 };
    \n-
    \n-
    48 };
    \n-
    \n-
    49
    \n-
    51
    \n-
    52 } // namespace TypeTree
    \n-
    53} //namespace Dune
    \n+
    31 static const bool isLeaf = true;
    \n+
    32
    \n+
    34 static const bool isPower = false;
    \n+
    35
    \n+
    37 static const bool isComposite = false;
    \n+
    38
    \n+
    40 [[deprecated("Will be removed after release 2.9. Use degree()")]]
    \n+
    41 static const std::size_t CHILDREN = 0;
    \n+
    42
    \n+\n+
    45
    \n+
    \n+
    46 static constexpr auto degree()
    \n+
    47 {
    \n+
    48 return std::integral_constant<std::size_t,0>{};
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    51 protected:
    \n+
    52
    \n
    54
    \n-
    55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH
    \n-\n+\n+
    60 };
    \n+
    \n+
    61
    \n+
    63
    \n+
    64 } // namespace TypeTree
    \n+
    65} //namespace Dune
    \n+
    66
    \n+
    67#endif // DUNE_TYPETREE_POWERNODE_HH
    \n+\n
    Definition accumulate_static.hh:13
    \n-
    Definition powercompositenodetransformationtemplates.hh:21
    \n-
    Definition powercompositenodetransformationtemplates.hh:24
    \n-
    TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type
    Definition powercompositenodetransformationtemplates.hh:25
    \n-
    Definition powercompositenodetransformationtemplates.hh:32
    \n-
    Definition powercompositenodetransformationtemplates.hh:35
    \n-
    TransformedNode< SourceNode, TC > type
    Definition powercompositenodetransformationtemplates.hh:36
    \n-
    Definition powercompositenodetransformationtemplates.hh:42
    \n-
    Definition powercompositenodetransformationtemplates.hh:45
    \n-
    TransformedNode< SourceNode, TC... > type
    Definition powercompositenodetransformationtemplates.hh:46
    \n+
    Base class for leaf nodes in a dune-typetree.
    Definition leafnode.hh:26
    \n+
    LeafNodeTag NodeTag
    The type tag that describes a LeafNode.
    Definition leafnode.hh:44
    \n+
    static const bool isLeaf
    Mark this class as a leaf in a dune-typetree.
    Definition leafnode.hh:31
    \n+
    static const std::size_t CHILDREN
    Leafs have no children.
    Definition leafnode.hh:41
    \n+
    static const bool isPower
    Mark this class as a non power in the dune-typetree.
    Definition leafnode.hh:34
    \n+
    LeafNode()
    Default constructor.
    Definition leafnode.hh:59
    \n+
    static const bool isComposite
    Mark this class as a non composite in the dune-typetree.
    Definition leafnode.hh:37
    \n+
    static constexpr auto degree()
    Definition leafnode.hh:46
    \n+
    Tag designating a leaf node.
    Definition nodetags.hh:16
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,88 +7,93 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-powercompositenodetransformationtemplates.hh\n+leafnode.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH\n- 5#define DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH\n+ 4#ifndef DUNE_TYPETREE_LEAFNODE_HH\n+ 5#define DUNE_TYPETREE_LEAFNODE_HH\n 6\n- 7#include \n- 8\n- 9#include \n+ 7#include \n+ 8#include \n+ 9#include \n 10\n 11namespace Dune {\n 12 namespace TypeTree {\n 13\n- 19 template class TransformedNode>\n-20 struct GenericPowerNodeTransformationTemplate\n- 21 {\n- 22 template\n-23 struct result\n- 24 {\n-25 typedef TransformedNode::value> type;\n- 26 };\n- 27 };\n- 28\n+25 class LeafNode\n+ 26 {\n+ 27\n+ 28 public:\n 29\n- 30 template class TransformedNode>\n-31 struct GenericDynamicPowerNodeTransformationTemplate\n- 32 {\n- 33 template\n-34 struct result\n- 35 {\n-36 typedef TransformedNode type;\n- 37 };\n- 38 };\n- 39\n- 40 template class TransformedNode>\n-41 struct GenericCompositeNodeTransformationTemplate\n- 42 {\n- 43 template\n-44 struct result\n- 45 {\n-46 typedef TransformedNode type;\n- 47 };\n- 48 };\n- 49\n- 51\n- 52 } // namespace TypeTree\n- 53} //namespace Dune\n+31 static const bool isLeaf = true;\n+ 32\n+34 static const bool isPower = false;\n+ 35\n+37 static const bool isComposite = false;\n+ 38\n+ 40 [[deprecated(\"Will be removed after release 2.9. Use degree()\")]]\n+41 static const std::size_t CHILDREN = 0;\n+ 42\n+44 typedef LeafNodeTag NodeTag;\n+ 45\n+46 static constexpr auto degree()\n+ 47 {\n+ 48 return std::integral_constant{};\n+ 49 }\n+ 50\n+ 51 protected:\n+ 52\n 54\n- 55#endif // DUNE_TYPETREE_POWERCOMPOSITENODETRANSFORMATIONTEMPLATES_HH\n-nodeinterface.hh\n+59 LeafNode() {}\n+ 60 };\n+ 61\n+ 63\n+ 64 } // namespace TypeTree\n+ 65} //namespace Dune\n+ 66\n+ 67#endif // DUNE_TYPETREE_POWERNODE_HH\n+nodetags.hh\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::GenericPowerNodeTransformationTemplate\n-Definition powercompositenodetransformationtemplates.hh:21\n-Dune::TypeTree::GenericPowerNodeTransformationTemplate::result\n-Definition powercompositenodetransformationtemplates.hh:24\n-Dune::TypeTree::GenericPowerNodeTransformationTemplate::result::type\n-TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type\n-Definition powercompositenodetransformationtemplates.hh:25\n-Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate\n-Definition powercompositenodetransformationtemplates.hh:32\n-Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result\n-Definition powercompositenodetransformationtemplates.hh:35\n-Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result::type\n-TransformedNode< SourceNode, TC > type\n-Definition powercompositenodetransformationtemplates.hh:36\n-Dune::TypeTree::GenericCompositeNodeTransformationTemplate\n-Definition powercompositenodetransformationtemplates.hh:42\n-Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result\n-Definition powercompositenodetransformationtemplates.hh:45\n-Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result::type\n-TransformedNode< SourceNode, TC... > type\n-Definition powercompositenodetransformationtemplates.hh:46\n+Dune::TypeTree::LeafNode\n+Base class for leaf nodes in a dune-typetree.\n+Definition leafnode.hh:26\n+Dune::TypeTree::LeafNode::NodeTag\n+LeafNodeTag NodeTag\n+The type tag that describes a LeafNode.\n+Definition leafnode.hh:44\n+Dune::TypeTree::LeafNode::isLeaf\n+static const bool isLeaf\n+Mark this class as a leaf in a dune-typetree.\n+Definition leafnode.hh:31\n+Dune::TypeTree::LeafNode::CHILDREN\n+static const std::size_t CHILDREN\n+Leafs have no children.\n+Definition leafnode.hh:41\n+Dune::TypeTree::LeafNode::isPower\n+static const bool isPower\n+Mark this class as a non power in the dune-typetree.\n+Definition leafnode.hh:34\n+Dune::TypeTree::LeafNode::LeafNode\n+LeafNode()\n+Default constructor.\n+Definition leafnode.hh:59\n+Dune::TypeTree::LeafNode::isComposite\n+static const bool isComposite\n+Mark this class as a non composite in the dune-typetree.\n+Definition leafnode.hh:37\n+Dune::TypeTree::LeafNode::degree\n+static constexpr auto degree()\n+Definition leafnode.hh:46\n+Dune::TypeTree::LeafNodeTag\n+Tag designating a leaf node.\n+Definition nodetags.hh:16\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00020.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: transformation.hh File Reference\n+dune-typetree: utility.hh File Reference\n \n \n \n \n \n \n \n@@ -71,52 +71,43 @@\n \n \n \n
    \n \n-
    transformation.hh File Reference
    \n+Namespaces
    \n+
    utility.hh File Reference
    \n \n
    \n-
    #include <array>
    \n+
    #include <memory>
    \n #include <tuple>
    \n-#include <memory>
    \n+#include <type_traits>
    \n #include <utility>
    \n+#include <algorithm>
    \n+#include <dune/common/shared_ptr.hh>
    \n+#include <dune/common/indices.hh>
    \n #include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/typetree/typetraits.hh>
    \n-#include <dune/typetree/nodeinterface.hh>
    \n-#include <dune/typetree/nodetags.hh>
    \n-#include <dune/typetree/utility.hh>
    \n+#include <dune/typetree/nodeinterface.hh>
    \n+#include <dune/typetree/nodetags.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n \n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive >
     Transform a TypeTree. More...
    struct  Dune::TypeTree::TreeInfo< Tree, Tag >
     Struct for obtaining some basic structural information about a TypeTree. More...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n-\n-\n-\n-\n-\n

    \n-Functions

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

    Go to the source code of this file.

    \n \n \n-\n+\n+\n \n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

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

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n

    \n Classes

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

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    struct  Dune::TypeTree::NodeInterface
     Interface for nodes in a dune-typetree. More...
    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 >
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-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.
     
    \n-\n-\n-\n-\n-\n

    \n-Functions

    template<typename Node >
    std::size_t Dune::TypeTree::degree (const Node &node)
     Returns the degree of node as run time information.
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,45 +6,45 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces | Typedefs | Functions\n-nodeinterface.hh File Reference\n-#include \n-#include \n-#include \n+Classes | Namespaces\n+simpletransformationdescriptors.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::TypeTree::NodeInterface\n-\u00a0 Interface for nodes in a dune-typetree. More...\n+struct \u00a0Dune::TypeTree::SimpleLeafNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>::result<_TC_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>::result<_TC_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>::result<_TC_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n- Typedefs\n-template\n-using\u00a0Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag\n-\u00a0 Returns the node tag of the given Node.\n-\u00a0\n-template\n-using\u00a0Dune::TypeTree::ImplementationTag = typename std::decay_t< T >::\n- ImplementationTag\n-\u00a0 Returns the implementation tag of the given Node.\n-\u00a0\n-template\n-using\u00a0Dune::TypeTree::StaticDegree = decltype(Node::degree())\n-\u00a0 Returns the statically known degree of the given Node type as a std::\n- integral_constant.\n-\u00a0\n- Functions\n-template\n-std::size_t\u00a0Dune::TypeTree::degree (const Node &node)\n-\u00a0 Returns the degree of node as run time information.\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00029_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: nodeinterface.hh Source File\n+dune-typetree: simpletransformationdescriptors.hh Source File\n \n \n \n \n \n \n \n@@ -74,102 +74,207 @@\n \n
    \n \n
    \n
    \n
    \n-
    nodeinterface.hh
    \n+
    simpletransformationdescriptors.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    2// vi: set et ts=8 sw=2 sts=2:
    \n+Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n+
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH
    \n-
    5#define DUNE_TYPETREE_NODEINTERFACE_HH
    \n+
    4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
    \n+
    5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
    \n
    6
    \n-
    7#include <cstddef>
    \n-
    8#include <type_traits>
    \n+
    7#include <array>
    \n+
    8#include <memory>
    \n
    9
    \n-
    10#include <dune/common/documentation.hh>
    \n-
    11
    \n-
    12namespace Dune {
    \n-
    13 namespace TypeTree {
    \n+\n+\n+
    12#include <dune/common/exceptions.hh>
    \n+
    13
    \n
    14
    \n-
    \n-\n-
    33 {
    \n-
    35 static const bool isLeaf = implementationDefined;
    \n+
    15namespace Dune {
    \n+
    16 namespace TypeTree {
    \n+
    17
    \n+
    23 template<typename SourceNode, typename Transformation, typename TransformedNode>
    \n+
    \n+\n+
    25 {
    \n+
    26
    \n+
    27 static const bool recursive = false;
    \n+
    28
    \n+
    29 typedef TransformedNode transformed_type;
    \n+
    30 typedef std::shared_ptr<transformed_type> transformed_storage_type;
    \n+
    31
    \n+
    \n+
    32 static transformed_type transform(const SourceNode& s, const Transformation& t)
    \n+
    33 {
    \n+
    34 return transformed_type();
    \n+
    35 }
    \n+
    \n
    36
    \n-
    38 static const bool isPower = implementationDefined;
    \n-
    39
    \n-
    41 static const bool isComposite = implementationDefined;
    \n-
    42
    \n+
    \n+
    37 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
    \n+
    38 {
    \n+
    39 return std::make_shared<transformed_type>();
    \n+
    40 }
    \n+
    \n+
    41
    \n+
    42 };
    \n+
    \n+
    43
    \n
    44
    \n-
    49 static const std::size_t CHILDREN = implementationDefined;
    \n+
    45 template<typename SourceNode, typename Transformation, template<typename Child, std::size_t> class TransformedNode>
    \n+
    \n+\n+
    47 {
    \n+
    48
    \n+
    49 static const bool recursive = true;
    \n
    50
    \n-
    52
    \n-
    57 static auto degree();
    \n+
    51 template<typename TC>
    \n+
    \n+
    52 struct result
    \n+
    53 {
    \n+
    54 typedef TransformedNode<TC, StaticDegree<SourceNode>::value> type;
    \n+
    55 typedef std::shared_ptr<type> storage_type;
    \n+
    56 static const std::size_t degree = StaticDegree<type>::value;
    \n+
    57 };
    \n+
    \n
    58
    \n-
    60
    \n-
    65 typedef ImplementationDefined NodeTag;
    \n-
    66
    \n-
    68
    \n-
    71 typedef ImplementationDefined NodeStorage;
    \n-
    72 };
    \n+
    59 template<typename TC>
    \n+
    \n+
    60 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
    \n+
    61 {
    \n+
    62 return typename result<TC>::type(children);
    \n+
    63 }
    \n
    \n+
    64
    \n+
    65 template<typename TC>
    \n+
    \n+
    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)
    \n+
    67 {
    \n+
    68 return std::make_shared<typename result<TC>::type>(children);
    \n+
    69 }
    \n+
    \n+
    70
    \n+
    71 };
    \n+
    \n+
    72
    \n
    73
    \n-
    75 template<typename Node>
    \n-
    76 using NodeTag = typename std::decay_t<Node>::NodeTag;
    \n+
    74 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNode>
    \n+
    \n+\n+
    76 {
    \n
    77
    \n-
    79 template<typename T>
    \n-
    80 using ImplementationTag = typename std::decay_t<T>::ImplementationTag;
    \n-
    81
    \n-
    82
    \n-
    84 template<typename Node>
    \n-
    \n-
    85 std::size_t degree(const Node& node)
    \n-
    86 {
    \n-
    87 return degree(&node,NodeTag<Node>());
    \n-
    88 }
    \n-
    \n-
    89
    \n-
    90#ifndef DOXYGEN
    \n-
    91
    \n-
    93
    \n-
    99 template<typename Node, typename NodeTag>
    \n-
    100 std::size_t degree(const Node* node, NodeTag)
    \n-
    101 {
    \n-
    102 return node->degree();
    \n-
    103 }
    \n-
    104
    \n-
    105#endif // DOXYGEN
    \n-
    106
    \n-
    108
    \n-
    112 template<typename Node>
    \n-
    113 using StaticDegree = decltype(Node::degree());
    \n+
    78 static const bool recursive = true;
    \n+
    79
    \n+
    80 template<typename TC>
    \n+
    \n+
    81 struct result
    \n+
    82 {
    \n+
    83 typedef TransformedNode<TC> type;
    \n+
    84 typedef std::shared_ptr<type> storage_type;
    \n+
    85 };
    \n+
    \n+
    86
    \n+
    87 template<typename TC>
    \n+
    \n+
    88 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
    \n+
    89 {
    \n+
    90 return typename result<TC>::type(children);
    \n+
    91 }
    \n+
    \n+
    92
    \n+
    93 template<typename TC>
    \n+
    \n+
    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)
    \n+
    95 {
    \n+
    96 return std::make_shared<typename result<TC>::type>(children);
    \n+
    97 }
    \n+
    \n+
    98
    \n+
    99 };
    \n+
    \n+
    100
    \n+
    101
    \n+
    102 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNode>
    \n+
    \n+\n+
    104 {
    \n+
    105
    \n+
    106 static const bool recursive = true;
    \n+
    107
    \n+
    108 template<typename... TC>
    \n+
    \n+
    109 struct result
    \n+
    110 {
    \n+
    111 typedef TransformedNode<TC...> type;
    \n+
    112 typedef std::shared_ptr<type> storage_type;
    \n+
    113 };
    \n+
    \n
    114
    \n-
    116
    \n-
    117 } // namespace TypeTree
    \n-
    118} //namespace Dune
    \n-
    119
    \n-
    120#endif // DUNE_TYPETREE_NODEINTERFACE_HH
    \n-
    std::size_t degree(const Node &node)
    Returns the degree of node as run time information.
    Definition nodeinterface.hh:85
    \n-
    typename std::decay_t< Node >::NodeTag NodeTag
    Returns the node tag of the given Node.
    Definition nodeinterface.hh:76
    \n-
    typename std::decay_t< T >::ImplementationTag ImplementationTag
    Returns the implementation tag of the given Node.
    Definition nodeinterface.hh:80
    \n+
    115 template<typename... TC>
    \n+
    \n+
    116 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
    \n+
    117 {
    \n+
    118 return typename result<TC...>::type(children...);
    \n+
    119 }
    \n+
    \n+
    120
    \n+
    121 template<typename... TC>
    \n+
    \n+
    122 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
    \n+
    123 {
    \n+
    124 return std::make_shared<typename result<TC...>::type>(children...);
    \n+
    125 }
    \n+
    \n+
    126
    \n+
    127 };
    \n+
    \n+
    128
    \n+
    130
    \n+
    131 } // namespace TypeTree
    \n+
    132} //namespace Dune
    \n+
    133
    \n+
    134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
    \n+\n+\n
    decltype(Node::degree()) StaticDegree
    Returns the statically known degree of the given Node type as a std::integral_constant.
    Definition nodeinterface.hh:113
    \n
    Definition accumulate_static.hh:13
    \n-
    Interface for nodes in a dune-typetree.
    Definition nodeinterface.hh:33
    \n-
    static const std::size_t CHILDREN
    Number of children of this node in the dune-typetree.
    Definition nodeinterface.hh:49
    \n-
    static auto degree()
    Number of children of this node in the dune-typetree.
    \n-
    static const bool isPower
    Whether this is a power node in the dune-typetree.
    Definition nodeinterface.hh:38
    \n-
    static const bool isLeaf
    Whether this is a leaf node in a dune-typetree.
    Definition nodeinterface.hh:35
    \n-
    ImplementationDefined NodeStorage
    container type to pass around a collection of children
    Definition nodeinterface.hh:71
    \n-
    static const bool isComposite
    Whether this is a composite node in the dune-typetree.
    Definition nodeinterface.hh:41
    \n-
    ImplementationDefined NodeTag
    The type tag that describes what kind of node this is.
    Definition nodeinterface.hh:65
    \n+
    Definition simpletransformationdescriptors.hh:25
    \n+
    static transformed_type transform(const SourceNode &s, const Transformation &t)
    Definition simpletransformationdescriptors.hh:32
    \n+
    static const bool recursive
    Definition simpletransformationdescriptors.hh:27
    \n+
    std::shared_ptr< transformed_type > transformed_storage_type
    Definition simpletransformationdescriptors.hh:30
    \n+
    static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
    Definition simpletransformationdescriptors.hh:37
    \n+
    TransformedNode transformed_type
    Definition simpletransformationdescriptors.hh:29
    \n+
    Definition simpletransformationdescriptors.hh:47
    \n+
    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
    \n+
    static const bool recursive
    Definition simpletransformationdescriptors.hh:49
    \n+
    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
    \n+
    Definition simpletransformationdescriptors.hh:53
    \n+
    TransformedNode< TC, StaticDegree< SourceNode >::value > type
    Definition simpletransformationdescriptors.hh:54
    \n+
    static const std::size_t degree
    Definition simpletransformationdescriptors.hh:56
    \n+
    std::shared_ptr< type > storage_type
    Definition simpletransformationdescriptors.hh:55
    \n+
    Definition simpletransformationdescriptors.hh:76
    \n+
    static const bool recursive
    Definition simpletransformationdescriptors.hh:78
    \n+
    static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
    Definition simpletransformationdescriptors.hh:88
    \n+
    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
    \n+
    Definition simpletransformationdescriptors.hh:82
    \n+
    TransformedNode< TC > type
    Definition simpletransformationdescriptors.hh:83
    \n+
    std::shared_ptr< type > storage_type
    Definition simpletransformationdescriptors.hh:84
    \n+
    Definition simpletransformationdescriptors.hh:104
    \n+
    static const bool recursive
    Definition simpletransformationdescriptors.hh:106
    \n+
    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
    \n+
    static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
    Definition simpletransformationdescriptors.hh:116
    \n+
    Definition simpletransformationdescriptors.hh:110
    \n+
    std::shared_ptr< type > storage_type
    Definition simpletransformationdescriptors.hh:112
    \n+
    TransformedNode< TC... > type
    Definition simpletransformationdescriptors.hh:111
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,129 +7,251 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-nodeinterface.hh\n+simpletransformationdescriptors.hh\n Go_to_the_documentation_of_this_file.\n- 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n- 2// vi: set et ts=8 sw=2 sts=2:\n+ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n+ 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH\n- 5#define DUNE_TYPETREE_NODEINTERFACE_HH\n+ 4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH\n+ 5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH\n 6\n- 7#include \n- 8#include \n+ 7#include \n+ 8#include \n 9\n- 10#include \n- 11\n- 12namespace Dune {\n- 13 namespace TypeTree {\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13\n 14\n-32 struct NodeInterface\n+ 15namespace Dune {\n+ 16 namespace TypeTree {\n+ 17\n+ 23 template\n+24 struct SimpleLeafNodeTransformation\n+ 25 {\n+ 26\n+27 static const bool recursive = false;\n+ 28\n+29 typedef TransformedNode transformed_type;\n+30 typedef std::shared_ptr transformed_storage_type;\n+ 31\n+32 static transformed_type transform(const SourceNode& s, const Transformation&\n+t)\n 33 {\n-35 static const bool isLeaf = implementationDefined;\n+ 34 return transformed_type();\n+ 35 }\n 36\n-38 static const bool isPower = implementationDefined;\n- 39\n-41 static const bool isComposite = implementationDefined;\n- 42\n+37 static transformed_storage_type transform_storage(std::shared_ptr s, const Transformation& t)\n+ 38 {\n+ 39 return std::make_shared();\n+ 40 }\n+ 41\n+ 42 };\n+ 43\n 44\n-49 static const std::size_t CHILDREN = implementationDefined;\n+ 45 template class TransformedNode>\n+46 struct SimplePowerNodeTransformation\n+ 47 {\n+ 48\n+49 static const bool recursive = true;\n 50\n- 52\n-57 static auto degree();\n+ 51 template\n+52 struct result\n+ 53 {\n+54 typedef TransformedNode::value> type;\n+55 typedef std::shared_ptr storage_type;\n+56 static const std::size_t degree = StaticDegree::value;\n+ 57 };\n 58\n- 60\n-65 typedef ImplementationDefined NodeTag;\n- 66\n- 68\n-71 typedef ImplementationDefined NodeStorage;\n- 72 };\n+ 59 template\n+60 static typename result::type transform(const SourceNode& s, const\n+Transformation& t, const std::array,result::degree>&\n+children)\n+ 61 {\n+ 62 return typename result::type(children);\n+ 63 }\n+ 64\n+ 65 template\n+66 static typename result::storage_type transform_storage(std::\n+shared_ptr s, const Transformation& t, const std::array,result::degree>& children)\n+ 67 {\n+ 68 return std::make_shared::type>(children);\n+ 69 }\n+ 70\n+ 71 };\n+ 72\n 73\n- 75 template\n-76 using NodeTag = typename std::decay_t::NodeTag;\n+ 74 template class TransformedNode>\n+75 struct SimpleDynamicPowerNodeTransformation\n+ 76 {\n 77\n- 79 template\n-80 using ImplementationTag = typename std::decay_t::ImplementationTag;\n- 81\n- 82\n- 84 template\n-85 std::size_t degree(const Node& node)\n- 86 {\n- 87 return degree(&node,NodeTag());\n- 88 }\n- 89\n- 90#ifndef DOXYGEN\n- 91\n- 93\n- 99 template\n- 100 std::size_t degree(const Node* node, NodeTag)\n- 101 {\n- 102 return node->degree();\n- 103 }\n- 104\n- 105#endif // DOXYGEN\n- 106\n- 108\n- 112 template\n-113 using StaticDegree = decltype(Node::degree());\n+78 static const bool recursive = true;\n+ 79\n+ 80 template\n+81 struct result\n+ 82 {\n+83 typedef TransformedNode type;\n+84 typedef std::shared_ptr storage_type;\n+ 85 };\n+ 86\n+ 87 template\n+88 static typename result::type transform(const SourceNode& s, const\n+Transformation& t, const std::vector>& children)\n+ 89 {\n+ 90 return typename result::type(children);\n+ 91 }\n+ 92\n+ 93 template\n+94 static typename result::storage_type transform_storage(std::\n+shared_ptr s, const Transformation& t, const std::\n+vector>& children)\n+ 95 {\n+ 96 return std::make_shared::type>(children);\n+ 97 }\n+ 98\n+ 99 };\n+ 100\n+ 101\n+ 102 template class TransformedNode>\n+103 struct SimpleCompositeNodeTransformation\n+ 104 {\n+ 105\n+106 static const bool recursive = true;\n+ 107\n+ 108 template\n+109 struct result\n+ 110 {\n+111 typedef TransformedNode type;\n+112 typedef std::shared_ptr storage_type;\n+ 113 };\n 114\n- 116\n- 117 } // namespace TypeTree\n- 118} //namespace Dune\n- 119\n- 120#endif // DUNE_TYPETREE_NODEINTERFACE_HH\n-Dune::TypeTree::degree\n-std::size_t degree(const Node &node)\n-Returns the degree of node as run time information.\n-Definition nodeinterface.hh:85\n-Dune::TypeTree::NodeTag\n-typename std::decay_t< Node >::NodeTag NodeTag\n-Returns the node tag of the given Node.\n-Definition nodeinterface.hh:76\n-Dune::TypeTree::ImplementationTag\n-typename std::decay_t< T >::ImplementationTag ImplementationTag\n-Returns the implementation tag of the given Node.\n-Definition nodeinterface.hh:80\n+ 115 template\n+116 static typename result::type transform(const SourceNode& s, const\n+Transformation& t, std::shared_ptr... children)\n+ 117 {\n+ 118 return typename result::type(children...);\n+ 119 }\n+ 120\n+ 121 template\n+122 static typename result::storage_type transform_storage(std::\n+shared_ptr s, const Transformation& t, std::shared_ptr...\n+children)\n+ 123 {\n+ 124 return std::make_shared::type>(children...);\n+ 125 }\n+ 126\n+ 127 };\n+ 128\n+ 130\n+ 131 } // namespace TypeTree\n+ 132} //namespace Dune\n+ 133\n+ 134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH\n+nodetags.hh\n+nodeinterface.hh\n Dune::TypeTree::StaticDegree\n decltype(Node::degree()) StaticDegree\n Returns the statically known degree of the given Node type as a std::\n integral_constant.\n Definition nodeinterface.hh:113\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::NodeInterface\n-Interface for nodes in a dune-typetree.\n-Definition nodeinterface.hh:33\n-Dune::TypeTree::NodeInterface::CHILDREN\n-static const std::size_t CHILDREN\n-Number of children of this node in the dune-typetree.\n-Definition nodeinterface.hh:49\n-Dune::TypeTree::NodeInterface::degree\n-static auto degree()\n-Number of children of this node in the dune-typetree.\n-Dune::TypeTree::NodeInterface::isPower\n-static const bool isPower\n-Whether this is a power node in the dune-typetree.\n-Definition nodeinterface.hh:38\n-Dune::TypeTree::NodeInterface::isLeaf\n-static const bool isLeaf\n-Whether this is a leaf node in a dune-typetree.\n-Definition nodeinterface.hh:35\n-Dune::TypeTree::NodeInterface::NodeStorage\n-ImplementationDefined NodeStorage\n-container type to pass around a collection of children\n-Definition nodeinterface.hh:71\n-Dune::TypeTree::NodeInterface::isComposite\n-static const bool isComposite\n-Whether this is a composite node in the dune-typetree.\n-Definition nodeinterface.hh:41\n-Dune::TypeTree::NodeInterface::NodeTag\n-ImplementationDefined NodeTag\n-The type tag that describes what kind of node this is.\n-Definition nodeinterface.hh:65\n+Dune::TypeTree::SimpleLeafNodeTransformation\n+Definition simpletransformationdescriptors.hh:25\n+Dune::TypeTree::SimpleLeafNodeTransformation::transform\n+static transformed_type transform(const SourceNode &s, const Transformation &t)\n+Definition simpletransformationdescriptors.hh:32\n+Dune::TypeTree::SimpleLeafNodeTransformation::recursive\n+static const bool recursive\n+Definition simpletransformationdescriptors.hh:27\n+Dune::TypeTree::SimpleLeafNodeTransformation::transformed_storage_type\n+std::shared_ptr< transformed_type > transformed_storage_type\n+Definition simpletransformationdescriptors.hh:30\n+Dune::TypeTree::SimpleLeafNodeTransformation::transform_storage\n+static transformed_storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t)\n+Definition simpletransformationdescriptors.hh:37\n+Dune::TypeTree::SimpleLeafNodeTransformation::transformed_type\n+TransformedNode transformed_type\n+Definition simpletransformationdescriptors.hh:29\n+Dune::TypeTree::SimplePowerNodeTransformation\n+Definition simpletransformationdescriptors.hh:47\n+Dune::TypeTree::SimplePowerNodeTransformation::transform_storage\n+static result< TC >::storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC\n+>, result< TC >::degree > &children)\n+Definition simpletransformationdescriptors.hh:66\n+Dune::TypeTree::SimplePowerNodeTransformation::recursive\n+static const bool recursive\n+Definition simpletransformationdescriptors.hh:49\n+Dune::TypeTree::SimplePowerNodeTransformation::transform\n+static result< TC >::type transform(const SourceNode &s, const Transformation\n+&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)\n+Definition simpletransformationdescriptors.hh:60\n+Dune::TypeTree::SimplePowerNodeTransformation::result\n+Definition simpletransformationdescriptors.hh:53\n+Dune::TypeTree::SimplePowerNodeTransformation::result::type\n+TransformedNode< TC, StaticDegree< SourceNode >::value > type\n+Definition simpletransformationdescriptors.hh:54\n+Dune::TypeTree::SimplePowerNodeTransformation::result::degree\n+static const std::size_t degree\n+Definition simpletransformationdescriptors.hh:56\n+Dune::TypeTree::SimplePowerNodeTransformation::result::storage_type\n+std::shared_ptr< type > storage_type\n+Definition simpletransformationdescriptors.hh:55\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation\n+Definition simpletransformationdescriptors.hh:76\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation::recursive\n+static const bool recursive\n+Definition simpletransformationdescriptors.hh:78\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform\n+static result< TC >::type transform(const SourceNode &s, const Transformation\n+&t, const std::vector< std::shared_ptr< TC > > &children)\n+Definition simpletransformationdescriptors.hh:88\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform_storage\n+static result< TC >::storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC\n+> > &children)\n+Definition simpletransformationdescriptors.hh:94\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result\n+Definition simpletransformationdescriptors.hh:82\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::type\n+TransformedNode< TC > type\n+Definition simpletransformationdescriptors.hh:83\n+Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::storage_type\n+std::shared_ptr< type > storage_type\n+Definition simpletransformationdescriptors.hh:84\n+Dune::TypeTree::SimpleCompositeNodeTransformation\n+Definition simpletransformationdescriptors.hh:104\n+Dune::TypeTree::SimpleCompositeNodeTransformation::recursive\n+static const bool recursive\n+Definition simpletransformationdescriptors.hh:106\n+Dune::TypeTree::SimpleCompositeNodeTransformation::transform_storage\n+static result< TC... >::storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)\n+Definition simpletransformationdescriptors.hh:122\n+Dune::TypeTree::SimpleCompositeNodeTransformation::transform\n+static result< TC... >::type transform(const SourceNode &s, const\n+Transformation &t, std::shared_ptr< TC >... children)\n+Definition simpletransformationdescriptors.hh:116\n+Dune::TypeTree::SimpleCompositeNodeTransformation::result\n+Definition simpletransformationdescriptors.hh:110\n+Dune::TypeTree::SimpleCompositeNodeTransformation::result::storage_type\n+std::shared_ptr< type > storage_type\n+Definition simpletransformationdescriptors.hh:112\n+Dune::TypeTree::SimpleCompositeNodeTransformation::result::type\n+TransformedNode< TC... > type\n+Definition simpletransformationdescriptors.hh:111\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00032.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: accumulate_static.hh File Reference\n+dune-typetree: traversal.hh File Reference\n \n \n \n \n \n \n \n@@ -70,134 +70,87 @@\n
    \n \n
    \n
    \n
    \n \n-
    accumulate_static.hh File Reference
    \n+
    traversal.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/typetraits.hh>
    \n-#include <dune/typetree/nodeinterface.hh>
    \n-#include <dune/typetree/nodetags.hh>
    \n-#include <dune/typetree/treepath.hh>
    \n+
    #include <utility>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/std/type_traits.hh>
    \n+#include <dune/typetree/childextraction.hh>
    \n+#include <dune/typetree/nodetags.hh>
    \n+#include <dune/typetree/treepath.hh>
    \n+#include <dune/typetree/visitor.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-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...
     
    \n \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::Experimental
    namespace  Dune::TypeTree::Detail
     
    \n+\n+\n+\n+\n+\n+\n+\n+

    \n+Typedefs

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

    \n Functions

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

    Variable Documentation

    \n-\n-

    ◆ child_result

    \n-\n-
    \n-
    \n-\n- \n- \n- \n- \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n
    \n- \n- \n- \n- \n-
    const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result
    \n-
    \n-static
    template<class Tree , TreePathType::Type pathType, class Prefix , std::enable_if_t< Tree::isLeaf, int > = 0>
    constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix)
     
    template<class Tree , TreePathType::Type pathType, class Prefix , std::size_t... indices, std::enable_if_t<(Tree::isComposite or(Tree::isPower and(pathType!=TreePathType::dynamic))), int > = 0>
    constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std::index_sequence< indices... >)
     
    template<class T , class TreePath , class V , std::enable_if_t< std::decay_t< T >::isLeaf, int > = 0>
    void Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath treePath, V &&visitor)
     
    template<class T , class TreePath , class PreFunc , class LeafFunc , class PostFunc >
    void Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
     
    template<class Tree , TreePathType::Type pathType = TreePathType::dynamic>
    constexpr auto Dune::TypeTree::leafTreePathTuple ()
     Create tuple of tree paths to leafs.
     
    template<typename Tree , typename Visitor >
    void Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor)
     Apply visitor to TypeTree.
     
    template<class Tree , class PreFunc , class LeafFunc , class PostFunc >
    void Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
     Traverse tree and visit each node.
     
    template<class Tree , class InnerFunc , class LeafFunc >
    void Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc &&innerFunc, LeafFunc &&leafFunc)
     Traverse tree and visit each node.
     
    template<class Tree , class NodeFunc >
    void Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc)
     Traverse tree and visit each node.
     
    template<class Tree , class LeafFunc >
    void Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc &&leafFunc)
     Traverse tree and visit each leaf node.
     
    \n-
    \n-\n-
    \n-
    \n-\n-

    ◆ result

    \n-\n-
    \n-
    \n-\n- \n- \n- \n- \n-
    \n- \n- \n- \n- \n-
    const result_type result = current_value
    \n-
    \n-static
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,85 +6,85 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces | Functions\n-accumulate_static.hh File Reference\n-#include \n-#include \n+Namespaces | Typedefs | Functions\n+traversal.hh File Reference\n+#include \n+#include \n+#include \n+#include \n #include \n #include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-struct \u00a0Dune::TypeTree::or_<_result_type_>\n-\u00a0 Statically combine two values of type result_type using ||. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::or_<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::and_<_result_type_>\n-\u00a0 Statically combine two values of type result_type using &&. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::and_<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::plus<_result_type_>\n-\u00a0 Statically combine two values of type result_type using +. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::plus<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::minus<_result_type_>\n-\u00a0 Statically combine two values of type result_type using -. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::minus<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::multiply<_result_type_>\n-\u00a0 Statically combine two values of type result_type using *. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::multiply<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::min<_result_type_>\n-\u00a0 Statically combine two values of type result_type by returning their\n- minimum. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::min<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::max<_result_type_>\n-\u00a0 Statically combine two values of type result_type by returning their\n- maximum. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::max<_result_type_>::reduce<_r1,_r2_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::AccumulateValue<_Tree,_Functor,_Reduction,_startValue,\n- ParentChildReduction_>\n-\u00a0 Statically accumulate a value over the nodes of a TypeTree. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::TypeAccumulationPolicy<_Functor,_Reduction,_StartType,\n- ParentChildReduction,_ReductionAlgorithm_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::AccumulateType<_Tree,_Policy_>\n-\u00a0 Statically accumulate a type over the nodes of a TypeTree. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n-namespace \u00a0Dune::TypeTree::Experimental\n+namespace \u00a0Dune::TypeTree::Detail\n+\u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::TypeTree::Detail::DynamicTraversalConcept = decltype((std::\n+ declval< Tree >().degree(), std::declval< Tree >().child(0u)))\n+\u00a0\n+template\n+using\u00a0Dune::TypeTree::Detail::StaticTraversalConcept = decltype((std::\n+ integral_constant< std::size_t, Tree::degree()>{}))\n \u00a0\n Functions\n-template\n-auto\u00a0Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor\n- &&visitor, Init &&init)\n-\u00a0 Apply hybrid visitor to TypeTree.\n-\u00a0\n-***** Variable Documentation *****\n-***** \u25c6\u00a0child_result *****\n-const result_type child_result =\n-accumulate_value>:: static\n-result\n-***** \u25c6\u00a0result *****\n-const result_type result = current_value static\n+template = 0>\n+constexpr auto\u00a0Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix)\n+\u00a0\n+template = 0>\n+constexpr auto\u00a0Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std::\n+ index_sequence< indices... >)\n+\u00a0\n+template::isLeaf, int > = 0>\n+ void\u00a0Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath\n+ treePath, V &&visitor)\n+\u00a0\n+template\n+ void\u00a0Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath\n+ treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc\n+ &&postFunc)\n+\u00a0\n+template\n+constexpr auto\u00a0Dune::TypeTree::leafTreePathTuple ()\n+\u00a0 Create tuple of tree paths to leafs.\n+\u00a0\n+template\n+ void\u00a0Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor)\n+\u00a0 Apply visitor to TypeTree.\n+\u00a0\n+template\n+ void\u00a0Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc,\n+ LeafFunc &&leafFunc, PostFunc &&postFunc)\n+\u00a0 Traverse tree and visit each node.\n+\u00a0\n+template\n+ void\u00a0Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc\n+ &&innerFunc, LeafFunc &&leafFunc)\n+\u00a0 Traverse tree and visit each node.\n+\u00a0\n+template\n+ void\u00a0Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc)\n+\u00a0 Traverse tree and visit each node.\n+\u00a0\n+template\n+ void\u00a0Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc\n+ &&leafFunc)\n+\u00a0 Traverse tree and visit each leaf node.\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00032_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: accumulate_static.hh Source File\n+dune-typetree: traversal.hh Source File\n \n \n \n \n \n \n \n@@ -74,591 +74,296 @@\n \n
    \n \n
    \n
    \n
    \n-
    accumulate_static.hh
    \n+
    traversal.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH
    \n-
    5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH
    \n+
    4#ifndef DUNE_TYPETREE_TRAVERSAL_HH
    \n+
    5#define DUNE_TYPETREE_TRAVERSAL_HH
    \n
    6
    \n-
    7#include <dune/common/typetraits.hh>
    \n-\n-\n-\n+
    7#include <utility>
    \n+
    8
    \n+
    9#include <dune/common/hybridutilities.hh>
    \n+
    10#include <dune/common/std/type_traits.hh>
    \n
    11
    \n-
    12
    \n-
    \n-
    13namespace Dune {
    \n-
    \n-
    14 namespace TypeTree {
    \n-
    15
    \n-
    22 template<typename result_type>
    \n-
    \n-
    23 struct or_
    \n-
    24 {
    \n-
    25 template<result_type r1, result_type r2>
    \n-
    \n-
    26 struct reduce
    \n-
    27 {
    \n-
    28 static const result_type result = r1 || r2;
    \n-
    29 };
    \n-
    \n-
    30 };
    \n-
    \n-
    31
    \n-
    33 template<typename result_type>
    \n-
    \n-
    34 struct and_
    \n-
    35 {
    \n-
    36 template<result_type r1, result_type r2>
    \n-
    \n-
    37 struct reduce
    \n-
    38 {
    \n-
    39 static const result_type result = r1 && r2;
    \n-
    40 };
    \n-
    \n-
    41 };
    \n-
    \n+\n+\n+\n+\n+
    16
    \n+
    17namespace Dune {
    \n+
    18 namespace TypeTree {
    \n+
    19
    \n+
    25#ifndef DOXYGEN
    \n+
    27 struct NoOp
    \n+
    28 {
    \n+
    29 template<class... T>
    \n+
    30 constexpr void operator()(T&&...) const { /* do nothing */ }
    \n+
    31 };
    \n+
    32#endif
    \n+
    33
    \n+
    34 namespace Detail {
    \n+
    35
    \n+
    36 // SFINAE template check that Tree has a degree() function and a child() function accepting integer indices
    \n+
    37 template<class Tree>
    \n+
    38 using DynamicTraversalConcept = decltype((
    \n+
    39 std::declval<Tree>().degree(),
    \n+
    40 std::declval<Tree>().child(0u)
    \n+
    41 ));
    \n
    42
    \n-
    44 template<typename result_type>
    \n-
    \n-
    45 struct plus
    \n-
    46 {
    \n-
    47 template<result_type r1, result_type r2>
    \n-
    \n-
    48 struct reduce
    \n-
    49 {
    \n-
    50 static const result_type result = r1 + r2;
    \n-
    51 };
    \n-
    \n-
    52 };
    \n-
    \n-
    53
    \n-
    55 template<typename result_type>
    \n-
    \n-
    56 struct minus
    \n-
    57 {
    \n-
    58 template<result_type r1, result_type r2>
    \n-
    \n-
    59 struct reduce
    \n-
    60 {
    \n-
    61 static const result_type result = r1 - r2;
    \n-
    62 };
    \n-
    \n-
    63 };
    \n-
    \n-
    64
    \n-
    66 template<typename result_type>
    \n-
    \n-
    67 struct multiply
    \n-
    68 {
    \n-
    69 template<result_type r1, result_type r2>
    \n-
    \n-
    70 struct reduce
    \n+
    43 // SFINAE template check that Tree has static (constexpr) function Tree::degree()
    \n+
    44 template<class Tree>
    \n+
    45 using StaticTraversalConcept = decltype((
    \n+
    46 std::integral_constant<std::size_t, Tree::degree()>{}
    \n+
    47 ));
    \n+
    48
    \n+
    49
    \n+
    50 template<class Tree, TreePathType::Type pathType, class Prefix,
    \n+
    51 std::enable_if_t<Tree::isLeaf, int> = 0>
    \n+
    \n+
    52 constexpr auto leafTreePathTuple(Prefix prefix)
    \n+
    53 {
    \n+
    54 return std::make_tuple(prefix);
    \n+
    55 }
    \n+
    \n+
    56
    \n+
    57 template<class Tree, TreePathType::Type pathType, class Prefix,
    \n+
    58 std::enable_if_t<not Tree::isLeaf, int> = 0>
    \n+
    59 constexpr auto leafTreePathTuple(Prefix prefix);
    \n+
    60
    \n+
    61 template<class Tree, TreePathType::Type pathType, class Prefix, std::size_t... indices,
    \n+
    62 std::enable_if_t<(Tree::isComposite or (Tree::isPower and (pathType!=TreePathType::dynamic))), int> = 0>
    \n+
    \n+
    63 constexpr auto leafTreePathTuple(Prefix prefix, std::index_sequence<indices...>)
    \n+
    64 {
    \n+
    65 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, Dune::index_constant<indices>{}))...);
    \n+
    66 }
    \n+
    \n+
    67
    \n+
    68 template<class Tree, TreePathType::Type pathType, class Prefix, std::size_t... indices,
    \n+
    69 std::enable_if_t<(Tree::isPower and (pathType==TreePathType::dynamic)), int> = 0>
    \n+
    70 constexpr auto leafTreePathTuple(Prefix prefix, std::index_sequence<indices...>)
    \n
    71 {
    \n-
    72 static const result_type result = r1 * r2;
    \n-
    73 };
    \n-
    \n-
    74 };
    \n-
    \n-
    75
    \n-
    77 template<typename result_type>
    \n-
    \n-
    78 struct min
    \n-
    79 {
    \n-
    80 template<result_type r1, result_type r2>
    \n-
    \n-
    81 struct reduce
    \n-
    82 {
    \n-
    83 static const result_type result = r1 < r2 ? r1 : r2;
    \n-
    84 };
    \n-
    \n-
    85 };
    \n-
    \n-
    86
    \n-
    88 template<typename result_type>
    \n-
    \n-
    89 struct max
    \n-
    90 {
    \n-
    91 template<result_type r1, result_type r2>
    \n-
    \n-
    92 struct reduce
    \n-
    93 {
    \n-
    94 static const result_type result = r1 > r2 ? r1 : r2;
    \n-
    95 };
    \n-
    \n-
    96 };
    \n-
    \n-
    97
    \n-
    98
    \n-
    99 namespace {
    \n-
    100
    \n-
    101 // implementation of the traversal algorithm
    \n-
    102
    \n-
    104 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath, bool doVisit>
    \n-
    105 struct accumulate_node_helper
    \n+
    72 return std::tuple_cat(Detail::leafTreePathTuple<TypeTree::Child<Tree,indices>, pathType>(Dune::TypeTree::push_back(prefix, indices))...);
    \n+
    73 }
    \n+
    74
    \n+
    75 template<class Tree, TreePathType::Type pathType, class Prefix,
    \n+
    76 std::enable_if_t<not Tree::isLeaf, int>>
    \n+
    77 constexpr auto leafTreePathTuple(Prefix prefix)
    \n+
    78 {
    \n+
    79 return Detail::leafTreePathTuple<Tree, pathType>(prefix, std::make_index_sequence<Tree::degree()>{});
    \n+
    80 }
    \n+
    81
    \n+
    82 /* The signature is the same as for the public applyToTree
    \n+
    83 * function in Dune::Typetree, despite the additionally passed
    \n+
    84 * treePath argument. The path passed here is associated to
    \n+
    85 * the tree and the relative paths of the children (wrt. to tree)
    \n+
    86 * are appended to this. Hence the behavior of the public function
    \n+
    87 * is resembled by passing an empty treePath.
    \n+
    88 */
    \n+
    89
    \n+
    90 /*
    \n+
    91 * This is the overload for leaf traversal
    \n+
    92 */
    \n+
    93 template<class T, class TreePath, class V,
    \n+
    94 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
    \n+
    \n+
    95 void applyToTree(T&& tree, TreePath treePath, V&& visitor)
    \n+
    96 {
    \n+
    97 visitor.leaf(tree, treePath);
    \n+
    98 }
    \n+
    \n+
    99
    \n+
    100 /*
    \n+
    101 * This is the general overload doing child traversal.
    \n+
    102 */
    \n+
    103 template<class T, class TreePath, class V,
    \n+
    104 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
    \n+
    105 void applyToTree(T&& tree, TreePath treePath, V&& visitor)
    \n
    106 {
    \n-
    107
    \n-
    108 typedef typename Functor::result_type result_type;
    \n-
    109
    \n-
    110 static const result_type result = current_value;
    \n-
    111
    \n-
    112 };
    \n-
    113
    \n-
    115 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath>
    \n-
    116 struct accumulate_node_helper<Node,Functor,Reduction,current_value,TreePath,true>
    \n-
    117 {
    \n-
    118
    \n-
    119 typedef typename Functor::result_type result_type;
    \n+
    107 using Tree = std::remove_reference_t<T>;
    \n+
    108 using Visitor = std::remove_reference_t<V>;
    \n+
    109 visitor.pre(tree, treePath);
    \n+
    110
    \n+
    111 // check which type of traversal is supported by the tree
    \n+
    112 using allowDynamicTraversal = Dune::Std::is_detected<DynamicTraversalConcept,Tree>;
    \n+
    113 using allowStaticTraversal = Dune::Std::is_detected<StaticTraversalConcept,Tree>;
    \n+
    114
    \n+
    115 // the tree must support either dynamic or static traversal
    \n+
    116 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
    \n+
    117
    \n+
    118 // the visitor may specify preferred dynamic traversal
    \n+
    119 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
    \n
    120
    \n-
    121 static const result_type result = Reduction::template reduce<current_value,Functor::template visit<Node,TreePath>::result>::result;
    \n-
    122
    \n-
    123 };
    \n-
    124
    \n-
    126 template<typename Tree, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, typename Tag>
    \n-
    127 struct accumulate_value;
    \n+
    121 // create a dynamic or static index range
    \n+
    122 auto indices = [&]{
    \n+
    123 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
    \n+
    124 return Dune::range(std::size_t(tree.degree()));
    \n+
    125 else
    \n+
    126 return Dune::range(tree.degree());
    \n+
    127 }();
    \n
    128
    \n-
    130 template<typename LeafNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n-
    131 struct accumulate_value<LeafNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,LeafNodeTag>
    \n-
    132 {
    \n+
    129 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
    \n+
    130 Hybrid::forEach(indices, [&](auto i) {
    \n+
    131 auto&& child = tree.child(i);
    \n+
    132 using Child = std::decay_t<decltype(child)>;
    \n
    133
    \n-
    134 typedef typename Functor::result_type result_type;
    \n+
    134 visitor.beforeChild(tree, child, treePath, i);
    \n
    135
    \n-
    136 static const result_type result =
    \n-
    137
    \n-
    138 accumulate_node_helper<LeafNode,Functor,Reduction,current_value,TreePath,Functor::template doVisit<LeafNode,TreePath>::value>::result;
    \n-
    139
    \n-
    140 };
    \n-
    141
    \n-
    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>
    \n-
    144 struct accumulate_over_children
    \n-
    145 {
    \n+
    136 // This requires that visitor.in(...) can always be instantiated,
    \n+
    137 // even if there's a single child only.
    \n+
    138 if (i>0)
    \n+
    139 visitor.in(tree, treePath);
    \n+
    140
    \n+
    141 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
    \n+
    142 if constexpr(visitChild) {
    \n+
    143 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n+
    144 applyToTree(child, childTreePath, visitor);
    \n+
    145 }
    \n
    146
    \n-
    147 typedef typename Functor::result_type result_type;
    \n-
    148
    \n-
    149 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
    \n-
    150
    \n-
    151 typedef typename Node::template Child<i>::Type child;
    \n+
    147 visitor.afterChild(tree, child, treePath, i);
    \n+
    148 });
    \n+
    149 }
    \n+
    150 visitor.post(tree, treePath);
    \n+
    151 }
    \n
    152
    \n-
    153 static const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result;
    \n-
    154
    \n-
    155 static const result_type result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,child_result,TreePath,i+1,n>::result;
    \n-
    156
    \n-
    157 };
    \n-
    158
    \n-
    160 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t n>
    \n-
    161 struct accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,n,n>
    \n-
    162 {
    \n-
    163
    \n-
    164 typedef typename Functor::result_type result_type;
    \n-
    165
    \n-
    166 static const result_type result = current_value;
    \n-
    167
    \n-
    168 };
    \n+
    153 /* Traverse tree and visit each node. The signature is the same
    \n+
    154 * as for the public forEachNode function in Dune::Typtree,
    \n+
    155 * despite the additionally passed treePath argument. The path
    \n+
    156 * passed here is associated to the tree and the relative
    \n+
    157 * paths of the children (wrt. to tree) are appended to this.
    \n+
    158 * Hence the behavior of the public function is resembled
    \n+
    159 * by passing an empty treePath.
    \n+
    160 */
    \n+
    161 template<class T, class TreePath, class PreFunc, class LeafFunc, class PostFunc>
    \n+
    \n+
    162 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
    \n+
    163 {
    \n+
    164 using Tree = std::decay_t<T>;
    \n+
    165 if constexpr(Tree::isLeaf) {
    \n+
    166 leafFunc(tree, treePath);
    \n+
    167 } else {
    \n+
    168 preFunc(tree, treePath);
    \n
    169
    \n-
    172 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n-
    173 struct accumulate_value_generic_composite_node
    \n-
    174 {
    \n-
    175
    \n-
    176 typedef typename Functor::result_type result_type;
    \n-
    177
    \n-
    178 static const result_type child_result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,0,StaticDegree<Node>::value>::result;
    \n-
    179
    \n-
    180 static const result_type result =
    \n-
    181 accumulate_node_helper<Node,Functor,ParentChildReduction,child_result,TreePath,Functor::template doVisit<Node,TreePath>::value>::result;
    \n-
    182
    \n-
    183
    \n-
    184 };
    \n-
    185
    \n-
    187 template<typename PowerNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n-
    188 struct accumulate_value<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,PowerNodeTag>
    \n-
    189 : public accumulate_value_generic_composite_node<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
    \n-
    190 {};
    \n-
    191
    \n-
    193 template<typename CompositeNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n-
    194 struct accumulate_value<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,CompositeNodeTag>
    \n-
    195 : public accumulate_value_generic_composite_node<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
    \n-
    196 {};
    \n+
    170 // check which type of traversal is supported by the tree, prefer dynamic traversal
    \n+
    171 using allowDynamicTraversal = Dune::Std::is_detected<DynamicTraversalConcept,Tree>;
    \n+
    172 using allowStaticTraversal = Dune::Std::is_detected<StaticTraversalConcept,Tree>;
    \n+
    173
    \n+
    174 // the tree must support either dynamic or static traversal
    \n+
    175 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
    \n+
    176
    \n+
    177 if constexpr(allowDynamicTraversal::value) {
    \n+
    178 // Specialization for dynamic traversal
    \n+
    179 for (std::size_t i = 0; i < tree.degree(); ++i) {
    \n+
    180 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n+
    181 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);
    \n+
    182 }
    \n+
    183 } else if constexpr(allowStaticTraversal::value) {
    \n+
    184 // Specialization for static traversal
    \n+
    185 auto indices = std::make_index_sequence<Tree::degree()>{};
    \n+
    186 Hybrid::forEach(indices, [&](auto i) {
    \n+
    187 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n+
    188 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);
    \n+
    189 });
    \n+
    190 }
    \n+
    191 postFunc(tree, treePath);
    \n+
    192 }
    \n+
    193 }
    \n+
    \n+
    194
    \n+
    195 } // namespace Detail
    \n+
    196
    \n
    197
    \n-
    198 } // anonymous namespace
    \n-
    199
    \n+
    198 // ********************************************************************************
    \n+
    199 // Public Interface
    \n+
    200 // ********************************************************************************
    \n
    201
    \n-
    257 template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>
    \n-
    \n-\n-
    259 {
    \n+
    215 template<class Tree, TreePathType::Type pathType=TreePathType::dynamic>
    \n+
    \n+
    216 constexpr auto leafTreePathTuple()
    \n+
    217 {
    \n+
    218 return Detail::leafTreePathTuple<std::decay_t<Tree>, pathType>(hybridTreePath());
    \n+
    219 }
    \n+
    \n+
    220
    \n+
    222
    \n+
    236 template<typename Tree, typename Visitor>
    \n+
    \n+
    237 void applyToTree(Tree&& tree, Visitor&& visitor)
    \n+
    238 {
    \n+
    239 Detail::applyToTree(tree, hybridTreePath(), visitor);
    \n+
    240 }
    \n+
    \n+
    241
    \n+
    255 template<class Tree, class PreFunc, class LeafFunc, class PostFunc>
    \n+
    \n+
    256 [[deprecated]] void forEachNode(Tree&& tree, PreFunc&& preFunc, LeafFunc&& leafFunc, PostFunc&& postFunc)
    \n+
    257 {
    \n+
    258 Detail::forEachNode(tree, hybridTreePath(), preFunc, leafFunc, postFunc);
    \n+
    259 }
    \n+
    \n
    260
    \n-
    262 typedef typename Functor::result_type result_type;
    \n-
    263
    \n-
    265 static const result_type result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result;
    \n-
    266
    \n-
    267 };
    \n-
    \n-
    268
    \n-
    271 struct flattened_reduction;
    \n-
    272
    \n-
    275 struct bottom_up_reduction;
    \n-
    276
    \n-
    277 namespace {
    \n+
    273 template<class Tree, class InnerFunc, class LeafFunc>
    \n+
    \n+
    274 [[deprecated]] void forEachNode(Tree&& tree, InnerFunc&& innerFunc, LeafFunc&& leafFunc)
    \n+
    275 {
    \n+
    276 Detail::forEachNode(tree, hybridTreePath(), innerFunc, leafFunc, NoOp{});
    \n+
    277 }
    \n+
    \n
    278
    \n-
    279 // implementation of the traversal algorithm
    \n-
    280
    \n-
    283 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath, bool doVisit>
    \n-
    284 struct accumulate_type_node_helper
    \n-
    285 {
    \n-
    286
    \n-
    287 typedef current_type type;
    \n-
    288
    \n-
    289 };
    \n-
    290
    \n-
    292 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath>
    \n-
    293 struct accumulate_type_node_helper<Node,Functor,Reduction,current_type,TreePath,true>
    \n-
    294 {
    \n-
    295
    \n-
    296 typedef typename Reduction::template reduce<
    \n-
    297 current_type,
    \n-
    298 typename Functor::template visit<
    \n-
    299 Node,
    \n-
    300 TreePath
    \n-
    301 >::type
    \n-
    302 >::type type;
    \n-
    303
    \n-
    304 };
    \n-
    305
    \n-
    307 template<typename Tree, typename Policy, typename current_type, typename TreePath, typename Tag>
    \n-
    308 struct accumulate_type;
    \n-
    309
    \n-
    311 template<typename LeafNode, typename Policy, typename current_type, typename TreePath>
    \n-
    312 struct accumulate_type<LeafNode,Policy,current_type,TreePath,LeafNodeTag>
    \n-
    313 {
    \n-
    314
    \n-
    315 typedef typename accumulate_type_node_helper<
    \n-
    316 LeafNode,
    \n-
    317 typename Policy::functor,
    \n-
    318 typename Policy::sibling_reduction,
    \n-
    319 current_type,
    \n-
    320 TreePath,
    \n-
    321 Policy::functor::template doVisit<
    \n-
    322 LeafNode,
    \n-
    323 TreePath>::value
    \n-
    324 >::type type;
    \n-
    325
    \n-
    326 };
    \n-
    327
    \n-
    328
    \n-
    331 template<typename current_type, typename tree_path, typename start_type, typename reduction_strategy>
    \n-
    332 struct propagate_type_down_tree;
    \n-
    333
    \n-
    335 template<typename current_type, typename tree_path, typename start_type>
    \n-
    336 struct propagate_type_down_tree<
    \n-
    337 current_type,
    \n-
    338 tree_path,
    \n-
    339 start_type,
    \n-
    340 bottom_up_reduction
    \n-
    341 >
    \n-
    342 {
    \n-
    343 typedef current_type type;
    \n-
    344 };
    \n-
    345
    \n-
    347 template<typename current_type, typename tree_path, typename start_type>
    \n-
    348 struct propagate_type_down_tree<
    \n-
    349 current_type,
    \n-
    350 tree_path,
    \n-
    351 start_type,
    \n-
    352 flattened_reduction
    \n-
    353 >
    \n-
    354 {
    \n-
    355 typedef typename std::conditional<
    \n-
    356 TreePathBack<tree_path>::value == 0,
    \n-
    357 start_type,
    \n-
    358 current_type
    \n-
    359 >::type type;
    \n-
    360 };
    \n-
    361
    \n-
    362
    \n-
    364 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t i, std::size_t n>
    \n-
    365 struct accumulate_type_over_children
    \n-
    366 {
    \n-
    367
    \n-
    368 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
    \n-
    369
    \n-
    370 typedef typename Node::template Child<i>::Type child;
    \n-
    371
    \n-
    372 typedef typename accumulate_type<
    \n-
    373 child,
    \n-
    374 Policy,
    \n-
    375 // apply reduction choice (flat / hierarchic)
    \n-
    376 typename propagate_type_down_tree<
    \n-
    377 current_type,
    \n-
    378 child_tree_path,
    \n-
    379 typename Policy::start_type,
    \n-
    380 typename Policy::reduction_strategy
    \n-
    381 >::type,
    \n-
    382 child_tree_path,
    \n-
    383 NodeTag<child>
    \n-
    384 >::type child_result_type;
    \n-
    385
    \n-
    386 typedef typename accumulate_type_over_children<
    \n-
    387 Node,
    \n-
    388 Policy,
    \n-
    389 child_result_type,
    \n-
    390 TreePath,
    \n-
    391 i+1,
    \n-
    392 n
    \n-
    393 >::type type;
    \n-
    394
    \n-
    395 };
    \n-
    396
    \n-
    398 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t n>
    \n-
    399 struct accumulate_type_over_children<Node,Policy,current_type,TreePath,n,n>
    \n-
    400 {
    \n-
    401
    \n-
    402 typedef current_type type;
    \n-
    403
    \n-
    404 };
    \n-
    405
    \n-
    406
    \n-
    409 template<typename Node, typename Policy, typename current_type, typename TreePath>
    \n-
    410 struct accumulate_type_generic_composite_node
    \n-
    411 {
    \n-
    412
    \n-
    413 typedef typename accumulate_type_over_children<
    \n-
    414 Node,
    \n-
    415 Policy,
    \n-
    416 current_type,
    \n-
    417 TreePath,
    \n-
    418 0,
    \n-
    419 StaticDegree<Node>::value
    \n-
    420 >::type children_result_type;
    \n-
    421
    \n-
    422 typedef typename accumulate_type_node_helper<
    \n-
    423 Node,
    \n-
    424 typename Policy::functor,
    \n-
    425 typename Policy::parent_child_reduction,
    \n-
    426 children_result_type,
    \n-
    427 TreePath,
    \n-
    428 Policy::functor::template doVisit<
    \n-
    429 Node,
    \n-\n-
    431 >::value
    \n-
    432 >::type type;
    \n-
    433
    \n-
    434 };
    \n-
    435
    \n-
    437 template<typename PowerNode, typename Policy, typename current_type, typename TreePath>
    \n-
    438 struct accumulate_type<PowerNode,Policy,current_type,TreePath,PowerNodeTag>
    \n-
    439 : public accumulate_type_generic_composite_node<PowerNode,Policy,current_type,TreePath>
    \n-
    440 {};
    \n-
    441
    \n-
    443 template<typename CompositeNode, typename Policy, typename current_type, typename TreePath>
    \n-
    444 struct accumulate_type<CompositeNode,Policy,current_type,TreePath,CompositeNodeTag>
    \n-
    445 : public accumulate_type_generic_composite_node<CompositeNode,Policy,current_type,TreePath>
    \n-
    446 {};
    \n-
    447
    \n-
    448 } // anonymous namespace
    \n-
    449
    \n-
    450
    \n-
    458 template<
    \n-
    459 typename Functor,
    \n-
    460 typename Reduction,
    \n-
    461 typename StartType,
    \n-
    462 typename ParentChildReduction = Reduction,
    \n-
    463 typename ReductionAlgorithm = flattened_reduction
    \n-
    464 >
    \n-
    \n-\n-
    466 {
    \n-
    467
    \n-
    495 typedef Functor functor;
    \n-
    496
    \n-
    516 typedef Reduction sibling_reduction;
    \n-
    517
    \n-
    524 typedef ParentChildReduction parent_child_reduction;
    \n-
    525
    \n-
    532 typedef StartType start_type;
    \n-
    533
    \n-
    538 typedef ReductionAlgorithm reduction_strategy;
    \n-
    539 };
    \n-
    \n-
    540
    \n-
    541
    \n-
    543
    \n-
    551 template<typename Tree, typename Policy>
    \n-
    \n-\n-
    553 {
    \n-
    554
    \n-
    556 typedef typename accumulate_type<
    \n-
    557 Tree,
    \n-
    558 Policy,
    \n-
    559 typename Policy::start_type,
    \n-\n-\n-
    562 >::type type;
    \n-
    563
    \n-
    564 };
    \n-
    \n-
    565
    \n-
    566
    \n-
    567
    \n-
    568
    \n-
    569
    \n-
    570 /***************************************************/
    \n-
    571
    \n-
    \n-
    572 namespace Experimental {
    \n-
    573 namespace Impl {
    \n-
    574
    \n-
    576 template<class T, class TreePath, class V, class U,
    \n-
    577 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
    \n-
    578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
    \n-
    579 {
    \n-
    580 return visitor.leaf(tree, treePath, std::forward<U>(current_val));
    \n-
    581 }
    \n-
    582
    \n-
    584 template<class T, class TreePath, class V, class U,
    \n-
    585 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
    \n-
    586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
    \n-
    587 {
    \n-
    588 using Tree = std::remove_reference_t<T>;
    \n-
    589 using Visitor = std::remove_reference_t<V>;
    \n-
    590 auto pre_val = visitor.pre(tree, treePath, std::forward<U>(current_val));
    \n-
    591
    \n-
    592 // check which type of traversal is supported by the tree
    \n-
    593 using allowDynamicTraversal = Dune::Std::is_detected<Detail::DynamicTraversalConcept,Tree>;
    \n-
    594 using allowStaticTraversal = Dune::Std::is_detected<Detail::StaticTraversalConcept,Tree>;
    \n-
    595
    \n-
    596 // the tree must support either dynamic or static traversal
    \n-
    597 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
    \n-
    598
    \n-
    599 // the visitor may specify preferred dynamic traversal
    \n-
    600 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
    \n-
    601
    \n-
    602 // declare rule that applies visitor and current value to a child i. Returns next value
    \n-
    603 auto apply_i = [&](auto&& value, const auto& i){
    \n-
    604 auto&& child = tree.child(i);
    \n-
    605 using Child = std::decay_t<decltype(child)>;
    \n-
    606
    \n-
    607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move(value));
    \n-
    608
    \n-
    609 // visits between children
    \n-
    610 auto val_in = Hybrid::ifElse(
    \n-
    611 Hybrid::equals(i,Indices::_0),
    \n-
    612 [&](auto id){return std::move(val_before);},
    \n-
    613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));}
    \n-
    614 );
    \n-
    615
    \n-
    616 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
    \n-
    617 auto val_visit = [&](){
    \n-
    618 if constexpr (visitChild) {
    \n-
    619 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n-
    620 return hybridApplyToTree(child, childTreePath, visitor, std::move(val_in));
    \n-
    621 }
    \n-
    622 else
    \n-
    623 return std::move(val_in);
    \n-
    624 }();
    \n-
    625
    \n-
    626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit));
    \n-
    627 };
    \n-
    628
    \n-
    629 // apply visitor to children
    \n-
    630 auto in_val = [&](){
    \n-
    631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal::value) {
    \n-
    632 // get list of static indices
    \n-
    633 auto indices = std::make_index_sequence<Tree::degree()>{};
    \n-
    634
    \n-
    635 // unfold apply_i left to right
    \n-
    636 return unpackIntegerSequence([&](auto... i) {
    \n-
    656 return left_fold(std::move(apply_i),std::move(pre_val), i...);
    \n-
    657 }, indices);
    \n-
    658
    \n-
    659 } else {
    \n-
    660 // unfold first child to get type
    \n-
    661 auto i_val = apply_i(std::move(pre_val),std::size_t{0});
    \n-
    662 // dynamically loop rest of the children to accumulate remindng values
    \n-
    663 for(std::size_t i = 1; i < tree.degree(); i++)
    \n-
    664 i_val = apply_i(i_val,i);
    \n-
    665 return i_val;
    \n-
    666 }
    \n-
    667 }();
    \n-
    668
    \n-
    669 return visitor.post(tree, treePath, in_val);
    \n-
    670 }
    \n-
    671
    \n-
    672 }
    \n-
    673
    \n-
    697 template<typename Tree, typename Visitor, typename Init>
    \n-
    \n-
    698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init)
    \n-
    699 {
    \n-
    700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init);
    \n-
    701 }
    \n-
    \n-
    702
    \n-
    703 } // namespace Experimental
    \n-
    \n-
    704
    \n-
    706 } // namespace TypeTree
    \n-
    \n-
    707} //namespace Dune
    \n-
    \n-
    708
    \n-
    709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH
    \n-\n-
    static const result_type child_result
    Definition accumulate_static.hh:153
    \n-
    static const result_type result
    Definition accumulate_static.hh:110
    \n-\n-\n+
    288 template<class Tree, class NodeFunc>
    \n+
    \n+
    289 void forEachNode(Tree&& tree, NodeFunc&& nodeFunc)
    \n+
    290 {
    \n+
    291 Detail::forEachNode(tree, hybridTreePath(), nodeFunc, nodeFunc, NoOp{});
    \n+
    292 }
    \n+
    \n+
    293
    \n+
    303 template<class Tree, class LeafFunc>
    \n+
    \n+
    304 void forEachLeafNode(Tree&& tree, LeafFunc&& leafFunc)
    \n+
    305 {
    \n+
    306 Detail::forEachNode(tree, hybridTreePath(), NoOp{}, leafFunc, NoOp{});
    \n+
    307 }
    \n+
    \n+
    308
    \n+
    310
    \n+
    311 } // namespace TypeTree
    \n+
    312} //namespace Dune
    \n+
    313
    \n+
    314#endif // DUNE_TYPETREE_TRAVERSAL_HH
    \n+\n+\n+\n+\n+
    void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
    Traverse tree and visit each node.
    Definition traversal.hh:256
    \n+
    constexpr auto leafTreePathTuple()
    Create tuple of tree paths to leafs.
    Definition traversal.hh:216
    \n+
    void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc)
    Traverse tree and visit each leaf node.
    Definition traversal.hh:304
    \n+
    void applyToTree(Tree &&tree, Visitor &&visitor)
    Apply visitor to TypeTree.
    Definition traversal.hh:237
    \n
    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
    \n
    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
    \n-
    typename std::decay_t< Node >::NodeTag NodeTag
    Returns the node tag of the given Node.
    Definition nodeinterface.hh:76
    \n
    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
    \n
    constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:180
    \n
    constexpr HybridTreePath< T... > treePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:191
    \n
    HybridTreePath< Dune::index_constant< i >... > TreePath
    Definition treepath.hh:521
    \n
    Definition accumulate_static.hh:13
    \n-
    Statically combine two values of type result_type using ||.
    Definition accumulate_static.hh:24
    \n-
    Definition accumulate_static.hh:27
    \n-
    static const result_type result
    Definition accumulate_static.hh:28
    \n-
    Statically combine two values of type result_type using &&.
    Definition accumulate_static.hh:35
    \n-
    Definition accumulate_static.hh:38
    \n-
    static const result_type result
    Definition accumulate_static.hh:39
    \n-
    Statically combine two values of type result_type using +.
    Definition accumulate_static.hh:46
    \n-
    Definition accumulate_static.hh:49
    \n-
    static const result_type result
    Definition accumulate_static.hh:50
    \n-
    Statically combine two values of type result_type using -.
    Definition accumulate_static.hh:57
    \n-
    Definition accumulate_static.hh:60
    \n-
    static const result_type result
    Definition accumulate_static.hh:61
    \n-
    Statically combine two values of type result_type using *.
    Definition accumulate_static.hh:68
    \n-
    Definition accumulate_static.hh:71
    \n-
    static const result_type result
    Definition accumulate_static.hh:72
    \n-
    Statically combine two values of type result_type by returning their minimum.
    Definition accumulate_static.hh:79
    \n-
    Definition accumulate_static.hh:82
    \n-
    static const result_type result
    Definition accumulate_static.hh:83
    \n-
    Statically combine two values of type result_type by returning their maximum.
    Definition accumulate_static.hh:90
    \n-
    Definition accumulate_static.hh:93
    \n-
    static const result_type result
    Definition accumulate_static.hh:94
    \n-
    Statically accumulate a value over the nodes of a TypeTree.
    Definition accumulate_static.hh:259
    \n-
    Functor::result_type result_type
    The result type of the computation.
    Definition accumulate_static.hh:262
    \n-
    static const result_type result
    The accumulated result of the computation.
    Definition accumulate_static.hh:265
    \n-
    Definition accumulate_static.hh:466
    \n-
    ParentChildReduction parent_child_reduction
    Definition accumulate_static.hh:524
    \n-
    Functor functor
    Definition accumulate_static.hh:495
    \n-
    StartType start_type
    Definition accumulate_static.hh:532
    \n-
    ReductionAlgorithm reduction_strategy
    Definition accumulate_static.hh:538
    \n-
    Reduction sibling_reduction
    Definition accumulate_static.hh:516
    \n-
    Statically accumulate a type over the nodes of a TypeTree.
    Definition accumulate_static.hh:553
    \n-
    accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, NodeTag< Tree > >::type type
    The accumulated result of the computation.
    Definition accumulate_static.hh:562
    \n+
    void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
    Definition traversal.hh:162
    \n+
    decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u))) DynamicTraversalConcept
    Definition traversal.hh:41
    \n+
    decltype((std::integral_constant< std::size_t, Tree::degree()>{})) StaticTraversalConcept
    Definition traversal.hh:47
    \n+
    void applyToTree(T &&tree, TreePath treePath, V &&visitor)
    Definition traversal.hh:95
    \n+
    constexpr auto leafTreePathTuple(Prefix prefix)
    Definition traversal.hh:52
    \n+
    Type
    Definition treepath.hh:30
    \n+
    @ dynamic
    Definition treepath.hh:30
    \n
    A hybrid version of TreePath that supports both compile time and run time indices.
    Definition treepath.hh:79
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,591 +7,315 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-accumulate_static.hh\n+traversal.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH\n- 5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH\n+ 4#ifndef DUNE_TYPETREE_TRAVERSAL_HH\n+ 5#define DUNE_TYPETREE_TRAVERSAL_HH\n 6\n- 7#include \n- 8#include \n- 9#include \n- 10#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n 11\n- 12\n-13namespace Dune {\n-14 namespace TypeTree {\n- 15\n- 22 template\n-23 struct or_\n- 24 {\n- 25 template\n-26 struct reduce\n- 27 {\n-28 static const result_type result = r1 || r2;\n- 29 };\n- 30 };\n- 31\n- 33 template\n-34 struct and_\n- 35 {\n- 36 template\n-37 struct reduce\n- 38 {\n-39 static const result_type result = r1 && r2;\n- 40 };\n- 41 };\n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16\n+ 17namespace Dune {\n+ 18 namespace TypeTree {\n+ 19\n+ 25#ifndef DOXYGEN\n+ 27 struct NoOp\n+ 28 {\n+ 29 template\n+ 30 constexpr void operator()(T&&...) const { /* do nothing */ }\n+ 31 };\n+ 32#endif\n+ 33\n+ 34 namespace Detail {\n+ 35\n+ 36 // SFINAE template check that Tree has a degree() function and a child()\n+function accepting integer indices\n+ 37 template\n+38 using DynamicTraversalConcept = decltype((\n+ 39 std::declval().degree(),\n+ 40 std::declval().child(0u)\n+ 41 ));\n 42\n- 44 template\n-45 struct plus\n- 46 {\n- 47 template\n-48 struct reduce\n- 49 {\n-50 static const result_type result = r1 + r2;\n- 51 };\n- 52 };\n- 53\n- 55 template\n-56 struct minus\n- 57 {\n- 58 template\n-59 struct reduce\n- 60 {\n-61 static const result_type result = r1 - r2;\n- 62 };\n- 63 };\n- 64\n- 66 template\n-67 struct multiply\n- 68 {\n- 69 template\n-70 struct reduce\n+ 43 // SFINAE template check that Tree has static (constexpr) function Tree::\n+degree()\n+ 44 template\n+45 using StaticTraversalConcept = decltype((\n+ 46 std::integral_constant{}\n+ 47 ));\n+ 48\n+ 49\n+ 50 template = 0>\n+52 constexpr auto leafTreePathTuple(Prefix prefix)\n+ 53 {\n+ 54 return std::make_tuple(prefix);\n+ 55 }\n+ 56\n+ 57 template = 0>\n+ 59 constexpr auto leafTreePathTuple(Prefix prefix);\n+ 60\n+ 61 template = 0>\n+63 constexpr auto leafTreePathTuple(Prefix prefix, std::\n+index_sequence)\n+ 64 {\n+ 65 return std::tuple_cat(Detail::leafTreePathTuple, pathType>(Dune::TypeTree::push_back(prefix, Dune::\n+index_constant{}))...);\n+ 66 }\n+ 67\n+ 68 template = 0>\n+ 70 constexpr auto leafTreePathTuple(Prefix prefix, std::\n+index_sequence)\n 71 {\n-72 static const result_type result = r1 * r2;\n- 73 };\n- 74 };\n- 75\n- 77 template\n-78 struct min\n- 79 {\n- 80 template\n-81 struct reduce\n- 82 {\n-83 static const result_type result = r1 < r2 ? r1 : r2;\n- 84 };\n- 85 };\n- 86\n- 88 template\n-89 struct max\n- 90 {\n- 91 template\n-92 struct reduce\n- 93 {\n-94 static const result_type result = r1 > r2 ? r1 : r2;\n- 95 };\n- 96 };\n- 97\n- 98\n- 99 namespace {\n- 100\n- 101 // implementation of the traversal algorithm\n- 102\n- 104 template\n- 105 struct accumulate_node_helper\n+ 72 return std::tuple_cat(Detail::leafTreePathTuple, pathType>(Dune::TypeTree::push_back(prefix, indices))...);\n+ 73 }\n+ 74\n+ 75 template>\n+ 77 constexpr auto leafTreePathTuple(Prefix prefix)\n+ 78 {\n+ 79 return Detail::leafTreePathTuple(prefix, std::\n+make_index_sequence{});\n+ 80 }\n+ 81\n+ 82 /* The signature is the same as for the public applyToTree\n+ 83 * function in Dune::Typetree, despite the additionally passed\n+ 84 * treePath argument. The path passed here is associated to\n+ 85 * the tree and the relative paths of the children (wrt. to tree)\n+ 86 * are appended to this. Hence the behavior of the public function\n+ 87 * is resembled by passing an empty treePath.\n+ 88 */\n+ 89\n+ 90 /*\n+ 91 * This is the overload for leaf traversal\n+ 92 */\n+ 93 template::isLeaf, int> = 0>\n+95 void applyToTree(T&& tree, TreePath treePath, V&& visitor)\n+ 96 {\n+ 97 visitor.leaf(tree, treePath);\n+ 98 }\n+ 99\n+ 100 /*\n+ 101 * This is the general overload doing child traversal.\n+ 102 */\n+ 103 template::isLeaf, int> = 0>\n+ 105 void applyToTree(T&& tree, TreePath treePath, V&& visitor)\n 106 {\n- 107\n- 108 typedef typename Functor::result_type result_type;\n- 109\n-110 static const result_type result = current_value;\n- 111\n- 112 };\n- 113\n- 115 template\n- 116 struct\n-accumulate_node_helper\n- 117 {\n- 118\n- 119 typedef typename Functor::result_type result_type;\n+ 107 using Tree = std::remove_reference_t;\n+ 108 using Visitor = std::remove_reference_t;\n+ 109 visitor.pre(tree, treePath);\n+ 110\n+ 111 // check which type of traversal is supported by the tree\n+ 112 using allowDynamicTraversal = Dune::Std::\n+is_detected;\n+ 113 using allowStaticTraversal = Dune::Std::\n+is_detected;\n+ 114\n+ 115 // the tree must support either dynamic or static traversal\n+ 116 static_assert(allowDynamicTraversal::value || allowStaticTraversal::\n+value);\n+ 117\n+ 118 // the visitor may specify preferred dynamic traversal\n+ 119 using preferDynamicTraversal = std::bool_constant;\n 120\n- 121 static const result_type result = Reduction::template\n-reduce::result>::result;\n- 122\n- 123 };\n- 124\n- 126 template\n- 127 struct accumulate_value;\n+ 121 // create a dynamic or static index range\n+ 122 auto indices = [&]{\n+ 123 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::\n+value)\n+ 124 return Dune::range(std::size_t(tree.degree()));\n+ 125 else\n+ 126 return Dune::range(tree.degree());\n+ 127 }();\n 128\n- 130 template\n- 131 struct\n-accumulate_value\n- 132 {\n+ 129 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value)\n+{\n+ 130 Hybrid::forEach(indices, [&](auto i) {\n+ 131 auto&& child = tree.child(i);\n+ 132 using Child = std::decay_t;\n 133\n- 134 typedef typename Functor::result_type result_type;\n+ 134 visitor.beforeChild(tree, child, treePath, i);\n 135\n- 136 static const result_type result =\n- 137\n- 138\n-accumulate_node_helper::value>::result;\n- 139\n- 140 };\n- 141\n- 143 template\n- 144 struct accumulate_over_children\n- 145 {\n+ 136 // This requires that visitor.in(...) can always be instantiated,\n+ 137 // even if there's a single child only.\n+ 138 if (i>0)\n+ 139 visitor.in(tree, treePath);\n+ 140\n+ 141 constexpr bool visitChild = Visitor::template\n+VisitChild::value;\n+ 142 if constexpr(visitChild) {\n+ 143 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n+ 144 applyToTree(child, childTreePath, visitor);\n+ 145 }\n 146\n- 147 typedef typename Functor::result_type result_type;\n- 148\n- 149 typedef decltype(push_back(TreePath{},index_constant{}))\n-child_tree_path;\n- 150\n- 151 typedef typename Node::template Child::Type child;\n+ 147 visitor.afterChild(tree, child, treePath, i);\n+ 148 });\n+ 149 }\n+ 150 visitor.post(tree, treePath);\n+ 151 }\n 152\n-153 static const result_type child_result =\n-accumulate_value>::\n-result;\n- 154\n- 155 static const result_type result =\n-accumulate_over_children::\n-result;\n- 156\n- 157 };\n- 158\n- 160 template\n- 161 struct\n-accumulate_over_children\n- 162 {\n- 163\n- 164 typedef typename Functor::result_type result_type;\n- 165\n- 166 static const result_type result = current_value;\n- 167\n- 168 };\n+ 153 /* Traverse tree and visit each node. The signature is the same\n+ 154 * as for the public forEachNode function in Dune::Typtree,\n+ 155 * despite the additionally passed treePath argument. The path\n+ 156 * passed here is associated to the tree and the relative\n+ 157 * paths of the children (wrt. to tree) are appended to this.\n+ 158 * Hence the behavior of the public function is resembled\n+ 159 * by passing an empty treePath.\n+ 160 */\n+ 161 template\n+162 void forEachNode(T&& tree, TreePath treePath, PreFunc&& preFunc, LeafFunc&&\n+leafFunc, PostFunc&& postFunc)\n+ 163 {\n+ 164 using Tree = std::decay_t;\n+ 165 if constexpr(Tree::isLeaf) {\n+ 166 leafFunc(tree, treePath);\n+ 167 } else {\n+ 168 preFunc(tree, treePath);\n 169\n- 172 template\n- 173 struct accumulate_value_generic_composite_node\n- 174 {\n- 175\n- 176 typedef typename Functor::result_type result_type;\n- 177\n- 178 static const result_type child_result =\n-accumulate_over_children::\n-value>::result;\n- 179\n- 180 static const result_type result =\n- 181\n-accumulate_node_helper::value>::result;\n- 182\n- 183\n- 184 };\n- 185\n- 187 template\n- 188 struct\n-accumulate_value\n- 189 : public\n-accumulate_value_generic_composite_node\n- 190 {};\n- 191\n- 193 template\n- 194 struct\n-accumulate_value\n- 195 : public\n-accumulate_value_generic_composite_node\n- 196 {};\n+ 170 // check which type of traversal is supported by the tree, prefer dynamic\n+traversal\n+ 171 using allowDynamicTraversal = Dune::Std::\n+is_detected;\n+ 172 using allowStaticTraversal = Dune::Std::\n+is_detected;\n+ 173\n+ 174 // the tree must support either dynamic or static traversal\n+ 175 static_assert(allowDynamicTraversal::value || allowStaticTraversal::\n+value);\n+ 176\n+ 177 if constexpr(allowDynamicTraversal::value) {\n+ 178 // Specialization for dynamic traversal\n+ 179 for (std::size_t i = 0; i < tree.degree(); ++i) {\n+ 180 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n+ 181 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);\n+ 182 }\n+ 183 } else if constexpr(allowStaticTraversal::value) {\n+ 184 // Specialization for static traversal\n+ 185 auto indices = std::make_index_sequence{};\n+ 186 Hybrid::forEach(indices, [&](auto i) {\n+ 187 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n+ 188 forEachNode(tree.child(i), childTreePath, preFunc, leafFunc, postFunc);\n+ 189 });\n+ 190 }\n+ 191 postFunc(tree, treePath);\n+ 192 }\n+ 193 }\n+ 194\n+ 195 } // namespace Detail\n+ 196\n 197\n- 198 } // anonymous namespace\n- 199\n+ 198 /\n+/\n+********************************************************************************\n+ 199 // Public Interface\n+ 200 /\n+/\n+********************************************************************************\n 201\n- 257 template\n-258 struct AccumulateValue\n- 259 {\n+ 215 template\n+216 constexpr auto leafTreePathTuple()\n+ 217 {\n+ 218 return Detail::leafTreePathTuple, pathType>\n+(hybridTreePath());\n+ 219 }\n+ 220\n+ 222\n+ 236 template\n+237 void applyToTree(Tree&& tree, Visitor&& visitor)\n+ 238 {\n+ 239 Detail::applyToTree(tree, hybridTreePath(), visitor);\n+ 240 }\n+ 241\n+ 255 template\n+256 [[deprecated]] void forEachNode(Tree&& tree, PreFunc&& preFunc, LeafFunc&&\n+leafFunc, PostFunc&& postFunc)\n+ 257 {\n+ 258 Detail::forEachNode(tree, hybridTreePath(), preFunc, leafFunc, postFunc);\n+ 259 }\n 260\n-262 typedef typename Functor::result_type result_type;\n- 263\n-265 static const result_type result =\n-accumulate_value,NodeTag>::\n-result;\n- 266\n- 267 };\n- 268\n- 271 struct flattened_reduction;\n- 272\n- 275 struct bottom_up_reduction;\n- 276\n- 277 namespace {\n+ 273 template\n+274 [[deprecated]] void forEachNode(Tree&& tree, InnerFunc&& innerFunc,\n+LeafFunc&& leafFunc)\n+ 275 {\n+ 276 Detail::forEachNode(tree, hybridTreePath(), innerFunc, leafFunc, NoOp{});\n+ 277 }\n 278\n- 279 // implementation of the traversal algorithm\n- 280\n- 283 template\n- 284 struct accumulate_type_node_helper\n- 285 {\n- 286\n- 287 typedef current_type type;\n- 288\n- 289 };\n- 290\n- 292 template\n- 293 struct\n-accumulate_type_node_helper\n- 294 {\n- 295\n- 296 typedef typename Reduction::template reduce<\n- 297 current_type,\n- 298 typename Functor::template visit<\n- 299 Node,\n- 300 TreePath\n- 301 >::type\n- 302 >::type type;\n- 303\n- 304 };\n- 305\n- 307 template\n- 308 struct accumulate_type;\n- 309\n- 311 template\n- 312 struct accumulate_type\n- 313 {\n- 314\n- 315 typedef typename accumulate_type_node_helper<\n- 316 LeafNode,\n- 317 typename Policy::functor,\n- 318 typename Policy::sibling_reduction,\n- 319 current_type,\n- 320 TreePath,\n- 321 Policy::functor::template doVisit<\n- 322 LeafNode,\n- 323 TreePath>::value\n- 324 >::type type;\n- 325\n- 326 };\n- 327\n- 328\n- 331 template\n- 332 struct propagate_type_down_tree;\n- 333\n- 335 template\n- 336 struct propagate_type_down_tree<\n- 337 current_type,\n- 338 tree_path,\n- 339 start_type,\n- 340 bottom_up_reduction\n- 341 >\n- 342 {\n- 343 typedef current_type type;\n- 344 };\n- 345\n- 347 template\n- 348 struct propagate_type_down_tree<\n- 349 current_type,\n- 350 tree_path,\n- 351 start_type,\n- 352 flattened_reduction\n- 353 >\n- 354 {\n- 355 typedef typename std::conditional<\n- 356 TreePathBack::value == 0,\n- 357 start_type,\n- 358 current_type\n- 359 >::type type;\n- 360 };\n- 361\n- 362\n- 364 template\n- 365 struct accumulate_type_over_children\n- 366 {\n- 367\n- 368 typedef decltype(push_back(TreePath{},index_constant{}))\n-child_tree_path;\n- 369\n- 370 typedef typename Node::template Child::Type child;\n- 371\n- 372 typedef typename accumulate_type<\n- 373 child,\n- 374 Policy,\n- 375 // apply reduction choice (flat / hierarchic)\n- 376 typename propagate_type_down_tree<\n- 377 current_type,\n- 378 child_tree_path,\n- 379 typename Policy::start_type,\n- 380 typename Policy::reduction_strategy\n- 381 >::type,\n- 382 child_tree_path,\n- 383 NodeTag\n- 384 >::type child_result_type;\n- 385\n- 386 typedef typename accumulate_type_over_children<\n- 387 Node,\n- 388 Policy,\n- 389 child_result_type,\n- 390 TreePath,\n- 391 i+1,\n- 392 n\n- 393 >::type type;\n- 394\n- 395 };\n- 396\n- 398 template\n- 399 struct\n-accumulate_type_over_children\n- 400 {\n- 401\n- 402 typedef current_type type;\n- 403\n- 404 };\n- 405\n- 406\n- 409 template\n- 410 struct accumulate_type_generic_composite_node\n- 411 {\n- 412\n- 413 typedef typename accumulate_type_over_children<\n- 414 Node,\n- 415 Policy,\n- 416 current_type,\n- 417 TreePath,\n- 418 0,\n- 419 StaticDegree::value\n- 420 >::type children_result_type;\n- 421\n- 422 typedef typename accumulate_type_node_helper<\n- 423 Node,\n- 424 typename Policy::functor,\n- 425 typename Policy::parent_child_reduction,\n- 426 children_result_type,\n- 427 TreePath,\n- 428 Policy::functor::template doVisit<\n- 429 Node,\n- 430 TreePath\n- 431 >::value\n- 432 >::type type;\n- 433\n- 434 };\n- 435\n- 437 template\n- 438 struct\n-accumulate_type\n- 439 : public\n-accumulate_type_generic_composite_node\n- 440 {};\n- 441\n- 443 template\n- 444 struct\n-accumulate_type\n- 445 : public\n-accumulate_type_generic_composite_node\n- 446 {};\n- 447\n- 448 } // anonymous namespace\n- 449\n- 450\n- 458 template<\n- 459 typename Functor,\n- 460 typename Reduction,\n- 461 typename StartType,\n- 462 typename ParentChildReduction = Reduction,\n- 463 typename ReductionAlgorithm = flattened_reduction\n- 464 >\n-465 struct TypeAccumulationPolicy\n- 466 {\n- 467\n-495 typedef Functor functor;\n- 496\n-516 typedef Reduction sibling_reduction;\n- 517\n-524 typedef ParentChildReduction parent_child_reduction;\n- 525\n-532 typedef StartType start_type;\n- 533\n-538 typedef ReductionAlgorithm reduction_strategy;\n- 539 };\n- 540\n- 541\n- 543\n- 551 template\n-552 struct AccumulateType\n- 553 {\n- 554\n- 556 typedef typename accumulate_type<\n- 557 Tree,\n- 558 Policy,\n- 559 typename Policy::start_type,\n- 560 HybridTreePath<>,\n- 561 NodeTag\n-562 >::type type;\n- 563\n- 564 };\n- 565\n- 566\n- 567\n- 568\n- 569\n- 570 /***************************************************/\n- 571\n-572 namespace Experimental {\n- 573 namespace Impl {\n- 574\n- 576 template::isLeaf, int> = 0>\n- 578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&&\n-current_val)\n- 579 {\n- 580 return visitor.leaf(tree, treePath, std::forward(current_val));\n- 581 }\n- 582\n- 584 template::isLeaf, int> = 0>\n- 586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&&\n-current_val)\n- 587 {\n- 588 using Tree = std::remove_reference_t;\n- 589 using Visitor = std::remove_reference_t;\n- 590 auto pre_val = visitor.pre(tree, treePath, std::forward(current_val));\n- 591\n- 592 // check which type of traversal is supported by the tree\n- 593 using allowDynamicTraversal = Dune::Std::is_detected;\n- 594 using allowStaticTraversal = Dune::Std::is_detected;\n- 595\n- 596 // the tree must support either dynamic or static traversal\n- 597 static_assert(allowDynamicTraversal::value || allowStaticTraversal::\n-value);\n- 598\n- 599 // the visitor may specify preferred dynamic traversal\n- 600 using preferDynamicTraversal = std::bool_constant;\n- 601\n- 602 // declare rule that applies visitor and current value to a child i.\n-Returns next value\n- 603 auto apply_i = [&](auto&& value, const auto& i){\n- 604 auto&& child = tree.child(i);\n- 605 using Child = std::decay_t;\n- 606\n- 607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move\n-(value));\n- 608\n- 609 // visits between children\n- 610 auto val_in = Hybrid::ifElse(\n- 611 Hybrid::equals(i,Indices::_0),\n- 612 [&](auto id){return std::move(val_before);},\n- 613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));}\n- 614 );\n- 615\n- 616 constexpr bool visitChild = Visitor::template\n-VisitChild::value;\n- 617 auto val_visit = [&](){\n- 618 if constexpr (visitChild) {\n- 619 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n- 620 return hybridApplyToTree(child, childTreePath, visitor, std::move\n-(val_in));\n- 621 }\n- 622 else\n- 623 return std::move(val_in);\n- 624 }();\n- 625\n- 626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit));\n- 627 };\n- 628\n- 629 // apply visitor to children\n- 630 auto in_val = [&](){\n- 631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal::\n-value) {\n- 632 // get list of static indices\n- 633 auto indices = std::make_index_sequence{};\n- 634\n- 635 // unfold apply_i left to right\n- 636 return unpackIntegerSequence([&](auto... i) {\n- 656 return left_fold(std::move(apply_i),std::move(pre_val), i...);\n- 657 }, indices);\n- 658\n- 659 } else {\n- 660 // unfold first child to get type\n- 661 auto i_val = apply_i(std::move(pre_val),std::size_t{0});\n- 662 // dynamically loop rest of the children to accumulate remindng values\n- 663 for(std::size_t i = 1; i < tree.degree(); i++)\n- 664 i_val = apply_i(i_val,i);\n- 665 return i_val;\n- 666 }\n- 667 }();\n- 668\n- 669 return visitor.post(tree, treePath, in_val);\n- 670 }\n- 671\n- 672 }\n- 673\n- 697 template\n-698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init)\n- 699 {\n- 700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init);\n- 701 }\n- 702\n- 703 } // namespace Experimental\n- 704\n- 706 } // namespace TypeTree\n- 707} //namespace Dune\n- 708\n- 709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH\n-nodeinterface.hh\n-child_result\n-static const result_type child_result\n-Definition accumulate_static.hh:153\n-result\n-static const result_type result\n-Definition accumulate_static.hh:110\n-treepath.hh\n+ 288 template\n+289 void forEachNode(Tree&& tree, NodeFunc&& nodeFunc)\n+ 290 {\n+ 291 Detail::forEachNode(tree, hybridTreePath(), nodeFunc, nodeFunc, NoOp{});\n+ 292 }\n+ 293\n+ 303 template\n+304 void forEachLeafNode(Tree&& tree, LeafFunc&& leafFunc)\n+ 305 {\n+ 306 Detail::forEachNode(tree, hybridTreePath(), NoOp{}, leafFunc, NoOp{});\n+ 307 }\n+ 308\n+ 310\n+ 311 } // namespace TypeTree\n+ 312} //namespace Dune\n+ 313\n+ 314#endif // DUNE_TYPETREE_TRAVERSAL_HH\n nodetags.hh\n+childextraction.hh\n+visitor.hh\n+treepath.hh\n+Dune::TypeTree::forEachNode\n+void forEachNode(Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc\n+&&postFunc)\n+Traverse tree and visit each node.\n+Definition traversal.hh:256\n+Dune::TypeTree::leafTreePathTuple\n+constexpr auto leafTreePathTuple()\n+Create tuple of tree paths to leafs.\n+Definition traversal.hh:216\n+Dune::TypeTree::forEachLeafNode\n+void forEachLeafNode(Tree &&tree, LeafFunc &&leafFunc)\n+Traverse tree and visit each leaf node.\n+Definition traversal.hh:304\n+Dune::TypeTree::applyToTree\n+void applyToTree(Tree &&tree, Visitor &&visitor)\n+Apply visitor to TypeTree.\n+Definition traversal.hh:237\n Dune::TypeTree::Child\n typename impl::_Child< Node, indices... >::type Child\n Template alias for the type of a child node given by a list of child indices.\n Definition childextraction.hh:223\n Dune::TypeTree::child\n ImplementationDefined child(Node &&node, Indices... indices)\n Extracts the child of a node given by a sequence of compile-time and run-time\n indices.\n Definition childextraction.hh:126\n-Dune::TypeTree::NodeTag\n-typename std::decay_t< Node >::NodeTag NodeTag\n-Returns the node tag of the given Node.\n-Definition nodeinterface.hh:76\n Dune::TypeTree::push_back\n constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath<\n T... > &tp, std::size_t i)\n Appends a run time index to a HybridTreePath.\n Definition treepath.hh:281\n Dune::TypeTree::hybridTreePath\n constexpr HybridTreePath< T... > hybridTreePath(const T &... t)\n@@ -602,106 +326,38 @@\n Constructs a new HybridTreePath from the given indices.\n Definition treepath.hh:191\n Dune::TypeTree::TreePath\n HybridTreePath< Dune::index_constant< i >... > TreePath\n Definition treepath.hh:521\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::or_\n-Statically combine two values of type result_type using ||.\n-Definition accumulate_static.hh:24\n-Dune::TypeTree::or_::reduce\n-Definition accumulate_static.hh:27\n-Dune::TypeTree::or_::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:28\n-Dune::TypeTree::and_\n-Statically combine two values of type result_type using &&.\n-Definition accumulate_static.hh:35\n-Dune::TypeTree::and_::reduce\n-Definition accumulate_static.hh:38\n-Dune::TypeTree::and_::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:39\n-Dune::TypeTree::plus\n-Statically combine two values of type result_type using +.\n-Definition accumulate_static.hh:46\n-Dune::TypeTree::plus::reduce\n-Definition accumulate_static.hh:49\n-Dune::TypeTree::plus::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:50\n-Dune::TypeTree::minus\n-Statically combine two values of type result_type using -.\n-Definition accumulate_static.hh:57\n-Dune::TypeTree::minus::reduce\n-Definition accumulate_static.hh:60\n-Dune::TypeTree::minus::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:61\n-Dune::TypeTree::multiply\n-Statically combine two values of type result_type using *.\n-Definition accumulate_static.hh:68\n-Dune::TypeTree::multiply::reduce\n-Definition accumulate_static.hh:71\n-Dune::TypeTree::multiply::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:72\n-Dune::TypeTree::min\n-Statically combine two values of type result_type by returning their minimum.\n-Definition accumulate_static.hh:79\n-Dune::TypeTree::min::reduce\n-Definition accumulate_static.hh:82\n-Dune::TypeTree::min::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:83\n-Dune::TypeTree::max\n-Statically combine two values of type result_type by returning their maximum.\n-Definition accumulate_static.hh:90\n-Dune::TypeTree::max::reduce\n-Definition accumulate_static.hh:93\n-Dune::TypeTree::max::reduce::result\n-static const result_type result\n-Definition accumulate_static.hh:94\n-Dune::TypeTree::AccumulateValue\n-Statically accumulate a value over the nodes of a TypeTree.\n-Definition accumulate_static.hh:259\n-Dune::TypeTree::AccumulateValue::result_type\n-Functor::result_type result_type\n-The result type of the computation.\n-Definition accumulate_static.hh:262\n-Dune::TypeTree::AccumulateValue::result\n-static const result_type result\n-The accumulated result of the computation.\n-Definition accumulate_static.hh:265\n-Dune::TypeTree::TypeAccumulationPolicy\n-Definition accumulate_static.hh:466\n-Dune::TypeTree::TypeAccumulationPolicy::parent_child_reduction\n-ParentChildReduction parent_child_reduction\n-Definition accumulate_static.hh:524\n-Dune::TypeTree::TypeAccumulationPolicy::functor\n-Functor functor\n-Definition accumulate_static.hh:495\n-Dune::TypeTree::TypeAccumulationPolicy::start_type\n-StartType start_type\n-Definition accumulate_static.hh:532\n-Dune::TypeTree::TypeAccumulationPolicy::reduction_strategy\n-ReductionAlgorithm reduction_strategy\n-Definition accumulate_static.hh:538\n-Dune::TypeTree::TypeAccumulationPolicy::sibling_reduction\n-Reduction sibling_reduction\n-Definition accumulate_static.hh:516\n-Dune::TypeTree::AccumulateType\n-Statically accumulate a type over the nodes of a TypeTree.\n-Definition accumulate_static.hh:553\n-Dune::TypeTree::AccumulateType::type\n-accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>,\n-NodeTag< Tree > >::type type\n-The accumulated result of the computation.\n-Definition accumulate_static.hh:562\n+Dune::TypeTree::Detail::forEachNode\n+void forEachNode(T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc\n+&&leafFunc, PostFunc &&postFunc)\n+Definition traversal.hh:162\n+Dune::TypeTree::Detail::DynamicTraversalConcept\n+decltype((std::declval< Tree >().degree(), std::declval< Tree >().child(0u)))\n+DynamicTraversalConcept\n+Definition traversal.hh:41\n+Dune::TypeTree::Detail::StaticTraversalConcept\n+decltype((std::integral_constant< std::size_t, Tree::degree()>{}))\n+StaticTraversalConcept\n+Definition traversal.hh:47\n+Dune::TypeTree::Detail::applyToTree\n+void applyToTree(T &&tree, TreePath treePath, V &&visitor)\n+Definition traversal.hh:95\n+Dune::TypeTree::Detail::leafTreePathTuple\n+constexpr auto leafTreePathTuple(Prefix prefix)\n+Definition traversal.hh:52\n+Dune::TypeTree::TreePathType::Type\n+Type\n+Definition treepath.hh:30\n+Dune::TypeTree::TreePathType::dynamic\n+@ dynamic\n+Definition treepath.hh:30\n Dune::TypeTree::HybridTreePath\n A hybrid version of TreePath that supports both compile time and run time\n indices.\n Definition treepath.hh:79\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00035.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: simpletransformationdescriptors.hh File Reference\n+dune-typetree: visitor.hh File Reference\n \n \n \n \n \n \n \n@@ -71,49 +71,109 @@\n \n
    \n \n
    \n \n-
    simpletransformationdescriptors.hh File Reference
    \n+Namespaces |\n+Functions |\n+Variables
    \n+
    visitor.hh File Reference
    \n \n
    \n-
    #include <array>
    \n-#include <memory>
    \n-#include <dune/typetree/nodeinterface.hh>
    \n-#include <dune/typetree/nodetags.hh>
    \n-#include <dune/common/exceptions.hh>
    \n+\n

    Go to the source code of this file.

    \n \n \n-\n+\n+\n \n-\n+\n+\n \n-\n+\n+\n \n-\n+\n+\n \n-\n+\n+\n \n-\n+\n+\n \n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    struct  Dune::TypeTree::SimpleLeafNodeTransformation< SourceNode, Transformation, TransformedNode >
    struct  Dune::TypeTree::DefaultVisitor
     Visitor interface and base class for TypeTree visitors. More...
     
    struct  Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >
    struct  Dune::TypeTree::DefaultPairVisitor
     Visitor interface and base class for visitors of pairs of TypeTrees. More...
     
    struct  Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
    struct  Dune::TypeTree::Experimental::DefaultHybridVisitor
     Hybrid visitor interface and base class for TypeTree hybrid visitors. More...
     
    struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >
    struct  Dune::TypeTree::VisitDirectChildren
     Mixin base class for visitors that only want to visit the direct children of a node. More...
     
    struct  Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
    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::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >
    struct  Dune::TypeTree::VisitTree
     Mixin base class for visitors that want to visit the complete tree. More...
     
    struct  Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC >
    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
     
    \n \n \n \n \n \n+\n+\n+\n+\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::Experimental
     
    namespace  Dune::TypeTree::Experimental::Info
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+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.
     
    \n+\n+\n+\n+\n+\n

    \n+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.
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,45 +6,108 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces\n-simpletransformationdescriptors.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Functions | Variables\n+visitor.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::TypeTree::SimpleLeafNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>\n+struct \u00a0Dune::TypeTree::DefaultVisitor\n+\u00a0 Visitor interface and base class for TypeTree visitors. More...\n \u00a0\n-struct \u00a0Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>\n+struct \u00a0Dune::TypeTree::DefaultPairVisitor\n+\u00a0 Visitor interface and base class for visitors of pairs of TypeTrees.\n+ More...\n \u00a0\n-struct \u00a0Dune::TypeTree::SimplePowerNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>::result<_TC_>\n+struct \u00a0Dune::TypeTree::Experimental::DefaultHybridVisitor\n+\u00a0 Hybrid visitor interface and base class for TypeTree hybrid visitors.\n+ More...\n \u00a0\n-struct \u00a0Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>\n+struct \u00a0Dune::TypeTree::VisitDirectChildren\n+\u00a0 Mixin base class for visitors that only want to visit the direct\n+ children of a node. More...\n \u00a0\n-struct \u00a0Dune::TypeTree::SimpleDynamicPowerNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>::result<_TC_>\n+struct \u00a0Dune::TypeTree::VisitDirectChildren::VisitChild<_Node1,_Child1,_Node2,\n+ Child2,_TreePath_>\n+\u00a0 Template struct for determining whether or not to visit a given child.\n+ More...\n \u00a0\n-struct \u00a0Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>\n+struct \u00a0Dune::TypeTree::VisitTree\n+\u00a0 Mixin base class for visitors that want to visit the complete tree.\n+ More...\n \u00a0\n-struct \u00a0Dune::TypeTree::SimpleCompositeNodeTransformation<_SourceNode,\n- Transformation,_TransformedNode_>::result<_TC_>\n+struct \u00a0Dune::TypeTree::VisitTree::VisitChild<_Node1,_Child1,_Node2,_Child2,\n+ TreePath_>\n+\u00a0 Template struct for determining whether or not to visit a given child.\n+ More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::StaticTraversal\n+\u00a0 Mixin base class for visitors that require a static TreePath during\n+ traversal. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::DynamicTraversal\n+\u00a0 Mixin base class for visitors that only need a dynamic TreePath during\n+ traversal. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::TreeVisitor\n+\u00a0 Convenience base class for visiting the entire tree. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::DirectChildrenVisitor\n+\u00a0 Convenience base class for visiting the direct children of a node.\n+ More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::TreePairVisitor\n+\u00a0 Convenience base class for visiting an entire tree pair. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::DirectChildrenPairVisitor\n+\u00a0 Convenience base class for visiting the direct children of a node\n+ pair. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::Experimental::Info::LeafCounterVisitor\n+\u00a0\n+struct \u00a0Dune::TypeTree::Experimental::Info::NodeCounterVisitor\n+\u00a0\n+struct \u00a0Dune::TypeTree::Experimental::Info::DepthVisitor\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n+namespace \u00a0Dune::TypeTree::Experimental\n+\u00a0\n+namespace \u00a0Dune::TypeTree::Experimental::Info\n+\u00a0\n+ Functions\n+template\n+ auto\u00a0Dune::TypeTree::Experimental::Info::depth (const Tree &tree)\n+\u00a0 The depth of the TypeTree.\n+\u00a0\n+template\n+constexpr auto\u00a0Dune::TypeTree::Experimental::Info::depth ()\n+\u00a0 The depth of the Tree.\n+\u00a0\n+template\n+ auto\u00a0Dune::TypeTree::Experimental::Info::nodeCount (const Tree\n+ &tree)\n+\u00a0 The total number of nodes in the Tree.\n+\u00a0\n+template\n+ auto\u00a0Dune::TypeTree::Experimental::Info::leafCount (const Tree\n+ &tree)\n+\u00a0 The number of leaf nodes in the Tree.\n+\u00a0\n+ Variables\n+template\n+constexpr bool\u00a0Dune::TypeTree::Experimental::Info::isDynamic = std::\n+ is_same()))>\n+ {}\n+\u00a0 true if any of the nodes in the tree only has dynamic degree.\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00035_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: simpletransformationdescriptors.hh Source File\n+dune-typetree: visitor.hh Source File\n \n \n \n \n \n \n \n@@ -74,207 +74,385 @@\n \n
    \n \n
    \n
    \n
    \n-
    simpletransformationdescriptors.hh
    \n+
    visitor.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
    \n-
    5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
    \n+
    4#ifndef DUNE_TYPETREE_VISITOR_HH
    \n+
    5#define DUNE_TYPETREE_VISITOR_HH
    \n
    6
    \n-
    7#include <array>
    \n-
    8#include <memory>
    \n+\n+\n
    9
    \n-\n-\n-
    12#include <dune/common/exceptions.hh>
    \n-
    13
    \n-
    14
    \n-
    15namespace Dune {
    \n-
    16 namespace TypeTree {
    \n-
    17
    \n-
    23 template<typename SourceNode, typename Transformation, typename TransformedNode>
    \n-
    \n-\n-
    25 {
    \n-
    26
    \n-
    27 static const bool recursive = false;
    \n-
    28
    \n-
    29 typedef TransformedNode transformed_type;
    \n-
    30 typedef std::shared_ptr<transformed_type> transformed_storage_type;
    \n-
    31
    \n-
    \n-
    32 static transformed_type transform(const SourceNode& s, const Transformation& t)
    \n-
    33 {
    \n-
    34 return transformed_type();
    \n-
    35 }
    \n-
    \n-
    36
    \n-
    \n-
    37 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
    \n-
    38 {
    \n-
    39 return std::make_shared<transformed_type>();
    \n-
    40 }
    \n-
    \n-
    41
    \n-
    42 };
    \n-
    \n-
    43
    \n-
    44
    \n-
    45 template<typename SourceNode, typename Transformation, template<typename Child, std::size_t> class TransformedNode>
    \n+
    10namespace Dune {
    \n+
    11 namespace TypeTree {
    \n+
    12
    \n+
    19
    \n
    \n-\n+\n
    47 {
    \n
    48
    \n-
    49 static const bool recursive = true;
    \n
    50
    \n-
    51 template<typename TC>
    \n-
    \n-
    52 struct result
    \n-
    53 {
    \n-
    54 typedef TransformedNode<TC, StaticDegree<SourceNode>::value> type;
    \n-
    55 typedef std::shared_ptr<type> storage_type;
    \n-
    56 static const std::size_t degree = StaticDegree<type>::value;
    \n-
    57 };
    \n-
    \n-
    58
    \n-
    59 template<typename TC>
    \n-
    \n-
    60 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
    \n-
    61 {
    \n-
    62 return typename result<TC>::type(children);
    \n-
    63 }
    \n-
    \n-
    64
    \n-
    65 template<typename TC>
    \n-
    \n-
    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)
    \n-
    67 {
    \n-
    68 return std::make_shared<typename result<TC>::type>(children);
    \n-
    69 }
    \n-
    \n-
    70
    \n-
    71 };
    \n-
    \n-
    72
    \n+
    57 template<typename T, typename TreePath>
    \n+
    58 void pre(T&&, TreePath) const {}
    \n+
    59
    \n+
    61
    \n+
    69 template<typename T, typename TreePath>
    \n+
    70 void in(T&&, TreePath) const {}
    \n+
    71
    \n
    73
    \n-
    74 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNode>
    \n-
    \n-\n-
    76 {
    \n-
    77
    \n-
    78 static const bool recursive = true;
    \n-
    79
    \n-
    80 template<typename TC>
    \n-
    \n-
    81 struct result
    \n-
    82 {
    \n-
    83 typedef TransformedNode<TC> type;
    \n-
    84 typedef std::shared_ptr<type> storage_type;
    \n-
    85 };
    \n-
    \n-
    86
    \n-
    87 template<typename TC>
    \n-
    \n-
    88 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
    \n-
    89 {
    \n-
    90 return typename result<TC>::type(children);
    \n-
    91 }
    \n-
    \n+
    80 template<typename T, typename TreePath>
    \n+
    81 void post(T&&, TreePath) const {}
    \n+
    82
    \n+
    84
    \n+
    90 template<typename T, typename TreePath>
    \n+
    91 void leaf(T&&, TreePath) const {}
    \n
    92
    \n-
    93 template<typename TC>
    \n-
    \n-
    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)
    \n-
    95 {
    \n-
    96 return std::make_shared<typename result<TC>::type>(children);
    \n-
    97 }
    \n-
    \n-
    98
    \n-
    99 };
    \n-
    \n-
    100
    \n-
    101
    \n-
    102 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNode>
    \n-
    \n-\n-
    104 {
    \n-
    105
    \n-
    106 static const bool recursive = true;
    \n-
    107
    \n-
    108 template<typename... TC>
    \n-
    \n-
    109 struct result
    \n-
    110 {
    \n-
    111 typedef TransformedNode<TC...> type;
    \n-
    112 typedef std::shared_ptr<type> storage_type;
    \n-
    113 };
    \n-
    \n-
    114
    \n-
    115 template<typename... TC>
    \n-
    \n-
    116 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
    \n-
    117 {
    \n-
    118 return typename result<TC...>::type(children...);
    \n-
    119 }
    \n-
    \n-
    120
    \n-
    121 template<typename... TC>
    \n-
    \n-
    122 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
    \n-
    123 {
    \n-
    124 return std::make_shared<typename result<TC...>::type>(children...);
    \n-
    125 }
    \n+
    94
    \n+
    104 template<typename T, typename Child, typename TreePath, typename ChildIndex>
    \n+
    105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}
    \n+
    106
    \n+
    108
    \n+
    119 template<typename T, typename Child, typename TreePath, typename ChildIndex>
    \n+
    120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}
    \n+
    121
    \n+
    122 };
    \n
    \n+
    123
    \n+
    124
    \n
    126
    \n-
    127 };
    \n-
    \n-
    128
    \n-
    130
    \n-
    131 } // namespace TypeTree
    \n-
    132} //namespace Dune
    \n-
    133
    \n-
    134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH
    \n-\n-\n-
    decltype(Node::degree()) StaticDegree
    Returns the statically known degree of the given Node type as a std::integral_constant.
    Definition nodeinterface.hh:113
    \n+
    \n+\n+
    162 {
    \n+
    163
    \n+
    165
    \n+
    173 template<typename T1, typename T2, typename TreePath>
    \n+
    174 void pre(T1&&, T2&&, TreePath) const {}
    \n+
    175
    \n+
    177
    \n+
    186 template<typename T1, typename T2, typename TreePath>
    \n+
    187 void in(T1&&, T2&&, TreePath) const {}
    \n+
    188
    \n+
    190
    \n+
    198 template<typename T1, typename T2, typename TreePath>
    \n+
    199 void post(T1&&, T2&&, TreePath) const {}
    \n+
    200
    \n+
    202
    \n+
    213 template<typename T1, typename T2, typename TreePath>
    \n+
    214 void leaf(T1&&, T2&&, TreePath) const {}
    \n+
    215
    \n+
    217
    \n+
    229 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
    \n+
    230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
    \n+
    231
    \n+
    233
    \n+
    245 template<typename T1, typename Child1, typename T2, typename Child2, typename TreePath, typename ChildIndex>
    \n+
    246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const {}
    \n+
    247
    \n+
    248 };
    \n+
    \n+
    249
    \n+
    250
    \n+
    251 namespace Experimental {
    \n+
    252
    \n+
    \n+\n+
    284 {
    \n+
    285
    \n+
    293 template<typename T, typename TreePath, typename U>
    \n+
    294 auto pre(T&&, TreePath, const U& u) const { return u;}
    \n+
    295
    \n+
    303 template<typename T, typename TreePath, typename U>
    \n+
    304 auto in(T&&, TreePath, const U& u) const {return u;}
    \n+
    305
    \n+
    313 template<typename T, typename TreePath, typename U>
    \n+
    314 auto post(T&&, TreePath, const U& u) const {return u;}
    \n+
    315
    \n+
    323 template<typename T, typename TreePath, typename U>
    \n+
    324 auto leaf(T&&, TreePath, const U& u) const { return u;}
    \n+
    325
    \n+
    333 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
    \n+
    334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
    \n+
    335
    \n+
    343 template<typename T, typename Child, typename TreePath, typename ChildIndex, typename U>
    \n+
    344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const {return u;}
    \n+
    345
    \n+
    346 };
    \n+
    \n+
    347 } // namespace Experimental
    \n+
    348
    \n+
    350
    \n+
    \n+\n+
    356 {
    \n+
    357
    \n+
    358 // the little trick with the default template arguments
    \n+
    359 // makes the class usable for both single-tree visitors
    \n+
    360 // and visitors for pairs of trees
    \n+
    362 template<typename Node1,
    \n+
    363 typename Child1,
    \n+
    364 typename Node2,
    \n+
    365 typename Child2 = void,
    \n+
    366 typename TreePath = void>
    \n+
    \n+\n+
    368 {
    \n+
    370 static const bool value = false;
    \n+
    371 };
    \n+
    \n+
    372
    \n+
    373 };
    \n+
    \n+
    374
    \n+
    375
    \n+
    377
    \n+
    \n+\n+
    382 {
    \n+
    383
    \n+
    384 // the little trick with the default template arguments
    \n+
    385 // makes the class usable for both single-tree visitors
    \n+
    386 // and visitors for pairs of trees
    \n+
    388 template<typename Node1,
    \n+
    389 typename Child1,
    \n+
    390 typename Node2,
    \n+
    391 typename Child2 = void,
    \n+
    392 typename TreePath = void>
    \n+
    \n+\n+
    394 {
    \n+
    396 static const bool value = true;
    \n+
    397 };
    \n+
    \n+
    398
    \n+
    399 };
    \n+
    \n+
    400
    \n+
    402
    \n+
    \n+\n+
    410 {
    \n+\n+
    413 };
    \n+
    \n+
    414
    \n+
    416
    \n+
    \n+\n+
    424 {
    \n+\n+
    427 };
    \n+
    \n+
    428
    \n+
    \n+\n+
    431 : public DefaultVisitor
    \n+
    432 , public VisitTree
    \n+
    433 {};
    \n+
    \n+
    434
    \n+
    \n+\n+
    437 : public DefaultVisitor
    \n+
    438 , public VisitDirectChildren
    \n+
    439 {};
    \n+
    \n+
    440
    \n+
    \n+\n+
    443 : public DefaultPairVisitor
    \n+
    444 , public VisitTree
    \n+
    445 {};
    \n+
    \n+
    446
    \n+
    \n+\n+
    449 : public DefaultPairVisitor
    \n+
    450 , public VisitDirectChildren
    \n+
    451 {};
    \n+
    \n+
    452
    \n+
    \n+
    453 namespace Experimental::Info {
    \n+
    454
    \n+
    \n+\n+
    456 : public DefaultHybridVisitor
    \n+
    457 , public StaticTraversal
    \n+
    458 , public VisitTree
    \n+
    459 {
    \n+
    460 template<class Tree, class Child, class TreePath, class ChildIndex, class U>
    \n+
    \n+
    461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const {
    \n+
    462 // in this case child index is an integral constant: forward u
    \n+
    463 return u;
    \n+
    464 }
    \n+
    \n+
    465
    \n+
    466 template<class Tree, class Child, class TreePath, class U>
    \n+
    \n+
    467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t /*childIndex*/, U u) const {
    \n+
    468 // in this case child index is a run-time index: cast accumulated u to std::size_t
    \n+
    469 return std::size_t{u};
    \n+
    470 }
    \n+
    \n+
    471
    \n+
    472 template<class Tree, class TreePath, class U>
    \n+
    \n+
    473 auto leaf(Tree&&, TreePath, U u) const
    \n+
    474 {
    \n+
    475 return Hybrid::plus(u,Dune::Indices::_1);
    \n+
    476 }
    \n+
    \n+
    477
    \n+
    478 };
    \n+
    \n+
    479
    \n+
    \n+\n+
    481 : public LeafCounterVisitor
    \n+
    482 {
    \n+
    483 template<typename Tree, typename TreePath, typename U>
    \n+
    \n+
    484 auto pre(Tree&&, TreePath, U u) const {
    \n+
    485 return Hybrid::plus(u,Indices::_1);
    \n+
    486 }
    \n+
    \n+
    487 };
    \n+
    \n+
    488
    \n+
    \n+\n+
    490 : public DefaultHybridVisitor
    \n+
    491 , public StaticTraversal
    \n+
    492 , public VisitTree
    \n+
    493 {
    \n+
    494 template<class Tree, class TreePath, class U>
    \n+
    \n+
    495 auto leaf(Tree&&, TreePath, U u) const
    \n+
    496 {
    \n+
    497 auto path_size = index_constant<treePathSize(TreePath{})>{};
    \n+
    498 auto depth = Hybrid::plus(path_size,Indices::_1);
    \n+
    499 return Hybrid::max(depth,u);
    \n+
    500 }
    \n+
    \n+
    501 };
    \n+
    \n+
    502
    \n+
    504 // result is alwayas an integral constant
    \n+
    505 template<typename Tree>
    \n+
    \n+
    506 auto depth(const Tree& tree)
    \n+
    507 {
    \n+
    508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0);
    \n+
    509 }
    \n+
    \n+
    510
    \n+
    512 // return types is std::integral_constant.
    \n+
    513 template<typename Tree>
    \n+
    \n+
    514 constexpr auto depth()
    \n+
    515 {
    \n+
    516 return decltype(hybridApplyToTree(std::declval<Tree>(),DepthVisitor{},Indices::_0)){};
    \n+
    517 }
    \n+
    \n+
    518
    \n+
    520 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
    \n+
    521 template<typename Tree>
    \n+
    \n+
    522 auto nodeCount(const Tree& tree)
    \n+
    523 {
    \n+
    524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0);
    \n+
    525 }
    \n+
    \n+
    526
    \n+
    528 // if Tree is dynamic, return type is std::size_t, otherwise std::integral_constant.
    \n+
    529 template<typename Tree>
    \n+
    \n+
    530 auto leafCount(const Tree& tree)
    \n+
    531 {
    \n+
    532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0);
    \n+
    533 }
    \n+
    \n+
    534
    \n+
    536 template<typename Tree>
    \n+
    537 constexpr bool isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{};
    \n+
    538
    \n+
    539 } // namespace Experimental::Info
    \n+
    \n+
    540
    \n+
    542
    \n+
    543 } // namespace TypeTree
    \n+
    544} //namespace Dune
    \n+
    545
    \n+
    546#endif // DUNE_TYPETREE_VISITOR_HH
    \n+\n+\n+
    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
    \n+
    constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
    Returns the size (number of components) of the given HybridTreePath.
    Definition treepath.hh:199
    \n
    Definition accumulate_static.hh:13
    \n-
    Definition simpletransformationdescriptors.hh:25
    \n-
    static transformed_type transform(const SourceNode &s, const Transformation &t)
    Definition simpletransformationdescriptors.hh:32
    \n-
    static const bool recursive
    Definition simpletransformationdescriptors.hh:27
    \n-
    std::shared_ptr< transformed_type > transformed_storage_type
    Definition simpletransformationdescriptors.hh:30
    \n-
    static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
    Definition simpletransformationdescriptors.hh:37
    \n-
    TransformedNode transformed_type
    Definition simpletransformationdescriptors.hh:29
    \n-
    Definition simpletransformationdescriptors.hh:47
    \n-
    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
    \n-
    static const bool recursive
    Definition simpletransformationdescriptors.hh:49
    \n-
    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
    \n-
    Definition simpletransformationdescriptors.hh:53
    \n-
    TransformedNode< TC, StaticDegree< SourceNode >::value > type
    Definition simpletransformationdescriptors.hh:54
    \n-
    static const std::size_t degree
    Definition simpletransformationdescriptors.hh:56
    \n-
    std::shared_ptr< type > storage_type
    Definition simpletransformationdescriptors.hh:55
    \n-
    Definition simpletransformationdescriptors.hh:76
    \n-
    static const bool recursive
    Definition simpletransformationdescriptors.hh:78
    \n-
    static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
    Definition simpletransformationdescriptors.hh:88
    \n-
    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
    \n-
    Definition simpletransformationdescriptors.hh:82
    \n-
    TransformedNode< TC > type
    Definition simpletransformationdescriptors.hh:83
    \n-
    std::shared_ptr< type > storage_type
    Definition simpletransformationdescriptors.hh:84
    \n-
    Definition simpletransformationdescriptors.hh:104
    \n-
    static const bool recursive
    Definition simpletransformationdescriptors.hh:106
    \n-
    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
    \n-
    static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
    Definition simpletransformationdescriptors.hh:116
    \n-
    Definition simpletransformationdescriptors.hh:110
    \n-
    std::shared_ptr< type > storage_type
    Definition simpletransformationdescriptors.hh:112
    \n-
    TransformedNode< TC... > type
    Definition simpletransformationdescriptors.hh:111
    \n+
    auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
    Apply hybrid visitor to TypeTree.
    Definition accumulate_static.hh:698
    \n+
    Type
    Definition treepath.hh:30
    \n+
    @ fullyStatic
    Definition treepath.hh:30
    \n+
    @ dynamic
    Definition treepath.hh:30
    \n+
    constexpr bool isDynamic
    true if any of the nodes in the tree only has dynamic degree.
    Definition visitor.hh:537
    \n+
    auto leafCount(const Tree &tree)
    The number of leaf nodes in the Tree.
    Definition visitor.hh:530
    \n+
    auto nodeCount(const Tree &tree)
    The total number of nodes in the Tree.
    Definition visitor.hh:522
    \n+
    constexpr auto depth()
    The depth of the Tree.
    Definition visitor.hh:514
    \n+
    A hybrid version of TreePath that supports both compile time and run time indices.
    Definition treepath.hh:79
    \n+
    Visitor interface and base class for TypeTree visitors.
    Definition visitor.hh:47
    \n+
    void in(T &&, TreePath) const
    Method for infix tree traversal.
    Definition visitor.hh:70
    \n+
    void afterChild(T &&, Child &&, TreePath, ChildIndex) const
    Method for child-parent traversal.
    Definition visitor.hh:120
    \n+
    void beforeChild(T &&, Child &&, TreePath, ChildIndex) const
    Method for parent-child traversal.
    Definition visitor.hh:105
    \n+
    void post(T &&, TreePath) const
    Method for postfix tree traversal.
    Definition visitor.hh:81
    \n+
    void leaf(T &&, TreePath) const
    Method for leaf traversal.
    Definition visitor.hh:91
    \n+
    void pre(T &&, TreePath) const
    Method for prefix tree traversal.
    Definition visitor.hh:58
    \n+
    Visitor interface and base class for visitors of pairs of TypeTrees.
    Definition visitor.hh:162
    \n+
    void leaf(T1 &&, T2 &&, TreePath) const
    Method for leaf traversal.
    Definition visitor.hh:214
    \n+
    void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
    Method for parent-child traversal.
    Definition visitor.hh:230
    \n+
    void pre(T1 &&, T2 &&, TreePath) const
    Method for prefix tree traversal.
    Definition visitor.hh:174
    \n+
    void post(T1 &&, T2 &&, TreePath) const
    Method for postfix traversal.
    Definition visitor.hh:199
    \n+
    void in(T1 &&, T2 &&, TreePath) const
    Method for infix tree traversal.
    Definition visitor.hh:187
    \n+
    void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
    Method for child-parent traversal.
    Definition visitor.hh:246
    \n+
    Hybrid visitor interface and base class for TypeTree hybrid visitors.
    Definition visitor.hh:284
    \n+
    auto post(T &&, TreePath, const U &u) const
    Method for postfix tree traversal.
    Definition visitor.hh:314
    \n+
    auto pre(T &&, TreePath, const U &u) const
    Method for prefix tree traversal.
    Definition visitor.hh:294
    \n+
    auto leaf(T &&, TreePath, const U &u) const
    Method for leaf traversal.
    Definition visitor.hh:324
    \n+
    auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
    Method for child-parent traversal.
    Definition visitor.hh:344
    \n+
    auto in(T &&, TreePath, const U &u) const
    Method for infix tree traversal.
    Definition visitor.hh:304
    \n+
    auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
    Method for parent-child traversal.
    Definition visitor.hh:334
    \n+
    Mixin base class for visitors that only want to visit the direct children of a node.
    Definition visitor.hh:356
    \n+
    Template struct for determining whether or not to visit a given child.
    Definition visitor.hh:368
    \n+
    static const bool value
    Do not visit any child.
    Definition visitor.hh:370
    \n+
    Mixin base class for visitors that want to visit the complete tree.
    Definition visitor.hh:382
    \n+
    Template struct for determining whether or not to visit a given child.
    Definition visitor.hh:394
    \n+
    static const bool value
    Visit any child.
    Definition visitor.hh:396
    \n+
    Mixin base class for visitors that require a static TreePath during traversal.
    Definition visitor.hh:410
    \n+
    static const TreePathType::Type treePathType
    Use the static tree traversal algorithm.
    Definition visitor.hh:412
    \n+
    Mixin base class for visitors that only need a dynamic TreePath during traversal.
    Definition visitor.hh:424
    \n+
    static const TreePathType::Type treePathType
    Use the dynamic tree traversal algorithm.
    Definition visitor.hh:426
    \n+
    Convenience base class for visiting the entire tree.
    Definition visitor.hh:433
    \n+
    Convenience base class for visiting the direct children of a node.
    Definition visitor.hh:439
    \n+
    Convenience base class for visiting an entire tree pair.
    Definition visitor.hh:445
    \n+
    Convenience base class for visiting the direct children of a node pair.
    Definition visitor.hh:451
    \n+\n+
    auto leaf(Tree &&, TreePath, U u) const
    Definition visitor.hh:473
    \n+
    auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const
    Definition visitor.hh:461
    \n+
    std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const
    Definition visitor.hh:467
    \n+\n+
    auto pre(Tree &&, TreePath, U u) const
    Definition visitor.hh:484
    \n+\n+
    auto leaf(Tree &&, TreePath, U u) const
    Definition visitor.hh:495
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,251 +7,484 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-simpletransformationdescriptors.hh\n+visitor.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH\n- 5#define DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH\n+ 4#ifndef DUNE_TYPETREE_VISITOR_HH\n+ 5#define DUNE_TYPETREE_VISITOR_HH\n 6\n- 7#include \n- 8#include \n+ 7#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14\n- 15namespace Dune {\n- 16 namespace TypeTree {\n- 17\n- 23 template\n-24 struct SimpleLeafNodeTransformation\n- 25 {\n- 26\n-27 static const bool recursive = false;\n- 28\n-29 typedef TransformedNode transformed_type;\n-30 typedef std::shared_ptr transformed_storage_type;\n- 31\n-32 static transformed_type transform(const SourceNode& s, const Transformation&\n-t)\n- 33 {\n- 34 return transformed_type();\n- 35 }\n- 36\n-37 static transformed_storage_type transform_storage(std::shared_ptr s, const Transformation& t)\n- 38 {\n- 39 return std::make_shared();\n- 40 }\n- 41\n- 42 };\n- 43\n- 44\n- 45 template class TransformedNode>\n-46 struct SimplePowerNodeTransformation\n+ 10namespace Dune {\n+ 11 namespace TypeTree {\n+ 12\n+ 19\n+46 struct DefaultVisitor\n 47 {\n 48\n-49 static const bool recursive = true;\n 50\n- 51 template\n-52 struct result\n- 53 {\n-54 typedef TransformedNode::value> type;\n-55 typedef std::shared_ptr storage_type;\n-56 static const std::size_t degree = StaticDegree::value;\n- 57 };\n- 58\n- 59 template\n-60 static typename result::type transform(const SourceNode& s, const\n-Transformation& t, const std::array,result::degree>&\n-children)\n- 61 {\n- 62 return typename result::type(children);\n- 63 }\n- 64\n- 65 template\n-66 static typename result::storage_type transform_storage(std::\n-shared_ptr s, const Transformation& t, const std::array,result::degree>& children)\n- 67 {\n- 68 return std::make_shared::type>(children);\n- 69 }\n- 70\n- 71 };\n- 72\n+ 57 template\n+58 void pre(T&&, TreePath) const {}\n+ 59\n+ 61\n+ 69 template\n+70 void in(T&&, TreePath) const {}\n+ 71\n 73\n- 74 template class TransformedNode>\n-75 struct SimpleDynamicPowerNodeTransformation\n- 76 {\n- 77\n-78 static const bool recursive = true;\n- 79\n- 80 template\n-81 struct result\n- 82 {\n-83 typedef TransformedNode type;\n-84 typedef std::shared_ptr storage_type;\n- 85 };\n- 86\n- 87 template\n-88 static typename result::type transform(const SourceNode& s, const\n-Transformation& t, const std::vector>& children)\n- 89 {\n- 90 return typename result::type(children);\n- 91 }\n+ 80 template\n+81 void post(T&&, TreePath) const {}\n+ 82\n+ 84\n+ 90 template\n+91 void leaf(T&&, TreePath) const {}\n 92\n- 93 template\n-94 static typename result::storage_type transform_storage(std::\n-shared_ptr s, const Transformation& t, const std::\n-vector>& children)\n- 95 {\n- 96 return std::make_shared::type>(children);\n- 97 }\n- 98\n- 99 };\n- 100\n- 101\n- 102 template class TransformedNode>\n-103 struct SimpleCompositeNodeTransformation\n- 104 {\n- 105\n-106 static const bool recursive = true;\n- 107\n- 108 template\n-109 struct result\n- 110 {\n-111 typedef TransformedNode type;\n-112 typedef std::shared_ptr storage_type;\n- 113 };\n- 114\n- 115 template\n-116 static typename result::type transform(const SourceNode& s, const\n-Transformation& t, std::shared_ptr... children)\n- 117 {\n- 118 return typename result::type(children...);\n- 119 }\n- 120\n- 121 template\n-122 static typename result::storage_type transform_storage(std::\n-shared_ptr s, const Transformation& t, std::shared_ptr...\n-children)\n- 123 {\n- 124 return std::make_shared::type>(children...);\n- 125 }\n+ 94\n+ 104 template\n+105 void beforeChild(T&&, Child&&, TreePath, ChildIndex) const {}\n+ 106\n+ 108\n+ 119 template\n+120 void afterChild(T&&, Child&&, TreePath, ChildIndex) const {}\n+ 121\n+ 122 };\n+ 123\n+ 124\n 126\n- 127 };\n- 128\n- 130\n- 131 } // namespace TypeTree\n- 132} //namespace Dune\n- 133\n- 134#endif // DUNE_TYPETREE_SIMPLETRANSFORMATIONDESCRIPTORS_HH\n-nodeinterface.hh\n-nodetags.hh\n-Dune::TypeTree::StaticDegree\n-decltype(Node::degree()) StaticDegree\n-Returns the statically known degree of the given Node type as a std::\n+161 struct DefaultPairVisitor\n+ 162 {\n+ 163\n+ 165\n+ 173 template\n+174 void pre(T1&&, T2&&, TreePath) const {}\n+ 175\n+ 177\n+ 186 template\n+187 void in(T1&&, T2&&, TreePath) const {}\n+ 188\n+ 190\n+ 198 template\n+199 void post(T1&&, T2&&, TreePath) const {}\n+ 200\n+ 202\n+ 213 template\n+214 void leaf(T1&&, T2&&, TreePath) const {}\n+ 215\n+ 217\n+ 229 template\n+230 void beforeChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex)\n+const {}\n+ 231\n+ 233\n+ 245 template\n+246 void afterChild(T1&&, Child1&&, T2&&, Child2&&, TreePath, ChildIndex) const\n+{}\n+ 247\n+ 248 };\n+ 249\n+ 250\n+ 251 namespace Experimental {\n+ 252\n+283 struct DefaultHybridVisitor\n+ 284 {\n+ 285\n+ 293 template\n+294 auto pre(T&&, TreePath, const U& u) const { return u;}\n+ 295\n+ 303 template\n+304 auto in(T&&, TreePath, const U& u) const {return u;}\n+ 305\n+ 313 template\n+314 auto post(T&&, TreePath, const U& u) const {return u;}\n+ 315\n+ 323 template\n+324 auto leaf(T&&, TreePath, const U& u) const { return u;}\n+ 325\n+ 333 template\n+334 auto beforeChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const\n+{return u;}\n+ 335\n+ 343 template\n+344 auto afterChild(T&&, Child&&, TreePath, ChildIndex, const U& u) const\n+{return u;}\n+ 345\n+ 346 };\n+ 347 } // namespace Experimental\n+ 348\n+ 350\n+355 struct VisitDirectChildren\n+ 356 {\n+ 357\n+ 358 // the little trick with the default template arguments\n+ 359 // makes the class usable for both single-tree visitors\n+ 360 // and visitors for pairs of trees\n+ 362 template\n+367 struct VisitChild\n+ 368 {\n+370 static const bool value = false;\n+ 371 };\n+ 372\n+ 373 };\n+ 374\n+ 375\n+ 377\n+381 struct VisitTree\n+ 382 {\n+ 383\n+ 384 // the little trick with the default template arguments\n+ 385 // makes the class usable for both single-tree visitors\n+ 386 // and visitors for pairs of trees\n+ 388 template\n+393 struct VisitChild\n+ 394 {\n+396 static const bool value = true;\n+ 397 };\n+ 398\n+ 399 };\n+ 400\n+ 402\n+409 struct StaticTraversal\n+ 410 {\n+412 static const TreePathType::Type treePathType = TreePathType::fullyStatic;\n+ 413 };\n+ 414\n+ 416\n+423 struct DynamicTraversal\n+ 424 {\n+426 static const TreePathType::Type treePathType = TreePathType::dynamic;\n+ 427 };\n+ 428\n+430 struct TreeVisitor\n+ 431 : public DefaultVisitor\n+ 432 , public VisitTree\n+ 433 {};\n+ 434\n+436 struct DirectChildrenVisitor\n+ 437 : public DefaultVisitor\n+ 438 , public VisitDirectChildren\n+ 439 {};\n+ 440\n+442 struct TreePairVisitor\n+ 443 : public DefaultPairVisitor\n+ 444 , public VisitTree\n+ 445 {};\n+ 446\n+448 struct DirectChildrenPairVisitor\n+ 449 : public DefaultPairVisitor\n+ 450 , public VisitDirectChildren\n+ 451 {};\n+ 452\n+453 namespace Experimental::Info {\n+ 454\n+455 struct LeafCounterVisitor\n+ 456 : public DefaultHybridVisitor\n+ 457 , public StaticTraversal\n+ 458 , public VisitTree\n+ 459 {\n+ 460 template\n+461 auto beforeChild(Tree&&, Child&&, TreePath, ChildIndex, U u) const {\n+ 462 // in this case child index is an integral constant: forward u\n+ 463 return u;\n+ 464 }\n+ 465\n+ 466 template\n+467 std::size_t beforeChild(Tree&&, Child&&, TreePath, std::size_t /\n+*childIndex*/, U u) const {\n+ 468 // in this case child index is a run-time index: cast accumulated u to\n+std::size_t\n+ 469 return std::size_t{u};\n+ 470 }\n+ 471\n+ 472 template\n+473 auto leaf(Tree&&, TreePath, U u) const\n+ 474 {\n+ 475 return Hybrid::plus(u,Dune::Indices::_1);\n+ 476 }\n+ 477\n+ 478 };\n+ 479\n+480 struct NodeCounterVisitor\n+ 481 : public LeafCounterVisitor\n+ 482 {\n+ 483 template\n+484 auto pre(Tree&&, TreePath, U u) const {\n+ 485 return Hybrid::plus(u,Indices::_1);\n+ 486 }\n+ 487 };\n+ 488\n+489 struct DepthVisitor\n+ 490 : public DefaultHybridVisitor\n+ 491 , public StaticTraversal\n+ 492 , public VisitTree\n+ 493 {\n+ 494 template\n+495 auto leaf(Tree&&, TreePath, U u) const\n+ 496 {\n+ 497 auto path_size = index_constant{};\n+ 498 auto depth = Hybrid::plus(path_size,Indices::_1);\n+ 499 return Hybrid::max(depth,u);\n+ 500 }\n+ 501 };\n+ 502\n+ 504 // result is alwayas an integral constant\n+ 505 template\n+506 auto depth(const Tree& tree)\n+ 507 {\n+ 508 return hybridApplyToTree(tree,DepthVisitor{},Indices::_0);\n+ 509 }\n+ 510\n+ 512 // return types is std::integral_constant.\n+ 513 template\n+514 constexpr auto depth()\n+ 515 {\n+ 516 return decltype(hybridApplyToTree(std::declval(),DepthVisitor\n+{},Indices::_0)){};\n+ 517 }\n+ 518\n+ 520 // if Tree is dynamic, return type is std::size_t, otherwise std::\n integral_constant.\n-Definition nodeinterface.hh:113\n+ 521 template\n+522 auto nodeCount(const Tree& tree)\n+ 523 {\n+ 524 return hybridApplyToTree(tree,NodeCounterVisitor{},Indices::_0);\n+ 525 }\n+ 526\n+ 528 // if Tree is dynamic, return type is std::size_t, otherwise std::\n+integral_constant.\n+ 529 template\n+530 auto leafCount(const Tree& tree)\n+ 531 {\n+ 532 return hybridApplyToTree(tree,LeafCounterVisitor{},Dune::Indices::_0);\n+ 533 }\n+ 534\n+ 536 template\n+537 constexpr bool isDynamic = std::is_same()))>{};\n+ 538\n+ 539 } // namespace Experimental::Info\n+ 540\n+ 542\n+ 543 } // namespace TypeTree\n+ 544} //namespace Dune\n+ 545\n+ 546#endif // DUNE_TYPETREE_VISITOR_HH\n+utility.hh\n+treepath.hh\n+Dune::TypeTree::Child\n+typename impl::_Child< Node, indices... >::type Child\n+Template alias for the type of a child node given by a list of child indices.\n+Definition childextraction.hh:223\n+Dune::TypeTree::treePathSize\n+constexpr std::size_t treePathSize(const HybridTreePath< T... > &)\n+Returns the size (number of components) of the given HybridTreePath.\n+Definition treepath.hh:199\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::SimpleLeafNodeTransformation\n-Definition simpletransformationdescriptors.hh:25\n-Dune::TypeTree::SimpleLeafNodeTransformation::transform\n-static transformed_type transform(const SourceNode &s, const Transformation &t)\n-Definition simpletransformationdescriptors.hh:32\n-Dune::TypeTree::SimpleLeafNodeTransformation::recursive\n-static const bool recursive\n-Definition simpletransformationdescriptors.hh:27\n-Dune::TypeTree::SimpleLeafNodeTransformation::transformed_storage_type\n-std::shared_ptr< transformed_type > transformed_storage_type\n-Definition simpletransformationdescriptors.hh:30\n-Dune::TypeTree::SimpleLeafNodeTransformation::transform_storage\n-static transformed_storage_type transform_storage(std::shared_ptr< const\n-SourceNode > s, const Transformation &t)\n-Definition simpletransformationdescriptors.hh:37\n-Dune::TypeTree::SimpleLeafNodeTransformation::transformed_type\n-TransformedNode transformed_type\n-Definition simpletransformationdescriptors.hh:29\n-Dune::TypeTree::SimplePowerNodeTransformation\n-Definition simpletransformationdescriptors.hh:47\n-Dune::TypeTree::SimplePowerNodeTransformation::transform_storage\n-static result< TC >::storage_type transform_storage(std::shared_ptr< const\n-SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC\n->, result< TC >::degree > &children)\n-Definition simpletransformationdescriptors.hh:66\n-Dune::TypeTree::SimplePowerNodeTransformation::recursive\n-static const bool recursive\n-Definition simpletransformationdescriptors.hh:49\n-Dune::TypeTree::SimplePowerNodeTransformation::transform\n-static result< TC >::type transform(const SourceNode &s, const Transformation\n-&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)\n-Definition simpletransformationdescriptors.hh:60\n-Dune::TypeTree::SimplePowerNodeTransformation::result\n-Definition simpletransformationdescriptors.hh:53\n-Dune::TypeTree::SimplePowerNodeTransformation::result::type\n-TransformedNode< TC, StaticDegree< SourceNode >::value > type\n-Definition simpletransformationdescriptors.hh:54\n-Dune::TypeTree::SimplePowerNodeTransformation::result::degree\n-static const std::size_t degree\n-Definition simpletransformationdescriptors.hh:56\n-Dune::TypeTree::SimplePowerNodeTransformation::result::storage_type\n-std::shared_ptr< type > storage_type\n-Definition simpletransformationdescriptors.hh:55\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation\n-Definition simpletransformationdescriptors.hh:76\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation::recursive\n-static const bool recursive\n-Definition simpletransformationdescriptors.hh:78\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform\n-static result< TC >::type transform(const SourceNode &s, const Transformation\n-&t, const std::vector< std::shared_ptr< TC > > &children)\n-Definition simpletransformationdescriptors.hh:88\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation::transform_storage\n-static result< TC >::storage_type transform_storage(std::shared_ptr< const\n-SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC\n-> > &children)\n-Definition simpletransformationdescriptors.hh:94\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result\n-Definition simpletransformationdescriptors.hh:82\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::type\n-TransformedNode< TC > type\n-Definition simpletransformationdescriptors.hh:83\n-Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result::storage_type\n-std::shared_ptr< type > storage_type\n-Definition simpletransformationdescriptors.hh:84\n-Dune::TypeTree::SimpleCompositeNodeTransformation\n-Definition simpletransformationdescriptors.hh:104\n-Dune::TypeTree::SimpleCompositeNodeTransformation::recursive\n-static const bool recursive\n-Definition simpletransformationdescriptors.hh:106\n-Dune::TypeTree::SimpleCompositeNodeTransformation::transform_storage\n-static result< TC... >::storage_type transform_storage(std::shared_ptr< const\n-SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)\n-Definition simpletransformationdescriptors.hh:122\n-Dune::TypeTree::SimpleCompositeNodeTransformation::transform\n-static result< TC... >::type transform(const SourceNode &s, const\n-Transformation &t, std::shared_ptr< TC >... children)\n-Definition simpletransformationdescriptors.hh:116\n-Dune::TypeTree::SimpleCompositeNodeTransformation::result\n-Definition simpletransformationdescriptors.hh:110\n-Dune::TypeTree::SimpleCompositeNodeTransformation::result::storage_type\n-std::shared_ptr< type > storage_type\n-Definition simpletransformationdescriptors.hh:112\n-Dune::TypeTree::SimpleCompositeNodeTransformation::result::type\n-TransformedNode< TC... > type\n-Definition simpletransformationdescriptors.hh:111\n+Dune::TypeTree::Experimental::hybridApplyToTree\n+auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)\n+Apply hybrid visitor to TypeTree.\n+Definition accumulate_static.hh:698\n+Dune::TypeTree::TreePathType::Type\n+Type\n+Definition treepath.hh:30\n+Dune::TypeTree::TreePathType::fullyStatic\n+@ fullyStatic\n+Definition treepath.hh:30\n+Dune::TypeTree::TreePathType::dynamic\n+@ dynamic\n+Definition treepath.hh:30\n+Dune::TypeTree::Experimental::Info::isDynamic\n+constexpr bool isDynamic\n+true if any of the nodes in the tree only has dynamic degree.\n+Definition visitor.hh:537\n+Dune::TypeTree::Experimental::Info::leafCount\n+auto leafCount(const Tree &tree)\n+The number of leaf nodes in the Tree.\n+Definition visitor.hh:530\n+Dune::TypeTree::Experimental::Info::nodeCount\n+auto nodeCount(const Tree &tree)\n+The total number of nodes in the Tree.\n+Definition visitor.hh:522\n+Dune::TypeTree::Experimental::Info::depth\n+constexpr auto depth()\n+The depth of the Tree.\n+Definition visitor.hh:514\n+Dune::TypeTree::HybridTreePath\n+A hybrid version of TreePath that supports both compile time and run time\n+indices.\n+Definition treepath.hh:79\n+Dune::TypeTree::DefaultVisitor\n+Visitor interface and base class for TypeTree visitors.\n+Definition visitor.hh:47\n+Dune::TypeTree::DefaultVisitor::in\n+void in(T &&, TreePath) const\n+Method for infix tree traversal.\n+Definition visitor.hh:70\n+Dune::TypeTree::DefaultVisitor::afterChild\n+void afterChild(T &&, Child &&, TreePath, ChildIndex) const\n+Method for child-parent traversal.\n+Definition visitor.hh:120\n+Dune::TypeTree::DefaultVisitor::beforeChild\n+void beforeChild(T &&, Child &&, TreePath, ChildIndex) const\n+Method for parent-child traversal.\n+Definition visitor.hh:105\n+Dune::TypeTree::DefaultVisitor::post\n+void post(T &&, TreePath) const\n+Method for postfix tree traversal.\n+Definition visitor.hh:81\n+Dune::TypeTree::DefaultVisitor::leaf\n+void leaf(T &&, TreePath) const\n+Method for leaf traversal.\n+Definition visitor.hh:91\n+Dune::TypeTree::DefaultVisitor::pre\n+void pre(T &&, TreePath) const\n+Method for prefix tree traversal.\n+Definition visitor.hh:58\n+Dune::TypeTree::DefaultPairVisitor\n+Visitor interface and base class for visitors of pairs of TypeTrees.\n+Definition visitor.hh:162\n+Dune::TypeTree::DefaultPairVisitor::leaf\n+void leaf(T1 &&, T2 &&, TreePath) const\n+Method for leaf traversal.\n+Definition visitor.hh:214\n+Dune::TypeTree::DefaultPairVisitor::beforeChild\n+void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex)\n+const\n+Method for parent-child traversal.\n+Definition visitor.hh:230\n+Dune::TypeTree::DefaultPairVisitor::pre\n+void pre(T1 &&, T2 &&, TreePath) const\n+Method for prefix tree traversal.\n+Definition visitor.hh:174\n+Dune::TypeTree::DefaultPairVisitor::post\n+void post(T1 &&, T2 &&, TreePath) const\n+Method for postfix traversal.\n+Definition visitor.hh:199\n+Dune::TypeTree::DefaultPairVisitor::in\n+void in(T1 &&, T2 &&, TreePath) const\n+Method for infix tree traversal.\n+Definition visitor.hh:187\n+Dune::TypeTree::DefaultPairVisitor::afterChild\n+void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const\n+Method for child-parent traversal.\n+Definition visitor.hh:246\n+Dune::TypeTree::Experimental::DefaultHybridVisitor\n+Hybrid visitor interface and base class for TypeTree hybrid visitors.\n+Definition visitor.hh:284\n+Dune::TypeTree::Experimental::DefaultHybridVisitor::post\n+auto post(T &&, TreePath, const U &u) const\n+Method for postfix tree traversal.\n+Definition visitor.hh:314\n+Dune::TypeTree::Experimental::DefaultHybridVisitor::pre\n+auto pre(T &&, TreePath, const U &u) const\n+Method for prefix tree traversal.\n+Definition visitor.hh:294\n+Dune::TypeTree::Experimental::DefaultHybridVisitor::leaf\n+auto leaf(T &&, TreePath, const U &u) const\n+Method for leaf traversal.\n+Definition visitor.hh:324\n+Dune::TypeTree::Experimental::DefaultHybridVisitor::afterChild\n+auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const\n+Method for child-parent traversal.\n+Definition visitor.hh:344\n+Dune::TypeTree::Experimental::DefaultHybridVisitor::in\n+auto in(T &&, TreePath, const U &u) const\n+Method for infix tree traversal.\n+Definition visitor.hh:304\n+Dune::TypeTree::Experimental::DefaultHybridVisitor::beforeChild\n+auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const\n+Method for parent-child traversal.\n+Definition visitor.hh:334\n+Dune::TypeTree::VisitDirectChildren\n+Mixin base class for visitors that only want to visit the direct children of a\n+node.\n+Definition visitor.hh:356\n+Dune::TypeTree::VisitDirectChildren::VisitChild\n+Template struct for determining whether or not to visit a given child.\n+Definition visitor.hh:368\n+Dune::TypeTree::VisitDirectChildren::VisitChild::value\n+static const bool value\n+Do not visit any child.\n+Definition visitor.hh:370\n+Dune::TypeTree::VisitTree\n+Mixin base class for visitors that want to visit the complete tree.\n+Definition visitor.hh:382\n+Dune::TypeTree::VisitTree::VisitChild\n+Template struct for determining whether or not to visit a given child.\n+Definition visitor.hh:394\n+Dune::TypeTree::VisitTree::VisitChild::value\n+static const bool value\n+Visit any child.\n+Definition visitor.hh:396\n+Dune::TypeTree::StaticTraversal\n+Mixin base class for visitors that require a static TreePath during traversal.\n+Definition visitor.hh:410\n+Dune::TypeTree::StaticTraversal::treePathType\n+static const TreePathType::Type treePathType\n+Use the static tree traversal algorithm.\n+Definition visitor.hh:412\n+Dune::TypeTree::DynamicTraversal\n+Mixin base class for visitors that only need a dynamic TreePath during\n+traversal.\n+Definition visitor.hh:424\n+Dune::TypeTree::DynamicTraversal::treePathType\n+static const TreePathType::Type treePathType\n+Use the dynamic tree traversal algorithm.\n+Definition visitor.hh:426\n+Dune::TypeTree::TreeVisitor\n+Convenience base class for visiting the entire tree.\n+Definition visitor.hh:433\n+Dune::TypeTree::DirectChildrenVisitor\n+Convenience base class for visiting the direct children of a node.\n+Definition visitor.hh:439\n+Dune::TypeTree::TreePairVisitor\n+Convenience base class for visiting an entire tree pair.\n+Definition visitor.hh:445\n+Dune::TypeTree::DirectChildrenPairVisitor\n+Convenience base class for visiting the direct children of a node pair.\n+Definition visitor.hh:451\n+Dune::TypeTree::Experimental::Info::LeafCounterVisitor\n+Definition visitor.hh:459\n+Dune::TypeTree::Experimental::Info::LeafCounterVisitor::leaf\n+auto leaf(Tree &&, TreePath, U u) const\n+Definition visitor.hh:473\n+Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild\n+auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const\n+Definition visitor.hh:461\n+Dune::TypeTree::Experimental::Info::LeafCounterVisitor::beforeChild\n+std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const\n+Definition visitor.hh:467\n+Dune::TypeTree::Experimental::Info::NodeCounterVisitor\n+Definition visitor.hh:482\n+Dune::TypeTree::Experimental::Info::NodeCounterVisitor::pre\n+auto pre(Tree &&, TreePath, U u) const\n+Definition visitor.hh:484\n+Dune::TypeTree::Experimental::Info::DepthVisitor\n+Definition visitor.hh:493\n+Dune::TypeTree::Experimental::Info::DepthVisitor::leaf\n+auto leaf(Tree &&, TreePath, U u) const\n+Definition visitor.hh:495\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00038.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: powernode.hh File Reference\n+dune-typetree: filteredcompositenode.hh File Reference\n \n \n \n \n \n \n \n@@ -72,37 +72,35 @@\n
  • dune
  • typetree
  • \n \n \n
    \n \n-
    powernode.hh File Reference
    \n+
    filteredcompositenode.hh File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <array>
    \n-#include <memory>
    \n+
    #include <memory>
    \n+#include <tuple>
    \n #include <type_traits>
    \n+#include <dune/typetree/nodetags.hh>
    \n+#include <dune/typetree/filters.hh>
    \n+#include <dune/common/shared_ptr.hh>
    \n #include <dune/common/typetraits.hh>
    \n-#include <dune/common/std/type_traits.hh>
    \n-#include <dune/typetree/nodetags.hh>
    \n-#include <dune/typetree/utility.hh>
    \n-#include <dune/typetree/childextraction.hh>
    \n-#include <dune/typetree/typetraits.hh>
    \n+#include <dune/common/indices.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n

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

    Go to the source code of this file.

    \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-Classes

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

    \n-Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::TreePathType
     
    \n-\n-\n-\n-\n-\n-\n-\n-

    \n-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 >... >
     
    \n-\n-\n-\n-

    \n-Enumerations

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

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

    Go to the source code of this file.

    \n \n \n-\n+\n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n

    \n Classes

    struct  Dune::first_type< T0, T... >
    class  Dune::TypeTree::Detail::ContainerFactory< LeafToValue >
     
    struct  Dune::TypeTree::has_node_tag< T >
    class  Dune::TypeTree::Detail::TreeContainerVectorBackend< Container >
     
    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...
    struct  Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue >
     
    \n \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::impl
    namespace  Dune::TypeTree::Detail
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+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.
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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<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.
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,89 +6,64 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces | Functions\n-typetraits.hh File Reference\n+Classes | Namespaces | Typedefs | Functions\n+treecontainer.hh File Reference\n #include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::first_type<_T0,_T..._>\n+ class \u00a0Dune::TypeTree::Detail::ContainerFactory<_LeafToValue_>\n \u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag<_T_>\n+ class \u00a0Dune::TypeTree::Detail::TreeContainerVectorBackend<_Container_>\n \u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag<_T_>::yes\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag<_T_>::no\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>::maybe<_N_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>::yes\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_node_tag_value<_T,_V_>::no\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag<_T_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag<_T_>::yes\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag<_T_>::no\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>::maybe<_N_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>::yes\n-\u00a0\n-struct \u00a0Dune::TypeTree::has_implementation_tag_value<_T,_V_>::no\n-\u00a0\n-struct \u00a0Dune::TypeTree::AlwaysVoid<_typename_>\n-\u00a0\n-struct \u00a0Dune::TypeTree::meta_function\n-\u00a0 Marker tag declaring a meta function. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::lazy_evaluate<_F_>\n-\u00a0 Helper meta function to delay evaluation of F. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::lazy_identity<_F_>\n-\u00a0 Identity function. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::evaluate_if_meta_function<_F_>\n-\u00a0 Meta function that evaluates its argument iff it inherits from\n- meta_function. More...\n-\u00a0\n-struct \u00a0Dune::TypeTree::IsTreePath<_T_>\n-\u00a0 Check if type represents a tree path. More...\n+struct \u00a0Dune::TypeTree::Detail::LeafToDefaultConstructibleValue<_LeafToValue_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n-namespace \u00a0Dune::TypeTree::impl\n+namespace \u00a0Dune::TypeTree::Detail\n+\u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::TypeTree::UniformTreeContainer = std::decay_t< decltype\n+ (makeTreeContainer< Value >(std::declval< const Tree & >()))>\n+\u00a0 Alias to container type generated by makeTreeContainer for given tree\n+ type and uniform value type.\n+\u00a0\n+template class LeafToValue, class Tree >\n+using\u00a0Dune::TypeTree::TreeContainer = std::decay_t< decltype(makeTreeContainer\n+ (std::declval< const Tree & >(), std::declval< Detail::\n+ LeafToDefaultConstructibleValue< LeafToValue > >()))>\n+\u00a0 Alias to container type generated by makeTreeContainer for give tree\n+ type and when using LeafToValue to create values.\n \u00a0\n Functions\n-template\n- T *\u00a0Dune::TypeTree::declptr ()\n-\u00a0 Helper function for generating a pointer to a value of type T\n- in an unevaluated operand setting.\n-\u00a0\n-constexpr auto\u00a0Dune::TypeTree::impl::isTreePath (void *) -> std::false_type\n-\u00a0\n-template\n-constexpr auto\u00a0Dune::TypeTree::impl::isTreePath (const HybridTreePath< I... >\n- *) -> std::true_type\n-\u00a0\n-template\n-constexpr auto\u00a0Dune::TypeTree::isTreePath (const T &) -> IsTreePath< T >\n-\u00a0 Check if given object represents a tree path.\n+template\n+auto\u00a0Dune::TypeTree::Detail::makeTreeContainerVectorBackend (Container\n+ &&container)\n+\u00a0\n+template\n+auto\u00a0Dune::TypeTree::makeTreeContainer (const Tree &tree, LeafToValue\n+ &&leafToValue)\n+\u00a0 Create container havin the same structure as the given tree.\n+\u00a0\n+template\n+auto\u00a0Dune::TypeTree::makeTreeContainer (const Tree &tree)\n+\u00a0 Create container havin the same structure as the given tree.\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00044_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: typetraits.hh Source File\n+dune-typetree: treecontainer.hh Source File\n \n \n \n \n \n \n \n@@ -74,276 +74,331 @@\n \n
    \n \n
    \n \n
    \n-
    typetraits.hh
    \n+
    treecontainer.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_TYPETRAITS_HH
    \n-
    5#define DUNE_TYPETREE_TYPETRAITS_HH
    \n+
    4#ifndef DUNE_TYPETREE_TREECONTAINER_HH
    \n+
    5#define DUNE_TYPETREE_TREECONTAINER_HH
    \n
    6
    \n
    7#include <type_traits>
    \n-
    8#include <dune/common/typetraits.hh>
    \n-
    9
    \n-\n-\n-
    12
    \n-
    13namespace Dune {
    \n-
    14
    \n-
    15 // Provide some more C++11 TMP helpers.
    \n-
    16 // These should be upstreamed to dune-common ASAP.
    \n-
    17
    \n-
    18 template<typename... T>
    \n-
    19 struct first_type;
    \n-
    20
    \n-
    21 template<typename T0, typename... T>
    \n-
    \n-
    22 struct first_type<T0,T...>
    \n-
    23 {
    \n-
    24 typedef T0 type;
    \n-
    25 };
    \n-
    \n-
    26
    \n-
    27 namespace TypeTree {
    \n-
    28
    \n-
    29 template<typename T>
    \n-
    \n-\n-
    31 {
    \n-
    32 struct yes { char dummy[1]; };
    \n-
    33 struct no { char dummy[2]; };
    \n-
    34
    \n-
    35 template<typename X>
    \n-
    36 static yes test(NodeTag<X> *);
    \n-
    37 template<typename X>
    \n-
    38 static no test(...);
    \n-
    39
    \n-
    41 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
    \n-
    42 };
    \n-
    \n+
    8#include <utility>
    \n+
    9#include <functional>
    \n+
    10#include <array>
    \n+
    11
    \n+
    12#include <dune/common/indices.hh>
    \n+
    13#include <dune/common/hybridutilities.hh>
    \n+
    14#include <dune/common/rangeutilities.hh>
    \n+
    15#include <dune/common/tuplevector.hh>
    \n+
    16
    \n+\n+
    18
    \n+
    19namespace Dune {
    \n+
    20 namespace TypeTree {
    \n+
    21
    \n+
    22 namespace Detail {
    \n+
    23
    \n+
    24 /*
    \n+
    25 * \\brief A factory class creating a hybrid container compatible with a type tree
    \n+
    26 *
    \n+
    27 * This class allows to create a nested hybrid container having the same structure
    \n+
    28 * as a given type tree. Power nodes are represented as std::array's while composite
    \n+
    29 * nodes are represented as Dune::TupleVector's. The stored values for the leaf nodes
    \n+
    30 * are creating using a given predicate. Once created, the factory provides an
    \n+
    31 * operator() creating the container for the tree given as argument.
    \n+
    32 *
    \n+
    33 * \\tparam LeafToValue Type of a predicate that determines the stored values at the leafs
    \n+
    34 */
    \n+
    35 template<class LeafToValue>
    \n+
    \n+\n+
    37 {
    \n+
    38 template<class N>
    \n+
    39 using DynamicDegreeConcept = decltype((std::size_t(std::declval<N>().degree()), true));
    \n+
    40
    \n+
    41 template<class N>
    \n+
    42 using StaticDegreeConcept = decltype((std::integral_constant<std::size_t, N::degree()>{}, true));
    \n
    43
    \n-
    44 template<typename T, typename V>
    \n-
    \n-\n-
    46 {
    \n-
    47 template<int N>
    \n-
    48 struct maybe { char dummy[N+1]; };
    \n-
    49 struct yes { char dummy[2]; };
    \n-
    50 struct no { char dummy[1]; };
    \n-
    51
    \n-
    52 template<typename X>
    \n-\n-\n-
    55 template<typename X>
    \n-
    56 static no test(...);
    \n-
    57
    \n-
    59 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
    \n-
    60 };
    \n-
    \n-
    61
    \n-
    62 template<typename T>
    \n-
    \n-\n-
    64 {
    \n-
    65 struct yes { char dummy[1]; };
    \n-
    66 struct no { char dummy[2]; };
    \n+
    44 template<class N>
    \n+
    45 using DynamicChildAccessConcept = decltype((std::declval<N>().child(0u), true));
    \n+
    46
    \n+
    47 public:
    \n+
    48
    \n+
    \n+
    56 ContainerFactory(LeafToValue leafToValue) :
    \n+
    57 leafToValue_(leafToValue)
    \n+
    58 {}
    \n+
    \n+
    59
    \n+
    60 template<class Node>
    \n+
    \n+
    61 auto operator()(const Node& node)
    \n+
    62 {
    \n+
    63 return (*this)(node, Dune::PriorityTag<5>{});
    \n+
    64 }
    \n+
    \n+
    65
    \n+
    66 private:
    \n
    67
    \n-
    68 template<typename X>
    \n-\n-
    70 template<typename X>
    \n-
    71 static no test(...);
    \n-
    72
    \n-
    74 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
    \n-
    75 };
    \n-
    \n-
    76
    \n-
    77 template<typename T, typename V>
    \n-
    \n-\n-
    79 {
    \n-
    80 template<int N>
    \n-
    81 struct maybe { char dummy[N+1]; };
    \n-
    82 struct yes { char dummy[2]; };
    \n-
    83 struct no { char dummy[1]; };
    \n+
    68 template<class Node,
    \n+
    69 std::enable_if_t<Node::isLeaf, bool> = true>
    \n+
    70 auto operator()(const Node& node, Dune::PriorityTag<4>)
    \n+
    71 {
    \n+
    72 return leafToValue_(node);
    \n+
    73 }
    \n+
    74
    \n+
    75 template<class Node,
    \n+
    76 StaticDegreeConcept<Node> = true,
    \n+
    77 DynamicChildAccessConcept<Node> = true>
    \n+
    78 auto operator()(const Node& node, Dune::PriorityTag<3>)
    \n+
    79 {
    \n+
    80 return Dune::unpackIntegerSequence([&](auto... indices) {
    \n+
    81 return std::array{(*this)(node.child(indices))...};
    \n+
    82 }, std::make_index_sequence<std::size_t(Node::degree())>());
    \n+
    83 }
    \n
    84
    \n-
    85 template<typename X>
    \n-\n-\n-
    88 template<typename X>
    \n-
    89 static no test(...);
    \n-
    90
    \n-
    92 constexpr static bool value = sizeof(test<T>(0)) == sizeof(yes);
    \n-
    93 };
    \n-
    \n-
    94
    \n-
    95 template<typename>
    \n-
    \n-\n-
    97 {
    \n-
    98 typedef void type;
    \n-
    99 };
    \n-
    \n-
    100
    \n-
    101
    \n-
    103 template<typename T>
    \n-\n-
    105
    \n+
    85 template<class Node,
    \n+
    86 DynamicDegreeConcept<Node> = true,
    \n+
    87 DynamicChildAccessConcept<Node> = true>
    \n+
    88 auto operator()(const Node& node, Dune::PriorityTag<2>)
    \n+
    89 {
    \n+
    90 using TransformedChild = decltype((*this)(node.child(0)));
    \n+
    91 std::vector<TransformedChild> container;
    \n+
    92 container.reserve(node.degree());
    \n+
    93 for (std::size_t i = 0; i < node.degree(); ++i)
    \n+
    94 container.emplace_back((*this)(node.child(i)));
    \n+
    95 return container;
    \n+
    96 }
    \n+
    97
    \n+
    98 template<class Node,
    \n+
    99 StaticDegreeConcept<Node> = true>
    \n+
    100 auto operator()(const Node& node, Dune::PriorityTag<1>)
    \n+
    101 {
    \n+
    102 return Dune::unpackIntegerSequence([&](auto... indices) {
    \n+
    103 return Dune::makeTupleVector((*this)(node.child(indices))...);
    \n+
    104 }, std::make_index_sequence<std::size_t(Node::degree())>());
    \n+
    105 }
    \n
    106
    \n-
    107 // Support for lazy evaluation of meta functions. This is required when doing
    \n-
    108 // nested tag dispatch without C++11-style typedefs (based on using syntax).
    \n-
    109 // The standard struct-based meta functions cause premature evaluation in a
    \n-
    110 // context that is not SFINAE-compatible. We thus have to return the meta function
    \n-
    111 // without evaluating it, placing that burden on the caller. On the other hand,
    \n-
    112 // the lookup will often directly be the target type, so here is some helper code
    \n-
    113 // to automatically do the additional evaluation if necessary.
    \n-
    114 // Too bad that the new syntax is GCC 4.6+...
    \n-
    115
    \n-
    116
    \n-
    118
    \n-
    121 struct meta_function {};
    \n-
    122
    \n-
    124 template<typename F>
    \n-
    \n-\n-
    126 {
    \n-
    127 typedef typename F::type type;
    \n-
    128 };
    \n-
    \n-
    129
    \n-
    131 template<typename F>
    \n-
    \n-\n-
    133 {
    \n-
    134 typedef F type;
    \n-
    135 };
    \n-
    \n-
    136
    \n-
    138 template<typename F>
    \n-
    \n-\n-
    140 {
    \n-
    141 typedef typename std::conditional<
    \n-
    142 std::is_base_of<meta_function,F>::value,
    \n-\n-\n-
    145 >::type::type type;
    \n-
    146 };
    \n-
    \n-
    147
    \n-
    \n-
    148 namespace impl {
    \n-
    149
    \n-
    150 // Check if type is a or is derived from one of the tree path types
    \n-
    151
    \n-
    152 // Default overload for types not representing a tree path
    \n-
    \n-
    153 constexpr auto isTreePath(void*)
    \n-
    154 -> std::false_type
    \n-
    155 {
    \n-
    156 return std::false_type();
    \n-
    157 }
    \n-
    \n+
    107 private:
    \n+
    108 LeafToValue leafToValue_;
    \n+
    109 };
    \n+
    \n+
    110
    \n+
    111
    \n+
    112 /*
    \n+
    113 * \\brief Wrap nested container to provide a VectorBackend
    \n+
    114 */
    \n+
    115 template<class Container>
    \n+
    \n+\n+
    117 {
    \n+
    118 template<class C>
    \n+
    119 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<>& path)
    \n+
    120 {
    \n+
    121 return container;
    \n+
    122 }
    \n+
    123
    \n+
    124 template<class C, class... T>
    \n+
    125 static constexpr decltype(auto) accessByTreePath(C&& container, const HybridTreePath<T...>& path)
    \n+
    126 {
    \n+
    127 auto head = path[Dune::Indices::_0];
    \n+
    128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){
    \n+
    129 return treePath(path[Dune::index_constant<i+1>{}]...);
    \n+
    130 }, std::make_index_sequence<sizeof...(T)-1>());
    \n+
    131 return accessByTreePath(container[head], tailPath);
    \n+
    132 }
    \n+
    133
    \n+
    134 template<class C, class Tree,
    \n+
    135 std::enable_if_t<Tree::isLeaf, bool> = true>
    \n+
    136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune::PriorityTag<2>)
    \n+
    137 {
    \n+
    138 /* do nothing */
    \n+
    139 }
    \n+
    140
    \n+
    141 template<class C, class Tree,
    \n+
    142 class = decltype(std::declval<C>().resize(0u))>
    \n+
    143 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<1>)
    \n+
    144 {
    \n+
    145 container.resize(tree.degree());
    \n+
    146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
    \n+
    147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
    \n+
    148 });
    \n+
    149 }
    \n+
    150
    \n+
    151 template<class C, class Tree>
    \n+
    152 static void resizeImpl(C& container, const Tree& tree, Dune::PriorityTag<0>)
    \n+
    153 {
    \n+
    154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {
    \n+
    155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});
    \n+
    156 });
    \n+
    157 }
    \n
    158
    \n-
    159 // Overload for instances of HybridTreePath<...>
    \n-
    160 template<class... I>
    \n-
    \n-
    161 constexpr auto isTreePath(const HybridTreePath<I...>*)
    \n-
    162 -> std::true_type
    \n-
    163 {
    \n-
    164 return std::true_type();
    \n-
    165 }
    \n-
    \n+
    159 template<class T>
    \n+
    160 using TypeTreeConcept = decltype((
    \n+
    161 std::declval<T>().degree(),
    \n+
    162 T::isLeaf,
    \n+
    163 T::isPower,
    \n+
    164 T::isComposite,
    \n+
    165 true));
    \n
    166
    \n-
    167 }
    \n-
    \n-
    168
    \n-
    179 template<class T>
    \n-
    \n-
    180 struct IsTreePath :
    \n-
    181 public decltype(impl::isTreePath((typename std::decay<T>::type*)(nullptr)))
    \n-
    182 {};
    \n-
    \n-
    183
    \n-
    190 template<class T>
    \n-
    \n-
    191 constexpr auto isTreePath(const T&)
    \n-\n-
    193 {
    \n-
    194 return IsTreePath<T>();
    \n-
    195 }
    \n-
    \n-
    196
    \n-
    197
    \n-
    198 } // end namespace TypeTree
    \n-
    199} // end namespace Dune
    \n-
    200
    \n-
    201#endif // DUNE_TYPETREE_TYPETRAITS_HH
    \n-\n-\n-
    typename std::decay_t< Node >::NodeTag NodeTag
    Returns the node tag of the given Node.
    Definition nodeinterface.hh:76
    \n-
    typename std::decay_t< T >::ImplementationTag ImplementationTag
    Returns the implementation tag of the given Node.
    Definition nodeinterface.hh:80
    \n+
    167 public:
    \n+
    \n+
    169 TreeContainerVectorBackend(Container&& container) :
    \n+
    170 container_(std::move(container))
    \n+
    171 {}
    \n+
    \n+
    172
    \n+
    174 template <class Tree, TypeTreeConcept<Tree> = true>
    \n+
    \n+
    175 TreeContainerVectorBackend(const Tree& tree) :
    \n+\n+
    177 {
    \n+
    178 this->resize(tree);
    \n+
    179 }
    \n+
    \n+
    180
    \n+
    182 template <class C = Container,
    \n+
    183 std::enable_if_t<std::is_default_constructible_v<C>, bool> = true>
    \n+
    \n+\n+
    185 container_()
    \n+
    186 {}
    \n+
    \n+
    187
    \n+
    188 template<class... T>
    \n+
    \n+
    189 decltype(auto) operator[](const HybridTreePath<T...>& path) const
    \n+
    190 {
    \n+
    191 return accessByTreePath(container_, path);
    \n+
    192 }
    \n+
    \n+
    193
    \n+
    194 template<class... T>
    \n+
    \n+
    195 decltype(auto) operator[](const HybridTreePath<T...>& path)
    \n+
    196 {
    \n+
    197 return accessByTreePath(container_, path);
    \n+
    198 }
    \n+
    \n+
    199
    \n+
    201 template<class Tree, TypeTreeConcept<Tree> = true>
    \n+
    \n+
    202 void resize(const Tree& tree)
    \n+
    203 {
    \n+
    204 resizeImpl(container_, tree, Dune::PriorityTag<5>{});
    \n+
    205 }
    \n+
    \n+
    206
    \n+
    \n+
    207 const Container& data() const
    \n+
    208 {
    \n+
    209 return container_;
    \n+
    210 }
    \n+
    \n+
    211
    \n+
    \n+
    212 Container& data()
    \n+
    213 {
    \n+
    214 return container_;
    \n+
    215 }
    \n+
    \n+
    216
    \n+
    217 private:
    \n+
    218 Container container_;
    \n+
    219 };
    \n+
    \n+
    220
    \n+
    221 template<class Container>
    \n+
    \n+
    222 auto makeTreeContainerVectorBackend(Container&& container)
    \n+
    223 {
    \n+
    224 return TreeContainerVectorBackend<std::decay_t<Container>>(std::forward<Container>(container));
    \n+
    225 }
    \n+
    \n+
    226
    \n+
    227 /*
    \n+
    228 * \\brief A simple lambda for creating default constructible values from a node
    \n+
    229 *
    \n+
    230 * This simply returns LeafToValue<Node>{} for a given Node. It's needed
    \n+
    231 * because using a lambda expression in a using declaration is not allowed
    \n+
    232 * because it's an unevaluated context.
    \n+
    233 */
    \n+
    234 template<template<class Node> class LeafToValue>
    \n+
    \n+\n+
    236 {
    \n+
    237 template<class Node>
    \n+
    \n+
    238 auto operator()(const Node& node) const
    \n+
    239 {
    \n+
    240 return LeafToValue<Node>{};
    \n+
    241 }
    \n+
    \n+
    242 };
    \n+
    \n+
    243
    \n+
    244 } // namespace Detail
    \n+
    245
    \n+
    265 template<class Tree, class LeafToValue>
    \n+
    \n+
    266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue)
    \n+
    267 {
    \n+
    268 auto f = std::ref(leafToValue);
    \n+\n+
    270 return Detail::makeTreeContainerVectorBackend(factory(tree));
    \n+
    271 }
    \n+
    \n+
    272
    \n+
    288 template<class Value, class Tree>
    \n+
    \n+
    289 auto makeTreeContainer(const Tree& tree)
    \n+
    290 {
    \n+
    291 return makeTreeContainer(tree, [](const auto&) {return Value{};});
    \n+
    292 }
    \n+
    \n+
    293
    \n+
    297 template<class Value, class Tree>
    \n+
    298 using UniformTreeContainer = std::decay_t<decltype(makeTreeContainer<Value>(std::declval<const Tree&>()))>;
    \n+
    299
    \n+
    303 template<template<class Node> class LeafToValue, class Tree>
    \n+
    304 using TreeContainer = std::decay_t<decltype(makeTreeContainer(std::declval<const Tree&>(), std::declval<Detail::LeafToDefaultConstructibleValue<LeafToValue>>()))>;
    \n+
    305
    \n+
    307
    \n+
    308 } // namespace TypeTree
    \n+
    309} //namespace Dune
    \n+
    310
    \n+
    311#endif // DUNE_TYPETREE_TREECONTAINER_HH
    \n+\n+
    auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue)
    Create container havin the same structure as the given tree.
    Definition treecontainer.hh:266
    \n+
    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
    \n+
    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
    \n+
    std::size_t degree(const Node &node)
    Returns the degree of node as run time information.
    Definition nodeinterface.hh:85
    \n+
    constexpr HybridTreePath< T... > treePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:191
    \n
    Definition accumulate_static.hh:13
    \n-
    constexpr auto isTreePath(const T &) -> IsTreePath< T >
    Check if given object represents a tree path.
    Definition typetraits.hh:191
    \n-
    T * declptr()
    Helper function for generating a pointer to a value of type T in an unevaluated operand setting.
    \n-
    constexpr auto isTreePath(void *) -> std::false_type
    Definition typetraits.hh:153
    \n+
    auto makeTreeContainerVectorBackend(Container &&container)
    Definition treecontainer.hh:222
    \n+
    Definition treecontainer.hh:37
    \n+
    auto operator()(const Node &node)
    Definition treecontainer.hh:61
    \n+
    ContainerFactory(LeafToValue leafToValue)
    Create ContainerFactory.
    Definition treecontainer.hh:56
    \n+\n+
    void resize(const Tree &tree)
    Resize the (nested) container depending on the degree of the tree nodes.
    Definition treecontainer.hh:202
    \n+
    Container & data()
    Definition treecontainer.hh:212
    \n+
    const Container & data() const
    Definition treecontainer.hh:207
    \n+
    TreeContainerVectorBackend(Container &&container)
    Move the passed container into the internal storage.
    Definition treecontainer.hh:169
    \n+
    TreeContainerVectorBackend()
    Default constructor. The stored container might need to be resized before usage.
    Definition treecontainer.hh:184
    \n+
    TreeContainerVectorBackend(const Tree &tree)
    Default construct the container and perform a resize depending on the tree-node degrees.
    Definition treecontainer.hh:175
    \n+\n+
    auto operator()(const Node &node) const
    Definition treecontainer.hh:238
    \n
    A hybrid version of TreePath that supports both compile time and run time indices.
    Definition treepath.hh:79
    \n-
    Definition typetraits.hh:19
    \n-
    T0 type
    Definition typetraits.hh:24
    \n-
    Definition typetraits.hh:31
    \n-
    static constexpr bool value
    True if class T defines a NodeTag.
    Definition typetraits.hh:41
    \n-
    static yes test(NodeTag< X > *)
    \n-\n-
    Definition typetraits.hh:32
    \n-
    char dummy[1]
    Definition typetraits.hh:32
    \n-
    Definition typetraits.hh:33
    \n-
    char dummy[2]
    Definition typetraits.hh:33
    \n-
    Definition typetraits.hh:46
    \n-
    static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a)
    \n-
    static constexpr bool value
    True if class T defines a NodeTag of type V.
    Definition typetraits.hh:59
    \n-\n-\n-
    char dummy[N+1]
    Definition typetraits.hh:48
    \n-
    Definition typetraits.hh:49
    \n-
    char dummy[2]
    Definition typetraits.hh:49
    \n-
    Definition typetraits.hh:50
    \n-
    char dummy[1]
    Definition typetraits.hh:50
    \n-
    Definition typetraits.hh:64
    \n-
    static yes test(ImplementationTag< X > *)
    \n-\n-
    static constexpr bool value
    True if class T defines an ImplementationTag.
    Definition typetraits.hh:74
    \n-\n-
    char dummy[1]
    Definition typetraits.hh:65
    \n-\n-
    char dummy[2]
    Definition typetraits.hh:66
    \n-\n-
    static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test(ImplementationTag< X > *a)
    \n-\n-
    static constexpr bool value
    True if class T defines an ImplementationTag of type V.
    Definition typetraits.hh:92
    \n-\n-
    char dummy[N+1]
    Definition typetraits.hh:81
    \n-\n-
    char dummy[2]
    Definition typetraits.hh:82
    \n-\n-
    char dummy[1]
    Definition typetraits.hh:83
    \n-
    Definition typetraits.hh:97
    \n-
    void type
    Definition typetraits.hh:98
    \n-
    Marker tag declaring a meta function.
    Definition typetraits.hh:121
    \n-
    Helper meta function to delay evaluation of F.
    Definition typetraits.hh:126
    \n-
    F::type type
    Definition typetraits.hh:127
    \n-
    Identity function.
    Definition typetraits.hh:133
    \n-
    F type
    Definition typetraits.hh:134
    \n-
    Meta function that evaluates its argument iff it inherits from meta_function.
    Definition typetraits.hh:140
    \n-
    std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F >, lazy_identity< F > >::type::type type
    Definition typetraits.hh:145
    \n-
    Check if type represents a tree path.
    Definition typetraits.hh:182
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,346 +7,365 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-typetraits.hh\n+treecontainer.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_TYPETRAITS_HH\n- 5#define DUNE_TYPETREE_TYPETRAITS_HH\n+ 4#ifndef DUNE_TYPETREE_TREECONTAINER_HH\n+ 5#define DUNE_TYPETREE_TREECONTAINER_HH\n 6\n 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12\n- 13namespace Dune {\n- 14\n- 15 // Provide some more C++11 TMP helpers.\n- 16 // These should be upstreamed to dune-common ASAP.\n- 17\n- 18 template\n-19 struct first_type;\n- 20\n- 21 template\n-22 struct first_type\n- 23 {\n-24 typedef T0 type;\n- 25 };\n- 26\n- 27 namespace TypeTree {\n- 28\n- 29 template\n-30 struct has_node_tag\n- 31 {\n-32 struct yes { char dummy[1]; };\n-33 struct no { char dummy[2]; };\n- 34\n- 35 template\n-36 static yes test(NodeTag *);\n- 37 template\n-38 static no test(...);\n- 39\n-41 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n- 42 };\n+ 8#include \n+ 9#include \n+ 10#include \n+ 11\n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16\n+ 17#include \n+ 18\n+ 19namespace Dune {\n+ 20 namespace TypeTree {\n+ 21\n+ 22 namespace Detail {\n+ 23\n+ 24 /*\n+ 25 * \\brief A factory class creating a hybrid container compatible with a type\n+tree\n+ 26 *\n+ 27 * This class allows to create a nested hybrid container having the same\n+structure\n+ 28 * as a given type tree. Power nodes are represented as std::array's while\n+composite\n+ 29 * nodes are represented as Dune::TupleVector's. The stored values for the\n+leaf nodes\n+ 30 * are creating using a given predicate. Once created, the factory provides\n+an\n+ 31 * operator() creating the container for the tree given as argument.\n+ 32 *\n+ 33 * \\tparam LeafToValue Type of a predicate that determines the stored values\n+at the leafs\n+ 34 */\n+ 35 template\n+36 class ContainerFactory\n+ 37 {\n+ 38 template\n+ 39 using DynamicDegreeConcept = decltype((std::size_t(std::declval().degree\n+()), true));\n+ 40\n+ 41 template\n+ 42 using StaticDegreeConcept = decltype((std::integral_constant{}, true));\n 43\n- 44 template\n-45 struct has_node_tag_value\n- 46 {\n- 47 template\n-48 struct maybe { char dummy[N+1]; };\n-49 struct yes { char dummy[2]; };\n-50 struct no { char dummy[1]; };\n- 51\n- 52 template\n- 53 static maybe>::value>\n-54 test(NodeTag * a);\n- 55 template\n-56 static no test(...);\n- 57\n-59 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n- 60 };\n- 61\n- 62 template\n-63 struct has_implementation_tag\n- 64 {\n-65 struct yes { char dummy[1]; };\n-66 struct no { char dummy[2]; };\n+ 44 template\n+ 45 using DynamicChildAccessConcept = decltype((std::declval().child(0u),\n+true));\n+ 46\n+ 47 public:\n+ 48\n+56 ContainerFactory(LeafToValue leafToValue) :\n+ 57 leafToValue_(leafToValue)\n+ 58 {}\n+ 59\n+ 60 template\n+61 auto operator()(const Node& node)\n+ 62 {\n+ 63 return (*this)(node, Dune::PriorityTag<5>{});\n+ 64 }\n+ 65\n+ 66 private:\n 67\n- 68 template\n-69 static yes test(ImplementationTag *);\n- 70 template\n-71 static no test(...);\n- 72\n-74 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n- 75 };\n- 76\n- 77 template\n-78 struct has_implementation_tag_value\n+ 68 template = true>\n+ 70 auto operator()(const Node& node, Dune::PriorityTag<4>)\n+ 71 {\n+ 72 return leafToValue_(node);\n+ 73 }\n+ 74\n+ 75 template = true,\n+ 77 DynamicChildAccessConcept = true>\n+ 78 auto operator()(const Node& node, Dune::PriorityTag<3>)\n 79 {\n- 80 template\n-81 struct maybe { char dummy[N+1]; };\n-82 struct yes { char dummy[2]; };\n-83 struct no { char dummy[1]; };\n+ 80 return Dune::unpackIntegerSequence([&](auto... indices) {\n+ 81 return std::array{(*this)(node.child(indices))...};\n+ 82 }, std::make_index_sequence());\n+ 83 }\n 84\n- 85 template\n- 86 static maybe>::value>\n-87 test(ImplementationTag * a);\n- 88 template\n-89 static no test(...);\n- 90\n-92 constexpr static bool value = sizeof(test(0)) == sizeof(yes);\n- 93 };\n- 94\n- 95 template\n-96 struct AlwaysVoid\n- 97 {\n-98 typedef void type;\n- 99 };\n- 100\n- 101\n- 103 template\n-104 T* declptr();\n- 105\n+ 85 template = true,\n+ 87 DynamicChildAccessConcept = true>\n+ 88 auto operator()(const Node& node, Dune::PriorityTag<2>)\n+ 89 {\n+ 90 using TransformedChild = decltype((*this)(node.child(0)));\n+ 91 std::vector container;\n+ 92 container.reserve(node.degree());\n+ 93 for (std::size_t i = 0; i < node.degree(); ++i)\n+ 94 container.emplace_back((*this)(node.child(i)));\n+ 95 return container;\n+ 96 }\n+ 97\n+ 98 template = true>\n+ 100 auto operator()(const Node& node, Dune::PriorityTag<1>)\n+ 101 {\n+ 102 return Dune::unpackIntegerSequence([&](auto... indices) {\n+ 103 return Dune::makeTupleVector((*this)(node.child(indices))...);\n+ 104 }, std::make_index_sequence());\n+ 105 }\n 106\n- 107 // Support for lazy evaluation of meta functions. This is required when\n-doing\n- 108 // nested tag dispatch without C++11-style typedefs (based on using\n-syntax).\n- 109 // The standard struct-based meta functions cause premature evaluation in\n-a\n- 110 // context that is not SFINAE-compatible. We thus have to return the meta\n-function\n- 111 // without evaluating it, placing that burden on the caller. On the other\n-hand,\n- 112 // the lookup will often directly be the target type, so here is some\n-helper code\n- 113 // to automatically do the additional evaluation if necessary.\n- 114 // Too bad that the new syntax is GCC 4.6+...\n- 115\n- 116\n- 118\n-121 struct meta_function {};\n- 122\n- 124 template\n-125 struct lazy_evaluate\n+ 107 private:\n+ 108 LeafToValue leafToValue_;\n+ 109 };\n+ 110\n+ 111\n+ 112 /*\n+ 113 * \\brief Wrap nested container to provide a VectorBackend\n+ 114 */\n+ 115 template\n+116 class TreeContainerVectorBackend\n+ 117 {\n+ 118 template\n+ 119 static constexpr decltype(auto) accessByTreePath(C&& container, const\n+HybridTreePath<>& path)\n+ 120 {\n+ 121 return container;\n+ 122 }\n+ 123\n+ 124 template\n+ 125 static constexpr decltype(auto) accessByTreePath(C&& container, const\n+HybridTreePath& path)\n 126 {\n-127 typedef typename F::type type;\n- 128 };\n- 129\n- 131 template\n-132 struct lazy_identity\n- 133 {\n-134 typedef F type;\n- 135 };\n- 136\n- 138 template\n-139 struct evaluate_if_meta_function\n- 140 {\n- 141 typedef typename std::conditional<\n- 142 std::is_base_of::value,\n- 143 lazy_evaluate,\n- 144 lazy_identity\n-145 >::type::type type;\n- 146 };\n- 147\n-148 namespace impl {\n- 149\n- 150 // Check if type is a or is derived from one of the tree path types\n- 151\n- 152 // Default overload for types not representing a tree path\n-153 constexpr auto isTreePath(void*)\n- 154 -> std::false_type\n- 155 {\n- 156 return std::false_type();\n+ 127 auto head = path[Dune::Indices::_0];\n+ 128 auto tailPath = Dune::unpackIntegerSequence([&](auto... i){\n+ 129 return treePath(path[Dune::index_constant{}]...);\n+ 130 }, std::make_index_sequence());\n+ 131 return accessByTreePath(container[head], tailPath);\n+ 132 }\n+ 133\n+ 134 template = true>\n+ 136 static void resizeImpl(C& /*container*/, const Tree& /*tree*/, Dune::\n+PriorityTag<2>)\n+ 137 {\n+ 138 /* do nothing */\n+ 139 }\n+ 140\n+ 141 template().resize(0u))>\n+ 143 static void resizeImpl(C& container, const Tree& tree, Dune::\n+PriorityTag<1>)\n+ 144 {\n+ 145 container.resize(tree.degree());\n+ 146 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {\n+ 147 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});\n+ 148 });\n+ 149 }\n+ 150\n+ 151 template\n+ 152 static void resizeImpl(C& container, const Tree& tree, Dune::\n+PriorityTag<0>)\n+ 153 {\n+ 154 Dune::Hybrid::forEach(Dune::range(tree.degree()), [&](auto i) {\n+ 155 resizeImpl(container[i], tree.child(i), Dune::PriorityTag<5>{});\n+ 156 });\n 157 }\n 158\n- 159 // Overload for instances of HybridTreePath<...>\n- 160 template\n-161 constexpr auto isTreePath(const HybridTreePath*)\n- 162 -> std::true_type\n- 163 {\n- 164 return std::true_type();\n- 165 }\n+ 159 template\n+ 160 using TypeTreeConcept = decltype((\n+ 161 std::declval().degree(),\n+ 162 T::isLeaf,\n+ 163 T::isPower,\n+ 164 T::isComposite,\n+ 165 true));\n 166\n- 167 }\n- 168\n- 179 template\n-180 struct IsTreePath :\n- 181 public decltype(impl::isTreePath((typename std::decay::type*)\n-(nullptr)))\n- 182 {};\n- 183\n- 190 template\n-191 constexpr auto isTreePath(const T&)\n- 192 -> IsTreePath\n- 193 {\n- 194 return IsTreePath();\n- 195 }\n- 196\n- 197\n- 198 } // end namespace TypeTree\n- 199} // end namespace Dune\n- 200\n- 201#endif // DUNE_TYPETREE_TYPETRAITS_HH\n-nodeinterface.hh\n+ 167 public:\n+169 TreeContainerVectorBackend(Container&& container) :\n+ 170 container_(std::move(container))\n+ 171 {}\n+ 172\n+ 174 template = true>\n+175 TreeContainerVectorBackend(const Tree& tree) :\n+ 176 TreeContainerVectorBackend()\n+ 177 {\n+ 178 this->resize(tree);\n+ 179 }\n+ 180\n+ 182 template , bool> = true>\n+184 TreeContainerVectorBackend() :\n+ 185 container_()\n+ 186 {}\n+ 187\n+ 188 template\n+189 decltype(auto) operator[](const HybridTreePath& path) const\n+ 190 {\n+ 191 return accessByTreePath(container_, path);\n+ 192 }\n+ 193\n+ 194 template\n+195 decltype(auto) operator[](const HybridTreePath& path)\n+ 196 {\n+ 197 return accessByTreePath(container_, path);\n+ 198 }\n+ 199\n+ 201 template = true>\n+202 void resize(const Tree& tree)\n+ 203 {\n+ 204 resizeImpl(container_, tree, Dune::PriorityTag<5>{});\n+ 205 }\n+ 206\n+207 const Container& data() const\n+ 208 {\n+ 209 return container_;\n+ 210 }\n+ 211\n+212 Container& data()\n+ 213 {\n+ 214 return container_;\n+ 215 }\n+ 216\n+ 217 private:\n+ 218 Container container_;\n+ 219 };\n+ 220\n+ 221 template\n+222 auto makeTreeContainerVectorBackend(Container&& container)\n+ 223 {\n+ 224 return TreeContainerVectorBackend>(std::\n+forward(container));\n+ 225 }\n+ 226\n+ 227 /*\n+ 228 * \\brief A simple lambda for creating default constructible values from a\n+node\n+ 229 *\n+ 230 * This simply returns LeafToValue{} for a given Node. It's needed\n+ 231 * because using a lambda expression in a using declaration is not allowed\n+ 232 * because it's an unevaluated context.\n+ 233 */\n+ 234 template class LeafToValue>\n+235 struct LeafToDefaultConstructibleValue\n+ 236 {\n+ 237 template\n+238 auto operator()(const Node& node) const\n+ 239 {\n+ 240 return LeafToValue{};\n+ 241 }\n+ 242 };\n+ 243\n+ 244 } // namespace Detail\n+ 245\n+ 265 template\n+266 auto makeTreeContainer(const Tree& tree, LeafToValue&& leafToValue)\n+ 267 {\n+ 268 auto f = std::ref(leafToValue);\n+ 269 auto factory = Detail::ContainerFactory(f);\n+ 270 return Detail::makeTreeContainerVectorBackend(factory(tree));\n+ 271 }\n+ 272\n+ 288 template\n+289 auto makeTreeContainer(const Tree& tree)\n+ 290 {\n+ 291 return makeTreeContainer(tree, [](const auto&) {return Value{};});\n+ 292 }\n+ 293\n+ 297 template\n+298 using UniformTreeContainer = std::decay_t\n+(std::declval()))>;\n+ 299\n+ 303 template class LeafToValue, class Tree>\n+304 using TreeContainer = std::decay_t(), std::declval>()))>;\n+ 305\n+ 307\n+ 308 } // namespace TypeTree\n+ 309} //namespace Dune\n+ 310\n+ 311#endif // DUNE_TYPETREE_TREECONTAINER_HH\n treepath.hh\n-Dune::TypeTree::NodeTag\n-typename std::decay_t< Node >::NodeTag NodeTag\n-Returns the node tag of the given Node.\n-Definition nodeinterface.hh:76\n-Dune::TypeTree::ImplementationTag\n-typename std::decay_t< T >::ImplementationTag ImplementationTag\n-Returns the implementation tag of the given Node.\n-Definition nodeinterface.hh:80\n+Dune::TypeTree::makeTreeContainer\n+auto makeTreeContainer(const Tree &tree, LeafToValue &&leafToValue)\n+Create container havin the same structure as the given tree.\n+Definition treecontainer.hh:266\n+Dune::TypeTree::UniformTreeContainer\n+std::decay_t< decltype(makeTreeContainer< Value >(std::declval< const Tree & >\n+()))> UniformTreeContainer\n+Alias to container type generated by makeTreeContainer for given tree type and\n+uniform value type.\n+Definition treecontainer.hh:298\n+Dune::TypeTree::TreeContainer\n+std::decay_t< decltype(makeTreeContainer(std::declval< const Tree & >(), std::\n+declval< Detail::LeafToDefaultConstructibleValue< LeafToValue > >()))>\n+TreeContainer\n+Alias to container type generated by makeTreeContainer for give tree type and\n+when using LeafToValue ...\n+Definition treecontainer.hh:304\n+Dune::TypeTree::degree\n+std::size_t degree(const Node &node)\n+Returns the degree of node as run time information.\n+Definition nodeinterface.hh:85\n+Dune::TypeTree::treePath\n+constexpr HybridTreePath< T... > treePath(const T &... t)\n+Constructs a new HybridTreePath from the given indices.\n+Definition treepath.hh:191\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::isTreePath\n-constexpr auto isTreePath(const T &) -> IsTreePath< T >\n-Check if given object represents a tree path.\n-Definition typetraits.hh:191\n-Dune::TypeTree::declptr\n-T * declptr()\n-Helper function for generating a pointer to a value of type T in an unevaluated\n-operand setting.\n-Dune::TypeTree::impl::isTreePath\n-constexpr auto isTreePath(void *) -> std::false_type\n-Definition typetraits.hh:153\n+Dune::TypeTree::Detail::makeTreeContainerVectorBackend\n+auto makeTreeContainerVectorBackend(Container &&container)\n+Definition treecontainer.hh:222\n+Dune::TypeTree::Detail::ContainerFactory\n+Definition treecontainer.hh:37\n+Dune::TypeTree::Detail::ContainerFactory::operator()\n+auto operator()(const Node &node)\n+Definition treecontainer.hh:61\n+Dune::TypeTree::Detail::ContainerFactory::ContainerFactory\n+ContainerFactory(LeafToValue leafToValue)\n+Create ContainerFactory.\n+Definition treecontainer.hh:56\n+Dune::TypeTree::Detail::TreeContainerVectorBackend\n+Definition treecontainer.hh:117\n+Dune::TypeTree::Detail::TreeContainerVectorBackend::resize\n+void resize(const Tree &tree)\n+Resize the (nested) container depending on the degree of the tree nodes.\n+Definition treecontainer.hh:202\n+Dune::TypeTree::Detail::TreeContainerVectorBackend::data\n+Container & data()\n+Definition treecontainer.hh:212\n+Dune::TypeTree::Detail::TreeContainerVectorBackend::data\n+const Container & data() const\n+Definition treecontainer.hh:207\n+Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend\n+TreeContainerVectorBackend(Container &&container)\n+Move the passed container into the internal storage.\n+Definition treecontainer.hh:169\n+Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend\n+TreeContainerVectorBackend()\n+Default constructor. The stored container might need to be resized before\n+usage.\n+Definition treecontainer.hh:184\n+Dune::TypeTree::Detail::TreeContainerVectorBackend::TreeContainerVectorBackend\n+TreeContainerVectorBackend(const Tree &tree)\n+Default construct the container and perform a resize depending on the tree-node\n+degrees.\n+Definition treecontainer.hh:175\n+Dune::TypeTree::Detail::LeafToDefaultConstructibleValue\n+Definition treecontainer.hh:236\n+Dune::TypeTree::Detail::LeafToDefaultConstructibleValue::operator()\n+auto operator()(const Node &node) const\n+Definition treecontainer.hh:238\n Dune::TypeTree::HybridTreePath\n A hybrid version of TreePath that supports both compile time and run time\n indices.\n Definition treepath.hh:79\n-Dune::first_type\n-Definition typetraits.hh:19\n-Dune::first_type<_T0,_T..._>::type\n-T0 type\n-Definition typetraits.hh:24\n-Dune::TypeTree::has_node_tag\n-Definition typetraits.hh:31\n-Dune::TypeTree::has_node_tag::value\n-static constexpr bool value\n-True if class T defines a NodeTag.\n-Definition typetraits.hh:41\n-Dune::TypeTree::has_node_tag::test\n-static yes test(NodeTag< X > *)\n-Dune::TypeTree::has_node_tag::test\n-static no test(...)\n-Dune::TypeTree::has_node_tag::yes\n-Definition typetraits.hh:32\n-Dune::TypeTree::has_node_tag::yes::dummy\n-char dummy[1]\n-Definition typetraits.hh:32\n-Dune::TypeTree::has_node_tag::no\n-Definition typetraits.hh:33\n-Dune::TypeTree::has_node_tag::no::dummy\n-char dummy[2]\n-Definition typetraits.hh:33\n-Dune::TypeTree::has_node_tag_value\n-Definition typetraits.hh:46\n-Dune::TypeTree::has_node_tag_value::test\n-static maybe< std::is_base_of< V, NodeTag< X > >::value > test(NodeTag< X > *a)\n-Dune::TypeTree::has_node_tag_value::value\n-static constexpr bool value\n-True if class T defines a NodeTag of type V.\n-Definition typetraits.hh:59\n-Dune::TypeTree::has_node_tag_value::test\n-static no test(...)\n-Dune::TypeTree::has_node_tag_value::maybe\n-Definition typetraits.hh:48\n-Dune::TypeTree::has_node_tag_value::maybe::dummy\n-char dummy[N+1]\n-Definition typetraits.hh:48\n-Dune::TypeTree::has_node_tag_value::yes\n-Definition typetraits.hh:49\n-Dune::TypeTree::has_node_tag_value::yes::dummy\n-char dummy[2]\n-Definition typetraits.hh:49\n-Dune::TypeTree::has_node_tag_value::no\n-Definition typetraits.hh:50\n-Dune::TypeTree::has_node_tag_value::no::dummy\n-char dummy[1]\n-Definition typetraits.hh:50\n-Dune::TypeTree::has_implementation_tag\n-Definition typetraits.hh:64\n-Dune::TypeTree::has_implementation_tag::test\n-static yes test(ImplementationTag< X > *)\n-Dune::TypeTree::has_implementation_tag::test\n-static no test(...)\n-Dune::TypeTree::has_implementation_tag::value\n-static constexpr bool value\n-True if class T defines an ImplementationTag.\n-Definition typetraits.hh:74\n-Dune::TypeTree::has_implementation_tag::yes\n-Definition typetraits.hh:65\n-Dune::TypeTree::has_implementation_tag::yes::dummy\n-char dummy[1]\n-Definition typetraits.hh:65\n-Dune::TypeTree::has_implementation_tag::no\n-Definition typetraits.hh:66\n-Dune::TypeTree::has_implementation_tag::no::dummy\n-char dummy[2]\n-Definition typetraits.hh:66\n-Dune::TypeTree::has_implementation_tag_value\n-Definition typetraits.hh:79\n-Dune::TypeTree::has_implementation_tag_value::test\n-static maybe< std::is_base_of< V, ImplementationTag< X > >::value > test\n-(ImplementationTag< X > *a)\n-Dune::TypeTree::has_implementation_tag_value::test\n-static no test(...)\n-Dune::TypeTree::has_implementation_tag_value::value\n-static constexpr bool value\n-True if class T defines an ImplementationTag of type V.\n-Definition typetraits.hh:92\n-Dune::TypeTree::has_implementation_tag_value::maybe\n-Definition typetraits.hh:81\n-Dune::TypeTree::has_implementation_tag_value::maybe::dummy\n-char dummy[N+1]\n-Definition typetraits.hh:81\n-Dune::TypeTree::has_implementation_tag_value::yes\n-Definition typetraits.hh:82\n-Dune::TypeTree::has_implementation_tag_value::yes::dummy\n-char dummy[2]\n-Definition typetraits.hh:82\n-Dune::TypeTree::has_implementation_tag_value::no\n-Definition typetraits.hh:83\n-Dune::TypeTree::has_implementation_tag_value::no::dummy\n-char dummy[1]\n-Definition typetraits.hh:83\n-Dune::TypeTree::AlwaysVoid\n-Definition typetraits.hh:97\n-Dune::TypeTree::AlwaysVoid::type\n-void type\n-Definition typetraits.hh:98\n-Dune::TypeTree::meta_function\n-Marker tag declaring a meta function.\n-Definition typetraits.hh:121\n-Dune::TypeTree::lazy_evaluate\n-Helper meta function to delay evaluation of F.\n-Definition typetraits.hh:126\n-Dune::TypeTree::lazy_evaluate::type\n-F::type type\n-Definition typetraits.hh:127\n-Dune::TypeTree::lazy_identity\n-Identity function.\n-Definition typetraits.hh:133\n-Dune::TypeTree::lazy_identity::type\n-F type\n-Definition typetraits.hh:134\n-Dune::TypeTree::evaluate_if_meta_function\n-Meta function that evaluates its argument iff it inherits from meta_function.\n-Definition typetraits.hh:140\n-Dune::TypeTree::evaluate_if_meta_function::type\n-std::conditional< std::is_base_of< meta_function, F >::value, lazy_evaluate< F\n->, lazy_identity< F > >::type::type type\n-Definition typetraits.hh:145\n-Dune::TypeTree::IsTreePath\n-Check if type represents a tree path.\n-Definition typetraits.hh:182\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00047.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: utility.hh File Reference\n+dune-typetree: powercompositenodetransformationtemplates.hh File Reference\n \n \n \n \n \n \n \n@@ -72,34 +72,35 @@\n
  • dune
  • typetree
  • \n \n \n
    \n \n-
    utility.hh File Reference
    \n+
    powercompositenodetransformationtemplates.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n-#include <tuple>
    \n-#include <type_traits>
    \n-#include <utility>
    \n-#include <algorithm>
    \n-#include <dune/common/shared_ptr.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/typetree/nodeinterface.hh>
    \n-#include <dune/typetree/nodetags.hh>
    \n+
    #include <cstddef>
    \n+#include <dune/typetree/nodeinterface.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

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

    Go to the source code of this file.

    \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Classes

    class  Dune::TypeTree::HybridTreePath< T >
     A hybrid version of TreePath that supports both compile time and run time indices. More...
     
    struct  Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >
     
    struct  Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k >
     
    struct  Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k >
     
    struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >
     
    struct  Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >
     
    struct  Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
     
    struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... >
     
    struct  Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >
     
    struct  Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > >
     
    struct  Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > >
     
    \n+\n+\n+\n+\n+\n+\n+\n+

    \n+Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::TreePathType
     
    \n+\n+\n+\n+\n+\n+\n+\n+

    \n+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 >... >
     
    \n+\n+\n+\n+

    \n+Enumerations

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

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

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+

    \n+Classes

    struct  Dune::TypeTree::NodeInterface
     Interface for nodes in a dune-typetree. More...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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.
     
    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.
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n

    \n 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.
     
    template<typename Node >
    std::size_t Dune::TypeTree::degree (const Node &node)
     Returns the degree of node as run time information.
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,60 +6,45 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Namespaces | Typedefs | Functions\n-childextraction.hh File Reference\n+Classes | Namespaces | Typedefs | Functions\n+nodeinterface.hh File Reference\n+#include \n #include \n-#include \n-#include \n #include \n-#include \n-#include \n-#include \n-#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+struct \u00a0Dune::TypeTree::NodeInterface\n+\u00a0 Interface for nodes in a dune-typetree. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n Typedefs\n-template\n-using\u00a0Dune::TypeTree::Child = typename impl::_Child< Node, indices... >::type\n-\u00a0 Template alias for the type of a child node given by a list of child\n- indices.\n-\u00a0\n-template\n-using\u00a0Dune::TypeTree::ChildForTreePath = typename impl::_ChildForTreePath<\n- Node, TreePath >::type\n-\u00a0 Template alias for the type of a child node given by a TreePath or a\n- HybridTreePath type.\n+template\n+using\u00a0Dune::TypeTree::NodeTag = typename std::decay_t< Node >::NodeTag\n+\u00a0 Returns the node tag of the given Node.\n \u00a0\n template\n-using\u00a0Dune::TypeTree::is_flat_index = typename impl::_is_flat_index< std::\n- decay_t< T > >::type\n-\u00a0 Type trait that determines whether T is a flat index in the context of\n- child extraction.\n+using\u00a0Dune::TypeTree::ImplementationTag = typename std::decay_t< T >::\n+ ImplementationTag\n+\u00a0 Returns the implementation tag of the given Node.\n+\u00a0\n+template\n+using\u00a0Dune::TypeTree::StaticDegree = decltype(Node::degree())\n+\u00a0 Returns the statically known degree of the given Node type as a std::\n+ integral_constant.\n \u00a0\n Functions\n-template\n-ImplementationDefined\u00a0Dune::TypeTree::child (Node &&node, Indices... indices)\n-\u00a0 Extracts the child of a node given by a sequence of\n- compile-time and run-time indices.\n-\u00a0\n-template\n-ImplementationDefined\u00a0Dune::TypeTree::childStorage (Node &&node, Indices...\n- indices)\n-\u00a0\n-template\n-ImplementationDefined\u00a0Dune::TypeTree::child (Node &&node, HybridTreePath<\n- Indices... > treePath)\n-\u00a0 Extracts the child of a node given by a HybridTreePath\n- object.\n+template\n+std::size_t\u00a0Dune::TypeTree::degree (const Node &node)\n+\u00a0 Returns the degree of node as run time information.\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00053_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: childextraction.hh Source File\n+dune-typetree: nodeinterface.hh Source File\n \n \n \n \n \n \n \n@@ -74,288 +74,102 @@\n \n
    \n \n
    \n
    \n
    \n-
    childextraction.hh
    \n+
    nodeinterface.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=8 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH
    \n-
    5#define DUNE_TYPETREE_CHILDEXTRACTION_HH
    \n+
    4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH
    \n+
    5#define DUNE_TYPETREE_NODEINTERFACE_HH
    \n
    6
    \n-
    7#include <type_traits>
    \n-
    8#include <utility>
    \n+
    7#include <cstddef>
    \n+
    8#include <type_traits>
    \n
    9
    \n-
    10#include <dune/common/concept.hh>
    \n-
    11#include <dune/common/documentation.hh>
    \n-
    12#include <dune/common/typetraits.hh>
    \n-
    13#include <dune/common/shared_ptr.hh>
    \n+
    10#include <dune/common/documentation.hh>
    \n+
    11
    \n+
    12namespace Dune {
    \n+
    13 namespace TypeTree {
    \n
    14
    \n-\n-\n-
    17
    \n-
    18
    \n-
    19namespace Dune {
    \n-
    20 namespace TypeTree {
    \n-
    21
    \n-
    26
    \n-
    27#ifndef DOXYGEN
    \n-
    28
    \n-
    29 namespace Impl {
    \n-
    30
    \n-
    31 // check at run time whether index is a valid child index
    \n-
    32 template <class Node, class Index>
    \n-
    33 std::true_type checkChildIndex (Node const& node, Index i)
    \n-
    34 {
    \n-
    35 assert(std::size_t(i) < node.degree() && "Child index out of range");
    \n-
    36 return {};
    \n-
    37 }
    \n-
    38
    \n-
    39 // check at compile time whether index is a valid index
    \n-
    40 template <class Node, std::size_t i>
    \n-
    41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node, index_constant<i>)
    \n-
    42 {
    \n-
    43 static_assert(i < Node::degree(), "Child index out of range");
    \n-
    44 return {};
    \n-
    45 }
    \n-
    46
    \n-
    47 // finally return the node itself if no further indices are provided. Break condition
    \n-
    48 // for the recursion over the node childs.
    \n-
    49 template<class Node>
    \n-
    50 decltype(auto) childImpl (Node&& node)
    \n-
    51 {
    \n-
    52 return std::forward<Node>(node);
    \n-
    53 }
    \n-
    54
    \n-
    55 template<class NodePtr>
    \n-
    56 auto childStorageImpl (NodePtr&& nodePtr)
    \n-
    57 {
    \n-
    58 return std::forward<NodePtr>(nodePtr);
    \n-
    59 }
    \n+
    \n+\n+
    33 {
    \n+
    35 static const bool isLeaf = implementationDefined;
    \n+
    36
    \n+
    38 static const bool isPower = implementationDefined;
    \n+
    39
    \n+
    41 static const bool isComposite = implementationDefined;
    \n+
    42
    \n+
    44
    \n+
    49 static const std::size_t CHILDREN = implementationDefined;
    \n+
    50
    \n+
    52
    \n+
    57 static auto degree();
    \n+
    58
    \n
    60
    \n-
    61 // recursively call `node.child(...)` with the given indices
    \n-
    62 template<class Node, class I0, class... I>
    \n-
    63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i)
    \n-
    64 {
    \n-
    65 auto valid = checkChildIndex(node,i0);
    \n-
    66 if constexpr (valid)
    \n-
    67 return childImpl(node.child(i0),i...);
    \n-
    68 else
    \n-
    69 return;
    \n-
    70 }
    \n-
    71
    \n-
    72 // recursively call `node.childStorage(...)` with the given indices
    \n-
    73 template<class NodePtr, class I0, class... I>
    \n-
    74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]] I... i)
    \n-
    75 {
    \n-
    76 auto valid = checkChildIndex(*nodePtr,i0);
    \n-
    77 if constexpr (valid)
    \n-
    78 return childStorageImpl(nodePtr->childStorage(i0),i...);
    \n-
    79 else
    \n-
    80 return;
    \n-
    81 }
    \n+
    65 typedef ImplementationDefined NodeTag;
    \n+
    66
    \n+
    68
    \n+
    71 typedef ImplementationDefined NodeStorage;
    \n+
    72 };
    \n+
    \n+
    73
    \n+
    75 template<typename Node>
    \n+
    76 using NodeTag = typename std::decay_t<Node>::NodeTag;
    \n+
    77
    \n+
    79 template<typename T>
    \n+
    80 using ImplementationTag = typename std::decay_t<T>::ImplementationTag;
    \n+
    81
    \n
    82
    \n-
    83 // forward to the impl methods by extracting the indices from the treepath
    \n-
    84 template<class Node, class... Indices, std::size_t... i>
    \n-
    85 decltype(auto) child (Node&& node, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
    \n-
    86 {
    \n-
    87 return childImpl(std::forward<Node>(node),treePathEntry<i>(tp)...);
    \n-
    88 }
    \n-
    89
    \n-
    90 // forward to the impl methods by extracting the indices from the treepath
    \n-
    91 template<class NodePtr, class... Indices, std::size_t... i>
    \n-
    92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]] HybridTreePath<Indices...> tp, std::index_sequence<i...>)
    \n-
    93 {
    \n-
    94 return childStorageImpl(std::forward<NodePtr>(nodePtr),treePathEntry<i>(tp)...);
    \n-
    95 }
    \n-
    96
    \n-
    97 } // end namespace Impl
    \n-
    98
    \n-
    99#endif // DOXYGEN
    \n-
    100
    \n-
    102
    \n-
    124 template<typename Node, typename... Indices>
    \n-
    125#ifdef DOXYGEN
    \n-
    \n-
    126 ImplementationDefined child (Node&& node, Indices... indices)
    \n-
    127#else
    \n-
    128 decltype(auto) child (Node&& node, Indices... indices)
    \n-
    129#endif
    \n-
    130 {
    \n-
    131 return Impl::childImpl(std::forward<Node>(node),indices...);
    \n-
    132 }
    \n-
    \n-
    133
    \n-
    134 template<typename Node, typename... Indices>
    \n-
    135#ifdef DOXYGEN
    \n-
    \n-
    136 ImplementationDefined childStorage (Node&& node, Indices... indices)
    \n-
    137#else
    \n-
    138 auto childStorage (Node&& node, Indices... indices)
    \n-
    139#endif
    \n-
    140 {
    \n-
    141 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty list of child indices");
    \n-
    142 return Impl::childStorageImpl(&node,indices...);
    \n-
    143 }
    \n+
    84 template<typename Node>
    \n+
    \n+
    85 std::size_t degree(const Node& node)
    \n+
    86 {
    \n+
    87 return degree(&node,NodeTag<Node>());
    \n+
    88 }
    \n
    \n-
    144
    \n-
    146
    \n-
    169 template<typename Node, typename... Indices>
    \n-
    170#ifdef DOXYGEN
    \n-
    \n-
    171 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
    \n-
    172#else
    \n-
    173 decltype(auto) child (Node&& node, HybridTreePath<Indices...> tp)
    \n-
    174#endif
    \n-
    175 {
    \n-
    176 return Impl::child(std::forward<Node>(node),tp,std::index_sequence_for<Indices...>{});
    \n-
    177 }
    \n-
    \n-
    178
    \n-
    179 template<typename Node, typename... Indices>
    \n-
    180#ifdef DOXYGEN
    \n-
    181 ImplementationDefined child (Node&& node, HybridTreePath<Indices...> treePath)
    \n-
    182#else
    \n-
    183 auto childStorage (Node&& node, HybridTreePath<Indices...> tp)
    \n-
    184#endif
    \n-
    185 {
    \n-
    186 static_assert(sizeof...(Indices) > 0, "childStorage() cannot be called with an empty TreePath");
    \n-
    187 return Impl::childStorage(&node,tp,std::index_sequence_for<Indices...>{});
    \n-
    188 }
    \n-
    189
    \n-
    190
    \n-
    191#ifndef DOXYGEN
    \n-
    192
    \n-
    193 namespace impl {
    \n-
    194
    \n-
    195 template<typename T>
    \n-
    196 struct filter_void
    \n-
    197 {
    \n-
    198 using type = T;
    \n-
    199 };
    \n-
    200
    \n-
    201 template<>
    \n-
    202 struct filter_void<void>
    \n-
    203 {};
    \n-
    204
    \n-
    205 template<typename Node, std::size_t... indices>
    \n-
    206 struct _Child
    \n-
    207 : public filter_void<std::decay_t<decltype(child(std::declval<Node>(),index_constant<indices>{}...))>>
    \n-
    208 {};
    \n-
    209
    \n-
    210 }
    \n-
    211
    \n-
    212#endif // DOXYGEN
    \n-
    213
    \n-
    215
    \n-
    222 template<typename Node, std::size_t... indices>
    \n-
    223 using Child = typename impl::_Child<Node,indices...>::type;
    \n-
    224
    \n-
    225
    \n-
    226#ifndef DOXYGEN
    \n-
    227
    \n-
    228 namespace impl {
    \n-
    229
    \n-
    230 template<typename Node, typename TreePath>
    \n-
    231 struct _ChildForTreePath
    \n-
    232 {
    \n-
    233 using type = typename std::decay<decltype(child(std::declval<Node>(),std::declval<TreePath>()))>::type;
    \n-
    234 };
    \n-
    235
    \n-
    236 }
    \n-
    237
    \n-
    238#endif // DOXYGEN
    \n-
    239
    \n-
    241
    \n-
    249 template<typename Node, typename TreePath>
    \n-
    250 using ChildForTreePath = typename impl::_ChildForTreePath<Node,TreePath>::type;
    \n-
    251
    \n-
    252
    \n-
    253#ifndef DOXYGEN
    \n-
    254
    \n-
    255 namespace impl {
    \n-
    256
    \n-
    257 // By default, types are flat indices if they are integral
    \n-
    258 template<typename T>
    \n-
    259 struct _is_flat_index
    \n-
    260 {
    \n-
    261 using type = std::is_integral<T>;
    \n-
    262 };
    \n-
    263
    \n-
    264 // And so is any index_constant
    \n-
    265 template<std::size_t i>
    \n-
    266 struct _is_flat_index<index_constant<i>>
    \n-
    267 {
    \n-
    268 using type = std::true_type;
    \n-
    269 };
    \n-
    270
    \n-
    271 }
    \n-
    272
    \n-
    273#endif // DOXYGEN
    \n-
    274
    \n-
    276 /*
    \n-
    277 * This type trait can be used to check whether T is a flat index (i.e. either `std::size_t`
    \n-
    278 * or `index_constant`). The type trait normalizes T before doing the check, so it will also
    \n-
    279 * work correctly for references and cv-qualified types.
    \n-
    280 */
    \n-
    281 template<typename T>
    \n-
    282 using is_flat_index = typename impl::_is_flat_index<std::decay_t<T>>::type;
    \n-
    283
    \n-
    284#ifndef DOXYGEN
    \n-
    285
    \n-
    286 namespace impl {
    \n-
    287
    \n-
    288 // helper function for check in member child() functions that tolerates being passed something that
    \n-
    289 // isn't a TreePath. It will just return 0 in that case
    \n-
    290
    \n-
    291 template<typename T>
    \n-
    292 constexpr typename std::enable_if<
    \n-\n-
    294 bool
    \n-
    295 >::type
    \n-
    296 _non_empty_tree_path (T)
    \n-
    297 {
    \n-
    298 return false;
    \n-
    299 }
    \n-
    300
    \n-
    301 template<typename T>
    \n-
    302 constexpr typename std::enable_if<
    \n-\n-
    304 bool
    \n-
    305 >::type
    \n-
    306 _non_empty_tree_path (T t)
    \n-
    307 {
    \n-
    308 return treePathSize(t) > 0;
    \n-
    309 }
    \n-
    310
    \n-
    311 }
    \n-
    312
    \n-
    313#endif // DOXYGEN
    \n-
    314
    \n-
    316
    \n-
    317 } // namespace TypeTree
    \n-
    318} //namespace Dune
    \n-
    319
    \n-
    320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH
    \n-\n-\n-
    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
    \n-
    ImplementationDefined childStorage(Node &&node, Indices... indices)
    Definition childextraction.hh:136
    \n-
    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
    \n-
    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
    \n-
    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
    \n-
    constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
    Returns the size (number of components) of the given HybridTreePath.
    Definition treepath.hh:199
    \n-
    constexpr HybridTreePath< T... > treePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:191
    \n+
    89
    \n+
    90#ifndef DOXYGEN
    \n+
    91
    \n+
    93
    \n+
    99 template<typename Node, typename NodeTag>
    \n+
    100 std::size_t degree(const Node* node, NodeTag)
    \n+
    101 {
    \n+
    102 return node->degree();
    \n+
    103 }
    \n+
    104
    \n+
    105#endif // DOXYGEN
    \n+
    106
    \n+
    108
    \n+
    112 template<typename Node>
    \n+
    113 using StaticDegree = decltype(Node::degree());
    \n+
    114
    \n+
    116
    \n+
    117 } // namespace TypeTree
    \n+
    118} //namespace Dune
    \n+
    119
    \n+
    120#endif // DUNE_TYPETREE_NODEINTERFACE_HH
    \n+
    std::size_t degree(const Node &node)
    Returns the degree of node as run time information.
    Definition nodeinterface.hh:85
    \n+
    typename std::decay_t< Node >::NodeTag NodeTag
    Returns the node tag of the given Node.
    Definition nodeinterface.hh:76
    \n+
    typename std::decay_t< T >::ImplementationTag ImplementationTag
    Returns the implementation tag of the given Node.
    Definition nodeinterface.hh:80
    \n+
    decltype(Node::degree()) StaticDegree
    Returns the statically known degree of the given Node type as a std::integral_constant.
    Definition nodeinterface.hh:113
    \n
    Definition accumulate_static.hh:13
    \n-
    A hybrid version of TreePath that supports both compile time and run time indices.
    Definition treepath.hh:79
    \n+
    Interface for nodes in a dune-typetree.
    Definition nodeinterface.hh:33
    \n+
    static const std::size_t CHILDREN
    Number of children of this node in the dune-typetree.
    Definition nodeinterface.hh:49
    \n+
    static auto degree()
    Number of children of this node in the dune-typetree.
    \n+
    static const bool isPower
    Whether this is a power node in the dune-typetree.
    Definition nodeinterface.hh:38
    \n+
    static const bool isLeaf
    Whether this is a leaf node in a dune-typetree.
    Definition nodeinterface.hh:35
    \n+
    ImplementationDefined NodeStorage
    container type to pass around a collection of children
    Definition nodeinterface.hh:71
    \n+
    static const bool isComposite
    Whether this is a composite node in the dune-typetree.
    Definition nodeinterface.hh:41
    \n+
    ImplementationDefined NodeTag
    The type tag that describes what kind of node this is.
    Definition nodeinterface.hh:65
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,321 +7,129 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-childextraction.hh\n+nodeinterface.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=8 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_CHILDEXTRACTION_HH\n- 5#define DUNE_TYPETREE_CHILDEXTRACTION_HH\n+ 4#ifndef DUNE_TYPETREE_NODEINTERFACE_HH\n+ 5#define DUNE_TYPETREE_NODEINTERFACE_HH\n 6\n- 7#include \n- 8#include \n+ 7#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n+ 10#include \n+ 11\n+ 12namespace Dune {\n+ 13 namespace TypeTree {\n 14\n- 15#include \n- 16#include \n- 17\n- 18\n- 19namespace Dune {\n- 20 namespace TypeTree {\n- 21\n- 26\n- 27#ifndef DOXYGEN\n- 28\n- 29 namespace Impl {\n- 30\n- 31 // check at run time whether index is a valid child index\n- 32 template \n- 33 std::true_type checkChildIndex (Node const& node, Index i)\n- 34 {\n- 35 assert(std::size_t(i) < node.degree() && \"Child index out of range\");\n- 36 return {};\n- 37 }\n- 38\n- 39 // check at compile time whether index is a valid index\n- 40 template \n- 41 std::bool_constant<(i < Node::degree())> checkChildIndex (Node const& node,\n-index_constant)\n- 42 {\n- 43 static_assert(i < Node::degree(), \"Child index out of range\");\n- 44 return {};\n- 45 }\n- 46\n- 47 // finally return the node itself if no further indices are provided. Break\n-condition\n- 48 // for the recursion over the node childs.\n- 49 template\n- 50 decltype(auto) childImpl (Node&& node)\n- 51 {\n- 52 return std::forward(node);\n- 53 }\n- 54\n- 55 template\n- 56 auto childStorageImpl (NodePtr&& nodePtr)\n- 57 {\n- 58 return std::forward(nodePtr);\n- 59 }\n+32 struct NodeInterface\n+ 33 {\n+35 static const bool isLeaf = implementationDefined;\n+ 36\n+38 static const bool isPower = implementationDefined;\n+ 39\n+41 static const bool isComposite = implementationDefined;\n+ 42\n+ 44\n+49 static const std::size_t CHILDREN = implementationDefined;\n+ 50\n+ 52\n+57 static auto degree();\n+ 58\n 60\n- 61 // recursively call `node.child(...)` with the given indices\n- 62 template\n- 63 decltype(auto) childImpl (Node&& node, I0 i0, [[maybe_unused]] I... i)\n- 64 {\n- 65 auto valid = checkChildIndex(node,i0);\n- 66 if constexpr (valid)\n- 67 return childImpl(node.child(i0),i...);\n- 68 else\n- 69 return;\n- 70 }\n- 71\n- 72 // recursively call `node.childStorage(...)` with the given indices\n- 73 template\n- 74 decltype(auto) childStorageImpl (NodePtr&& nodePtr, I0 i0, [[maybe_unused]]\n-I... i)\n- 75 {\n- 76 auto valid = checkChildIndex(*nodePtr,i0);\n- 77 if constexpr (valid)\n- 78 return childStorageImpl(nodePtr->childStorage(i0),i...);\n- 79 else\n- 80 return;\n- 81 }\n+65 typedef ImplementationDefined NodeTag;\n+ 66\n+ 68\n+71 typedef ImplementationDefined NodeStorage;\n+ 72 };\n+ 73\n+ 75 template\n+76 using NodeTag = typename std::decay_t::NodeTag;\n+ 77\n+ 79 template\n+80 using ImplementationTag = typename std::decay_t::ImplementationTag;\n+ 81\n 82\n- 83 // forward to the impl methods by extracting the indices from the treepath\n- 84 template\n- 85 decltype(auto) child (Node&& node, [[maybe_unused]]\n-HybridTreePath tp, std::index_sequence)\n+ 84 template\n+85 std::size_t degree(const Node& node)\n 86 {\n- 87 return childImpl(std::forward(node),treePathEntry(tp)...);\n+ 87 return degree(&node,NodeTag());\n 88 }\n 89\n- 90 // forward to the impl methods by extracting the indices from the treepath\n- 91 template\n- 92 decltype(auto) childStorage (NodePtr&& nodePtr, [[maybe_unused]]\n-HybridTreePath tp, std::index_sequence)\n- 93 {\n- 94 return childStorageImpl(std::forward(nodePtr),treePathEntry\n-(tp)...);\n- 95 }\n- 96\n- 97 } // end namespace Impl\n- 98\n- 99#endif // DOXYGEN\n- 100\n- 102\n- 124 template\n- 125#ifdef DOXYGEN\n-126 ImplementationDefined child (Node&& node, Indices... indices)\n- 127#else\n- 128 decltype(auto) child (Node&& node, Indices... indices)\n- 129#endif\n- 130 {\n- 131 return Impl::childImpl(std::forward(node),indices...);\n- 132 }\n- 133\n- 134 template\n- 135#ifdef DOXYGEN\n-136 ImplementationDefined childStorage (Node&& node, Indices... indices)\n- 137#else\n- 138 auto childStorage (Node&& node, Indices... indices)\n- 139#endif\n- 140 {\n- 141 static_assert(sizeof...(Indices) > 0, \"childStorage() cannot be called\n-with an empty list of child indices\");\n- 142 return Impl::childStorageImpl(&node,indices...);\n- 143 }\n- 144\n- 146\n- 169 template\n- 170#ifdef DOXYGEN\n-171 ImplementationDefined child (Node&& node, HybridTreePath\n-treePath)\n- 172#else\n- 173 decltype(auto) child (Node&& node, HybridTreePath tp)\n- 174#endif\n- 175 {\n- 176 return Impl::child(std::forward(node),tp,std::\n-index_sequence_for{});\n- 177 }\n- 178\n- 179 template\n- 180#ifdef DOXYGEN\n- 181 ImplementationDefined child (Node&& node, HybridTreePath\n-treePath)\n- 182#else\n- 183 auto childStorage (Node&& node, HybridTreePath tp)\n- 184#endif\n- 185 {\n- 186 static_assert(sizeof...(Indices) > 0, \"childStorage() cannot be called\n-with an empty TreePath\");\n- 187 return Impl::childStorage(&node,tp,std::index_sequence_for{});\n- 188 }\n- 189\n- 190\n- 191#ifndef DOXYGEN\n- 192\n- 193 namespace impl {\n- 194\n- 195 template\n- 196 struct filter_void\n- 197 {\n- 198 using type = T;\n- 199 };\n- 200\n- 201 template<>\n- 202 struct filter_void\n- 203 {};\n- 204\n- 205 template\n- 206 struct _Child\n- 207 : public filter_void\n-(),index_constant{}...))>>\n- 208 {};\n- 209\n- 210 }\n- 211\n- 212#endif // DOXYGEN\n- 213\n- 215\n- 222 template\n-223 using Child = typename impl::_Child::type;\n- 224\n- 225\n- 226#ifndef DOXYGEN\n- 227\n- 228 namespace impl {\n- 229\n- 230 template\n- 231 struct _ChildForTreePath\n- 232 {\n- 233 using type = typename std::decay(),std::\n-declval()))>::type;\n- 234 };\n- 235\n- 236 }\n- 237\n- 238#endif // DOXYGEN\n- 239\n- 241\n- 249 template\n-250 using ChildForTreePath = typename impl::_ChildForTreePath::\n-type;\n- 251\n- 252\n- 253#ifndef DOXYGEN\n- 254\n- 255 namespace impl {\n- 256\n- 257 // By default, types are flat indices if they are integral\n- 258 template\n- 259 struct _is_flat_index\n- 260 {\n- 261 using type = std::is_integral;\n- 262 };\n- 263\n- 264 // And so is any index_constant\n- 265 template\n- 266 struct _is_flat_index>\n- 267 {\n- 268 using type = std::true_type;\n- 269 };\n- 270\n- 271 }\n- 272\n- 273#endif // DOXYGEN\n- 274\n- 276 /*\n- 277 * This type trait can be used to check whether T is a flat index (i.e.\n-either `std::size_t`\n- 278 * or `index_constant`). The type trait normalizes T before doing the\n-check, so it will also\n- 279 * work correctly for references and cv-qualified types.\n- 280 */\n- 281 template\n-282 using is_flat_index = typename impl::_is_flat_index>::type;\n- 283\n- 284#ifndef DOXYGEN\n- 285\n- 286 namespace impl {\n- 287\n- 288 // helper function for check in member child() functions that tolerates\n-being passed something that\n- 289 // isn't a TreePath. It will just return 0 in that case\n- 290\n- 291 template\n- 292 constexpr typename std::enable_if<\n- 293 Dune::TypeTree::is_flat_index::value,\n- 294 bool\n- 295 >::type\n- 296 _non_empty_tree_path (T)\n- 297 {\n- 298 return false;\n- 299 }\n- 300\n- 301 template\n- 302 constexpr typename std::enable_if<\n- 303 !Dune::TypeTree::is_flat_index::value,\n- 304 bool\n- 305 >::type\n- 306 _non_empty_tree_path (T t)\n- 307 {\n- 308 return treePathSize(t) > 0;\n- 309 }\n- 310\n- 311 }\n- 312\n- 313#endif // DOXYGEN\n- 314\n- 316\n- 317 } // namespace TypeTree\n- 318} //namespace Dune\n- 319\n- 320#endif // DUNE_TYPETREE_CHILDEXTRACTION_HH\n-nodeinterface.hh\n-treepath.hh\n-Dune::TypeTree::is_flat_index\n-typename impl::_is_flat_index< std::decay_t< T > >::type is_flat_index\n-Type trait that determines whether T is a flat index in the context of child\n-extraction.\n-Definition childextraction.hh:282\n-Dune::TypeTree::childStorage\n-ImplementationDefined childStorage(Node &&node, Indices... indices)\n-Definition childextraction.hh:136\n-Dune::TypeTree::Child\n-typename impl::_Child< Node, indices... >::type Child\n-Template alias for the type of a child node given by a list of child indices.\n-Definition childextraction.hh:223\n-Dune::TypeTree::child\n-ImplementationDefined child(Node &&node, Indices... indices)\n-Extracts the child of a node given by a sequence of compile-time and run-time\n-indices.\n-Definition childextraction.hh:126\n-Dune::TypeTree::ChildForTreePath\n-typename impl::_ChildForTreePath< Node, TreePath >::type ChildForTreePath\n-Template alias for the type of a child node given by a TreePath or a\n-HybridTreePath type.\n-Definition childextraction.hh:250\n-Dune::TypeTree::treePathSize\n-constexpr std::size_t treePathSize(const HybridTreePath< T... > &)\n-Returns the size (number of components) of the given HybridTreePath.\n-Definition treepath.hh:199\n-Dune::TypeTree::treePath\n-constexpr HybridTreePath< T... > treePath(const T &... t)\n-Constructs a new HybridTreePath from the given indices.\n-Definition treepath.hh:191\n+ 90#ifndef DOXYGEN\n+ 91\n+ 93\n+ 99 template\n+ 100 std::size_t degree(const Node* node, NodeTag)\n+ 101 {\n+ 102 return node->degree();\n+ 103 }\n+ 104\n+ 105#endif // DOXYGEN\n+ 106\n+ 108\n+ 112 template\n+113 using StaticDegree = decltype(Node::degree());\n+ 114\n+ 116\n+ 117 } // namespace TypeTree\n+ 118} //namespace Dune\n+ 119\n+ 120#endif // DUNE_TYPETREE_NODEINTERFACE_HH\n+Dune::TypeTree::degree\n+std::size_t degree(const Node &node)\n+Returns the degree of node as run time information.\n+Definition nodeinterface.hh:85\n+Dune::TypeTree::NodeTag\n+typename std::decay_t< Node >::NodeTag NodeTag\n+Returns the node tag of the given Node.\n+Definition nodeinterface.hh:76\n+Dune::TypeTree::ImplementationTag\n+typename std::decay_t< T >::ImplementationTag ImplementationTag\n+Returns the implementation tag of the given Node.\n+Definition nodeinterface.hh:80\n+Dune::TypeTree::StaticDegree\n+decltype(Node::degree()) StaticDegree\n+Returns the statically known degree of the given Node type as a std::\n+integral_constant.\n+Definition nodeinterface.hh:113\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::HybridTreePath\n-A hybrid version of TreePath that supports both compile time and run time\n-indices.\n-Definition treepath.hh:79\n+Dune::TypeTree::NodeInterface\n+Interface for nodes in a dune-typetree.\n+Definition nodeinterface.hh:33\n+Dune::TypeTree::NodeInterface::CHILDREN\n+static const std::size_t CHILDREN\n+Number of children of this node in the dune-typetree.\n+Definition nodeinterface.hh:49\n+Dune::TypeTree::NodeInterface::degree\n+static auto degree()\n+Number of children of this node in the dune-typetree.\n+Dune::TypeTree::NodeInterface::isPower\n+static const bool isPower\n+Whether this is a power node in the dune-typetree.\n+Definition nodeinterface.hh:38\n+Dune::TypeTree::NodeInterface::isLeaf\n+static const bool isLeaf\n+Whether this is a leaf node in a dune-typetree.\n+Definition nodeinterface.hh:35\n+Dune::TypeTree::NodeInterface::NodeStorage\n+ImplementationDefined NodeStorage\n+container type to pass around a collection of children\n+Definition nodeinterface.hh:71\n+Dune::TypeTree::NodeInterface::isComposite\n+static const bool isComposite\n+Whether this is a composite node in the dune-typetree.\n+Definition nodeinterface.hh:41\n+Dune::TypeTree::NodeInterface::NodeTag\n+ImplementationDefined NodeTag\n+The type tag that describes what kind of node this is.\n+Definition nodeinterface.hh:65\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00056.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: nodetags.hh File Reference\n+dune-typetree: generictransformationdescriptors.hh File Reference\n \n \n \n \n \n \n \n@@ -72,33 +72,47 @@\n
  • dune
  • typetree
  • \n
    \n \n
    \n \n-
    nodetags.hh File Reference
    \n+
    generictransformationdescriptors.hh File Reference
    \n
    \n
    \n-\n+
    #include <array>
    \n+#include <memory>
    \n+#include <dune/typetree/nodeinterface.hh>
    \n+#include <dune/typetree/nodetags.hh>
    \n+#include <dune/typetree/powercompositenodetransformationtemplates.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n+\n \n-\n-\n+\n \n-\n-\n+\n \n

    \n Classes

    struct  Dune::TypeTree::LeafNodeTag
     Tag designating a leaf node. 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::PowerNodeTag
     Tag designating a power node. More...
    struct  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >
     
    struct  Dune::TypeTree::DynamicPowerNodeTag
     Tag designating a power node with runtime degree. More...
    struct  Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC >
     
    struct  Dune::TypeTree::CompositeNodeTag
     Tag designating a composite node. More...
    struct  Dune::TypeTree::GenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,28 +7,52 @@\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n Classes | Namespaces\n-nodetags.hh File Reference\n+generictransformationdescriptors.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::TypeTree::LeafNodeTag\n-\u00a0 Tag designating a leaf node. More...\n+struct \u00a0Dune::TypeTree::GenericLeafNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n \u00a0\n-struct \u00a0Dune::TypeTree::PowerNodeTag\n-\u00a0 Tag designating a power node. More...\n+struct \u00a0Dune::TypeTree::TemplatizedGenericPowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNodeTemplate_>\n \u00a0\n-struct \u00a0Dune::TypeTree::DynamicPowerNodeTag\n-\u00a0 Tag designating a power node with runtime degree. More...\n+struct \u00a0Dune::TypeTree::TemplatizedGenericPowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNodeTemplate_>::result<_TC_>\n \u00a0\n-struct \u00a0Dune::TypeTree::CompositeNodeTag\n-\u00a0 Tag designating a composite node. More...\n+struct \u00a0Dune::TypeTree::GenericPowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation<\n+ SourceNode,_Transformation,_TransformedNodeTemplate_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation<\n+ SourceNode,_Transformation,_TransformedNodeTemplate_>::result<_TC_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::GenericDynamicPowerNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation<\n+ SourceNode,_Transformation,_TransformedNodeTemplate_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation<\n+ SourceNode,_Transformation,_TransformedNodeTemplate_>::result<_TC_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::GenericCompositeNodeTransformation<_SourceNode,\n+ Transformation,_TransformedNode_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00056_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: nodetags.hh Source File\n+dune-typetree: generictransformationdescriptors.hh Source File\n \n \n \n \n \n \n \n@@ -74,52 +74,286 @@\n \n
    \n \n
    \n \n
    \n-
    nodetags.hh
    \n+
    generictransformationdescriptors.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_NODETAGS_HH
    \n-
    5#define DUNE_TYPETREE_NODETAGS_HH
    \n+
    4#ifndef DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
    \n+
    5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
    \n
    6
    \n-
    7namespace Dune {
    \n-
    8 namespace TypeTree {
    \n+
    7#include <array>
    \n+
    8#include <memory>
    \n
    9
    \n-
    16 struct LeafNodeTag {};
    \n-
    17
    \n-
    19 struct PowerNodeTag {};
    \n-
    20
    \n-\n-
    23
    \n-\n-
    26
    \n-
    27#ifndef DOXYGEN
    \n-
    28
    \n-
    30 struct StartTag {};
    \n-
    31
    \n+\n+\n+\n+
    13#include <dune/common/exceptions.hh>
    \n+
    14
    \n+
    15
    \n+
    16namespace Dune {
    \n+
    17 namespace TypeTree {
    \n+
    18
    \n+
    24 template<typename SourceNode, typename Transformation, typename TransformedNode>
    \n+
    \n+\n+
    26 {
    \n+
    27
    \n+
    28 static const bool recursive = false;
    \n+
    29
    \n+
    30 typedef TransformedNode transformed_type;
    \n+
    31 typedef std::shared_ptr<transformed_type> transformed_storage_type;
    \n
    32
    \n-
    33
    \n-
    34#endif // DOXYGEN
    \n-
    35
    \n+
    \n+
    33 static transformed_type transform(const SourceNode& s, const Transformation& t)
    \n+
    34 {
    \n+
    35 return transformed_type(s,t);
    \n+
    36 }
    \n+
    \n
    37
    \n-
    38 } // namespace TypeTree
    \n-
    39} //namespace Dune
    \n-
    40
    \n-
    41#endif // DUNE_TYPETREE_NODETAGS_HH
    \n+
    \n+
    38 static transformed_type transform(std::shared_ptr<const SourceNode> s, const Transformation& t)
    \n+
    39 {
    \n+
    40 return transformed_type(s,t);
    \n+
    41 }
    \n+
    \n+
    42
    \n+
    \n+
    43 static transformed_storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t)
    \n+
    44 {
    \n+
    45 return std::make_shared<transformed_type>(s,t);
    \n+
    46 }
    \n+
    \n+
    47
    \n+
    48 };
    \n+
    \n+
    49
    \n+
    50
    \n+
    51 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNodeTemplate>
    \n+
    \n+\n+
    53 {
    \n+
    54
    \n+
    55 static const bool recursive = true;
    \n+
    56
    \n+
    57 template<typename TC>
    \n+
    \n+
    58 struct result
    \n+
    59 {
    \n+
    60 typedef typename TransformedNodeTemplate<TC>::type type;
    \n+
    61 typedef std::shared_ptr<type> storage_type;
    \n+
    62 static const std::size_t degree = StaticDegree<type>::value;
    \n+
    63 };
    \n+
    \n+
    64
    \n+
    65 template<typename TC>
    \n+
    \n+
    66 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::array<std::shared_ptr<TC>,result<TC>::degree>& children)
    \n+
    67 {
    \n+
    68 return typename result<TC>::type(s,t,children);
    \n+
    69 }
    \n+
    \n+
    70
    \n+
    71 template<typename TC>
    \n+
    \n+
    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)
    \n+
    73 {
    \n+
    74 return typename result<TC>::type(s,t,children);
    \n+
    75 }
    \n+
    \n+
    76
    \n+
    77 template<typename TC>
    \n+
    \n+
    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)
    \n+
    79 {
    \n+
    80 return std::make_shared<typename result<TC>::type>(s,t,children);
    \n+
    81 }
    \n+
    \n+
    82
    \n+
    83 };
    \n+
    \n+
    84
    \n+
    85
    \n+
    86 template<typename SourceNode, typename Transformation, template<typename,typename,std::size_t> class TransformedNode>
    \n+
    \n+\n+\n+
    89 Transformation,
    \n+
    90 GenericPowerNodeTransformationTemplate<SourceNode,
    \n+
    91 Transformation,
    \n+
    92 TransformedNode>::template result
    \n+
    93 >
    \n+
    94 {};
    \n+
    \n+
    95
    \n+
    96
    \n+
    97 template<typename SourceNode, typename Transformation, template<typename Child> class TransformedNodeTemplate>
    \n+
    \n+\n+
    99 {
    \n+
    100
    \n+
    101 static const bool recursive = true;
    \n+
    102
    \n+
    103 template<typename TC>
    \n+
    \n+
    104 struct result
    \n+
    105 {
    \n+
    106 typedef typename TransformedNodeTemplate<TC>::type type;
    \n+
    107 typedef std::shared_ptr<type> storage_type;
    \n+
    108 };
    \n+
    \n+
    109
    \n+
    110 template<typename TC>
    \n+
    \n+
    111 static typename result<TC>::type transform(const SourceNode& s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
    \n+
    112 {
    \n+
    113 return typename result<TC>::type(s,t,children);
    \n+
    114 }
    \n+
    \n+
    115
    \n+
    116 template<typename TC>
    \n+
    \n+
    117 static typename result<TC>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, const std::vector<std::shared_ptr<TC>>& children)
    \n+
    118 {
    \n+
    119 return typename result<TC>::type(s,t,children);
    \n+
    120 }
    \n+
    \n+
    121
    \n+
    122 template<typename TC>
    \n+
    \n+
    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)
    \n+
    124 {
    \n+
    125 return std::make_shared<typename result<TC>::type>(s,t,children);
    \n+
    126 }
    \n+
    \n+
    127
    \n+
    128 };
    \n+
    \n+
    129
    \n+
    130
    \n+
    131 template<typename SourceNode, typename Transformation, template<typename,typename> class TransformedNode>
    \n+
    \n+\n+\n+
    134 Transformation,
    \n+
    135 GenericDynamicPowerNodeTransformationTemplate<SourceNode,
    \n+
    136 Transformation,
    \n+
    137 TransformedNode>::template result
    \n+
    138 >
    \n+
    139 {};
    \n+
    \n+
    140
    \n+
    141
    \n+
    142 template<typename SourceNode, typename Transformation, template<typename...> class TransformedNodeTemplate>
    \n+
    \n+\n+
    144 {
    \n+
    145
    \n+
    146 static const bool recursive = true;
    \n+
    147
    \n+
    148 template<typename... TC>
    \n+
    \n+
    149 struct result
    \n+
    150 {
    \n+
    151 typedef typename TransformedNodeTemplate<TC...>::type type;
    \n+
    152 typedef std::shared_ptr<type> storage_type;
    \n+
    153 };
    \n+
    \n+
    154
    \n+
    155 template<typename... TC>
    \n+
    \n+
    156 static typename result<TC...>::type transform(const SourceNode& s, const Transformation& t, std::shared_ptr<TC>... children)
    \n+
    157 {
    \n+
    158 return typename result<TC...>::type(s,t,children...);
    \n+
    159 }
    \n+
    \n+
    160
    \n+
    161 template<typename... TC>
    \n+
    \n+
    162 static typename result<TC...>::type transform(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
    \n+
    163 {
    \n+
    164 return typename result<TC...>::type(s,t,children...);
    \n+
    165 }
    \n+
    \n+
    166
    \n+
    167 template<typename... TC>
    \n+
    \n+
    168 static typename result<TC...>::storage_type transform_storage(std::shared_ptr<const SourceNode> s, const Transformation& t, std::shared_ptr<TC>... children)
    \n+
    169 {
    \n+
    170 return std::make_shared<typename result<TC...>::type>(s,t,children...);
    \n+
    171 }
    \n+
    \n+
    172
    \n+
    173 };
    \n+
    \n+
    174
    \n+
    175
    \n+
    176 template<typename SourceNode, typename Transformation, template<typename,typename...> class TransformedNode>
    \n+
    \n+\n+\n+
    179 Transformation,
    \n+
    180 GenericCompositeNodeTransformationTemplate<SourceNode,
    \n+
    181 Transformation,
    \n+
    182 TransformedNode>::template result
    \n+
    183 >
    \n+
    184 {};
    \n+
    \n+
    185
    \n+
    187
    \n+
    188 } // namespace TypeTree
    \n+
    189} //namespace Dune
    \n+
    190
    \n+
    191#endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH
    \n+\n+\n+\n+
    decltype(Node::degree()) StaticDegree
    Returns the statically known degree of the given Node type as a std::integral_constant.
    Definition nodeinterface.hh:113
    \n
    Definition accumulate_static.hh:13
    \n-
    Tag designating a leaf node.
    Definition nodetags.hh:16
    \n-
    Tag designating a power node.
    Definition nodetags.hh:19
    \n-
    Tag designating a power node with runtime degree.
    Definition nodetags.hh:22
    \n-
    Tag designating a composite node.
    Definition nodetags.hh:25
    \n+
    Definition generictransformationdescriptors.hh:26
    \n+
    TransformedNode transformed_type
    Definition generictransformationdescriptors.hh:30
    \n+
    std::shared_ptr< transformed_type > transformed_storage_type
    Definition generictransformationdescriptors.hh:31
    \n+
    static transformed_type transform(std::shared_ptr< const SourceNode > s, const Transformation &t)
    Definition generictransformationdescriptors.hh:38
    \n+
    static const bool recursive
    Definition generictransformationdescriptors.hh:28
    \n+
    static transformed_storage_type transform_storage(std::shared_ptr< const SourceNode > s, const Transformation &t)
    Definition generictransformationdescriptors.hh:43
    \n+
    static transformed_type transform(const SourceNode &s, const Transformation &t)
    Definition generictransformationdescriptors.hh:33
    \n+
    Definition generictransformationdescriptors.hh:53
    \n+
    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
    \n+
    static const bool recursive
    Definition generictransformationdescriptors.hh:55
    \n+
    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
    \n+
    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
    \n+
    Definition generictransformationdescriptors.hh:59
    \n+
    TransformedNodeTemplate< TC >::type type
    Definition generictransformationdescriptors.hh:60
    \n+
    static const std::size_t degree
    Definition generictransformationdescriptors.hh:62
    \n+
    std::shared_ptr< type > storage_type
    Definition generictransformationdescriptors.hh:61
    \n+
    Definition generictransformationdescriptors.hh:94
    \n+
    Definition generictransformationdescriptors.hh:99
    \n+
    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
    \n+
    static const bool recursive
    Definition generictransformationdescriptors.hh:101
    \n+
    static result< TC >::type transform(const SourceNode &s, const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)
    Definition generictransformationdescriptors.hh:111
    \n+
    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
    \n+
    Definition generictransformationdescriptors.hh:105
    \n+
    TransformedNodeTemplate< TC >::type type
    Definition generictransformationdescriptors.hh:106
    \n+
    std::shared_ptr< type > storage_type
    Definition generictransformationdescriptors.hh:107
    \n+
    Definition generictransformationdescriptors.hh:139
    \n+
    Definition generictransformationdescriptors.hh:144
    \n+
    static result< TC... >::type transform(const SourceNode &s, const Transformation &t, std::shared_ptr< TC >... children)
    Definition generictransformationdescriptors.hh:156
    \n+
    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
    \n+
    static result< TC... >::type transform(std::shared_ptr< const SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)
    Definition generictransformationdescriptors.hh:162
    \n+
    static const bool recursive
    Definition generictransformationdescriptors.hh:146
    \n+
    Definition generictransformationdescriptors.hh:150
    \n+
    TransformedNodeTemplate< TC... >::type type
    Definition generictransformationdescriptors.hh:151
    \n+
    std::shared_ptr< type > storage_type
    Definition generictransformationdescriptors.hh:152
    \n+
    Definition generictransformationdescriptors.hh:184
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,56 +7,345 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-nodetags.hh\n+generictransformationdescriptors.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_NODETAGS_HH\n- 5#define DUNE_TYPETREE_NODETAGS_HH\n+ 4#ifndef DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH\n+ 5#define DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH\n 6\n- 7namespace Dune {\n- 8 namespace TypeTree {\n+ 7#include \n+ 8#include \n 9\n-16 struct LeafNodeTag {};\n- 17\n-19 struct PowerNodeTag {};\n- 20\n-22 struct DynamicPowerNodeTag {};\n- 23\n-25 struct CompositeNodeTag {};\n- 26\n- 27#ifndef DOXYGEN\n- 28\n- 30 struct StartTag {};\n- 31\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15\n+ 16namespace Dune {\n+ 17 namespace TypeTree {\n+ 18\n+ 24 template\n+25 struct GenericLeafNodeTransformation\n+ 26 {\n+ 27\n+28 static const bool recursive = false;\n+ 29\n+30 typedef TransformedNode transformed_type;\n+31 typedef std::shared_ptr transformed_storage_type;\n 32\n- 33\n- 34#endif // DOXYGEN\n- 35\n+33 static transformed_type transform(const SourceNode& s, const Transformation&\n+t)\n+ 34 {\n+ 35 return transformed_type(s,t);\n+ 36 }\n 37\n- 38 } // namespace TypeTree\n- 39} //namespace Dune\n- 40\n- 41#endif // DUNE_TYPETREE_NODETAGS_HH\n+38 static transformed_type transform(std::shared_ptr s, const\n+Transformation& t)\n+ 39 {\n+ 40 return transformed_type(s,t);\n+ 41 }\n+ 42\n+43 static transformed_storage_type transform_storage(std::shared_ptr s, const Transformation& t)\n+ 44 {\n+ 45 return std::make_shared(s,t);\n+ 46 }\n+ 47\n+ 48 };\n+ 49\n+ 50\n+ 51 template class TransformedNodeTemplate>\n+52 struct TemplatizedGenericPowerNodeTransformation\n+ 53 {\n+ 54\n+55 static const bool recursive = true;\n+ 56\n+ 57 template\n+58 struct result\n+ 59 {\n+60 typedef typename TransformedNodeTemplate::type type;\n+61 typedef std::shared_ptr storage_type;\n+62 static const std::size_t degree = StaticDegree::value;\n+ 63 };\n+ 64\n+ 65 template\n+66 static typename result::type transform(const SourceNode& s, const\n+Transformation& t, const std::array,result::degree>&\n+children)\n+ 67 {\n+ 68 return typename result::type(s,t,children);\n+ 69 }\n+ 70\n+ 71 template\n+72 static typename result::type transform(std::shared_ptr\n+s, const Transformation& t, const std::array,result::\n+degree>& children)\n+ 73 {\n+ 74 return typename result::type(s,t,children);\n+ 75 }\n+ 76\n+ 77 template\n+78 static typename result::storage_type transform_storage(std::\n+shared_ptr s, const Transformation& t, const std::array,result::degree>& children)\n+ 79 {\n+ 80 return std::make_shared::type>(s,t,children);\n+ 81 }\n+ 82\n+ 83 };\n+ 84\n+ 85\n+ 86 template class TransformedNode>\n+87 struct GenericPowerNodeTransformation\n+ 88 : public TemplatizedGenericPowerNodeTransformation::template result\n+ 93 >\n+ 94 {};\n+ 95\n+ 96\n+ 97 template class TransformedNodeTemplate>\n+98 struct TemplatizedGenericDynamicPowerNodeTransformation\n+ 99 {\n+ 100\n+101 static const bool recursive = true;\n+ 102\n+ 103 template\n+104 struct result\n+ 105 {\n+106 typedef typename TransformedNodeTemplate::type type;\n+107 typedef std::shared_ptr storage_type;\n+ 108 };\n+ 109\n+ 110 template\n+111 static typename result::type transform(const SourceNode& s, const\n+Transformation& t, const std::vector>& children)\n+ 112 {\n+ 113 return typename result::type(s,t,children);\n+ 114 }\n+ 115\n+ 116 template\n+117 static typename result::type transform(std::shared_ptr s, const Transformation& t, const std::vector>&\n+children)\n+ 118 {\n+ 119 return typename result::type(s,t,children);\n+ 120 }\n+ 121\n+ 122 template\n+123 static typename result::storage_type transform_storage(std::\n+shared_ptr s, const Transformation& t, const std::\n+vector>& children)\n+ 124 {\n+ 125 return std::make_shared::type>(s,t,children);\n+ 126 }\n+ 127\n+ 128 };\n+ 129\n+ 130\n+ 131 template class TransformedNode>\n+132 struct GenericDynamicPowerNodeTransformation\n+ 133 : public TemplatizedGenericDynamicPowerNodeTransformation::template result\n+ 138 >\n+ 139 {};\n+ 140\n+ 141\n+ 142 template class TransformedNodeTemplate>\n+143 struct TemplatizedGenericCompositeNodeTransformation\n+ 144 {\n+ 145\n+146 static const bool recursive = true;\n+ 147\n+ 148 template\n+149 struct result\n+ 150 {\n+151 typedef typename TransformedNodeTemplate::type type;\n+152 typedef std::shared_ptr storage_type;\n+ 153 };\n+ 154\n+ 155 template\n+156 static typename result::type transform(const SourceNode& s, const\n+Transformation& t, std::shared_ptr... children)\n+ 157 {\n+ 158 return typename result::type(s,t,children...);\n+ 159 }\n+ 160\n+ 161 template\n+162 static typename result::type transform(std::shared_ptr s, const Transformation& t, std::shared_ptr... children)\n+ 163 {\n+ 164 return typename result::type(s,t,children...);\n+ 165 }\n+ 166\n+ 167 template\n+168 static typename result::storage_type transform_storage(std::\n+shared_ptr s, const Transformation& t, std::shared_ptr...\n+children)\n+ 169 {\n+ 170 return std::make_shared::type>(s,t,children...);\n+ 171 }\n+ 172\n+ 173 };\n+ 174\n+ 175\n+ 176 template class TransformedNode>\n+177 struct GenericCompositeNodeTransformation\n+ 178 : public TemplatizedGenericCompositeNodeTransformation::template result\n+ 183 >\n+ 184 {};\n+ 185\n+ 187\n+ 188 } // namespace TypeTree\n+ 189} //namespace Dune\n+ 190\n+ 191#endif // DUNE_TYPETREE_GENERICTRANSFORMATIONDESCRIPTORS_HH\n+nodetags.hh\n+powercompositenodetransformationtemplates.hh\n+nodeinterface.hh\n+Dune::TypeTree::StaticDegree\n+decltype(Node::degree()) StaticDegree\n+Returns the statically known degree of the given Node type as a std::\n+integral_constant.\n+Definition nodeinterface.hh:113\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::LeafNodeTag\n-Tag designating a leaf node.\n-Definition nodetags.hh:16\n-Dune::TypeTree::PowerNodeTag\n-Tag designating a power node.\n-Definition nodetags.hh:19\n-Dune::TypeTree::DynamicPowerNodeTag\n-Tag designating a power node with runtime degree.\n-Definition nodetags.hh:22\n-Dune::TypeTree::CompositeNodeTag\n-Tag designating a composite node.\n-Definition nodetags.hh:25\n+Dune::TypeTree::GenericLeafNodeTransformation\n+Definition generictransformationdescriptors.hh:26\n+Dune::TypeTree::GenericLeafNodeTransformation::transformed_type\n+TransformedNode transformed_type\n+Definition generictransformationdescriptors.hh:30\n+Dune::TypeTree::GenericLeafNodeTransformation::transformed_storage_type\n+std::shared_ptr< transformed_type > transformed_storage_type\n+Definition generictransformationdescriptors.hh:31\n+Dune::TypeTree::GenericLeafNodeTransformation::transform\n+static transformed_type transform(std::shared_ptr< const SourceNode > s, const\n+Transformation &t)\n+Definition generictransformationdescriptors.hh:38\n+Dune::TypeTree::GenericLeafNodeTransformation::recursive\n+static const bool recursive\n+Definition generictransformationdescriptors.hh:28\n+Dune::TypeTree::GenericLeafNodeTransformation::transform_storage\n+static transformed_storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t)\n+Definition generictransformationdescriptors.hh:43\n+Dune::TypeTree::GenericLeafNodeTransformation::transform\n+static transformed_type transform(const SourceNode &s, const Transformation &t)\n+Definition generictransformationdescriptors.hh:33\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation\n+Definition generictransformationdescriptors.hh:53\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::transform_storage\n+static result< TC >::storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t, const std::array< std::shared_ptr< TC\n+>, result< TC >::degree > &children)\n+Definition generictransformationdescriptors.hh:78\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::recursive\n+static const bool recursive\n+Definition generictransformationdescriptors.hh:55\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::transform\n+static result< TC >::type transform(std::shared_ptr< const SourceNode > s,\n+const Transformation &t, const std::array< std::shared_ptr< TC >, result< TC\n+>::degree > &children)\n+Definition generictransformationdescriptors.hh:72\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::transform\n+static result< TC >::type transform(const SourceNode &s, const Transformation\n+&t, const std::array< std::shared_ptr< TC >, result< TC >::degree > &children)\n+Definition generictransformationdescriptors.hh:66\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::result\n+Definition generictransformationdescriptors.hh:59\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::result::type\n+TransformedNodeTemplate< TC >::type type\n+Definition generictransformationdescriptors.hh:60\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::result::degree\n+static const std::size_t degree\n+Definition generictransformationdescriptors.hh:62\n+Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::result::storage_type\n+std::shared_ptr< type > storage_type\n+Definition generictransformationdescriptors.hh:61\n+Dune::TypeTree::GenericPowerNodeTransformation\n+Definition generictransformationdescriptors.hh:94\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation\n+Definition generictransformationdescriptors.hh:99\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::transform\n+static result< TC >::type transform(std::shared_ptr< const SourceNode > s,\n+const Transformation &t, const std::vector< std::shared_ptr< TC > > &children)\n+Definition generictransformationdescriptors.hh:117\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::recursive\n+static const bool recursive\n+Definition generictransformationdescriptors.hh:101\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::transform\n+static result< TC >::type transform(const SourceNode &s, const Transformation\n+&t, const std::vector< std::shared_ptr< TC > > &children)\n+Definition generictransformationdescriptors.hh:111\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::\n+transform_storage\n+static result< TC >::storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t, const std::vector< std::shared_ptr< TC\n+> > &children)\n+Definition generictransformationdescriptors.hh:123\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::result\n+Definition generictransformationdescriptors.hh:105\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::result::type\n+TransformedNodeTemplate< TC >::type type\n+Definition generictransformationdescriptors.hh:106\n+Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::result::\n+storage_type\n+std::shared_ptr< type > storage_type\n+Definition generictransformationdescriptors.hh:107\n+Dune::TypeTree::GenericDynamicPowerNodeTransformation\n+Definition generictransformationdescriptors.hh:139\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation\n+Definition generictransformationdescriptors.hh:144\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::transform\n+static result< TC... >::type transform(const SourceNode &s, const\n+Transformation &t, std::shared_ptr< TC >... children)\n+Definition generictransformationdescriptors.hh:156\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::\n+transform_storage\n+static result< TC... >::storage_type transform_storage(std::shared_ptr< const\n+SourceNode > s, const Transformation &t, std::shared_ptr< TC >... children)\n+Definition generictransformationdescriptors.hh:168\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::transform\n+static result< TC... >::type transform(std::shared_ptr< const SourceNode > s,\n+const Transformation &t, std::shared_ptr< TC >... children)\n+Definition generictransformationdescriptors.hh:162\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::recursive\n+static const bool recursive\n+Definition generictransformationdescriptors.hh:146\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::result\n+Definition generictransformationdescriptors.hh:150\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::result::type\n+TransformedNodeTemplate< TC... >::type type\n+Definition generictransformationdescriptors.hh:151\n+Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation::result::\n+storage_type\n+std::shared_ptr< type > storage_type\n+Definition generictransformationdescriptors.hh:152\n+Dune::TypeTree::GenericCompositeNodeTransformation\n+Definition generictransformationdescriptors.hh:184\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00059.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: typetree.hh File Reference\n+dune-typetree: compositenode.hh File Reference\n \n \n \n \n \n \n \n@@ -69,32 +69,45 @@\n \n
    \n \n
    \n \n
    \n-
    typetree.hh File Reference
    \n+ \n+
    compositenode.hh File Reference
    \n
    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n+\n+\n+\n+\n+\n+\n+\n+

    \n+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...
     
    \n+\n+\n+\n+\n+\n+

    \n+Namespaces

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

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n+\n+\n+\n+\n+\n

    \n+Functions

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

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+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...
     
    \n \n \n \n \n \n-\n+\n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::Detail
    namespace  Dune::TypeTree::Experimental
     
    \n \n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+

    \n 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.
     
    template<typename Tree , typename Visitor , typename Init >
    auto Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor &&visitor, Init &&init)
     Apply hybrid visitor to TypeTree.
     
    \n+

    Variable Documentation

    \n+\n+

    ◆ child_result

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

    ◆ result

    \n+\n+
    \n+
    \n+\n+ \n+ \n+ \n+ \n+
    \n+ \n+ \n+ \n+ \n+
    const result_type result = current_value
    \n+
    \n+static
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,37 +6,85 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Namespaces | Functions\n-pairtraversal.hh File Reference\n-#include \n+Classes | Namespaces | Functions\n+accumulate_static.hh File Reference\n+#include \n #include \n #include \n #include \n-#include \n-#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+struct \u00a0Dune::TypeTree::or_<_result_type_>\n+\u00a0 Statically combine two values of type result_type using ||. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::or_<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::and_<_result_type_>\n+\u00a0 Statically combine two values of type result_type using &&. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::and_<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::plus<_result_type_>\n+\u00a0 Statically combine two values of type result_type using +. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::plus<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::minus<_result_type_>\n+\u00a0 Statically combine two values of type result_type using -. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::minus<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::multiply<_result_type_>\n+\u00a0 Statically combine two values of type result_type using *. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::multiply<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::min<_result_type_>\n+\u00a0 Statically combine two values of type result_type by returning their\n+ minimum. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::min<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::max<_result_type_>\n+\u00a0 Statically combine two values of type result_type by returning their\n+ maximum. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::max<_result_type_>::reduce<_r1,_r2_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::AccumulateValue<_Tree,_Functor,_Reduction,_startValue,\n+ ParentChildReduction_>\n+\u00a0 Statically accumulate a value over the nodes of a TypeTree. More...\n+\u00a0\n+struct \u00a0Dune::TypeTree::TypeAccumulationPolicy<_Functor,_Reduction,_StartType,\n+ ParentChildReduction,_ReductionAlgorithm_>\n+\u00a0\n+struct \u00a0Dune::TypeTree::AccumulateType<_Tree,_Policy_>\n+\u00a0 Statically accumulate a type over the nodes of a TypeTree. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n-namespace \u00a0Dune::TypeTree::Detail\n+namespace \u00a0Dune::TypeTree::Experimental\n \u00a0\n Functions\n-template::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0>\n-void\u00a0Dune::TypeTree::Detail::applyToTreePair (T1 &&tree1, T2 &&tree2, TreePath\n- treePath, V &&visitor)\n-\u00a0\n-template\n-void\u00a0Dune::TypeTree::applyToTreePair (Tree1 &&tree1, Tree2 &&tree2, Visitor\n- &&visitor)\n-\u00a0 Apply visitor to a pair of TypeTrees.\n+template\n+auto\u00a0Dune::TypeTree::Experimental::hybridApplyToTree (Tree &&tree, Visitor\n+ &&visitor, Init &&init)\n+\u00a0 Apply hybrid visitor to TypeTree.\n \u00a0\n+***** Variable Documentation *****\n+***** \u25c6\u00a0child_result *****\n+const result_type child_result =\n+accumulate_value>:: static\n+result\n+***** \u25c6\u00a0result *****\n+const result_type result = current_value static\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00065_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: pairtraversal.hh Source File\n+dune-typetree: accumulate_static.hh Source File\n \n \n \n \n \n \n \n@@ -74,151 +74,591 @@\n \n
    \n \n
    \n
    \n
    \n-
    pairtraversal.hh
    \n+
    accumulate_static.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH
    \n-
    5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH
    \n+
    4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH
    \n+
    5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH
    \n
    6
    \n-
    7#include <dune/common/std/type_traits.hh>
    \n-
    8
    \n-\n-\n-\n-\n-\n-
    14
    \n-
    15namespace Dune {
    \n-
    16 namespace TypeTree {
    \n-
    17
    \n-
    \n-
    23 namespace Detail {
    \n-
    24
    \n-
    25 /* The signature is the same as for the public applyToTreePair
    \n-
    26 * function in Dune::Typtree, despite the additionally passed
    \n-
    27 * treePath argument. The path passed here is associated to
    \n-
    28 * the tree and the relative paths of the children (wrt. to tree)
    \n-
    29 * are appended to this. Hence the behavior of the public function
    \n-
    30 * is resembled by passing an empty treePath.
    \n-
    31 */
    \n-
    32
    \n-
    33 /*
    \n-
    34 * This is the overload for leaf traversal
    \n-
    35 */
    \n-
    36 template<class T1, class T2, class TreePath, class V,
    \n-
    37 std::enable_if_t<(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
    \n-
    \n-
    38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
    \n-
    39 {
    \n-
    40 visitor.leaf(tree1, tree2, treePath);
    \n-
    41 }
    \n+
    7#include <dune/common/typetraits.hh>
    \n+\n+\n+\n+
    11
    \n+
    12
    \n+
    \n+
    13namespace Dune {
    \n+
    \n+
    14 namespace TypeTree {
    \n+
    15
    \n+
    22 template<typename result_type>
    \n+
    \n+
    23 struct or_
    \n+
    24 {
    \n+
    25 template<result_type r1, result_type r2>
    \n+
    \n+
    26 struct reduce
    \n+
    27 {
    \n+
    28 static const result_type result = r1 || r2;
    \n+
    29 };
    \n+
    \n+
    30 };
    \n+
    \n+
    31
    \n+
    33 template<typename result_type>
    \n+
    \n+
    34 struct and_
    \n+
    35 {
    \n+
    36 template<result_type r1, result_type r2>
    \n+
    \n+
    37 struct reduce
    \n+
    38 {
    \n+
    39 static const result_type result = r1 && r2;
    \n+
    40 };
    \n+
    \n+
    41 };
    \n
    \n
    42
    \n-
    43 /*
    \n-
    44 * This is the general overload doing static child traversal.
    \n-
    45 */
    \n-
    46 template<class T1, class T2, class TreePath, class V,
    \n-
    47 std::enable_if_t<not(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
    \n-
    48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
    \n+
    44 template<typename result_type>
    \n+
    \n+
    45 struct plus
    \n+
    46 {
    \n+
    47 template<result_type r1, result_type r2>
    \n+
    \n+
    48 struct reduce
    \n
    49 {
    \n-
    50 // Do we really want to take care for const-ness of the Tree
    \n-
    51 // when instanciating VisitChild below? I'd rather expect this:
    \n-
    52 // using Tree1 = std::decay_t<T1>;
    \n-
    53 // using Tree2 = std::decay_t<T2>;
    \n-
    54 // using Visitor = std::decay_t<V>;
    \n-
    55 using Tree1 = std::remove_reference_t<T1>;
    \n-
    56 using Tree2 = std::remove_reference_t<T2>;
    \n-
    57 using Visitor = std::remove_reference_t<V>;
    \n-
    58 visitor.pre(tree1, tree2, treePath);
    \n-
    59
    \n-
    60 // check which type of traversal is supported by the trees
    \n-
    61 using allowDynamicTraversal = std::conjunction<
    \n-
    62 Dune::Std::is_detected<DynamicTraversalConcept,Tree1>,
    \n-
    63 Dune::Std::is_detected<DynamicTraversalConcept,Tree2>>;
    \n-
    64 using allowStaticTraversal = std::conjunction<
    \n-
    65 Dune::Std::is_detected<StaticTraversalConcept,Tree1>,
    \n-
    66 Dune::Std::is_detected<StaticTraversalConcept,Tree2>>;
    \n-
    67
    \n-
    68 // both trees must support either dynamic or static traversal
    \n-
    69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
    \n-
    70
    \n-
    71 // the visitor may specify preferred dynamic traversal
    \n-
    72 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
    \n-
    73
    \n-
    74 // create a dynamic or static index range
    \n-
    75 auto indices = [&]{
    \n-
    76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
    \n-
    77 return Dune::range(std::size_t(tree1.degree()));
    \n-
    78 else
    \n-
    79 return Dune::range(tree1.degree());
    \n-
    80 }();
    \n-
    81
    \n-
    82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
    \n-
    83 Dune::Hybrid::forEach(indices, [&](auto i) {
    \n-
    84 auto&& child1 = tree1.child(i);
    \n-
    85 auto&& child2 = tree2.child(i);
    \n-
    86 using Child1 = std::decay_t<decltype(child1)>;
    \n-
    87 using Child2 = std::decay_t<decltype(child2)>;
    \n-
    88
    \n-
    89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i);
    \n-
    90
    \n-
    91 // This requires that visitor.in(...) can always be instantiated,
    \n-
    92 // even if there's a single child only.
    \n-
    93 if (i>0)
    \n-
    94 visitor.in(tree1, tree2, treePath);
    \n-
    95
    \n-
    96 constexpr bool visitChild = Visitor::template VisitChild<Tree1,Child1,Tree2,Child2,TreePath>::value;
    \n-
    97 if constexpr(visitChild) {
    \n-
    98 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n-
    99 applyToTreePair(child1, child2, childTreePath, visitor);
    \n-
    100 }
    \n-
    101
    \n-
    102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i);
    \n-
    103 });
    \n-
    104 }
    \n-
    105 visitor.post(tree1, tree2, treePath);
    \n-
    106 }
    \n-
    107
    \n-
    108 } // namespace Detail
    \n+
    50 static const result_type result = r1 + r2;
    \n+
    51 };
    \n+
    \n+
    52 };
    \n+
    \n+
    53
    \n+
    55 template<typename result_type>
    \n+
    \n+
    56 struct minus
    \n+
    57 {
    \n+
    58 template<result_type r1, result_type r2>
    \n+
    \n+
    59 struct reduce
    \n+
    60 {
    \n+
    61 static const result_type result = r1 - r2;
    \n+
    62 };
    \n+
    \n+
    63 };
    \n+
    \n+
    64
    \n+
    66 template<typename result_type>
    \n+
    \n+
    67 struct multiply
    \n+
    68 {
    \n+
    69 template<result_type r1, result_type r2>
    \n+
    \n+
    70 struct reduce
    \n+
    71 {
    \n+
    72 static const result_type result = r1 * r2;
    \n+
    73 };
    \n+
    \n+
    74 };
    \n+
    \n+
    75
    \n+
    77 template<typename result_type>
    \n+
    \n+
    78 struct min
    \n+
    79 {
    \n+
    80 template<result_type r1, result_type r2>
    \n+
    \n+
    81 struct reduce
    \n+
    82 {
    \n+
    83 static const result_type result = r1 < r2 ? r1 : r2;
    \n+
    84 };
    \n+
    \n+
    85 };
    \n
    \n+
    86
    \n+
    88 template<typename result_type>
    \n+
    \n+
    89 struct max
    \n+
    90 {
    \n+
    91 template<result_type r1, result_type r2>
    \n+
    \n+
    92 struct reduce
    \n+
    93 {
    \n+
    94 static const result_type result = r1 > r2 ? r1 : r2;
    \n+
    95 };
    \n+
    \n+
    96 };
    \n+
    \n+
    97
    \n+
    98
    \n+
    99 namespace {
    \n+
    100
    \n+
    101 // implementation of the traversal algorithm
    \n+
    102
    \n+
    104 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath, bool doVisit>
    \n+
    105 struct accumulate_node_helper
    \n+
    106 {
    \n+
    107
    \n+
    108 typedef typename Functor::result_type result_type;
    \n
    109
    \n+
    110 static const result_type result = current_value;
    \n
    111
    \n-
    125 template<typename Tree1, typename Tree2, typename Visitor>
    \n-
    \n-
    126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor)
    \n-
    127 {
    \n-
    128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor);
    \n-
    129 }
    \n-
    \n-
    130
    \n-
    132
    \n-
    133 } // namespace TypeTree
    \n-
    134} //namespace Dune
    \n+
    112 };
    \n+
    113
    \n+
    115 template<typename Node, typename Functor, typename Reduction, typename Functor::result_type current_value, typename TreePath>
    \n+
    116 struct accumulate_node_helper<Node,Functor,Reduction,current_value,TreePath,true>
    \n+
    117 {
    \n+
    118
    \n+
    119 typedef typename Functor::result_type result_type;
    \n+
    120
    \n+
    121 static const result_type result = Reduction::template reduce<current_value,Functor::template visit<Node,TreePath>::result>::result;
    \n+
    122
    \n+
    123 };
    \n+
    124
    \n+
    126 template<typename Tree, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, typename Tag>
    \n+
    127 struct accumulate_value;
    \n+
    128
    \n+
    130 template<typename LeafNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n+
    131 struct accumulate_value<LeafNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,LeafNodeTag>
    \n+
    132 {
    \n+
    133
    \n+
    134 typedef typename Functor::result_type result_type;
    \n
    135
    \n-
    136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH
    \n-\n-\n-\n-\n-\n-
    void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)
    Apply visitor to a pair of TypeTrees.
    Definition pairtraversal.hh:126
    \n+
    136 static const result_type result =
    \n+
    137
    \n+
    138 accumulate_node_helper<LeafNode,Functor,Reduction,current_value,TreePath,Functor::template doVisit<LeafNode,TreePath>::value>::result;
    \n+
    139
    \n+
    140 };
    \n+
    141
    \n+
    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>
    \n+
    144 struct accumulate_over_children
    \n+
    145 {
    \n+
    146
    \n+
    147 typedef typename Functor::result_type result_type;
    \n+
    148
    \n+
    149 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
    \n+
    150
    \n+
    151 typedef typename Node::template Child<i>::Type child;
    \n+
    152
    \n+
    153 static const result_type child_result = accumulate_value<child,Functor,Reduction,ParentChildReduction,current_value,child_tree_path,NodeTag<child>>::result;
    \n+
    154
    \n+
    155 static const result_type result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,child_result,TreePath,i+1,n>::result;
    \n+
    156
    \n+
    157 };
    \n+
    158
    \n+
    160 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath, std::size_t n>
    \n+
    161 struct accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,n,n>
    \n+
    162 {
    \n+
    163
    \n+
    164 typedef typename Functor::result_type result_type;
    \n+
    165
    \n+
    166 static const result_type result = current_value;
    \n+
    167
    \n+
    168 };
    \n+
    169
    \n+
    172 template<typename Node, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n+
    173 struct accumulate_value_generic_composite_node
    \n+
    174 {
    \n+
    175
    \n+
    176 typedef typename Functor::result_type result_type;
    \n+
    177
    \n+
    178 static const result_type child_result = accumulate_over_children<Node,Functor,Reduction,ParentChildReduction,current_value,TreePath,0,StaticDegree<Node>::value>::result;
    \n+
    179
    \n+
    180 static const result_type result =
    \n+
    181 accumulate_node_helper<Node,Functor,ParentChildReduction,child_result,TreePath,Functor::template doVisit<Node,TreePath>::value>::result;
    \n+
    182
    \n+
    183
    \n+
    184 };
    \n+
    185
    \n+
    187 template<typename PowerNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n+
    188 struct accumulate_value<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,PowerNodeTag>
    \n+
    189 : public accumulate_value_generic_composite_node<PowerNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
    \n+
    190 {};
    \n+
    191
    \n+
    193 template<typename CompositeNode, typename Functor, typename Reduction, typename ParentChildReduction, typename Functor::result_type current_value, typename TreePath>
    \n+
    194 struct accumulate_value<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath,CompositeNodeTag>
    \n+
    195 : public accumulate_value_generic_composite_node<CompositeNode,Functor,Reduction,ParentChildReduction,current_value,TreePath>
    \n+
    196 {};
    \n+
    197
    \n+
    198 } // anonymous namespace
    \n+
    199
    \n+
    201
    \n+
    257 template<typename Tree, typename Functor, typename Reduction, typename Functor::result_type startValue, typename ParentChildReduction = Reduction>
    \n+
    \n+\n+
    259 {
    \n+
    260
    \n+
    262 typedef typename Functor::result_type result_type;
    \n+
    263
    \n+
    265 static const result_type result = accumulate_value<Tree,Functor,Reduction,ParentChildReduction,startValue,HybridTreePath<>,NodeTag<Tree>>::result;
    \n+
    266
    \n+
    267 };
    \n+
    \n+
    268
    \n+
    271 struct flattened_reduction;
    \n+
    272
    \n+
    275 struct bottom_up_reduction;
    \n+
    276
    \n+
    277 namespace {
    \n+
    278
    \n+
    279 // implementation of the traversal algorithm
    \n+
    280
    \n+
    283 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath, bool doVisit>
    \n+
    284 struct accumulate_type_node_helper
    \n+
    285 {
    \n+
    286
    \n+
    287 typedef current_type type;
    \n+
    288
    \n+
    289 };
    \n+
    290
    \n+
    292 template<typename Node, typename Functor, typename Reduction, typename current_type, typename TreePath>
    \n+
    293 struct accumulate_type_node_helper<Node,Functor,Reduction,current_type,TreePath,true>
    \n+
    294 {
    \n+
    295
    \n+
    296 typedef typename Reduction::template reduce<
    \n+
    297 current_type,
    \n+
    298 typename Functor::template visit<
    \n+
    299 Node,
    \n+
    300 TreePath
    \n+
    301 >::type
    \n+
    302 >::type type;
    \n+
    303
    \n+
    304 };
    \n+
    305
    \n+
    307 template<typename Tree, typename Policy, typename current_type, typename TreePath, typename Tag>
    \n+
    308 struct accumulate_type;
    \n+
    309
    \n+
    311 template<typename LeafNode, typename Policy, typename current_type, typename TreePath>
    \n+
    312 struct accumulate_type<LeafNode,Policy,current_type,TreePath,LeafNodeTag>
    \n+
    313 {
    \n+
    314
    \n+
    315 typedef typename accumulate_type_node_helper<
    \n+
    316 LeafNode,
    \n+
    317 typename Policy::functor,
    \n+
    318 typename Policy::sibling_reduction,
    \n+
    319 current_type,
    \n+
    320 TreePath,
    \n+
    321 Policy::functor::template doVisit<
    \n+
    322 LeafNode,
    \n+
    323 TreePath>::value
    \n+
    324 >::type type;
    \n+
    325
    \n+
    326 };
    \n+
    327
    \n+
    328
    \n+
    331 template<typename current_type, typename tree_path, typename start_type, typename reduction_strategy>
    \n+
    332 struct propagate_type_down_tree;
    \n+
    333
    \n+
    335 template<typename current_type, typename tree_path, typename start_type>
    \n+
    336 struct propagate_type_down_tree<
    \n+
    337 current_type,
    \n+
    338 tree_path,
    \n+
    339 start_type,
    \n+
    340 bottom_up_reduction
    \n+
    341 >
    \n+
    342 {
    \n+
    343 typedef current_type type;
    \n+
    344 };
    \n+
    345
    \n+
    347 template<typename current_type, typename tree_path, typename start_type>
    \n+
    348 struct propagate_type_down_tree<
    \n+
    349 current_type,
    \n+
    350 tree_path,
    \n+
    351 start_type,
    \n+
    352 flattened_reduction
    \n+
    353 >
    \n+
    354 {
    \n+
    355 typedef typename std::conditional<
    \n+
    356 TreePathBack<tree_path>::value == 0,
    \n+
    357 start_type,
    \n+
    358 current_type
    \n+
    359 >::type type;
    \n+
    360 };
    \n+
    361
    \n+
    362
    \n+
    364 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t i, std::size_t n>
    \n+
    365 struct accumulate_type_over_children
    \n+
    366 {
    \n+
    367
    \n+
    368 typedef decltype(push_back(TreePath{},index_constant<i>{})) child_tree_path;
    \n+
    369
    \n+
    370 typedef typename Node::template Child<i>::Type child;
    \n+
    371
    \n+
    372 typedef typename accumulate_type<
    \n+
    373 child,
    \n+
    374 Policy,
    \n+
    375 // apply reduction choice (flat / hierarchic)
    \n+
    376 typename propagate_type_down_tree<
    \n+
    377 current_type,
    \n+
    378 child_tree_path,
    \n+
    379 typename Policy::start_type,
    \n+
    380 typename Policy::reduction_strategy
    \n+
    381 >::type,
    \n+
    382 child_tree_path,
    \n+
    383 NodeTag<child>
    \n+
    384 >::type child_result_type;
    \n+
    385
    \n+
    386 typedef typename accumulate_type_over_children<
    \n+
    387 Node,
    \n+
    388 Policy,
    \n+
    389 child_result_type,
    \n+
    390 TreePath,
    \n+
    391 i+1,
    \n+
    392 n
    \n+
    393 >::type type;
    \n+
    394
    \n+
    395 };
    \n+
    396
    \n+
    398 template<typename Node, typename Policy, typename current_type, typename TreePath, std::size_t n>
    \n+
    399 struct accumulate_type_over_children<Node,Policy,current_type,TreePath,n,n>
    \n+
    400 {
    \n+
    401
    \n+
    402 typedef current_type type;
    \n+
    403
    \n+
    404 };
    \n+
    405
    \n+
    406
    \n+
    409 template<typename Node, typename Policy, typename current_type, typename TreePath>
    \n+
    410 struct accumulate_type_generic_composite_node
    \n+
    411 {
    \n+
    412
    \n+
    413 typedef typename accumulate_type_over_children<
    \n+
    414 Node,
    \n+
    415 Policy,
    \n+
    416 current_type,
    \n+
    417 TreePath,
    \n+
    418 0,
    \n+
    419 StaticDegree<Node>::value
    \n+
    420 >::type children_result_type;
    \n+
    421
    \n+
    422 typedef typename accumulate_type_node_helper<
    \n+
    423 Node,
    \n+
    424 typename Policy::functor,
    \n+
    425 typename Policy::parent_child_reduction,
    \n+
    426 children_result_type,
    \n+
    427 TreePath,
    \n+
    428 Policy::functor::template doVisit<
    \n+
    429 Node,
    \n+\n+
    431 >::value
    \n+
    432 >::type type;
    \n+
    433
    \n+
    434 };
    \n+
    435
    \n+
    437 template<typename PowerNode, typename Policy, typename current_type, typename TreePath>
    \n+
    438 struct accumulate_type<PowerNode,Policy,current_type,TreePath,PowerNodeTag>
    \n+
    439 : public accumulate_type_generic_composite_node<PowerNode,Policy,current_type,TreePath>
    \n+
    440 {};
    \n+
    441
    \n+
    443 template<typename CompositeNode, typename Policy, typename current_type, typename TreePath>
    \n+
    444 struct accumulate_type<CompositeNode,Policy,current_type,TreePath,CompositeNodeTag>
    \n+
    445 : public accumulate_type_generic_composite_node<CompositeNode,Policy,current_type,TreePath>
    \n+
    446 {};
    \n+
    447
    \n+
    448 } // anonymous namespace
    \n+
    449
    \n+
    450
    \n+
    458 template<
    \n+
    459 typename Functor,
    \n+
    460 typename Reduction,
    \n+
    461 typename StartType,
    \n+
    462 typename ParentChildReduction = Reduction,
    \n+
    463 typename ReductionAlgorithm = flattened_reduction
    \n+
    464 >
    \n+
    \n+\n+
    466 {
    \n+
    467
    \n+
    495 typedef Functor functor;
    \n+
    496
    \n+
    516 typedef Reduction sibling_reduction;
    \n+
    517
    \n+
    524 typedef ParentChildReduction parent_child_reduction;
    \n+
    525
    \n+
    532 typedef StartType start_type;
    \n+
    533
    \n+
    538 typedef ReductionAlgorithm reduction_strategy;
    \n+
    539 };
    \n+
    \n+
    540
    \n+
    541
    \n+
    543
    \n+
    551 template<typename Tree, typename Policy>
    \n+
    \n+\n+
    553 {
    \n+
    554
    \n+
    556 typedef typename accumulate_type<
    \n+
    557 Tree,
    \n+
    558 Policy,
    \n+
    559 typename Policy::start_type,
    \n+\n+\n+
    562 >::type type;
    \n+
    563
    \n+
    564 };
    \n+
    \n+
    565
    \n+
    566
    \n+
    567
    \n+
    568
    \n+
    569
    \n+
    570 /***************************************************/
    \n+
    571
    \n+
    \n+
    572 namespace Experimental {
    \n+
    573 namespace Impl {
    \n+
    574
    \n+
    576 template<class T, class TreePath, class V, class U,
    \n+
    577 std::enable_if_t<std::decay_t<T>::isLeaf, int> = 0>
    \n+
    578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
    \n+
    579 {
    \n+
    580 return visitor.leaf(tree, treePath, std::forward<U>(current_val));
    \n+
    581 }
    \n+
    582
    \n+
    584 template<class T, class TreePath, class V, class U,
    \n+
    585 std::enable_if_t<not std::decay_t<T>::isLeaf, int> = 0>
    \n+
    586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&& current_val)
    \n+
    587 {
    \n+
    588 using Tree = std::remove_reference_t<T>;
    \n+
    589 using Visitor = std::remove_reference_t<V>;
    \n+
    590 auto pre_val = visitor.pre(tree, treePath, std::forward<U>(current_val));
    \n+
    591
    \n+
    592 // check which type of traversal is supported by the tree
    \n+
    593 using allowDynamicTraversal = Dune::Std::is_detected<Detail::DynamicTraversalConcept,Tree>;
    \n+
    594 using allowStaticTraversal = Dune::Std::is_detected<Detail::StaticTraversalConcept,Tree>;
    \n+
    595
    \n+
    596 // the tree must support either dynamic or static traversal
    \n+
    597 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
    \n+
    598
    \n+
    599 // the visitor may specify preferred dynamic traversal
    \n+
    600 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
    \n+
    601
    \n+
    602 // declare rule that applies visitor and current value to a child i. Returns next value
    \n+
    603 auto apply_i = [&](auto&& value, const auto& i){
    \n+
    604 auto&& child = tree.child(i);
    \n+
    605 using Child = std::decay_t<decltype(child)>;
    \n+
    606
    \n+
    607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move(value));
    \n+
    608
    \n+
    609 // visits between children
    \n+
    610 auto val_in = Hybrid::ifElse(
    \n+
    611 Hybrid::equals(i,Indices::_0),
    \n+
    612 [&](auto id){return std::move(val_before);},
    \n+
    613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));}
    \n+
    614 );
    \n+
    615
    \n+
    616 constexpr bool visitChild = Visitor::template VisitChild<Tree,Child,TreePath>::value;
    \n+
    617 auto val_visit = [&](){
    \n+
    618 if constexpr (visitChild) {
    \n+
    619 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n+
    620 return hybridApplyToTree(child, childTreePath, visitor, std::move(val_in));
    \n+
    621 }
    \n+
    622 else
    \n+
    623 return std::move(val_in);
    \n+
    624 }();
    \n+
    625
    \n+
    626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit));
    \n+
    627 };
    \n+
    628
    \n+
    629 // apply visitor to children
    \n+
    630 auto in_val = [&](){
    \n+
    631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal::value) {
    \n+
    632 // get list of static indices
    \n+
    633 auto indices = std::make_index_sequence<Tree::degree()>{};
    \n+
    634
    \n+
    635 // unfold apply_i left to right
    \n+
    636 return unpackIntegerSequence([&](auto... i) {
    \n+
    656 return left_fold(std::move(apply_i),std::move(pre_val), i...);
    \n+
    657 }, indices);
    \n+
    658
    \n+
    659 } else {
    \n+
    660 // unfold first child to get type
    \n+
    661 auto i_val = apply_i(std::move(pre_val),std::size_t{0});
    \n+
    662 // dynamically loop rest of the children to accumulate remindng values
    \n+
    663 for(std::size_t i = 1; i < tree.degree(); i++)
    \n+
    664 i_val = apply_i(i_val,i);
    \n+
    665 return i_val;
    \n+
    666 }
    \n+
    667 }();
    \n+
    668
    \n+
    669 return visitor.post(tree, treePath, in_val);
    \n+
    670 }
    \n+
    671
    \n+
    672 }
    \n+
    673
    \n+
    697 template<typename Tree, typename Visitor, typename Init>
    \n+
    \n+
    698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init)
    \n+
    699 {
    \n+
    700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init);
    \n+
    701 }
    \n+
    \n+
    702
    \n+
    703 } // namespace Experimental
    \n+
    \n+
    704
    \n+
    706 } // namespace TypeTree
    \n+
    \n+
    707} //namespace Dune
    \n+
    \n+
    708
    \n+
    709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH
    \n+\n+\n+\n+
    static const result_type child_result
    Definition accumulate_static.hh:153
    \n+
    static const result_type result
    Definition accumulate_static.hh:110
    \n+
    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
    \n+
    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
    \n+
    typename std::decay_t< Node >::NodeTag NodeTag
    Returns the node tag of the given Node.
    Definition nodeinterface.hh:76
    \n
    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
    \n
    constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:180
    \n
    constexpr HybridTreePath< T... > treePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:191
    \n
    HybridTreePath< Dune::index_constant< i >... > TreePath
    Definition treepath.hh:521
    \n
    Definition accumulate_static.hh:13
    \n-
    void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)
    Definition pairtraversal.hh:38
    \n+
    Statically combine two values of type result_type using ||.
    Definition accumulate_static.hh:24
    \n+
    Definition accumulate_static.hh:27
    \n+
    static const result_type result
    Definition accumulate_static.hh:28
    \n+
    Statically combine two values of type result_type using &&.
    Definition accumulate_static.hh:35
    \n+
    Definition accumulate_static.hh:38
    \n+
    static const result_type result
    Definition accumulate_static.hh:39
    \n+
    Statically combine two values of type result_type using +.
    Definition accumulate_static.hh:46
    \n+
    Definition accumulate_static.hh:49
    \n+
    static const result_type result
    Definition accumulate_static.hh:50
    \n+
    Statically combine two values of type result_type using -.
    Definition accumulate_static.hh:57
    \n+
    Definition accumulate_static.hh:60
    \n+
    static const result_type result
    Definition accumulate_static.hh:61
    \n+
    Statically combine two values of type result_type using *.
    Definition accumulate_static.hh:68
    \n+
    Definition accumulate_static.hh:71
    \n+
    static const result_type result
    Definition accumulate_static.hh:72
    \n+
    Statically combine two values of type result_type by returning their minimum.
    Definition accumulate_static.hh:79
    \n+
    Definition accumulate_static.hh:82
    \n+
    static const result_type result
    Definition accumulate_static.hh:83
    \n+
    Statically combine two values of type result_type by returning their maximum.
    Definition accumulate_static.hh:90
    \n+
    Definition accumulate_static.hh:93
    \n+
    static const result_type result
    Definition accumulate_static.hh:94
    \n+
    Statically accumulate a value over the nodes of a TypeTree.
    Definition accumulate_static.hh:259
    \n+
    Functor::result_type result_type
    The result type of the computation.
    Definition accumulate_static.hh:262
    \n+
    static const result_type result
    The accumulated result of the computation.
    Definition accumulate_static.hh:265
    \n+
    Definition accumulate_static.hh:466
    \n+
    ParentChildReduction parent_child_reduction
    Definition accumulate_static.hh:524
    \n+
    Functor functor
    Definition accumulate_static.hh:495
    \n+
    StartType start_type
    Definition accumulate_static.hh:532
    \n+
    ReductionAlgorithm reduction_strategy
    Definition accumulate_static.hh:538
    \n+
    Reduction sibling_reduction
    Definition accumulate_static.hh:516
    \n+
    Statically accumulate a type over the nodes of a TypeTree.
    Definition accumulate_static.hh:553
    \n+
    accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>, NodeTag< Tree > >::type type
    The accumulated result of the computation.
    Definition accumulate_static.hh:562
    \n
    A hybrid version of TreePath that supports both compile time and run time indices.
    Definition treepath.hh:79
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,146 +7,591 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-pairtraversal.hh\n+accumulate_static.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH\n- 5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH\n+ 4#ifndef DUNE_TYPETREE_ACCUMULATE_STATIC_HH\n+ 5#define DUNE_TYPETREE_ACCUMULATE_STATIC_HH\n 6\n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14\n- 15namespace Dune {\n- 16 namespace TypeTree {\n- 17\n-23 namespace Detail {\n- 24\n- 25 /* The signature is the same as for the public applyToTreePair\n- 26 * function in Dune::Typtree, despite the additionally passed\n- 27 * treePath argument. The path passed here is associated to\n- 28 * the tree and the relative paths of the children (wrt. to tree)\n- 29 * are appended to this. Hence the behavior of the public function\n- 30 * is resembled by passing an empty treePath.\n- 31 */\n- 32\n- 33 /*\n- 34 * This is the overload for leaf traversal\n- 35 */\n- 36 template::isLeaf or std::decay_t::isLeaf),\n-int> = 0>\n-38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)\n- 39 {\n- 40 visitor.leaf(tree1, tree2, treePath);\n- 41 }\n+ 7#include \n+ 8#include \n+ 9#include \n+ 10#include \n+ 11\n+ 12\n+13namespace Dune {\n+14 namespace TypeTree {\n+ 15\n+ 22 template\n+23 struct or_\n+ 24 {\n+ 25 template\n+26 struct reduce\n+ 27 {\n+28 static const result_type result = r1 || r2;\n+ 29 };\n+ 30 };\n+ 31\n+ 33 template\n+34 struct and_\n+ 35 {\n+ 36 template\n+37 struct reduce\n+ 38 {\n+39 static const result_type result = r1 && r2;\n+ 40 };\n+ 41 };\n 42\n- 43 /*\n- 44 * This is the general overload doing static child traversal.\n- 45 */\n- 46 template::isLeaf or std::decay_t::isLeaf),\n-int> = 0>\n- 48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&&\n-visitor)\n+ 44 template\n+45 struct plus\n+ 46 {\n+ 47 template\n+48 struct reduce\n 49 {\n- 50 // Do we really want to take care for const-ness of the Tree\n- 51 // when instanciating VisitChild below? I'd rather expect this:\n- 52 // using Tree1 = std::decay_t;\n- 53 // using Tree2 = std::decay_t;\n- 54 // using Visitor = std::decay_t;\n- 55 using Tree1 = std::remove_reference_t;\n- 56 using Tree2 = std::remove_reference_t;\n- 57 using Visitor = std::remove_reference_t;\n- 58 visitor.pre(tree1, tree2, treePath);\n- 59\n- 60 // check which type of traversal is supported by the trees\n- 61 using allowDynamicTraversal = std::conjunction<\n- 62 Dune::Std::is_detected,\n- 63 Dune::Std::is_detected>;\n- 64 using allowStaticTraversal = std::conjunction<\n- 65 Dune::Std::is_detected,\n- 66 Dune::Std::is_detected>;\n- 67\n- 68 // both trees must support either dynamic or static traversal\n- 69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);\n- 70\n- 71 // the visitor may specify preferred dynamic traversal\n- 72 using preferDynamicTraversal = std::bool_constant;\n- 73\n- 74 // create a dynamic or static index range\n- 75 auto indices = [&]{\n- 76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)\n- 77 return Dune::range(std::size_t(tree1.degree()));\n- 78 else\n- 79 return Dune::range(tree1.degree());\n- 80 }();\n- 81\n- 82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {\n- 83 Dune::Hybrid::forEach(indices, [&](auto i) {\n- 84 auto&& child1 = tree1.child(i);\n- 85 auto&& child2 = tree2.child(i);\n- 86 using Child1 = std::decay_t;\n- 87 using Child2 = std::decay_t;\n- 88\n- 89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i);\n- 90\n- 91 // This requires that visitor.in(...) can always be instantiated,\n- 92 // even if there's a single child only.\n- 93 if (i>0)\n- 94 visitor.in(tree1, tree2, treePath);\n- 95\n- 96 constexpr bool visitChild = Visitor::template\n-VisitChild::value;\n- 97 if constexpr(visitChild) {\n- 98 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n- 99 applyToTreePair(child1, child2, childTreePath, visitor);\n- 100 }\n- 101\n- 102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i);\n- 103 });\n- 104 }\n- 105 visitor.post(tree1, tree2, treePath);\n- 106 }\n+50 static const result_type result = r1 + r2;\n+ 51 };\n+ 52 };\n+ 53\n+ 55 template\n+56 struct minus\n+ 57 {\n+ 58 template\n+59 struct reduce\n+ 60 {\n+61 static const result_type result = r1 - r2;\n+ 62 };\n+ 63 };\n+ 64\n+ 66 template\n+67 struct multiply\n+ 68 {\n+ 69 template\n+70 struct reduce\n+ 71 {\n+72 static const result_type result = r1 * r2;\n+ 73 };\n+ 74 };\n+ 75\n+ 77 template\n+78 struct min\n+ 79 {\n+ 80 template\n+81 struct reduce\n+ 82 {\n+83 static const result_type result = r1 < r2 ? r1 : r2;\n+ 84 };\n+ 85 };\n+ 86\n+ 88 template\n+89 struct max\n+ 90 {\n+ 91 template\n+92 struct reduce\n+ 93 {\n+94 static const result_type result = r1 > r2 ? r1 : r2;\n+ 95 };\n+ 96 };\n+ 97\n+ 98\n+ 99 namespace {\n+ 100\n+ 101 // implementation of the traversal algorithm\n+ 102\n+ 104 template\n+ 105 struct accumulate_node_helper\n+ 106 {\n 107\n- 108 } // namespace Detail\n+ 108 typedef typename Functor::result_type result_type;\n 109\n+110 static const result_type result = current_value;\n 111\n- 125 template\n-126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor)\n- 127 {\n- 128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor);\n- 129 }\n- 130\n- 132\n- 133 } // namespace TypeTree\n- 134} //namespace Dune\n+ 112 };\n+ 113\n+ 115 template\n+ 116 struct\n+accumulate_node_helper\n+ 117 {\n+ 118\n+ 119 typedef typename Functor::result_type result_type;\n+ 120\n+ 121 static const result_type result = Reduction::template\n+reduce::result>::result;\n+ 122\n+ 123 };\n+ 124\n+ 126 template\n+ 127 struct accumulate_value;\n+ 128\n+ 130 template\n+ 131 struct\n+accumulate_value\n+ 132 {\n+ 133\n+ 134 typedef typename Functor::result_type result_type;\n 135\n- 136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH\n-visitor.hh\n-nodeinterface.hh\n-treepath.hh\n+ 136 static const result_type result =\n+ 137\n+ 138\n+accumulate_node_helper::value>::result;\n+ 139\n+ 140 };\n+ 141\n+ 143 template\n+ 144 struct accumulate_over_children\n+ 145 {\n+ 146\n+ 147 typedef typename Functor::result_type result_type;\n+ 148\n+ 149 typedef decltype(push_back(TreePath{},index_constant{}))\n+child_tree_path;\n+ 150\n+ 151 typedef typename Node::template Child::Type child;\n+ 152\n+153 static const result_type child_result =\n+accumulate_value>::\n+result;\n+ 154\n+ 155 static const result_type result =\n+accumulate_over_children::\n+result;\n+ 156\n+ 157 };\n+ 158\n+ 160 template\n+ 161 struct\n+accumulate_over_children\n+ 162 {\n+ 163\n+ 164 typedef typename Functor::result_type result_type;\n+ 165\n+ 166 static const result_type result = current_value;\n+ 167\n+ 168 };\n+ 169\n+ 172 template\n+ 173 struct accumulate_value_generic_composite_node\n+ 174 {\n+ 175\n+ 176 typedef typename Functor::result_type result_type;\n+ 177\n+ 178 static const result_type child_result =\n+accumulate_over_children::\n+value>::result;\n+ 179\n+ 180 static const result_type result =\n+ 181\n+accumulate_node_helper::value>::result;\n+ 182\n+ 183\n+ 184 };\n+ 185\n+ 187 template\n+ 188 struct\n+accumulate_value\n+ 189 : public\n+accumulate_value_generic_composite_node\n+ 190 {};\n+ 191\n+ 193 template\n+ 194 struct\n+accumulate_value\n+ 195 : public\n+accumulate_value_generic_composite_node\n+ 196 {};\n+ 197\n+ 198 } // anonymous namespace\n+ 199\n+ 201\n+ 257 template\n+258 struct AccumulateValue\n+ 259 {\n+ 260\n+262 typedef typename Functor::result_type result_type;\n+ 263\n+265 static const result_type result =\n+accumulate_value,NodeTag>::\n+result;\n+ 266\n+ 267 };\n+ 268\n+ 271 struct flattened_reduction;\n+ 272\n+ 275 struct bottom_up_reduction;\n+ 276\n+ 277 namespace {\n+ 278\n+ 279 // implementation of the traversal algorithm\n+ 280\n+ 283 template\n+ 284 struct accumulate_type_node_helper\n+ 285 {\n+ 286\n+ 287 typedef current_type type;\n+ 288\n+ 289 };\n+ 290\n+ 292 template\n+ 293 struct\n+accumulate_type_node_helper\n+ 294 {\n+ 295\n+ 296 typedef typename Reduction::template reduce<\n+ 297 current_type,\n+ 298 typename Functor::template visit<\n+ 299 Node,\n+ 300 TreePath\n+ 301 >::type\n+ 302 >::type type;\n+ 303\n+ 304 };\n+ 305\n+ 307 template\n+ 308 struct accumulate_type;\n+ 309\n+ 311 template\n+ 312 struct accumulate_type\n+ 313 {\n+ 314\n+ 315 typedef typename accumulate_type_node_helper<\n+ 316 LeafNode,\n+ 317 typename Policy::functor,\n+ 318 typename Policy::sibling_reduction,\n+ 319 current_type,\n+ 320 TreePath,\n+ 321 Policy::functor::template doVisit<\n+ 322 LeafNode,\n+ 323 TreePath>::value\n+ 324 >::type type;\n+ 325\n+ 326 };\n+ 327\n+ 328\n+ 331 template\n+ 332 struct propagate_type_down_tree;\n+ 333\n+ 335 template\n+ 336 struct propagate_type_down_tree<\n+ 337 current_type,\n+ 338 tree_path,\n+ 339 start_type,\n+ 340 bottom_up_reduction\n+ 341 >\n+ 342 {\n+ 343 typedef current_type type;\n+ 344 };\n+ 345\n+ 347 template\n+ 348 struct propagate_type_down_tree<\n+ 349 current_type,\n+ 350 tree_path,\n+ 351 start_type,\n+ 352 flattened_reduction\n+ 353 >\n+ 354 {\n+ 355 typedef typename std::conditional<\n+ 356 TreePathBack::value == 0,\n+ 357 start_type,\n+ 358 current_type\n+ 359 >::type type;\n+ 360 };\n+ 361\n+ 362\n+ 364 template\n+ 365 struct accumulate_type_over_children\n+ 366 {\n+ 367\n+ 368 typedef decltype(push_back(TreePath{},index_constant{}))\n+child_tree_path;\n+ 369\n+ 370 typedef typename Node::template Child::Type child;\n+ 371\n+ 372 typedef typename accumulate_type<\n+ 373 child,\n+ 374 Policy,\n+ 375 // apply reduction choice (flat / hierarchic)\n+ 376 typename propagate_type_down_tree<\n+ 377 current_type,\n+ 378 child_tree_path,\n+ 379 typename Policy::start_type,\n+ 380 typename Policy::reduction_strategy\n+ 381 >::type,\n+ 382 child_tree_path,\n+ 383 NodeTag\n+ 384 >::type child_result_type;\n+ 385\n+ 386 typedef typename accumulate_type_over_children<\n+ 387 Node,\n+ 388 Policy,\n+ 389 child_result_type,\n+ 390 TreePath,\n+ 391 i+1,\n+ 392 n\n+ 393 >::type type;\n+ 394\n+ 395 };\n+ 396\n+ 398 template\n+ 399 struct\n+accumulate_type_over_children\n+ 400 {\n+ 401\n+ 402 typedef current_type type;\n+ 403\n+ 404 };\n+ 405\n+ 406\n+ 409 template\n+ 410 struct accumulate_type_generic_composite_node\n+ 411 {\n+ 412\n+ 413 typedef typename accumulate_type_over_children<\n+ 414 Node,\n+ 415 Policy,\n+ 416 current_type,\n+ 417 TreePath,\n+ 418 0,\n+ 419 StaticDegree::value\n+ 420 >::type children_result_type;\n+ 421\n+ 422 typedef typename accumulate_type_node_helper<\n+ 423 Node,\n+ 424 typename Policy::functor,\n+ 425 typename Policy::parent_child_reduction,\n+ 426 children_result_type,\n+ 427 TreePath,\n+ 428 Policy::functor::template doVisit<\n+ 429 Node,\n+ 430 TreePath\n+ 431 >::value\n+ 432 >::type type;\n+ 433\n+ 434 };\n+ 435\n+ 437 template\n+ 438 struct\n+accumulate_type\n+ 439 : public\n+accumulate_type_generic_composite_node\n+ 440 {};\n+ 441\n+ 443 template\n+ 444 struct\n+accumulate_type\n+ 445 : public\n+accumulate_type_generic_composite_node\n+ 446 {};\n+ 447\n+ 448 } // anonymous namespace\n+ 449\n+ 450\n+ 458 template<\n+ 459 typename Functor,\n+ 460 typename Reduction,\n+ 461 typename StartType,\n+ 462 typename ParentChildReduction = Reduction,\n+ 463 typename ReductionAlgorithm = flattened_reduction\n+ 464 >\n+465 struct TypeAccumulationPolicy\n+ 466 {\n+ 467\n+495 typedef Functor functor;\n+ 496\n+516 typedef Reduction sibling_reduction;\n+ 517\n+524 typedef ParentChildReduction parent_child_reduction;\n+ 525\n+532 typedef StartType start_type;\n+ 533\n+538 typedef ReductionAlgorithm reduction_strategy;\n+ 539 };\n+ 540\n+ 541\n+ 543\n+ 551 template\n+552 struct AccumulateType\n+ 553 {\n+ 554\n+ 556 typedef typename accumulate_type<\n+ 557 Tree,\n+ 558 Policy,\n+ 559 typename Policy::start_type,\n+ 560 HybridTreePath<>,\n+ 561 NodeTag\n+562 >::type type;\n+ 563\n+ 564 };\n+ 565\n+ 566\n+ 567\n+ 568\n+ 569\n+ 570 /***************************************************/\n+ 571\n+572 namespace Experimental {\n+ 573 namespace Impl {\n+ 574\n+ 576 template::isLeaf, int> = 0>\n+ 578 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&&\n+current_val)\n+ 579 {\n+ 580 return visitor.leaf(tree, treePath, std::forward(current_val));\n+ 581 }\n+ 582\n+ 584 template::isLeaf, int> = 0>\n+ 586 auto hybridApplyToTree(T&& tree, TreePath treePath, V&& visitor, U&&\n+current_val)\n+ 587 {\n+ 588 using Tree = std::remove_reference_t;\n+ 589 using Visitor = std::remove_reference_t;\n+ 590 auto pre_val = visitor.pre(tree, treePath, std::forward(current_val));\n+ 591\n+ 592 // check which type of traversal is supported by the tree\n+ 593 using allowDynamicTraversal = Dune::Std::is_detected;\n+ 594 using allowStaticTraversal = Dune::Std::is_detected;\n+ 595\n+ 596 // the tree must support either dynamic or static traversal\n+ 597 static_assert(allowDynamicTraversal::value || allowStaticTraversal::\n+value);\n+ 598\n+ 599 // the visitor may specify preferred dynamic traversal\n+ 600 using preferDynamicTraversal = std::bool_constant;\n+ 601\n+ 602 // declare rule that applies visitor and current value to a child i.\n+Returns next value\n+ 603 auto apply_i = [&](auto&& value, const auto& i){\n+ 604 auto&& child = tree.child(i);\n+ 605 using Child = std::decay_t;\n+ 606\n+ 607 auto val_before = visitor.beforeChild(tree, child, treePath, i, std::move\n+(value));\n+ 608\n+ 609 // visits between children\n+ 610 auto val_in = Hybrid::ifElse(\n+ 611 Hybrid::equals(i,Indices::_0),\n+ 612 [&](auto id){return std::move(val_before);},\n+ 613 [&](auto id){return visitor.in(tree, treePath, std::move(val_before));}\n+ 614 );\n+ 615\n+ 616 constexpr bool visitChild = Visitor::template\n+VisitChild::value;\n+ 617 auto val_visit = [&](){\n+ 618 if constexpr (visitChild) {\n+ 619 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n+ 620 return hybridApplyToTree(child, childTreePath, visitor, std::move\n+(val_in));\n+ 621 }\n+ 622 else\n+ 623 return std::move(val_in);\n+ 624 }();\n+ 625\n+ 626 return visitor.afterChild(tree, child, treePath, i, std::move(val_visit));\n+ 627 };\n+ 628\n+ 629 // apply visitor to children\n+ 630 auto in_val = [&](){\n+ 631 if constexpr (allowStaticTraversal::value && not preferDynamicTraversal::\n+value) {\n+ 632 // get list of static indices\n+ 633 auto indices = std::make_index_sequence{};\n+ 634\n+ 635 // unfold apply_i left to right\n+ 636 return unpackIntegerSequence([&](auto... i) {\n+ 656 return left_fold(std::move(apply_i),std::move(pre_val), i...);\n+ 657 }, indices);\n+ 658\n+ 659 } else {\n+ 660 // unfold first child to get type\n+ 661 auto i_val = apply_i(std::move(pre_val),std::size_t{0});\n+ 662 // dynamically loop rest of the children to accumulate remindng values\n+ 663 for(std::size_t i = 1; i < tree.degree(); i++)\n+ 664 i_val = apply_i(i_val,i);\n+ 665 return i_val;\n+ 666 }\n+ 667 }();\n+ 668\n+ 669 return visitor.post(tree, treePath, in_val);\n+ 670 }\n+ 671\n+ 672 }\n+ 673\n+ 697 template\n+698 auto hybridApplyToTree(Tree&& tree, Visitor&& visitor, Init&& init)\n+ 699 {\n+ 700 return Impl::hybridApplyToTree(tree, hybridTreePath(), visitor, init);\n+ 701 }\n+ 702\n+ 703 } // namespace Experimental\n+ 704\n+ 706 } // namespace TypeTree\n+ 707} //namespace Dune\n+ 708\n+ 709#endif // DUNE_TYPETREE_ACCUMULATE_STATIC_HH\n nodetags.hh\n-traversal.hh\n-Dune::TypeTree::applyToTreePair\n-void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)\n-Apply visitor to a pair of TypeTrees.\n-Definition pairtraversal.hh:126\n+treepath.hh\n+nodeinterface.hh\n+child_result\n+static const result_type child_result\n+Definition accumulate_static.hh:153\n+result\n+static const result_type result\n+Definition accumulate_static.hh:110\n+Dune::TypeTree::Child\n+typename impl::_Child< Node, indices... >::type Child\n+Template alias for the type of a child node given by a list of child indices.\n+Definition childextraction.hh:223\n+Dune::TypeTree::child\n+ImplementationDefined child(Node &&node, Indices... indices)\n+Extracts the child of a node given by a sequence of compile-time and run-time\n+indices.\n+Definition childextraction.hh:126\n+Dune::TypeTree::NodeTag\n+typename std::decay_t< Node >::NodeTag NodeTag\n+Returns the node tag of the given Node.\n+Definition nodeinterface.hh:76\n Dune::TypeTree::push_back\n constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath<\n T... > &tp, std::size_t i)\n Appends a run time index to a HybridTreePath.\n Definition treepath.hh:281\n Dune::TypeTree::hybridTreePath\n constexpr HybridTreePath< T... > hybridTreePath(const T &... t)\n@@ -157,17 +602,106 @@\n Constructs a new HybridTreePath from the given indices.\n Definition treepath.hh:191\n Dune::TypeTree::TreePath\n HybridTreePath< Dune::index_constant< i >... > TreePath\n Definition treepath.hh:521\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::Detail::applyToTreePair\n-void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)\n-Definition pairtraversal.hh:38\n+Dune::TypeTree::or_\n+Statically combine two values of type result_type using ||.\n+Definition accumulate_static.hh:24\n+Dune::TypeTree::or_::reduce\n+Definition accumulate_static.hh:27\n+Dune::TypeTree::or_::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:28\n+Dune::TypeTree::and_\n+Statically combine two values of type result_type using &&.\n+Definition accumulate_static.hh:35\n+Dune::TypeTree::and_::reduce\n+Definition accumulate_static.hh:38\n+Dune::TypeTree::and_::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:39\n+Dune::TypeTree::plus\n+Statically combine two values of type result_type using +.\n+Definition accumulate_static.hh:46\n+Dune::TypeTree::plus::reduce\n+Definition accumulate_static.hh:49\n+Dune::TypeTree::plus::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:50\n+Dune::TypeTree::minus\n+Statically combine two values of type result_type using -.\n+Definition accumulate_static.hh:57\n+Dune::TypeTree::minus::reduce\n+Definition accumulate_static.hh:60\n+Dune::TypeTree::minus::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:61\n+Dune::TypeTree::multiply\n+Statically combine two values of type result_type using *.\n+Definition accumulate_static.hh:68\n+Dune::TypeTree::multiply::reduce\n+Definition accumulate_static.hh:71\n+Dune::TypeTree::multiply::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:72\n+Dune::TypeTree::min\n+Statically combine two values of type result_type by returning their minimum.\n+Definition accumulate_static.hh:79\n+Dune::TypeTree::min::reduce\n+Definition accumulate_static.hh:82\n+Dune::TypeTree::min::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:83\n+Dune::TypeTree::max\n+Statically combine two values of type result_type by returning their maximum.\n+Definition accumulate_static.hh:90\n+Dune::TypeTree::max::reduce\n+Definition accumulate_static.hh:93\n+Dune::TypeTree::max::reduce::result\n+static const result_type result\n+Definition accumulate_static.hh:94\n+Dune::TypeTree::AccumulateValue\n+Statically accumulate a value over the nodes of a TypeTree.\n+Definition accumulate_static.hh:259\n+Dune::TypeTree::AccumulateValue::result_type\n+Functor::result_type result_type\n+The result type of the computation.\n+Definition accumulate_static.hh:262\n+Dune::TypeTree::AccumulateValue::result\n+static const result_type result\n+The accumulated result of the computation.\n+Definition accumulate_static.hh:265\n+Dune::TypeTree::TypeAccumulationPolicy\n+Definition accumulate_static.hh:466\n+Dune::TypeTree::TypeAccumulationPolicy::parent_child_reduction\n+ParentChildReduction parent_child_reduction\n+Definition accumulate_static.hh:524\n+Dune::TypeTree::TypeAccumulationPolicy::functor\n+Functor functor\n+Definition accumulate_static.hh:495\n+Dune::TypeTree::TypeAccumulationPolicy::start_type\n+StartType start_type\n+Definition accumulate_static.hh:532\n+Dune::TypeTree::TypeAccumulationPolicy::reduction_strategy\n+ReductionAlgorithm reduction_strategy\n+Definition accumulate_static.hh:538\n+Dune::TypeTree::TypeAccumulationPolicy::sibling_reduction\n+Reduction sibling_reduction\n+Definition accumulate_static.hh:516\n+Dune::TypeTree::AccumulateType\n+Statically accumulate a type over the nodes of a TypeTree.\n+Definition accumulate_static.hh:553\n+Dune::TypeTree::AccumulateType::type\n+accumulate_type< Tree, Policy, typenamePolicy::start_type, HybridTreePath<>,\n+NodeTag< Tree > >::type type\n+The accumulated result of the computation.\n+Definition accumulate_static.hh:562\n Dune::TypeTree::HybridTreePath\n A hybrid version of TreePath that supports both compile time and run time\n indices.\n Definition treepath.hh:79\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00068.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: leafnode.hh File Reference\n+dune-typetree: pairtraversal.hh File Reference\n \n \n \n \n \n \n \n@@ -70,37 +70,46 @@\n
    \n \n
    \n
    \n
    \n \n-
    leafnode.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    pairtraversal.hh File Reference
    \n
    \n
    \n-
    #include <dune/typetree/nodetags.hh>
    \n-#include <cstddef>
    \n-#include <type_traits>
    \n+
    #include <dune/common/std/type_traits.hh>
    \n+#include <dune/typetree/nodeinterface.hh>
    \n+#include <dune/typetree/nodetags.hh>
    \n+#include <dune/typetree/treepath.hh>
    \n+#include <dune/typetree/visitor.hh>
    \n+#include <dune/typetree/traversal.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-

    \n-Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::Detail
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+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.
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,25 +6,37 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces\n-leafnode.hh File Reference\n+Namespaces | Functions\n+pairtraversal.hh File Reference\n+#include \n+#include \n #include \n-#include \n-#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::TypeTree::LeafNode\n-\u00a0 Base class for leaf nodes in a dune-typetree. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n+namespace \u00a0Dune::TypeTree::Detail\n+\u00a0\n+ Functions\n+template::isLeaf or std::decay_t< T2 >::isLeaf), int > = 0>\n+void\u00a0Dune::TypeTree::Detail::applyToTreePair (T1 &&tree1, T2 &&tree2, TreePath\n+ treePath, V &&visitor)\n+\u00a0\n+template\n+void\u00a0Dune::TypeTree::applyToTreePair (Tree1 &&tree1, Tree2 &&tree2, Visitor\n+ &&visitor)\n+\u00a0 Apply visitor to a pair of TypeTrees.\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00068_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: leafnode.hh Source File\n+dune-typetree: pairtraversal.hh Source File\n \n \n \n \n \n \n \n@@ -74,77 +74,152 @@\n \n
    \n \n
    \n
    \n
    \n-
    leafnode.hh
    \n+
    pairtraversal.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_LEAFNODE_HH
    \n-
    5#define DUNE_TYPETREE_LEAFNODE_HH
    \n+
    4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH
    \n+
    5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH
    \n
    6
    \n-\n-
    8#include <cstddef>
    \n-
    9#include <type_traits>
    \n-
    10
    \n-
    11namespace Dune {
    \n-
    12 namespace TypeTree {
    \n-
    13
    \n-
    \n-\n-
    26 {
    \n-
    27
    \n-
    28 public:
    \n-
    29
    \n-
    31 static const bool isLeaf = true;
    \n+
    7#include <dune/common/std/type_traits.hh>
    \n+
    8
    \n+\n+\n+\n+\n+\n+
    14
    \n+
    15namespace Dune {
    \n+
    16 namespace TypeTree {
    \n+
    17
    \n+
    \n+
    23 namespace Detail {
    \n+
    24
    \n+
    25 /* The signature is the same as for the public applyToTreePair
    \n+
    26 * function in Dune::Typtree, despite the additionally passed
    \n+
    27 * treePath argument. The path passed here is associated to
    \n+
    28 * the tree and the relative paths of the children (wrt. to tree)
    \n+
    29 * are appended to this. Hence the behavior of the public function
    \n+
    30 * is resembled by passing an empty treePath.
    \n+
    31 */
    \n
    32
    \n-
    34 static const bool isPower = false;
    \n-
    35
    \n-
    37 static const bool isComposite = false;
    \n-
    38
    \n-
    40 [[deprecated("Will be removed after release 2.9. Use degree()")]]
    \n-
    41 static const std::size_t CHILDREN = 0;
    \n+
    33 /*
    \n+
    34 * This is the overload for leaf traversal
    \n+
    35 */
    \n+
    36 template<class T1, class T2, class TreePath, class V,
    \n+
    37 std::enable_if_t<(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
    \n+
    \n+
    38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
    \n+
    39 {
    \n+
    40 visitor.leaf(tree1, tree2, treePath);
    \n+
    41 }
    \n+
    \n
    42
    \n-\n-
    45
    \n-
    \n-
    46 static constexpr auto degree()
    \n-
    47 {
    \n-
    48 return std::integral_constant<std::size_t,0>{};
    \n-
    49 }
    \n-
    \n-
    50
    \n-
    51 protected:
    \n-
    52
    \n-
    54
    \n-\n-
    60 };
    \n-
    \n-
    61
    \n-
    63
    \n-
    64 } // namespace TypeTree
    \n-
    65} //namespace Dune
    \n-
    66
    \n-
    67#endif // DUNE_TYPETREE_POWERNODE_HH
    \n-\n+
    43 /*
    \n+
    44 * This is the general overload doing static child traversal.
    \n+
    45 */
    \n+
    46 template<class T1, class T2, class TreePath, class V,
    \n+
    47 std::enable_if_t<not(std::decay_t<T1>::isLeaf or std::decay_t<T2>::isLeaf), int> = 0>
    \n+
    48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)
    \n+
    49 {
    \n+
    50 // Do we really want to take care for const-ness of the Tree
    \n+
    51 // when instanciating VisitChild below? I'd rather expect this:
    \n+
    52 // using Tree1 = std::decay_t<T1>;
    \n+
    53 // using Tree2 = std::decay_t<T2>;
    \n+
    54 // using Visitor = std::decay_t<V>;
    \n+
    55 using Tree1 = std::remove_reference_t<T1>;
    \n+
    56 using Tree2 = std::remove_reference_t<T2>;
    \n+
    57 using Visitor = std::remove_reference_t<V>;
    \n+
    58 visitor.pre(tree1, tree2, treePath);
    \n+
    59
    \n+
    60 // check which type of traversal is supported by the trees
    \n+
    61 using allowDynamicTraversal = std::conjunction<
    \n+
    62 Dune::Std::is_detected<DynamicTraversalConcept,Tree1>,
    \n+
    63 Dune::Std::is_detected<DynamicTraversalConcept,Tree2>>;
    \n+
    64 using allowStaticTraversal = std::conjunction<
    \n+
    65 Dune::Std::is_detected<StaticTraversalConcept,Tree1>,
    \n+
    66 Dune::Std::is_detected<StaticTraversalConcept,Tree2>>;
    \n+
    67
    \n+
    68 // both trees must support either dynamic or static traversal
    \n+
    69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);
    \n+
    70
    \n+
    71 // the visitor may specify preferred dynamic traversal
    \n+
    72 using preferDynamicTraversal = std::bool_constant<Visitor::treePathType == TreePathType::dynamic>;
    \n+
    73
    \n+
    74 // create a dynamic or static index range
    \n+
    75 auto indices = [&]{
    \n+
    76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)
    \n+
    77 return Dune::range(std::size_t(tree1.degree()));
    \n+
    78 else
    \n+
    79 return Dune::range(tree1.degree());
    \n+
    80 }();
    \n+
    81
    \n+
    82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {
    \n+
    83 Dune::Hybrid::forEach(indices, [&](auto i) {
    \n+
    84 auto&& child1 = tree1.child(i);
    \n+
    85 auto&& child2 = tree2.child(i);
    \n+
    86 using Child1 = std::decay_t<decltype(child1)>;
    \n+
    87 using Child2 = std::decay_t<decltype(child2)>;
    \n+
    88
    \n+
    89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i);
    \n+
    90
    \n+
    91 // This requires that visitor.in(...) can always be instantiated,
    \n+
    92 // even if there's a single child only.
    \n+
    93 if (i>0)
    \n+
    94 visitor.in(tree1, tree2, treePath);
    \n+
    95
    \n+
    96 constexpr bool visitChild = Visitor::template VisitChild<Tree1,Child1,Tree2,Child2,TreePath>::value;
    \n+
    97 if constexpr(visitChild) {
    \n+
    98 auto childTreePath = Dune::TypeTree::push_back(treePath, i);
    \n+
    99 applyToTreePair(child1, child2, childTreePath, visitor);
    \n+
    100 }
    \n+
    101
    \n+
    102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i);
    \n+
    103 });
    \n+
    104 }
    \n+
    105 visitor.post(tree1, tree2, treePath);
    \n+
    106 }
    \n+
    107
    \n+
    108 } // namespace Detail
    \n+
    \n+
    109
    \n+
    111
    \n+
    125 template<typename Tree1, typename Tree2, typename Visitor>
    \n+
    \n+
    126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor)
    \n+
    127 {
    \n+
    128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor);
    \n+
    129 }
    \n+
    \n+
    130
    \n+
    132
    \n+
    133 } // namespace TypeTree
    \n+
    134} //namespace Dune
    \n+
    135
    \n+
    136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH
    \n+\n+\n+\n+\n+\n+
    void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)
    Apply visitor to a pair of TypeTrees.
    Definition pairtraversal.hh:126
    \n+
    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
    \n+
    constexpr HybridTreePath< T... > hybridTreePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:180
    \n+
    constexpr HybridTreePath< T... > treePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:191
    \n+
    HybridTreePath< Dune::index_constant< i >... > TreePath
    Definition treepath.hh:521
    \n
    Definition accumulate_static.hh:13
    \n-
    Base class for leaf nodes in a dune-typetree.
    Definition leafnode.hh:26
    \n-
    LeafNodeTag NodeTag
    The type tag that describes a LeafNode.
    Definition leafnode.hh:44
    \n-
    static const bool isLeaf
    Mark this class as a leaf in a dune-typetree.
    Definition leafnode.hh:31
    \n-
    static const std::size_t CHILDREN
    Leafs have no children.
    Definition leafnode.hh:41
    \n-
    static const bool isPower
    Mark this class as a non power in the dune-typetree.
    Definition leafnode.hh:34
    \n-
    LeafNode()
    Default constructor.
    Definition leafnode.hh:59
    \n-
    static const bool isComposite
    Mark this class as a non composite in the dune-typetree.
    Definition leafnode.hh:37
    \n-
    static constexpr auto degree()
    Definition leafnode.hh:46
    \n-
    Tag designating a leaf node.
    Definition nodetags.hh:16
    \n+
    void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)
    Definition pairtraversal.hh:38
    \n+
    A hybrid version of TreePath that supports both compile time and run time indices.
    Definition treepath.hh:79
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,93 +7,167 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-leafnode.hh\n+pairtraversal.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_LEAFNODE_HH\n- 5#define DUNE_TYPETREE_LEAFNODE_HH\n+ 4#ifndef DUNE_TYPETREE_PAIRTRAVERSAL_HH\n+ 5#define DUNE_TYPETREE_PAIRTRAVERSAL_HH\n 6\n- 7#include \n- 8#include \n- 9#include \n- 10\n- 11namespace Dune {\n- 12 namespace TypeTree {\n- 13\n-25 class LeafNode\n- 26 {\n- 27\n- 28 public:\n- 29\n-31 static const bool isLeaf = true;\n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15namespace Dune {\n+ 16 namespace TypeTree {\n+ 17\n+23 namespace Detail {\n+ 24\n+ 25 /* The signature is the same as for the public applyToTreePair\n+ 26 * function in Dune::Typtree, despite the additionally passed\n+ 27 * treePath argument. The path passed here is associated to\n+ 28 * the tree and the relative paths of the children (wrt. to tree)\n+ 29 * are appended to this. Hence the behavior of the public function\n+ 30 * is resembled by passing an empty treePath.\n+ 31 */\n 32\n-34 static const bool isPower = false;\n- 35\n-37 static const bool isComposite = false;\n- 38\n- 40 [[deprecated(\"Will be removed after release 2.9. Use degree()\")]]\n-41 static const std::size_t CHILDREN = 0;\n+ 33 /*\n+ 34 * This is the overload for leaf traversal\n+ 35 */\n+ 36 template::isLeaf or std::decay_t::isLeaf),\n+int> = 0>\n+38 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&& visitor)\n+ 39 {\n+ 40 visitor.leaf(tree1, tree2, treePath);\n+ 41 }\n 42\n-44 typedef LeafNodeTag NodeTag;\n- 45\n-46 static constexpr auto degree()\n- 47 {\n- 48 return std::integral_constant{};\n- 49 }\n- 50\n- 51 protected:\n- 52\n- 54\n-59 LeafNode() {}\n- 60 };\n- 61\n- 63\n- 64 } // namespace TypeTree\n- 65} //namespace Dune\n- 66\n- 67#endif // DUNE_TYPETREE_POWERNODE_HH\n+ 43 /*\n+ 44 * This is the general overload doing static child traversal.\n+ 45 */\n+ 46 template::isLeaf or std::decay_t::isLeaf),\n+int> = 0>\n+ 48 void applyToTreePair(T1&& tree1, T2&& tree2, TreePath treePath, V&&\n+visitor)\n+ 49 {\n+ 50 // Do we really want to take care for const-ness of the Tree\n+ 51 // when instanciating VisitChild below? I'd rather expect this:\n+ 52 // using Tree1 = std::decay_t;\n+ 53 // using Tree2 = std::decay_t;\n+ 54 // using Visitor = std::decay_t;\n+ 55 using Tree1 = std::remove_reference_t;\n+ 56 using Tree2 = std::remove_reference_t;\n+ 57 using Visitor = std::remove_reference_t;\n+ 58 visitor.pre(tree1, tree2, treePath);\n+ 59\n+ 60 // check which type of traversal is supported by the trees\n+ 61 using allowDynamicTraversal = std::conjunction<\n+ 62 Dune::Std::is_detected,\n+ 63 Dune::Std::is_detected>;\n+ 64 using allowStaticTraversal = std::conjunction<\n+ 65 Dune::Std::is_detected,\n+ 66 Dune::Std::is_detected>;\n+ 67\n+ 68 // both trees must support either dynamic or static traversal\n+ 69 static_assert(allowDynamicTraversal::value || allowStaticTraversal::value);\n+ 70\n+ 71 // the visitor may specify preferred dynamic traversal\n+ 72 using preferDynamicTraversal = std::bool_constant;\n+ 73\n+ 74 // create a dynamic or static index range\n+ 75 auto indices = [&]{\n+ 76 if constexpr(preferDynamicTraversal::value && allowDynamicTraversal::value)\n+ 77 return Dune::range(std::size_t(tree1.degree()));\n+ 78 else\n+ 79 return Dune::range(tree1.degree());\n+ 80 }();\n+ 81\n+ 82 if constexpr(allowDynamicTraversal::value || allowStaticTraversal::value) {\n+ 83 Dune::Hybrid::forEach(indices, [&](auto i) {\n+ 84 auto&& child1 = tree1.child(i);\n+ 85 auto&& child2 = tree2.child(i);\n+ 86 using Child1 = std::decay_t;\n+ 87 using Child2 = std::decay_t;\n+ 88\n+ 89 visitor.beforeChild(tree1, child1, tree2, child2, treePath, i);\n+ 90\n+ 91 // This requires that visitor.in(...) can always be instantiated,\n+ 92 // even if there's a single child only.\n+ 93 if (i>0)\n+ 94 visitor.in(tree1, tree2, treePath);\n+ 95\n+ 96 constexpr bool visitChild = Visitor::template\n+VisitChild::value;\n+ 97 if constexpr(visitChild) {\n+ 98 auto childTreePath = Dune::TypeTree::push_back(treePath, i);\n+ 99 applyToTreePair(child1, child2, childTreePath, visitor);\n+ 100 }\n+ 101\n+ 102 visitor.afterChild(tree1, child1, tree2, child2, treePath, i);\n+ 103 });\n+ 104 }\n+ 105 visitor.post(tree1, tree2, treePath);\n+ 106 }\n+ 107\n+ 108 } // namespace Detail\n+ 109\n+ 111\n+ 125 template\n+126 void applyToTreePair(Tree1&& tree1, Tree2&& tree2, Visitor&& visitor)\n+ 127 {\n+ 128 Detail::applyToTreePair(tree1, tree2, hybridTreePath(), visitor);\n+ 129 }\n+ 130\n+ 132\n+ 133 } // namespace TypeTree\n+ 134} //namespace Dune\n+ 135\n+ 136#endif // DUNE_TYPETREE_PAIRTRAVERSAL_HH\n nodetags.hh\n+traversal.hh\n+visitor.hh\n+treepath.hh\n+nodeinterface.hh\n+Dune::TypeTree::applyToTreePair\n+void applyToTreePair(Tree1 &&tree1, Tree2 &&tree2, Visitor &&visitor)\n+Apply visitor to a pair of TypeTrees.\n+Definition pairtraversal.hh:126\n+Dune::TypeTree::push_back\n+constexpr HybridTreePath< T..., std::size_t > push_back(const HybridTreePath<\n+T... > &tp, std::size_t i)\n+Appends a run time index to a HybridTreePath.\n+Definition treepath.hh:281\n+Dune::TypeTree::hybridTreePath\n+constexpr HybridTreePath< T... > hybridTreePath(const T &... t)\n+Constructs a new HybridTreePath from the given indices.\n+Definition treepath.hh:180\n+Dune::TypeTree::treePath\n+constexpr HybridTreePath< T... > treePath(const T &... t)\n+Constructs a new HybridTreePath from the given indices.\n+Definition treepath.hh:191\n+Dune::TypeTree::TreePath\n+HybridTreePath< Dune::index_constant< i >... > TreePath\n+Definition treepath.hh:521\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::LeafNode\n-Base class for leaf nodes in a dune-typetree.\n-Definition leafnode.hh:26\n-Dune::TypeTree::LeafNode::NodeTag\n-LeafNodeTag NodeTag\n-The type tag that describes a LeafNode.\n-Definition leafnode.hh:44\n-Dune::TypeTree::LeafNode::isLeaf\n-static const bool isLeaf\n-Mark this class as a leaf in a dune-typetree.\n-Definition leafnode.hh:31\n-Dune::TypeTree::LeafNode::CHILDREN\n-static const std::size_t CHILDREN\n-Leafs have no children.\n-Definition leafnode.hh:41\n-Dune::TypeTree::LeafNode::isPower\n-static const bool isPower\n-Mark this class as a non power in the dune-typetree.\n-Definition leafnode.hh:34\n-Dune::TypeTree::LeafNode::LeafNode\n-LeafNode()\n-Default constructor.\n-Definition leafnode.hh:59\n-Dune::TypeTree::LeafNode::isComposite\n-static const bool isComposite\n-Mark this class as a non composite in the dune-typetree.\n-Definition leafnode.hh:37\n-Dune::TypeTree::LeafNode::degree\n-static constexpr auto degree()\n-Definition leafnode.hh:46\n-Dune::TypeTree::LeafNodeTag\n-Tag designating a leaf node.\n-Definition nodetags.hh:16\n+Dune::TypeTree::Detail::applyToTreePair\n+void applyToTreePair(T1 &&tree1, T2 &&tree2, TreePath treePath, V &&visitor)\n+Definition pairtraversal.hh:38\n+Dune::TypeTree::HybridTreePath\n+A hybrid version of TreePath that supports both compile time and run time\n+indices.\n+Definition treepath.hh:79\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00071.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: filteredcompositenode.hh File Reference\n+dune-typetree: dynamicpowernode.hh File Reference\n \n \n \n \n \n \n \n@@ -72,35 +72,33 @@\n
  • dune
  • typetree
  • \n \n \n
    \n \n-
    filteredcompositenode.hh File Reference
    \n+
    dynamicpowernode.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n-#include <tuple>
    \n+
    #include <cassert>
    \n+#include <vector>
    \n+#include <memory>
    \n #include <type_traits>
    \n-#include <dune/typetree/nodetags.hh>
    \n-#include <dune/typetree/filters.hh>
    \n-#include <dune/common/shared_ptr.hh>
    \n #include <dune/common/typetraits.hh>
    \n-#include <dune/common/indices.hh>
    \n+#include <dune/common/std/type_traits.hh>
    \n+#include <dune/typetree/nodetags.hh>
    \n+#include <dune/typetree/utility.hh>
    \n+#include <dune/typetree/typetraits.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n+\n+\n \n

    \n Classes

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

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n \n-\n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n \n

    \n Classes

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

    Go to the source code of this file.

    \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
    \n-\n-\n-\n-\n-

    \n-Classes

    class  Dune::TypeTree::DynamicPowerNode< T >
     Collect multiple instances of type T within a dune-typetree. More...
     
    \n-\n-\n-\n-\n-\n-

    \n-Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,31 +6,25 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Classes | Namespaces\n-dynamicpowernode.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+typetree.hh File Reference\n #include \n #include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::TypeTree::DynamicPowerNode<_T_>\n-\u00a0 Collect multiple instances of type T within a dune-typetree. More...\n-\u00a0\n- Namespaces\n-namespace \u00a0Dune\n-\u00a0\n-namespace \u00a0Dune::TypeTree\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00077_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: dynamicpowernode.hh Source File\n+dune-typetree: typetree.hh Source File\n \n \n \n \n \n \n \n@@ -74,219 +74,51 @@\n \n
    \n \n
    \n
    \n
    \n-
    dynamicpowernode.hh
    \n+
    typetree.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n
    3
    \n-
    4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH
    \n-
    5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH
    \n+
    4#ifndef DUNE_TYPETREE_HH
    \n+
    5#define DUNE_TYPETREE_HH
    \n
    6
    \n-
    7#include <cassert>
    \n-
    8#include <vector>
    \n-
    9#include <memory>
    \n-
    10#include <type_traits>
    \n-
    11
    \n-
    12#include <dune/common/typetraits.hh>
    \n-
    13#include <dune/common/std/type_traits.hh>
    \n-
    14
    \n-\n-\n-\n-
    18
    \n-
    19namespace Dune {
    \n-
    20 namespace TypeTree {
    \n-
    21
    \n-
    31 template<typename T>
    \n-
    \n-\n-
    33 {
    \n-
    34
    \n-
    35 public:
    \n-
    36
    \n-
    38 static const bool isLeaf = false;
    \n-
    39
    \n-
    41 static const bool isPower = true;
    \n-
    42
    \n-
    44 static const bool isComposite = false;
    \n-
    45
    \n-
    \n-
    47 std::size_t degree() const
    \n-
    48 {
    \n-
    49 return _children.size();
    \n-
    50 }
    \n-
    \n-
    51
    \n-\n-
    54
    \n-
    56 typedef T ChildType;
    \n-
    57
    \n-
    59 typedef std::shared_ptr<T> ChildStorageType;
    \n-
    60
    \n-
    62 typedef std::shared_ptr<const T> ChildConstStorageType;
    \n-
    63
    \n-
    65 typedef std::vector<ChildStorageType> NodeStorage;
    \n-
    66
    \n-
    67
    \n-
    70
    \n-
    72
    \n-
    \n-
    75 ChildType& child (std::size_t i)
    \n-
    76 {
    \n-
    77 assert(i < degree() && "child index out of range");
    \n-
    78 return *_children[i];
    \n-
    79 }
    \n-
    \n-
    80
    \n-
    82
    \n-
    \n-
    85 const ChildType& child (std::size_t i) const
    \n-
    86 {
    \n-
    87 assert(i < degree() && "child index out of range");
    \n-
    88 return *_children[i];
    \n-
    89 }
    \n-
    \n-
    90
    \n-
    92
    \n-
    \n-\n-
    96 {
    \n-
    97 assert(i < degree() && "child index out of range");
    \n-
    98 return _children[i];
    \n-
    99 }
    \n-
    \n-
    100
    \n-
    102
    \n-
    \n-\n-
    109 {
    \n-
    110 assert(i < degree() && "child index out of range");
    \n-
    111 return _children[i];
    \n-
    112 }
    \n-
    \n-
    113
    \n-
    \n-
    115 void setChild (std::size_t i, ChildType& t)
    \n-
    116 {
    \n-
    117 assert(i < degree() && "child index out of range");
    \n-
    118 _children[i] = stackobject_to_shared_ptr(t);
    \n-
    119 }
    \n-
    \n-
    120
    \n-
    \n-
    122 void setChild (std::size_t i, ChildType&& t)
    \n-
    123 {
    \n-
    124 assert(i < degree() && "child index out of range");
    \n-
    125 _children[i] = convert_arg(std::move(t));
    \n-
    126 }
    \n-
    \n-
    127
    \n-
    \n-
    129 void setChild (std::size_t i, ChildStorageType st)
    \n-
    130 {
    \n-
    131 assert(i < degree() && "child index out of range");
    \n-
    132 _children[i] = std::move(st);
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    \n-
    135 const NodeStorage& nodeStorage () const
    \n-
    136 {
    \n-
    137 return _children;
    \n-
    138 }
    \n-
    \n-
    139
    \n-
    141
    \n-
    144
    \n-
    145 protected:
    \n-
    146
    \n-
    149 DynamicPowerNode () = delete;
    \n-
    150
    \n-
    152
    \n-
    \n-
    160 explicit DynamicPowerNode (std::size_t size)
    \n-
    161 : _children(size)
    \n-
    162 {}
    \n-
    \n-
    163
    \n-
    \n-
    165 explicit DynamicPowerNode (NodeStorage children)
    \n-
    166 : _children(std::move(children))
    \n-
    167 {}
    \n-
    \n-
    168
    \n-
    169#ifdef DOXYGEN
    \n-
    170
    \n-
    \n-
    172 DynamicPowerNode (T& t1, T& t2, ...)
    \n-
    173 {}
    \n-
    \n-
    174
    \n-
    175#else
    \n-
    176
    \n-
    177 template<typename... Children,
    \n-
    178 std::enable_if_t<(std::is_same_v<ChildType, std::decay_t<Children>> &&...), bool> = true>
    \n-
    179 DynamicPowerNode (Children&&... children)
    \n-
    180 {
    \n-
    181 _children = NodeStorage{convert_arg(std::forward<Children>(children))...};
    \n-
    182 }
    \n-
    183
    \n-
    184 template<typename... Children,
    \n-
    185 std::enable_if_t<(std::is_same_v<ChildType, std::decay_t<Children>> &&...), bool> = true>
    \n-
    186 DynamicPowerNode (std::shared_ptr<Children>... children)
    \n-
    187 {
    \n-
    188 _children = NodeStorage{std::move(children)...};
    \n-
    189 }
    \n-
    190
    \n-
    191#endif // DOXYGEN
    \n-
    192
    \n-
    194
    \n-
    195 private:
    \n-
    196 NodeStorage _children;
    \n-
    197 };
    \n-
    \n-
    198
    \n-
    200
    \n-
    201 } // namespace TypeTree
    \n-
    202} //namespace Dune
    \n-
    203
    \n-
    204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH
    \n-\n-\n-\n-
    Definition accumulate_static.hh:13
    \n-
    Collect multiple instances of type T within a dune-typetree.
    Definition dynamicpowernode.hh:33
    \n-
    static const bool isPower
    Mark this class as a power in the dune-typetree.
    Definition dynamicpowernode.hh:41
    \n-
    std::vector< ChildStorageType > NodeStorage
    The type used for storing the children.
    Definition dynamicpowernode.hh:65
    \n-
    const NodeStorage & nodeStorage() const
    Definition dynamicpowernode.hh:135
    \n-
    ChildConstStorageType childStorage(std::size_t i) const
    Returns the storage of the i-th child (const version).
    Definition dynamicpowernode.hh:108
    \n-
    const ChildType & child(std::size_t i) const
    Returns the i-th child (const version).
    Definition dynamicpowernode.hh:85
    \n-
    std::shared_ptr< T > ChildStorageType
    The storage type of each child.
    Definition dynamicpowernode.hh:59
    \n-
    DynamicPowerNode(T &t1, T &t2,...)
    Initialize all children with the passed-in objects.
    Definition dynamicpowernode.hh:172
    \n-
    std::shared_ptr< const T > ChildConstStorageType
    The const version of the storage type of each child.
    Definition dynamicpowernode.hh:62
    \n-
    DynamicPowerNode(NodeStorage children)
    Initialize the DynamicPowerNode with a copy of the passed-in storage type.
    Definition dynamicpowernode.hh:165
    \n-
    DynamicPowerNodeTag NodeTag
    The type tag that describes the node.
    Definition dynamicpowernode.hh:53
    \n-
    T ChildType
    The type of each child.
    Definition dynamicpowernode.hh:56
    \n-
    void setChild(std::size_t i, ChildType &t)
    Sets the i-th child to the passed-in value.
    Definition dynamicpowernode.hh:115
    \n-
    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
    \n-
    DynamicPowerNode(std::size_t size)
    Construct a node with the given number of children.
    Definition dynamicpowernode.hh:160
    \n-
    static const bool isComposite
    Mark this class as a non composite in the dune-typetree.
    Definition dynamicpowernode.hh:44
    \n-
    void setChild(std::size_t i, ChildType &&t)
    Store the passed value in i-th child.
    Definition dynamicpowernode.hh:122
    \n-
    ChildType & child(std::size_t i)
    Returns the i-th child.
    Definition dynamicpowernode.hh:75
    \n-
    std::size_t degree() const
    The number of children.
    Definition dynamicpowernode.hh:47
    \n-
    ChildStorageType childStorage(std::size_t i)
    Returns the storage of the i-th child.
    Definition dynamicpowernode.hh:95
    \n-
    static const bool isLeaf
    Mark this class as non leaf in the dune-typetree.
    Definition dynamicpowernode.hh:38
    \n-\n-
    Tag designating a power node with runtime degree.
    Definition nodetags.hh:22
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+
    20
    \n+
    21#endif // DUNE_TYPETREE_HH
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,255 +7,46 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-dynamicpowernode.hh\n+typetree.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n 3\n- 4#ifndef DUNE_TYPETREE_DYNAMICPOWERNODE_HH\n- 5#define DUNE_TYPETREE_DYNAMICPOWERNODE_HH\n+ 4#ifndef DUNE_TYPETREE_HH\n+ 5#define DUNE_TYPETREE_HH\n 6\n- 7#include \n- 8#include \n- 9#include \n- 10#include \n- 11\n- 12#include \n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17#include \n- 18\n- 19namespace Dune {\n- 20 namespace TypeTree {\n- 21\n- 31 template\n-32 class DynamicPowerNode\n- 33 {\n- 34\n- 35 public:\n- 36\n-38 static const bool isLeaf = false;\n- 39\n-41 static const bool isPower = true;\n- 42\n-44 static const bool isComposite = false;\n- 45\n-47 std::size_t degree() const\n- 48 {\n- 49 return _children.size();\n- 50 }\n- 51\n-53 typedef DynamicPowerNodeTag NodeTag;\n- 54\n-56 typedef T ChildType;\n- 57\n-59 typedef std::shared_ptr ChildStorageType;\n- 60\n-62 typedef std::shared_ptr ChildConstStorageType;\n- 63\n-65 typedef std::vector NodeStorage;\n- 66\n- 67\n- 70\n- 72\n-75 ChildType& child (std::size_t i)\n- 76 {\n- 77 assert(i < degree() && \"child index out of range\");\n- 78 return *_children[i];\n- 79 }\n- 80\n- 82\n-85 const ChildType& child (std::size_t i) const\n- 86 {\n- 87 assert(i < degree() && \"child index out of range\");\n- 88 return *_children[i];\n- 89 }\n- 90\n- 92\n-95 ChildStorageType childStorage (std::size_t i)\n- 96 {\n- 97 assert(i < degree() && \"child index out of range\");\n- 98 return _children[i];\n- 99 }\n- 100\n- 102\n-108 ChildConstStorageType childStorage (std::size_t i) const\n- 109 {\n- 110 assert(i < degree() && \"child index out of range\");\n- 111 return _children[i];\n- 112 }\n- 113\n-115 void setChild (std::size_t i, ChildType& t)\n- 116 {\n- 117 assert(i < degree() && \"child index out of range\");\n- 118 _children[i] = stackobject_to_shared_ptr(t);\n- 119 }\n- 120\n-122 void setChild (std::size_t i, ChildType&& t)\n- 123 {\n- 124 assert(i < degree() && \"child index out of range\");\n- 125 _children[i] = convert_arg(std::move(t));\n- 126 }\n- 127\n-129 void setChild (std::size_t i, ChildStorageType st)\n- 130 {\n- 131 assert(i < degree() && \"child index out of range\");\n- 132 _children[i] = std::move(st);\n- 133 }\n- 134\n-135 const NodeStorage& nodeStorage () const\n- 136 {\n- 137 return _children;\n- 138 }\n- 139\n- 141\n- 144\n- 145 protected:\n- 146\n-149 DynamicPowerNode () = delete;\n- 150\n- 152\n-160 explicit DynamicPowerNode (std::size_t size)\n- 161 : _children(size)\n- 162 {}\n- 163\n-165 explicit DynamicPowerNode (NodeStorage children)\n- 166 : _children(std::move(children))\n- 167 {}\n- 168\n- 169#ifdef DOXYGEN\n- 170\n-172 DynamicPowerNode (T& t1, T& t2, ...)\n- 173 {}\n- 174\n- 175#else\n- 176\n- 177 template>\n-&&...), bool> = true>\n- 179 DynamicPowerNode (Children&&... children)\n- 180 {\n- 181 _children = NodeStorage{convert_arg(std::forward(children))...};\n- 182 }\n- 183\n- 184 template>\n-&&...), bool> = true>\n- 186 DynamicPowerNode (std::shared_ptr... children)\n- 187 {\n- 188 _children = NodeStorage{std::move(children)...};\n- 189 }\n- 190\n- 191#endif // DOXYGEN\n- 192\n- 194\n- 195 private:\n- 196 NodeStorage _children;\n- 197 };\n- 198\n- 200\n- 201 } // namespace TypeTree\n- 202} //namespace Dune\n- 203\n- 204#endif // DUNE_TYPETREE_DYNAMICPOWERNODE_HH\n-typetraits.hh\n-utility.hh\n+ 7#include \n+ 8#include \n+ 9#include \n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16#include \n+ 17#include \n+ 18#include \n+ 19#include \n+ 20\n+ 21#endif // DUNE_TYPETREE_HH\n nodetags.hh\n-Dune\n-Definition accumulate_static.hh:13\n-Dune::TypeTree::DynamicPowerNode\n-Collect multiple instances of type T within a dune-typetree.\n-Definition dynamicpowernode.hh:33\n-Dune::TypeTree::DynamicPowerNode::isPower\n-static const bool isPower\n-Mark this class as a power in the dune-typetree.\n-Definition dynamicpowernode.hh:41\n-Dune::TypeTree::DynamicPowerNode::NodeStorage\n-std::vector< ChildStorageType > NodeStorage\n-The type used for storing the children.\n-Definition dynamicpowernode.hh:65\n-Dune::TypeTree::DynamicPowerNode::nodeStorage\n-const NodeStorage & nodeStorage() const\n-Definition dynamicpowernode.hh:135\n-Dune::TypeTree::DynamicPowerNode::childStorage\n-ChildConstStorageType childStorage(std::size_t i) const\n-Returns the storage of the i-th child (const version).\n-Definition dynamicpowernode.hh:108\n-Dune::TypeTree::DynamicPowerNode::child\n-const ChildType & child(std::size_t i) const\n-Returns the i-th child (const version).\n-Definition dynamicpowernode.hh:85\n-Dune::TypeTree::DynamicPowerNode::ChildStorageType\n-std::shared_ptr< T > ChildStorageType\n-The storage type of each child.\n-Definition dynamicpowernode.hh:59\n-Dune::TypeTree::DynamicPowerNode::DynamicPowerNode\n-DynamicPowerNode(T &t1, T &t2,...)\n-Initialize all children with the passed-in objects.\n-Definition dynamicpowernode.hh:172\n-Dune::TypeTree::DynamicPowerNode::ChildConstStorageType\n-std::shared_ptr< const T > ChildConstStorageType\n-The const version of the storage type of each child.\n-Definition dynamicpowernode.hh:62\n-Dune::TypeTree::DynamicPowerNode::DynamicPowerNode\n-DynamicPowerNode(NodeStorage children)\n-Initialize the DynamicPowerNode with a copy of the passed-in storage type.\n-Definition dynamicpowernode.hh:165\n-Dune::TypeTree::DynamicPowerNode::NodeTag\n-DynamicPowerNodeTag NodeTag\n-The type tag that describes the node.\n-Definition dynamicpowernode.hh:53\n-Dune::TypeTree::DynamicPowerNode::ChildType\n-T ChildType\n-The type of each child.\n-Definition dynamicpowernode.hh:56\n-Dune::TypeTree::DynamicPowerNode::setChild\n-void setChild(std::size_t i, ChildType &t)\n-Sets the i-th child to the passed-in value.\n-Definition dynamicpowernode.hh:115\n-Dune::TypeTree::DynamicPowerNode::setChild\n-void setChild(std::size_t i, ChildStorageType st)\n-Sets the stored value representing the i-th child to the passed-in value.\n-Definition dynamicpowernode.hh:129\n-Dune::TypeTree::DynamicPowerNode::DynamicPowerNode\n-DynamicPowerNode(std::size_t size)\n-Construct a node with the given number of children.\n-Definition dynamicpowernode.hh:160\n-Dune::TypeTree::DynamicPowerNode::isComposite\n-static const bool isComposite\n-Mark this class as a non composite in the dune-typetree.\n-Definition dynamicpowernode.hh:44\n-Dune::TypeTree::DynamicPowerNode::setChild\n-void setChild(std::size_t i, ChildType &&t)\n-Store the passed value in i-th child.\n-Definition dynamicpowernode.hh:122\n-Dune::TypeTree::DynamicPowerNode::child\n-ChildType & child(std::size_t i)\n-Returns the i-th child.\n-Definition dynamicpowernode.hh:75\n-Dune::TypeTree::DynamicPowerNode::degree\n-std::size_t degree() const\n-The number of children.\n-Definition dynamicpowernode.hh:47\n-Dune::TypeTree::DynamicPowerNode::childStorage\n-ChildStorageType childStorage(std::size_t i)\n-Returns the storage of the i-th child.\n-Definition dynamicpowernode.hh:95\n-Dune::TypeTree::DynamicPowerNode::isLeaf\n-static const bool isLeaf\n-Mark this class as non leaf in the dune-typetree.\n-Definition dynamicpowernode.hh:38\n-Dune::TypeTree::DynamicPowerNode::DynamicPowerNode\n-DynamicPowerNode()=delete\n-Dune::TypeTree::DynamicPowerNodeTag\n-Tag designating a power node with runtime degree.\n-Definition nodetags.hh:22\n+childextraction.hh\n+leafnode.hh\n+utility.hh\n+powernode.hh\n+traversal.hh\n+transformationutilities.hh\n+compositenode.hh\n+transformation.hh\n+accumulate_static.hh\n+pairtraversal.hh\n+dynamicpowernode.hh\n+traversalutilities.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00080.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: traversal.hh File Reference\n+dune-typetree: traversalutilities.hh File Reference\n \n \n \n \n \n \n \n@@ -71,86 +71,101 @@\n \n \n \n
    \n \n-
    traversal.hh File Reference
    \n+
    traversalutilities.hh File Reference
    \n
    \n
    \n-
    #include <utility>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/std/type_traits.hh>
    \n-#include <dune/typetree/childextraction.hh>
    \n-#include <dune/typetree/nodetags.hh>
    \n-#include <dune/typetree/treepath.hh>
    \n-#include <dune/typetree/visitor.hh>
    \n+\n

    Go to the source code of this file.

    \n \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    namespace  Dune::TypeTree::Detail
     
    \n-\n-\n-\n-\n-\n-\n-\n

    \n-Typedefs

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

    \n Functions

    template<class Tree , TreePathType::Type pathType, class Prefix , std::enable_if_t< Tree::isLeaf, int > = 0>
    constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix)
     
    template<class Tree , TreePathType::Type pathType, class Prefix , std::size_t... indices, std::enable_if_t<(Tree::isComposite or(Tree::isPower and(pathType!=TreePathType::dynamic))), int > = 0>
    constexpr auto Dune::TypeTree::Detail::leafTreePathTuple (Prefix prefix, std::index_sequence< indices... >)
     
    template<class T , class TreePath , class V , std::enable_if_t< std::decay_t< T >::isLeaf, int > = 0>
    void Dune::TypeTree::Detail::applyToTree (T &&tree, TreePath treePath, V &&visitor)
     
    template<class T , class TreePath , class PreFunc , class LeafFunc , class PostFunc >
    void Dune::TypeTree::Detail::forEachNode (T &&tree, TreePath treePath, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
     
    template<class Tree , TreePathType::Type pathType = TreePathType::dynamic>
    constexpr auto Dune::TypeTree::leafTreePathTuple ()
     Create tuple of tree paths to leafs.
     
    template<typename Tree , typename Visitor >
    void Dune::TypeTree::applyToTree (Tree &&tree, Visitor &&visitor)
     Apply visitor to TypeTree.
     
    template<class Tree , class PreFunc , class LeafFunc , class PostFunc >
    void Dune::TypeTree::forEachNode (Tree &&tree, PreFunc &&preFunc, LeafFunc &&leafFunc, PostFunc &&postFunc)
     Traverse tree and visit each node.
     
    template<class Tree , class InnerFunc , class LeafFunc >
    void Dune::TypeTree::forEachNode (Tree &&tree, InnerFunc &&innerFunc, LeafFunc &&leafFunc)
     Traverse tree and visit each node.
     
    template<class Tree , class NodeFunc >
    void Dune::TypeTree::forEachNode (Tree &&tree, NodeFunc &&nodeFunc)
     Traverse tree and visit each node.
     
    template<class Tree , class LeafFunc >
    void Dune::TypeTree::forEachLeafNode (Tree &&tree, LeafFunc &&leafFunc)
     Traverse tree and visit each leaf node.
     
    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.
     
    \n+

    Variable Documentation

    \n+\n+

    ◆ _functor

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    F _functor
    \n+
    \n+\n+
    \n+
    \n+\n+

    ◆ _reduction

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    R _reduction
    \n+
    \n+\n+
    \n+
    \n+\n+

    ◆ _value

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    ResultType _value
    \n+
    \n+\n+
    \n+
    \n+\n+

    ◆ treePathType

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

    TypeTree-specific exceptions. \n+More...

    \n+
    #include <dune/common/exceptions.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+

    \n+Classes

    class  Dune::TypeTree::Exception
     Base class for all TypeTree exceptions. More...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n-\n-\n-\n-\n-\n-

    \n-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.
     
    \n-

    Variable Documentation

    \n-\n-

    ◆ _functor

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    F _functor
    \n-
    \n-\n-
    \n-
    \n-\n-

    ◆ _reduction

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    R _reduction
    \n-
    \n-\n-
    \n-
    \n-\n-

    ◆ _value

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    ResultType _value
    \n-
    \n-\n-
    \n-
    \n-\n-

    ◆ treePathType

    \n-\n-
    \n-
    \n-\n- \n- \n- \n- \n
    \n- \n- \n- \n- \n-
    const TreePathType::Type treePathType = TreePathType::dynamic
    \n-
    \n-static
    \n-
    \n-\n-
    \n-
    \n-
    \n+

    Detailed Description

    \n+

    TypeTree-specific exceptions.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,35 +6,26 @@\n dune-typetree\u00a02.9\n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-Namespaces | Functions\n-traversalutilities.hh File Reference\n-#include \n+Classes | Namespaces\n+exceptions.hh File Reference\n+TypeTree-specific exceptions. More...\n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::TypeTree::Exception\n+\u00a0 Base class for all TypeTree exceptions. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::TypeTree\n \u00a0\n- Functions\n-template\n-ResultType\u00a0Dune::TypeTree::reduceOverLeafs (const Tree &tree, F functor, R\n- reduction, ResultType startValue)\n-\u00a0 Calculate a quantity as a reduction over the leaf nodes of a\n- TypeTree.\n-\u00a0\n-***** Variable Documentation *****\n-***** \u25c6\u00a0_functor *****\n-F _functor\n-***** \u25c6\u00a0_reduction *****\n-R _reduction\n-***** \u25c6\u00a0_value *****\n-ResultType _value\n-***** \u25c6\u00a0treePathType *****\n-const TreePathType::Type treePathType = TreePathType::dynamic static\n+***** Detailed Description *****\n+TypeTree-specific exceptions.\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00083_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: traversalutilities.hh Source File\n+dune-typetree: exceptions.hh Source File\n \n \n \n \n \n \n \n@@ -74,89 +74,39 @@\n \n
    \n \n
    \n \n
    \n-
    traversalutilities.hh
    \n+
    exceptions.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3
    \n-
    4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH
    \n-
    5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH
    \n-
    6
    \n-\n-
    8
    \n-
    9namespace Dune {
    \n-
    10 namespace TypeTree {
    \n-
    11
    \n-
    17 namespace {
    \n-
    18
    \n+
    3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH
    \n+
    4#define DUNE_TYPETREE_EXCEPTIONS_HH
    \n+
    5
    \n+
    6#include <dune/common/exceptions.hh>
    \n+
    7
    \n+
    13namespace Dune {
    \n+
    14 namespace TypeTree {
    \n+
    15
    \n+
    \n+\n+
    18 : public Dune::Exception
    \n+
    19 {};
    \n+
    \n
    20
    \n-
    25 template<typename F, typename R, typename ResultType>
    \n-
    26 struct LeafReductionVisitor
    \n-
    27 : public TypeTree::TreeVisitor
    \n-
    28 {
    \n-
    29
    \n-\n-
    31
    \n-
    32 template<typename Node, typename TreePath>
    \n-
    33 void leaf(const Node& node, TreePath treePath)
    \n-
    34 {
    \n-\n-
    36 }
    \n-
    37
    \n-
    38 LeafReductionVisitor(F functor, R reduction, ResultType startValue)
    \n-
    39 : _functor(functor)
    \n-
    40 , _reduction(reduction)
    \n-
    41 , _value(startValue)
    \n-
    42 {}
    \n-
    43
    \n-
    44 ResultType result() { return _value; }
    \n-
    45
    \n-\n-\n-
    48 ResultType _value;
    \n-
    49
    \n-
    50 };
    \n-
    51
    \n-
    52 } // anonymous namespace
    \n-
    53
    \n-
    55
    \n-
    80 template<typename ResultType, typename Tree, typename F, typename R>
    \n-
    \n-
    81 ResultType reduceOverLeafs(const Tree& tree, F functor, R reduction, ResultType startValue)
    \n-
    82 {
    \n-
    83 LeafReductionVisitor<F,R,ResultType> visitor(functor,reduction,startValue);
    \n-
    84 TypeTree::applyToTree(tree,visitor);
    \n-
    85 return visitor.result();
    \n-
    86 }
    \n-
    \n-
    87
    \n-
    89
    \n-
    90 } // namespace TypeTree
    \n-
    91} //namespace Dune
    \n-
    92
    \n-
    93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH
    \n-
    static const result_type result
    Definition accumulate_static.hh:110
    \n-\n-
    R _reduction
    Definition traversalutilities.hh:47
    \n-
    F _functor
    Definition traversalutilities.hh:46
    \n-
    static const TreePathType::Type treePathType
    Definition traversalutilities.hh:30
    \n-
    ResultType _value
    Definition traversalutilities.hh:48
    \n-
    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
    \n-
    void applyToTree(Tree &&tree, Visitor &&visitor)
    Apply visitor to TypeTree.
    Definition traversal.hh:237
    \n-
    constexpr HybridTreePath< T... > treePath(const T &... t)
    Constructs a new HybridTreePath from the given indices.
    Definition treepath.hh:191
    \n-
    HybridTreePath< Dune::index_constant< i >... > TreePath
    Definition treepath.hh:521
    \n+
    21 } // namespace TypeTree
    \n+
    22} // namespace Dune
    \n+
    23
    \n+
    24#endif // DUNE_TYPETREE_EXCEPTIONS_HH
    \n
    Definition accumulate_static.hh:13
    \n-
    Type
    Definition treepath.hh:30
    \n-
    @ dynamic
    Definition treepath.hh:30
    \n+
    Base class for all TypeTree exceptions.
    Definition exceptions.hh:19
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,110 +7,35 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * typetree\n-traversalutilities.hh\n+exceptions.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3\n- 4#ifndef DUNE_TYPETREE_TRAVERSALUTILITIES_HH\n- 5#define DUNE_TYPETREE_TRAVERSALUTILITIES_HH\n- 6\n- 7#include \n- 8\n- 9namespace Dune {\n- 10 namespace TypeTree {\n- 11\n- 17 namespace {\n- 18\n+ 3#ifndef DUNE_TYPETREE_EXCEPTIONS_HH\n+ 4#define DUNE_TYPETREE_EXCEPTIONS_HH\n+ 5\n+ 6#include \n+ 7\n+ 13namespace Dune {\n+ 14 namespace TypeTree {\n+ 15\n+17 class Exception\n+ 18 : public Dune::Exception\n+ 19 {};\n 20\n- 25 template\n- 26 struct LeafReductionVisitor\n- 27 : public TypeTree::TreeVisitor\n- 28 {\n- 29\n-30 static const TreePathType::Type treePathType = TreePathType::dynamic;\n- 31\n- 32 template\n- 33 void leaf(const Node& node, TreePath treePath)\n- 34 {\n- 35 _value = _reduction(_value,_functor(node,treePath));\n- 36 }\n- 37\n- 38 LeafReductionVisitor(F functor, R reduction, ResultType startValue)\n- 39 : _functor(functor)\n- 40 , _reduction(reduction)\n- 41 , _value(startValue)\n- 42 {}\n- 43\n- 44 ResultType result() { return _value; }\n- 45\n-46 F _functor;\n-47 R _reduction;\n-48 ResultType _value;\n- 49\n- 50 };\n- 51\n- 52 } // anonymous namespace\n- 53\n- 55\n- 80 template\n-81 ResultType reduceOverLeafs(const Tree& tree, F functor, R reduction,\n-ResultType startValue)\n- 82 {\n- 83 LeafReductionVisitor visitor(functor,reduction,startValue);\n- 84 TypeTree::applyToTree(tree,visitor);\n- 85 return visitor.result();\n- 86 }\n- 87\n- 89\n- 90 } // namespace TypeTree\n- 91} //namespace Dune\n- 92\n- 93#endif // DUNE_TYPETREE_TRAVERSALUTILITIES_HH\n-result\n-static const result_type result\n-Definition accumulate_static.hh:110\n-traversal.hh\n-_reduction\n-R _reduction\n-Definition traversalutilities.hh:47\n-_functor\n-F _functor\n-Definition traversalutilities.hh:46\n-treePathType\n-static const TreePathType::Type treePathType\n-Definition traversalutilities.hh:30\n-_value\n-ResultType _value\n-Definition traversalutilities.hh:48\n-Dune::TypeTree::reduceOverLeafs\n-ResultType reduceOverLeafs(const Tree &tree, F functor, R reduction, ResultType\n-startValue)\n-Calculate a quantity as a reduction over the leaf nodes of a TypeTree.\n-Definition traversalutilities.hh:81\n-Dune::TypeTree::applyToTree\n-void applyToTree(Tree &&tree, Visitor &&visitor)\n-Apply visitor to TypeTree.\n-Definition traversal.hh:237\n-Dune::TypeTree::treePath\n-constexpr HybridTreePath< T... > treePath(const T &... t)\n-Constructs a new HybridTreePath from the given indices.\n-Definition treepath.hh:191\n-Dune::TypeTree::TreePath\n-HybridTreePath< Dune::index_constant< i >... > TreePath\n-Definition treepath.hh:521\n+ 21 } // namespace TypeTree\n+ 22} // namespace Dune\n+ 23\n+ 24#endif // DUNE_TYPETREE_EXCEPTIONS_HH\n Dune\n Definition accumulate_static.hh:13\n-Dune::TypeTree::TreePathType::Type\n-Type\n-Definition treepath.hh:30\n-Dune::TypeTree::TreePathType::dynamic\n-@ dynamic\n-Definition treepath.hh:30\n+Dune::TypeTree::Exception\n+Base class for all TypeTree exceptions.\n+Definition exceptions.hh:19\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00086.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-typetree: exceptions.hh File Reference\n+dune-typetree: filters.hh File Reference\n \n \n \n \n \n \n \n@@ -72,39 +72,70 @@\n
  • dune
  • typetree
  • \n \n \n
    \n \n-
    exceptions.hh File Reference
    \n+
    filters.hh File Reference
    \n
    \n
    \n-\n-

    TypeTree-specific exceptions. \n-More...

    \n-
    #include <dune/common/exceptions.hh>
    \n+
    #include <tuple>
    \n+#include <dune/common/typetraits.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::TypeTree::Exception
     Base class for all TypeTree exceptions. 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...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::TypeTree
     
    \n-

    Detailed Description

    \n-

    TypeTree-specific exceptions.

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

    Apply visitor to TypeTree.

    \n-
    \n-\n+

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

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

    Statically combine two values of type result_type using ||. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::or_< result_type >

    Statically combine two values of type result_type using ||.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00927.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00927.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::or_< result_type >::reduce< r1, r2 > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 || r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00931.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00931.html", "unified_diff": "@@ -78,26 +78,26 @@\n
    Dune::TypeTree::and_< result_type > Struct Template Reference
    \n \n
    \n \n

    Statically combine two values of type result_type using &&. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::and_< result_type >

    Statically combine two values of type result_type using &&.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00935.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00935.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::and_< result_type >::reduce< r1, r2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 && r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00939.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00939.html", "unified_diff": "@@ -78,26 +78,26 @@\n
    Dune::TypeTree::plus< result_type > Struct Template Reference
    \n \n
    \n \n

    Statically combine two values of type result_type using +. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::plus< result_type >

    Statically combine two values of type result_type using +.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00943.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00943.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::plus< result_type >::reduce< r1, r2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 + r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00947.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00947.html", "unified_diff": "@@ -78,26 +78,26 @@\n
    Dune::TypeTree::minus< result_type > Struct Template Reference
    \n \n
    \n \n

    Statically combine two values of type result_type using -. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::minus< result_type >

    Statically combine two values of type result_type using -.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00951.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00951.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::minus< result_type >::reduce< r1, r2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 - r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00955.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00955.html", "unified_diff": "@@ -78,26 +78,26 @@\n
    Dune::TypeTree::multiply< result_type > Struct Template Reference
    \n \n
    \n \n

    Statically combine two values of type result_type using *. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::multiply< result_type >

    Statically combine two values of type result_type using *.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00959.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00959.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::multiply< result_type >::reduce< r1, r2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 * r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00963.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00963.html", "unified_diff": "@@ -78,26 +78,26 @@\n
    Dune::TypeTree::min< result_type > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::min< result_type >

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00967.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00967.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::min< result_type >::reduce< r1, r2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 < r2 ? r1 : r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00971.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00971.html", "unified_diff": "@@ -78,26 +78,26 @@\n
    Dune::TypeTree::max< result_type > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Classes

    struct  reduce
     
    \n

    Detailed Description

    \n
    template<typename result_type>
    \n struct Dune::TypeTree::max< result_type >

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a00975.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a00975.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::max< result_type >::reduce< r1, r2 > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n

    \n Static Public Attributes

    static const result_type result = r1 > r2 ? r1 : r2
     
    \n

    Member Data Documentation

    \n@@ -111,15 +111,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01015.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01015.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::TypeTree::AccumulateValue< Tree, Functor, Reduction, startValue, ParentChildReduction > Struct Template Reference
    \n \n
    \n \n

    Statically accumulate a value over the nodes of a TypeTree. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n \n

    \n Public Types

    typedef Functor::result_type result_type
     The result type of the computation.
     
    \n@@ -124,19 +124,19 @@\n
    static const bool value = true;
    \n
    };
    \n
    \n
    // Calculate the per-node result.
    \n
    template<typename Node, typename TreePath>
    \n
    struct visit
    \n
    {
    \n-
    static const result_type result = ...;
    \n+
    static const result_type result = ...;
    \n
    };
    \n
    \n
    };
    \n-
    static const result_type result
    Definition accumulate_static.hh:110
    \n+
    static const result_type result
    Definition accumulate_static.hh:110
    \n
    Functor::result_type result_type
    The result type of the computation.
    Definition accumulate_static.hh:262
    \n
    Template Parameters
    \n
    \n \n
    ReductionThe reduction operator used to accumulate the per-node results.
    \n \n \n@@ -145,15 +145,15 @@\n
    struct ReductionOperator
    \n
    {
    \n
    \n
    // combine two per-node results
    \n
    template<result_type r1, result_type r2>
    \n
    struct reduce
    \n
    {
    \n-
    static const result_type result = ...;
    \n+
    static const result_type result = ...;
    \n
    };
    \n
    \n
    };
    \n
    Template Parameters
    \n \n \n
    startValueThe starting value fed into the initial accumulation step.
    \n@@ -202,15 +202,15 @@\n
    \n \n

    The accumulated result of the computation.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01067.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01067.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TypeAccumulationPolicy< Functor, Reduction, StartType, ParentChildReduction, ReductionAlgorithm > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n \n \n@@ -220,15 +220,15 @@\n

    \n Public Types

    typedef Functor functor
     
    typedef Reduction sibling_reduction
     
    \n
    \n

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

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01071.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01071.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::AccumulateType< Tree, Policy > Struct Template Reference
    \n \n
    \n \n

    Statically accumulate a type over the nodes of a TypeTree. \n More...

    \n \n-

    #include <dune/typetree/accumulate_static.hh>

    \n+

    #include <dune/typetree/accumulate_static.hh>

    \n \n \n \n \n \n

    \n Public Types

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

    The accumulated result of the computation.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01075.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01075.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::TypeTree::CompositeNode< Children > Class Template Reference
    \n \n
    \n \n

    Base class for composite nodes based on variadic templates. \n More...

    \n \n-

    #include <dune/typetree/compositenode.hh>

    \n+

    #include <dune/typetree/compositenode.hh>

    \n \n \n \n \n \n

    \n Classes

    struct  Child
     Access to the type and storage type of the i-th child. More...
     
    \n@@ -848,15 +848,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01079.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01079.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::CompositeNode< Children >::Child< k > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/compositenode.hh>

    \n+

    #include <dune/typetree/compositenode.hh>

    \n
    \n \n \n \n \n \n@@ -136,15 +136,15 @@\n
    \n \n

    The type of the child.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01083.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01083.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::TypeTree::DynamicPowerNode< T > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/dynamicpowernode.hh>

    \n+

    #include <dune/typetree/dynamicpowernode.hh>

    \n

    \n Public Types

    typedef std::tuple_element< k, ChildTypes >::type Type
     The type of the child.
     
    typedef std::tuple_element< k, ChildTypes >::type type
    \n \n \n \n \n \n@@ -776,15 +776,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01087.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01087.html", "unified_diff": "@@ -76,29 +76,29 @@\n
    Dune::TypeTree::Exception Class Reference
    \n \n
    \n \n

    Base class for all TypeTree exceptions. \n More...

    \n \n-

    #include <dune/typetree/exceptions.hh>

    \n+

    #include <dune/typetree/exceptions.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::Exception:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n

    Detailed Description

    \n

    Base class for all TypeTree exceptions.

    \n

    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01091.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01091.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::TypeTree::FilteredCompositeNode< Node, Filter > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filteredcompositenode.hh>

    \n+

    #include <dune/typetree/filteredcompositenode.hh>

    \n

    \n Public Types

    typedef DynamicPowerNodeTag NodeTag
     The type tag that describes the node.
     
    typedef T ChildType
    \n \n \n \n \n

    \n Classes

    struct  Child
     Access to the type and storage type of the i-th child. More...
     
    \n@@ -722,15 +722,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01099.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01099.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::FilteredCompositeNode< Node, Filter >::Child< k > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filteredcompositenode.hh>

    \n+

    #include <dune/typetree/filteredcompositenode.hh>

    \n
    \n \n \n \n \n \n@@ -136,15 +136,15 @@\n
    \n \n

    The type of the child.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01103.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01103.html", "unified_diff": "@@ -76,20 +76,20 @@\n
    Dune::TypeTree::FilterEntry< new_k, old_k > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n

    Detailed Description

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

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01107.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01107.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::TypeTree::FilterResult< FilterEntries > Struct Template Reference
    \n \n
    \n \n

    The result of a filter. \n More...

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n

    \n Public Types

    typedef OriginalChild::Type Type
     The type of the child.
     
    typedef OriginalChild::type type
    \n \n \n \n

    \n Classes

    struct  apply
     
    \n \n

    \n@@ -144,15 +144,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01111.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01111.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::FilterResult< FilterEntries >::apply< Node > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n \n \n \n \n \n \n@@ -143,15 +143,15 @@\n \n

    \n 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
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01115.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01115.html", "unified_diff": "@@ -76,19 +76,19 @@\n
    Dune::TypeTree::SimpleFilterTag Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n

    Detailed Description

    \n

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01119.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01119.html", "unified_diff": "@@ -76,19 +76,19 @@\n
    Dune::TypeTree::AdvancedFilterTag Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n

    Detailed Description

    \n

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01123.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01123.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::TypeTree::AdvancedFilter Struct Reference
    \n \n
    \n \n

    Base class for advanced filters. \n More...

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::AdvancedFilter:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -124,15 +124,15 @@\n
    \n \n

    Filter tag for deciding on filter application mechanism.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01127.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01127.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::AdvancedFilter::apply< Node, Children > Struct Template Reference
    \n \n
    \n \n

    Apply this filter to the given node and children. \n More...

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n \n \n \n \n \n

    \n Public Types

    typedef implementation defined type
     The result of the filtering process.
     
    \n@@ -111,15 +111,15 @@\n \n

    The result of the filtering process.

    \n

    This type must be a model of FilterResult.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01131.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01131.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::TypeTree::SimpleFilter Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n \n \n \n \n \n \n@@ -118,15 +118,15 @@\n
    \n \n

    Filter tag for deciding on filter application mechanism.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01135.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01135.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::SimpleFilter::validate< Node > Struct Template Reference
    \n \n
    \n \n

    Validates the combination of filter and node. \n More...

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n

    \n Classes

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

    \n Static Public Attributes

    static const bool value = true
     True if the combination of filter and node is valid.
     
    \n@@ -118,15 +118,15 @@\n
    \n \n

    True if the combination of filter and node is valid.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01139.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01139.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::SimpleFilter::apply< Child, new_index, old_index > Struct Template Reference
    \n \n
    \n \n

    Applies the filter to the given child node. \n More...

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n \n \n \n \n \n

    \n Static Public Attributes

    static const bool value = true
     True if the child will be included in the filtered node.
     
    \n@@ -127,15 +127,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01159.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01159.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::IndexFilter< indices > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::IndexFilter< indices >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -126,15 +126,15 @@\n
    \n \n

    Filter tag for deciding on filter application mechanism.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01179.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01179.html", "unified_diff": "@@ -78,27 +78,27 @@\n
    Dune::TypeTree::filter< Filter > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n \n \n \n \n \n

    \n Classes

    struct  apply
     Apply the filter. More...
     
    \n

    Detailed Description

    \n
    template<typename Filter>
    \n struct Dune::TypeTree::filter< Filter >

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01183.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01183.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::filter< Filter >::apply< Node, Children > Struct Template Reference
    \n \n
    \n \n

    Apply the filter. \n More...

    \n \n-

    #include <dune/typetree/filters.hh>

    \n+

    #include <dune/typetree/filters.hh>

    \n \n \n \n \n

    \n Public Types

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

    Detailed Description

    \n@@ -110,15 +110,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01187.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01187.html", "unified_diff": "@@ -77,15 +77,15 @@\n Classes |\n Public Member Functions |\n List of all members \n
    Dune::TypeTree::FixedCapacityStackView< T > Class Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/fixedcapacitystack.hh>

    \n+

    #include <dune/typetree/fixedcapacitystack.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::FixedCapacityStackView< T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -481,15 +481,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01195.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01195.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::FixedCapacityStack< T, capacity > Class Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/fixedcapacitystack.hh>

    \n+

    #include <dune/typetree/fixedcapacitystack.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::FixedCapacityStack< T, capacity >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -478,15 +478,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01199.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01199.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::GenericLeafNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -275,15 +275,15 @@\n \n

    \n Public Types

    typedef TransformedNode transformed_type
     
    typedef std::shared_ptr< transformed_typetransformed_storage_type
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01203.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01203.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -279,15 +279,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01207.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01207.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::TemplatizedGenericPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -156,15 +156,15 @@\n \n

    \n Public Types

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

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::GenericPowerNodeTransformation< SourceNode, Transformation, TransformedNode >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -93,19 +93,19 @@\n \"\"\n \"\"\n \n
    \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n 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)
     
    \n \n \n \n

    \n Static Public Attributes

    static const bool recursive
     
    \n@@ -116,29 +116,29 @@\n
    \n
    \n \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n \n \n \n \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -158,29 +158,29 @@\n
    \n
    \n
    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 
    )
    \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n \n \n \n \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -200,29 +200,29 @@\n
    \n
    \n
    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 
    )
    \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n \n \n \n \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -243,28 +243,28 @@\n
    \n
    \n
    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 
    )
    \n \n \n \n \n
    \n \n \n- \n+ \n \n
    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
    \n
    \n staticinherited
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01215.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01215.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -279,15 +279,15 @@\n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01219.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01219.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -123,15 +123,15 @@\n \n

    \n Public Types

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

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::GenericDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -93,19 +93,19 @@\n \"\"\n \"\"\n \n
    \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n 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)
     
    \n \n \n \n

    \n Static Public Attributes

    static const bool recursive
     
    \n@@ -116,15 +116,15 @@\n
    \n
    \n \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -158,15 +158,15 @@\n
    \n
    \n
    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,
    \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -200,15 +200,15 @@\n
    \n
    \n
    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,
    \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -243,28 +243,28 @@\n
    \n
    \n
    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,
    \n \n \n \n \n
    \n \n \n- \n+ \n \n
    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
    \n
    \n staticinherited
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01227.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01227.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -279,15 +279,15 @@\n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01231.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01231.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TemplatizedGenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNodeTemplate >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -123,15 +123,15 @@\n \n

    \n Public Types

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

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n+

    #include <dune/typetree/generictransformationdescriptors.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::GenericCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -93,19 +93,19 @@\n \"\"\n \"\"\n \n
    \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n 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)
     
    \n \n \n \n

    \n Static Public Attributes

    static const bool recursive
     
    \n@@ -116,15 +116,15 @@\n
    \n
    \n \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -158,15 +158,15 @@\n
    \n
    \n
    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,
    \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -200,15 +200,15 @@\n
    \n
    \n
    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,
    \n \n \n
    \n \n \n- \n+ \n \n \n \n \n \n \n \n@@ -243,28 +243,28 @@\n
    \n
    \n
    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,
    \n \n \n \n \n
    \n \n \n- \n+ \n \n
    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
    \n
    \n staticinherited
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01239.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01239.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::TypeTree::LeafNode Class Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/leafnode.hh>

    \n+

    #include <dune/typetree/leafnode.hh>

    \n \n \n \n \n \n

    \n Public Types

    typedef LeafNodeTag NodeTag
     The type tag that describes a LeafNode.
     
    \n@@ -289,15 +289,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01243.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01243.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::TypeTree::NodeInterface Struct Reference
    \n \n
    \n \n

    Interface for nodes in a dune-typetree. \n More...

    \n \n-

    #include <dune/typetree/nodeinterface.hh>

    \n+

    #include <dune/typetree/nodeinterface.hh>

    \n
    \n \n \n \n \n \n@@ -284,15 +284,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01247.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01247.html", "unified_diff": "@@ -76,19 +76,19 @@\n
    Dune::TypeTree::LeafNodeTag Struct Reference
    \n \n
    \n \n

    Tag designating a leaf node. \n More...

    \n \n-

    #include <dune/typetree/nodetags.hh>

    \n+

    #include <dune/typetree/nodetags.hh>

    \n

    Detailed Description

    \n

    Tag designating a leaf node.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01251.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01251.html", "unified_diff": "@@ -76,19 +76,19 @@\n
    Dune::TypeTree::PowerNodeTag Struct Reference
    \n \n
    \n \n

    Tag designating a power node. \n More...

    \n \n-

    #include <dune/typetree/nodetags.hh>

    \n+

    #include <dune/typetree/nodetags.hh>

    \n

    Detailed Description

    \n

    Tag designating a power node.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01255.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01255.html", "unified_diff": "@@ -76,19 +76,19 @@\n
    Dune::TypeTree::DynamicPowerNodeTag Struct Reference
    \n \n
    \n \n

    Tag designating a power node with runtime degree. \n More...

    \n \n-

    #include <dune/typetree/nodetags.hh>

    \n+

    #include <dune/typetree/nodetags.hh>

    \n

    Detailed Description

    \n

    Tag designating a power node with runtime degree.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01259.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01259.html", "unified_diff": "@@ -76,19 +76,19 @@\n
    Dune::TypeTree::CompositeNodeTag Struct Reference
    \n \n
    \n \n

    Tag designating a composite node. \n More...

    \n \n-

    #include <dune/typetree/nodetags.hh>

    \n+

    #include <dune/typetree/nodetags.hh>

    \n

    Detailed Description

    \n

    Tag designating a composite node.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01263.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01263.html", "unified_diff": "@@ -75,23 +75,23 @@\n
    \n \n
    Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n
    \n

    \n Public Types

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

    \n Classes

    struct  result
     
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01267.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01267.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::GenericPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n+

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n \n \n \n \n

    \n Public Types

    typedef TransformedNode< SourceNode, TC, StaticDegree< SourceNode >::value > type
     
    \n

    Member Typedef Documentation

    \n@@ -103,15 +103,15 @@\n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01271.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01271.html", "unified_diff": "@@ -75,23 +75,23 @@\n
    \n \n
    Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n+

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n \n \n \n \n

    \n Classes

    struct  result
     
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01275.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01275.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n+

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n \n \n \n \n

    \n Public Types

    typedef TransformedNode< SourceNode, TC > type
     
    \n

    Member Typedef Documentation

    \n@@ -103,15 +103,15 @@\n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01279.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01279.html", "unified_diff": "@@ -75,23 +75,23 @@\n
    \n \n
    Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n+

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n \n \n \n \n

    \n Classes

    struct  result
     
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01283.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01283.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::GenericCompositeNodeTransformationTemplate< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n+

    #include <dune/typetree/powercompositenodetransformationtemplates.hh>

    \n \n \n \n \n

    \n Public Types

    typedef TransformedNode< SourceNode, TC... > type
     
    \n

    Member Typedef Documentation

    \n@@ -103,15 +103,15 @@\n
    \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01287.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01287.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::TypeTree::PowerNode< T, k > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/powernode.hh>

    \n+

    #include <dune/typetree/powernode.hh>

    \n \n \n \n \n \n

    \n Classes

    struct  Child
     Access to the type and storage type of the i-th child. More...
     
    \n@@ -1145,15 +1145,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01291.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01291.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::PowerNode< T, k >::Child< i > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/powernode.hh>

    \n+

    #include <dune/typetree/powernode.hh>

    \n
    \n \n \n \n \n \n@@ -136,15 +136,15 @@\n
    \n \n

    The type of the child.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01295.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01295.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::TypeTree::ProxyNode< Node > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::ProxyNode< Node >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -538,15 +538,15 @@\n
    \n \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01299.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01299.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::StaticChildAccessors< ProxiedNode > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::StaticChildAccessors< ProxiedNode >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -340,15 +340,15 @@\n
    \n \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01307.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01307.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::StaticChildAccessors< ProxiedNode >::Child< k >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -92,15 +92,15 @@\n \n
    \n

    Detailed Description

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

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01311.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01311.html", "unified_diff": "@@ -78,15 +78,15 @@\n
    Dune::TypeTree::DynamicChildAccessors< ProxiedNode > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::DynamicChildAccessors< ProxiedNode >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -524,15 +524,15 @@\n
    \n \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01315.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01315.html", "unified_diff": "@@ -91,15 +91,15 @@\n \"\"\n \n \n

    Detailed Description

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

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

    \n

    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01319.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01319.html", "unified_diff": "@@ -76,20 +76,20 @@\n
    Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag > Struct Template Reference
    \n \n
    \n \n

    ProxyNode base class for LeafNode. \n More...

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n

    Detailed Description

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

    ProxyNode base class for LeafNode.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01323.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01323.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag > Struct Template Reference
    \n \n
    \n \n

    ProxyNode base class for CompositeNode. \n More...

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -338,15 +338,15 @@\n
    \n \n

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

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01327.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01327.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag > Struct Template Reference
    \n \n
    \n \n

    ProxyNode base class for PowerNode. \n More...

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -545,15 +545,15 @@\n
    \n \n

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

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01331.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01331.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag > Struct Template Reference
    \n \n
    \n \n

    ProxyNode base class for DynamicPowerNode. \n More...

    \n \n-

    #include <dune/typetree/proxynode.hh>

    \n+

    #include <dune/typetree/proxynode.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -545,15 +545,15 @@\n
    \n \n

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

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01335.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01335.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members\n
    Dune::TypeTree::SimpleLeafNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n \n

    \n Public Types

    typedef T Type
     The type of the child.
     
    typedef T type
    \n \n \n \n \n \n@@ -235,15 +235,15 @@\n \n

    \n Public Types

    typedef TransformedNode transformed_type
     
    typedef std::shared_ptr< transformed_typetransformed_storage_type
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01339.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01339.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n+

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n \n \n \n \n

    \n Classes

    struct  result
     
    \n \n

    \n@@ -218,15 +218,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01343.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01343.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Types |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::SimplePowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n+

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -156,15 +156,15 @@\n \n

    \n Public Types

    typedef TransformedNode< TC, StaticDegree< SourceNode >::value > type
     
    typedef std::shared_ptr< typestorage_type
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01347.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01347.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n+

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n \n \n \n \n

    \n Classes

    struct  result
     
    \n \n

    \n@@ -218,15 +218,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01351.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01351.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::SimpleDynamicPowerNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n+

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -123,15 +123,15 @@\n \n

    \n Public Types

    typedef TransformedNode< TC > type
     
    typedef std::shared_ptr< typestorage_type
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01355.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01355.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n+

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n \n \n \n \n

    \n Classes

    struct  result
     
    \n \n

    \n@@ -218,15 +218,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01359.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01359.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::SimpleCompositeNodeTransformation< SourceNode, Transformation, TransformedNode >::result< TC > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n+

    #include <dune/typetree/simpletransformationdescriptors.hh>

    \n \n \n \n \n \n \n@@ -123,15 +123,15 @@\n \n

    \n Public Types

    typedef TransformedNode< TC... > type
     
    typedef std::shared_ptr< typestorage_type
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01363.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01363.html", "unified_diff": "@@ -80,15 +80,15 @@\n
    Dune::TypeTree::TransformTree< SourceTree, Transformation, Tag, recursive > Struct Template Reference
    \n \n
    \n \n

    Transform a TypeTree. \n More...

    \n \n-

    #include <dune/typetree/transformation.hh>

    \n+

    #include <dune/typetree/transformation.hh>

    \n \n \n \n \n \n \n@@ -397,15 +397,15 @@\n

    \n Public Types

    typedef transformed_type type
     The type of the transformed tree.
     
    typedef type Type
    \n
    \n

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

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01371.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01371.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::Detail::ContainerFactory< LeafToValue > Class Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treecontainer.hh>

    \n+

    #include <dune/typetree/treecontainer.hh>

    \n \n \n \n \n \n \n@@ -157,15 +157,15 @@\n \n

    \n Public Member Functions

     ContainerFactory (LeafToValue leafToValue)
     Create ContainerFactory.
     
    template<class Node >
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01375.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01375.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::Detail::TreeContainerVectorBackend< Container > Class Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treecontainer.hh>

    \n+

    #include <dune/typetree/treecontainer.hh>

    \n \n \n \n \n \n \n@@ -348,15 +348,15 @@\n
    \n \n

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

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01379.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01379.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::Detail::LeafToDefaultConstructibleValue< LeafToValue > Struct Template Reference
    \n \n

    \n Public Member Functions

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

    \n Public Member Functions

    template<class Node >
    auto operator() (const Node &node) const
     
    \n@@ -116,15 +116,15 @@\n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01383.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01383.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::TypeTree::HybridTreePath< T > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n \n \n \n \n \n

    \n Public Types

    using index_sequence = std::index_sequence_for< T... >
     An index_sequence for the entries in this HybridTreePath.
     
    \n@@ -576,15 +576,15 @@\n
    \n \n

    Get the size (length) of this path.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01387.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01387.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::TypeTree::TreePathSize< typename > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01391.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01391.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::TypeTree::TreePathPushBack< typename, size_t > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01395.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01395.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::TypeTree::TreePathPushFront< typename, size_t > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01399.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01399.html", "unified_diff": "@@ -85,15 +85,15 @@\n \"\"\n \"\"\n \"\"\n \"\"\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01403.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01403.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::TypeTree::TreePathFront< typename > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01407.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01407.html", "unified_diff": "@@ -85,15 +85,15 @@\n \"\"\n \"\"\n \"\"\n \"\"\n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01411.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01411.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::TypeTree::TreePathPopFront< typename > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01415.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01415.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::TypeTree::TreePathConcat< typename, typename > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01419.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01419.html", "unified_diff": "@@ -73,27 +73,27 @@\n \n \n
    \n
    Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01423.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01423.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n
    \n \n \n \n

    \n Public Types

    typedef HybridTreePath< index_constant< i >..., index_constant< k > > type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n
    \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01427.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01427.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n \n \n \n \n

    \n Public Types

    typedef HybridTreePath< index_constant< k >, index_constant< i >... > type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01431.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01431.html", "unified_diff": "@@ -73,27 +73,27 @@\n \n \n
    \n
    Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01435.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01435.html", "unified_diff": "@@ -73,29 +73,29 @@\n \n \n
    \n
    Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01439.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01439.html", "unified_diff": "@@ -73,27 +73,27 @@\n \n \n
    \n
    Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01443.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01443.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< k > >, i... > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n \n \n \n \n

    \n Public Types

    typedef HybridTreePath< index_constant< i >... > type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n
    \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01447.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01447.html", "unified_diff": "@@ -73,29 +73,29 @@\n \n \n
    \n
    Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... > Struct Template Reference
    \n
    \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreePathPopBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... >, i... >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01451.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01451.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TreePathPopFront< HybridTreePath< index_constant< k >, index_constant< i >... > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n \n \n \n \n

    \n Public Types

    typedef HybridTreePath< index_constant< i >... > type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01455.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01455.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::TreePathConcat< HybridTreePath< index_constant< i >... >, HybridTreePath< index_constant< k >... > > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/treepath.hh>

    \n+

    #include <dune/typetree/treepath.hh>

    \n \n \n \n \n

    \n Public Types

    typedef HybridTreePath< index_constant< i >..., index_constant< k >... > type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01459.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01459.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::first_type< T > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01463.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01463.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::first_type< T0, T... > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Types

    typedef T0 type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01467.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01467.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::has_node_tag< T > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n \n \n@@ -191,15 +191,15 @@\n
    \n \n

    True if class T defines a NodeTag.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01471.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01471.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_node_tag< T >::yes Struct Reference
    \n \n

    \n Classes

    struct  no
     
    struct  yes
     
    \n \n \n \n

    \n Public Attributes

    char dummy [1]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01475.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01475.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_node_tag< T >::no Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Attributes

    char dummy [2]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01479.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01479.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::has_node_tag_value< T, V > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n \n \n@@ -193,15 +193,15 @@\n
    \n \n

    True if class T defines a NodeTag of type V.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01483.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01483.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_node_tag_value< T, V >::maybe< N > Struct Template Reference
    \n \n

    \n Classes

    struct  maybe
     
    struct  no
     
    \n \n \n \n

    \n Public Attributes

    char dummy [N+1]
     
    \n

    Member Data Documentation

    \n@@ -103,15 +103,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01487.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01487.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_node_tag_value< T, V >::yes Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Attributes

    char dummy [2]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01491.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01491.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_node_tag_value< T, V >::no Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Attributes

    char dummy [1]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01495.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01495.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::has_implementation_tag< T > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n \n \n@@ -191,15 +191,15 @@\n
    \n \n

    True if class T defines an ImplementationTag.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01499.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01499.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_implementation_tag< T >::yes Struct Reference
    \n \n

    \n Classes

    struct  no
     
    struct  yes
     
    \n \n \n \n

    \n Public Attributes

    char dummy [1]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01503.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01503.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_implementation_tag< T >::no Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Attributes

    char dummy [2]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01507.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01507.html", "unified_diff": "@@ -78,15 +78,15 @@\n Static Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::has_implementation_tag_value< T, V > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n \n \n@@ -193,15 +193,15 @@\n
    \n \n

    True if class T defines an ImplementationTag of type V.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01511.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01511.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_implementation_tag_value< T, V >::maybe< N > Struct Template Reference
    \n \n

    \n Classes

    struct  maybe
     
    struct  no
     
    \n \n \n \n

    \n Public Attributes

    char dummy [N+1]
     
    \n

    Member Data Documentation

    \n@@ -103,15 +103,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01515.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01515.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_implementation_tag_value< T, V >::yes Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Attributes

    char dummy [2]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01519.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01519.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::has_implementation_tag_value< T, V >::no Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Attributes

    char dummy [1]
     
    \n

    Member Data Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01523.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01523.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::TypeTree::AlwaysVoid< typename > Struct Template Reference
    \n \n
    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Types

    typedef void type
     
    \n

    Member Typedef Documentation

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01527.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01527.html", "unified_diff": "@@ -76,20 +76,20 @@\n
    Dune::TypeTree::meta_function Struct Reference
    \n \n
    \n \n

    Marker tag declaring a meta function. \n More...

    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n

    Detailed Description

    \n

    Marker tag declaring a meta function.

    \n

    Just inherit from this type to cause lazy evaluation

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01531.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01531.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::lazy_evaluate< F > Struct Template Reference
    \n \n
    \n \n

    Helper meta function to delay evaluation of F. \n More...

    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Types

    typedef F::type type
     
    \n

    Detailed Description

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01535.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01535.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::lazy_identity< F > Struct Template Reference
    \n \n
    \n \n

    Identity function. \n More...

    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Types

    typedef F type
     
    \n

    Detailed Description

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01539.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01539.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::evaluate_if_meta_function< F > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n \n \n \n \n

    \n Public Types

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

    Detailed Description

    \n@@ -107,15 +107,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01543.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01543.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::TypeTree::IsTreePath< T > Struct Template Reference
    \n \n
    \n \n

    Check if type represents a tree path. \n More...

    \n \n-

    #include <dune/typetree/typetraits.hh>

    \n+

    #include <dune/typetree/typetraits.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::IsTreePath< T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -98,15 +98,15 @@\n
    Template Parameters
    \n \n \n
    TCheck if this type represents a tree path
    \n
    \n
    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01547.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01547.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::TreeInfo< Tree, Tag > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/utility.hh>

    \n+

    #include <dune/typetree/utility.hh>

    \n \n \n \n \n \n \n@@ -184,15 +184,15 @@\n
    \n \n

    The total number of nodes in the TypeTree.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01551.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01551.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::DefaultVisitor Struct Reference
    \n \n
    \n \n

    Visitor interface and base class for TypeTree visitors. \n More...

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::DefaultVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -451,15 +451,15 @@\n

    \n Static Public Attributes

    static const std::size_t depth = NodeInfo::depth
     The depth of the TypeTree.
     
    static const std::size_t nodeCount = NodeInfo::nodeCount
    \n
    \n
    \n \n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01555.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01555.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::DefaultPairVisitor Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::DefaultPairVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -515,15 +515,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01559.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01559.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::Experimental::DefaultHybridVisitor Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::Experimental::DefaultHybridVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -501,15 +501,15 @@\n \n \n
    Returns
    The result of applying this visitor to u.
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01563.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01563.html", "unified_diff": "@@ -78,15 +78,15 @@\n
    Dune::TypeTree::VisitDirectChildren Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::VisitDirectChildren:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -102,15 +102,15 @@\n  Template struct for determining whether or not to visit a given child. More...
    \n  \n \n

    Detailed Description

    \n

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

    \n

    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.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01567.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01567.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::VisitDirectChildren::VisitChild< Node1, Child1, Node2, Child2, TreePath > Struct Template Reference
    \n
    \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n \n \n \n \n \n

    \n Static Public Attributes

    static const bool value = false
     Do not visit any child.
     
    \n@@ -118,15 +118,15 @@\n
    \n \n

    Do not visit any child.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01571.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01571.html", "unified_diff": "@@ -78,15 +78,15 @@\n
    Dune::TypeTree::VisitTree Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::VisitTree:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -108,15 +108,15 @@\n  Template struct for determining whether or not to visit a given child. More...
    \n  \n \n

    Detailed Description

    \n

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

    \n

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01575.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01575.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::VisitTree::VisitChild< Node1, Child1, Node2, Child2, TreePath > Struct Template Reference
    \n
    \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n \n \n \n \n \n

    \n Static Public Attributes

    static const bool value = true
     Visit any child.
     
    \n@@ -118,15 +118,15 @@\n
    \n \n

    Visit any child.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01579.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01579.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::StaticTraversal Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::StaticTraversal:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -131,15 +131,15 @@\n
    \n \n

    Use the static tree traversal algorithm.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01583.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01583.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::DynamicTraversal Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n \n \n \n \n \n

    \n Static Public Attributes

    static const TreePathType::Type treePathType = TreePathType::dynamic
     Use the dynamic tree traversal algorithm.
     
    \n@@ -117,15 +117,15 @@\n
    \n \n

    Use the dynamic tree traversal algorithm.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01587.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01587.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::TreeVisitor Struct Reference
    \n \n
    \n \n

    Convenience base class for visiting the entire tree. \n More...

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreeVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -442,15 +442,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01591.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01591.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::DirectChildrenVisitor Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::DirectChildrenVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -442,15 +442,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01595.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01595.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::TreePairVisitor Struct Reference
    \n \n
    \n \n

    Convenience base class for visiting an entire tree pair. \n More...

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::TreePairVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -499,15 +499,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01599.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01599.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::TypeTree::DirectChildrenPairVisitor Struct Reference
    \n \n
    \n \n

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

    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::DirectChildrenPairVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -499,15 +499,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01603.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01603.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::Experimental::Info::LeafCounterVisitor Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::Experimental::Info::LeafCounterVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -686,15 +686,15 @@\n
    \n \n

    Use the static tree traversal algorithm.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01607.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01607.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::Experimental::Info::NodeCounterVisitor Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::Experimental::Info::NodeCounterVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -733,15 +733,15 @@\n
    \n \n

    Use the static tree traversal algorithm.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/a01611.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/a01611.html", "unified_diff": "@@ -77,15 +77,15 @@\n Public Member Functions |\n Static Public Attributes |\n List of all members \n
    Dune::TypeTree::Experimental::Info::DepthVisitor Struct Reference
    \n \n
    \n \n-

    #include <dune/typetree/visitor.hh>

    \n+

    #include <dune/typetree/visitor.hh>

    \n
    \n Inheritance diagram for Dune::TypeTree::Experimental::Info::DepthVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -566,15 +566,15 @@\n
    \n \n

    Use the static tree traversal algorithm.

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e74c06688912037f4b476b8dc05fab9.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/dir_5e74c06688912037f4b476b8dc05fab9.html", "unified_diff": "@@ -84,68 +84,68 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n 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
     transformationutilities.hh
     
     traversal.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
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/dune-typetree.tag.gz", "unified_diff": null, "details": [{"source1": "dune-typetree.tag", "source2": "dune-typetree.tag", "unified_diff": null, "details": [{"source1": "dune-typetree.tag", "source2": "dune-typetree.tag", "unified_diff": "@@ -9,18 +9,18 @@\n modules.txt\n /build/reproducible-path/dune-typetree-2.9.0/doc/doxygen/\n a00005.html\n \n \n accumulate_static.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00032.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n- dune/typetree/treepath.hh\n+ a00065.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n+ dune/typetree/treepath.hh\n Dune::TypeTree::or_\n Dune::TypeTree::or_::reduce\n Dune::TypeTree::and_\n Dune::TypeTree::and_::reduce\n Dune::TypeTree::plus\n Dune::TypeTree::plus::reduce\n Dune::TypeTree::minus\n@@ -36,81 +36,81 @@\n Dune::TypeTree::AccumulateType\n Dune\n Dune::TypeTree\n Dune::TypeTree::Experimental\n \n static const result_type\n result\n- a00032.html\n+ a00065.html\n acd23380b12c1509b3b3f31b893af75c8\n \n \n \n static const result_type\n child_result\n- a00032.html\n+ a00065.html\n a5c902ae13e1b03f88e252f9fd9f85952\n \n \n \n \n childextraction.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00053.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/treepath.hh\n+ a00014.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/treepath.hh\n Dune\n Dune::TypeTree\n \n \n compositenode.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00026.html\n- dune/typetree/nodetags.hh\n- dune/typetree/childextraction.hh\n- dune/typetree/typetraits.hh\n+ a00059.html\n+ dune/typetree/nodetags.hh\n+ dune/typetree/childextraction.hh\n+ dune/typetree/typetraits.hh\n Dune::TypeTree::CompositeNode\n Dune::TypeTree::CompositeNode::Child\n Dune\n Dune::TypeTree\n \n \n dynamicpowernode.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00077.html\n- dune/typetree/nodetags.hh\n- dune/typetree/utility.hh\n- dune/typetree/typetraits.hh\n+ a00071.html\n+ dune/typetree/nodetags.hh\n+ dune/typetree/utility.hh\n+ dune/typetree/typetraits.hh\n Dune::TypeTree::DynamicPowerNode\n Dune\n Dune::TypeTree\n \n \n exceptions.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00086.html\n+ a00083.html\n Dune::TypeTree::Exception\n Dune\n Dune::TypeTree\n \n \n filteredcompositenode.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00071.html\n- dune/typetree/nodetags.hh\n- dune/typetree/filters.hh\n+ a00038.html\n+ dune/typetree/nodetags.hh\n+ dune/typetree/filters.hh\n Dune::TypeTree::FilteredCompositeNode\n Dune::TypeTree::FilteredCompositeNode::Child\n Dune\n Dune::TypeTree\n \n \n filters.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00074.html\n+ a00086.html\n Dune::TypeTree::FilterEntry\n Dune::TypeTree::FilterResult\n Dune::TypeTree::FilterResult::apply\n Dune::TypeTree::SimpleFilterTag\n Dune::TypeTree::AdvancedFilterTag\n Dune::TypeTree::AdvancedFilter\n Dune::TypeTree::AdvancedFilter::apply\n@@ -122,27 +122,27 @@\n Dune::TypeTree::filter::apply\n Dune\n Dune::TypeTree\n \n \n fixedcapacitystack.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00023.html\n+ a00074.html\n Dune::TypeTree::FixedCapacityStackView\n Dune::TypeTree::FixedCapacityStack\n Dune\n Dune::TypeTree\n \n \n generictransformationdescriptors.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00062.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n- dune/typetree/powercompositenodetransformationtemplates.hh\n+ a00056.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n+ dune/typetree/powercompositenodetransformationtemplates.hh\n Dune::TypeTree::GenericLeafNodeTransformation\n Dune::TypeTree::TemplatizedGenericPowerNodeTransformation\n Dune::TypeTree::TemplatizedGenericPowerNodeTransformation::result\n Dune::TypeTree::GenericPowerNodeTransformation\n Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation\n Dune::TypeTree::TemplatizedGenericDynamicPowerNodeTransformation::result\n Dune::TypeTree::GenericDynamicPowerNodeTransformation\n@@ -151,197 +151,197 @@\n Dune::TypeTree::GenericCompositeNodeTransformation\n Dune\n Dune::TypeTree\n \n \n leafnode.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00068.html\n- dune/typetree/nodetags.hh\n+ a00017.html\n+ dune/typetree/nodetags.hh\n Dune::TypeTree::LeafNode\n Dune\n Dune::TypeTree\n \n \n nodeinterface.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00029.html\n+ a00053.html\n Dune::TypeTree::NodeInterface\n Dune\n Dune::TypeTree\n \n \n nodetags.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00056.html\n+ a00011.html\n Dune::TypeTree::LeafNodeTag\n Dune::TypeTree::PowerNodeTag\n Dune::TypeTree::DynamicPowerNodeTag\n Dune::TypeTree::CompositeNodeTag\n Dune\n Dune::TypeTree\n \n \n pairtraversal.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00065.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n- dune/typetree/treepath.hh\n- dune/typetree/visitor.hh\n- dune/typetree/traversal.hh\n+ a00068.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n+ dune/typetree/treepath.hh\n+ dune/typetree/visitor.hh\n+ dune/typetree/traversal.hh\n Dune\n Dune::TypeTree\n Dune::TypeTree::Detail\n \n \n powercompositenodetransformationtemplates.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00017.html\n- dune/typetree/nodeinterface.hh\n+ a00047.html\n+ dune/typetree/nodeinterface.hh\n Dune::TypeTree::GenericPowerNodeTransformationTemplate\n Dune::TypeTree::GenericPowerNodeTransformationTemplate::result\n Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate\n Dune::TypeTree::GenericDynamicPowerNodeTransformationTemplate::result\n Dune::TypeTree::GenericCompositeNodeTransformationTemplate\n Dune::TypeTree::GenericCompositeNodeTransformationTemplate::result\n Dune\n Dune::TypeTree\n \n \n powernode.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00038.html\n- dune/typetree/nodetags.hh\n- dune/typetree/utility.hh\n- dune/typetree/childextraction.hh\n- dune/typetree/typetraits.hh\n+ a00026.html\n+ dune/typetree/nodetags.hh\n+ dune/typetree/utility.hh\n+ dune/typetree/childextraction.hh\n+ dune/typetree/typetraits.hh\n Dune::TypeTree::PowerNode\n Dune::TypeTree::PowerNode::Child\n Dune\n Dune::TypeTree\n \n \n proxynode.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00008.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n+ a00023.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n Dune::TypeTree::StaticChildAccessors\n Dune::TypeTree::StaticChildAccessors::Child\n Dune::TypeTree::DynamicChildAccessors\n Dune::TypeTree::ProxyNodeBase< Node, LeafNodeTag >\n Dune::TypeTree::ProxyNodeBase< Node, CompositeNodeTag >\n Dune::TypeTree::ProxyNodeBase< Node, PowerNodeTag >\n Dune::TypeTree::ProxyNodeBase< Node, DynamicPowerNodeTag >\n Dune::TypeTree::ProxyNode\n Dune\n Dune::TypeTree\n \n \n simpletransformationdescriptors.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00035.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n+ a00029.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n Dune::TypeTree::SimpleLeafNodeTransformation\n Dune::TypeTree::SimplePowerNodeTransformation\n Dune::TypeTree::SimplePowerNodeTransformation::result\n Dune::TypeTree::SimpleDynamicPowerNodeTransformation\n Dune::TypeTree::SimpleDynamicPowerNodeTransformation::result\n Dune::TypeTree::SimpleCompositeNodeTransformation\n Dune::TypeTree::SimpleCompositeNodeTransformation::result\n Dune\n Dune::TypeTree\n \n \n transformation.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00020.html\n- dune/typetree/typetraits.hh\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n- dune/typetree/utility.hh\n+ a00062.html\n+ dune/typetree/typetraits.hh\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n+ dune/typetree/utility.hh\n Dune::TypeTree::TransformTree\n Dune\n Dune::TypeTree\n \n \n transformationutilities.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00050.html\n- dune/typetree/simpletransformationdescriptors.hh\n- dune/typetree/generictransformationdescriptors.hh\n+ a00041.html\n+ dune/typetree/simpletransformationdescriptors.hh\n+ dune/typetree/generictransformationdescriptors.hh\n \n \n traversal.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00080.html\n- dune/typetree/childextraction.hh\n- dune/typetree/nodetags.hh\n- dune/typetree/treepath.hh\n- dune/typetree/visitor.hh\n+ a00032.html\n+ dune/typetree/childextraction.hh\n+ dune/typetree/nodetags.hh\n+ dune/typetree/treepath.hh\n+ dune/typetree/visitor.hh\n Dune\n Dune::TypeTree\n Dune::TypeTree::Detail\n \n \n traversalutilities.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00083.html\n- dune/typetree/traversal.hh\n+ a00080.html\n+ dune/typetree/traversal.hh\n Dune\n Dune::TypeTree\n \n static const TreePathType::Type\n treePathType\n- a00083.html\n+ a00080.html\n ac933f134e17da9e8dbf18be15134df40\n \n \n \n F\n _functor\n- a00083.html\n+ a00080.html\n a925ce4fb47f35dbaf1550d896578184f\n \n \n \n R\n _reduction\n- a00083.html\n+ a00080.html\n a3399305aa17d4bcec74944e962ff3a12\n \n \n \n ResultType\n _value\n- a00083.html\n+ a00080.html\n ad4dc401736cbecb52f1afd1c8c8d359f\n \n \n \n \n treecontainer.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00014.html\n- dune/typetree/treepath.hh\n+ a00044.html\n+ dune/typetree/treepath.hh\n Dune::TypeTree::Detail::ContainerFactory\n Dune::TypeTree::Detail::TreeContainerVectorBackend\n Dune::TypeTree::Detail::LeafToDefaultConstructibleValue\n Dune\n Dune::TypeTree\n Dune::TypeTree::Detail\n \n \n treepath.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00041.html\n- dune/typetree/fixedcapacitystack.hh\n- dune/typetree/utility.hh\n+ a00050.html\n+ dune/typetree/fixedcapacitystack.hh\n+ dune/typetree/utility.hh\n Dune::TypeTree::HybridTreePath\n Dune::TypeTree::TreePathSize< HybridTreePath< index_constant< i >... > >\n Dune::TypeTree::TreePathPushBack< HybridTreePath< index_constant< i >... >, k >\n Dune::TypeTree::TreePathPushFront< HybridTreePath< index_constant< i >... >, k >\n Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< k > > >\n Dune::TypeTree::TreePathBack< HybridTreePath< index_constant< j >, index_constant< k >, index_constant< l >... > >\n Dune::TypeTree::TreePathFront< HybridTreePath< index_constant< k >, index_constant< i >... > >\n@@ -352,17 +352,17 @@\n Dune\n Dune::TypeTree\n Dune::TypeTree::TreePathType\n \n \n typetraits.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00044.html\n- dune/typetree/treepath.hh\n- dune/typetree/nodeinterface.hh\n+ a00008.html\n+ dune/typetree/treepath.hh\n+ dune/typetree/nodeinterface.hh\n Dune::first_type< T0, T... >\n Dune::TypeTree::has_node_tag\n Dune::TypeTree::has_node_tag::yes\n Dune::TypeTree::has_node_tag::no\n Dune::TypeTree::has_node_tag_value\n Dune::TypeTree::has_node_tag_value::maybe\n Dune::TypeTree::has_node_tag_value::yes\n@@ -383,45 +383,45 @@\n Dune\n Dune::TypeTree\n Dune::TypeTree::impl\n \n \n typetree.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00059.html\n- dune/typetree/nodetags.hh\n- dune/typetree/utility.hh\n- dune/typetree/leafnode.hh\n- dune/typetree/powernode.hh\n- dune/typetree/dynamicpowernode.hh\n- dune/typetree/compositenode.hh\n- dune/typetree/traversal.hh\n- dune/typetree/pairtraversal.hh\n- dune/typetree/traversalutilities.hh\n- dune/typetree/transformation.hh\n- dune/typetree/transformationutilities.hh\n- dune/typetree/accumulate_static.hh\n- dune/typetree/childextraction.hh\n+ a00077.html\n+ dune/typetree/nodetags.hh\n+ dune/typetree/utility.hh\n+ dune/typetree/leafnode.hh\n+ dune/typetree/powernode.hh\n+ dune/typetree/dynamicpowernode.hh\n+ dune/typetree/compositenode.hh\n+ dune/typetree/traversal.hh\n+ dune/typetree/pairtraversal.hh\n+ dune/typetree/traversalutilities.hh\n+ dune/typetree/transformation.hh\n+ dune/typetree/transformationutilities.hh\n+ dune/typetree/accumulate_static.hh\n+ dune/typetree/childextraction.hh\n \n \n utility.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00047.html\n- dune/typetree/nodeinterface.hh\n- dune/typetree/nodetags.hh\n+ a00020.html\n+ dune/typetree/nodeinterface.hh\n+ dune/typetree/nodetags.hh\n Dune::TypeTree::TreeInfo\n Dune\n Dune::TypeTree\n \n \n visitor.hh\n /build/reproducible-path/dune-typetree-2.9.0/dune/typetree/\n- a00011.html\n- dune/typetree/treepath.hh\n- dune/typetree/utility.hh\n+ a00035.html\n+ dune/typetree/treepath.hh\n+ dune/typetree/utility.hh\n Dune::TypeTree::DefaultVisitor\n Dune::TypeTree::DefaultPairVisitor\n Dune::TypeTree::Experimental::DefaultHybridVisitor\n Dune::TypeTree::VisitDirectChildren\n Dune::TypeTree::VisitDirectChildren::VisitChild\n Dune::TypeTree::VisitTree\n Dune::TypeTree::VisitTree::VisitChild\n"}]}]}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/files.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/files.html", "unified_diff": "@@ -74,41 +74,41 @@\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/globals.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/globals.html", "unified_diff": "@@ -66,20 +66,20 @@\n \n \n \n \n \n
    \n
    Here is a list of all file members with links to the files they belong to:
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-typetree-doc/doxygen/globals_vars.html", "source2": "./usr/share/doc/libdune-typetree-doc/doxygen/globals_vars.html", "unified_diff": "@@ -66,20 +66,20 @@\n \n \n \n \n \n
    \n
    Here is a list of all variables with links to the files they belong to:
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}]}]}]}]}