│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
57 template<
typename T,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
69 template<
typename T,
typename TreePath>
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
51 template<
typename SourceNode,
typename Transformation,
typename Tag>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
66 template<
typename S,
typename T,
typename Tag>
│ │ │ │ +
67 struct LookupNodeTransformation
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
80 template<
typename T,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
90 template<
typename T,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
104 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
119 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
76 static_assert((!std::is_same<type,void>::value),
"Unable to find valid transformation descriptor");
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
92 template<
typename SourceTree,
typename Transformation,
typename Tag = StartTag,
bool recursive = true>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
98 typedef typename LookupNodeTransformation<SourceTree,Transformation,typename SourceTree::ImplementationTag>::type NodeTransformation;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
114 static transformed_type
transform(
const SourceTree& s,
const Transformation& t = Transformation())
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
120 static transformed_type
transform(
const SourceTree& s, Transformation& t)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
126 static transformed_type
transform(std::shared_ptr<const SourceTree> sp,
const Transformation& t = Transformation())
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
132 static transformed_type
transform(std::shared_ptr<const SourceTree> sp, Transformation& t)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
139 static transformed_storage_type
transform_storage(std::shared_ptr<const SourceTree> sp,
const Transformation& t = Transformation())
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
146 static transformed_storage_type
transform_storage(std::shared_ptr<const SourceTree> sp, Transformation& t)
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
157 template<
typename S,
typename T,
bool recursive>
│ │ │ │ +
158 struct TransformTree<S,T,LeafNodeTag,recursive>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
161 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>
::type NodeTransformation;
│ │ │ │ +
│ │ │ │ +
163 typedef typename NodeTransformation::transformed_type transformed_type;
│ │ │ │ +
164 typedef typename NodeTransformation::transformed_storage_type transformed_storage_type;
│ │ │ │
│ │ │ │ -
173 template<
typename T1,
typename T2,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
167 static transformed_type
transform(
const S& s, T& t)
│ │ │ │ +
│ │ │ │ +
169 return NodeTransformation::transform(s,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
173 static transformed_type
transform(
const S& s,
const T& t)
│ │ │ │ +
│ │ │ │ +
175 return NodeTransformation::transform(s,t);
│ │ │ │ +
│ │ │ │
│ │ │ │ -
186 template<
typename T1,
typename T2,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
198 template<
typename T1,
typename T2,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
179 static transformed_type
transform(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
│ │ │ │ +
181 return NodeTransformation::transform(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
185 static transformed_type
transform(std::shared_ptr<const S> sp,
const T& t)
│ │ │ │ +
│ │ │ │ +
187 return NodeTransformation::transform(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
190 static transformed_storage_type
transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
│ │ │ │ +
192 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
195 static transformed_storage_type
transform_storage(std::shared_ptr<const S> sp,
const T& t)
│ │ │ │ +
│ │ │ │ +
197 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
213 template<
typename T1,
typename T2,
typename TreePath>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
229 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
245 template<
typename T1,
typename Child1,
typename T2,
typename Child2,
typename TreePath,
typename ChildIndex>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
204 template<
typename S,
typename T>
│ │ │ │ +
205 struct TransformTreeNonRecursive
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
208 typedef typename LookupNodeTransformation<S,T,ImplementationTag<S>>::type NodeTransformation;
│ │ │ │ +
│ │ │ │ +
210 typedef typename NodeTransformation::transformed_type transformed_type;
│ │ │ │ +
211 typedef typename NodeTransformation::transformed_storage_type transformed_storage_type;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
214 static transformed_type transform(
const S& s, T& t)
│ │ │ │ +
│ │ │ │ +
216 return NodeTransformation::transform(s,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
220 static transformed_type transform(
const S& s,
const T& t)
│ │ │ │ +
│ │ │ │ +
222 return NodeTransformation::transform(s,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
226 static transformed_type transform(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
│ │ │ │ +
228 return NodeTransformation::transform(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
232 static transformed_type transform(std::shared_ptr<const S> sp,
const T& t)
│ │ │ │ +
│ │ │ │ +
234 return NodeTransformation::transform(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
237 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
│ │ │ │ +
239 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
242 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp,
const T& t)
│ │ │ │ +
│ │ │ │ +
244 return NodeTransformation::transform_storage(sp,t);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
251 namespace Experimental {
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
253 template<
class Source,
class Transformation,
class Tag>
│ │ │ │ +
254 class RecursivePowerTransformTree
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
257 static_assert(std::is_same_v<Tag,PowerNodeTag> or std::is_same_v<Tag,DynamicPowerNodeTag>);
│ │ │ │ +
│ │ │ │ +
259 using ChildType =
typename Source::ChildType;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
262 template<
class NodeStorage>
│ │ │ │ +
263 static auto node_storage_provider(
const std::size_t& degree)
│ │ │ │ +
│ │ │ │ +
265 return std::vector<NodeStorage>(degree);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
269 template<
class NodeStorage,
class StaticIndex>
│ │ │ │ +
270 static auto node_storage_provider(StaticIndex)
│ │ │ │ +
│ │ │ │ +
272 return std::array<NodeStorage,std::size_t(StaticIndex{})>();
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
283 using NodeTransformation =
typename LookupNodeTransformation<Source,Transformation,ImplementationTag<Source>>::type;
│ │ │ │ +
284 using ChildNodeTransformation =
typename LookupNodeTransformation<ChildType,Transformation,ImplementationTag<ChildType>>::type;
│ │ │ │
│ │ │ │ -
293 template<
typename T,
typename TreePath,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
303 template<
typename T,
typename TreePath,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
313 template<
typename T,
typename TreePath,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
323 template<
typename T,
typename TreePath,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
333 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
343 template<
typename T,
typename Child,
typename TreePath,
typename ChildIndex,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
288 using ChildTreeTransformation = TransformTree<ChildType,
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
291 ChildNodeTransformation::recursive>;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
294 using transformed_child_type =
typename ChildTreeTransformation::transformed_type;
│ │ │ │ +
295 using transformed_child_storage_type =
typename ChildTreeTransformation::transformed_storage_type;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
298 using transformed_type =
typename NodeTransformation::template result<transformed_child_type>::type;
│ │ │ │ +
299 using transformed_storage_type =
typename NodeTransformation::template result<transformed_child_type>::storage_type;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
302 static transformed_type transform(
const Source& source, Transformation& transformation)
│ │ │ │ +
│ │ │ │ +
304 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source.degree());
│ │ │ │ +
305 for (std::size_t k = 0; k < source.degree(); ++k) {
│ │ │ │ +
306 children_storage[k] = ChildTreeTransformation::transform_storage(source.childStorage(k),transformation);
│ │ │ │ +
│ │ │ │ +
308 return NodeTransformation::transform(source,transformation,children_storage);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
312 static transformed_type transform(
const Source& source,
const Transformation& transformation)
│ │ │ │ +
│ │ │ │ +
314 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source.degree());
│ │ │ │ +
315 for (std::size_t k = 0; k < source.degree(); ++k) {
│ │ │ │ +
316 children_storage[k] = ChildTreeTransformation::transform_storage(source.childStorage(k),transformation);
│ │ │ │ +
│ │ │ │ +
318 return NodeTransformation::transform(source,transformation,children_storage);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
322 static transformed_type transform(std::shared_ptr<const Source> source_ptr, Transformation& transformation)
│ │ │ │ +
│ │ │ │ +
324 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source_ptr->degree());
│ │ │ │ +
325 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
326 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
│ │ │ │ +
328 return NodeTransformation::transform(source_ptr,transformation,children_storage);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
332 static transformed_type transform(std::shared_ptr<const Source> source_ptr,
const Transformation& transformation)
│ │ │ │ +
│ │ │ │ +
334 auto children_storage = node_storage_provider<std::shared_ptr<transformed_child_type>>(source_ptr->degree());
│ │ │ │ +
335 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
336 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
│ │ │ │ +
338 return NodeTransformation::transform(source_ptr,transformation,children_storage);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
342 static transformed_storage_type transform_storage(std::shared_ptr<const Source> source_ptr, Transformation& transformation)
│ │ │ │ +
│ │ │ │ +
344 auto children_storage = node_storage_provider<transformed_child_storage_type>(source_ptr->degree());
│ │ │ │ +
345 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
346 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
│ │ │ │ +
348 return NodeTransformation::transform_storage(source_ptr,transformation,children_storage);
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
362 template<
typename Node1,
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
365 typename Child2 = void,
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
352 static transformed_storage_type transform_storage(std::shared_ptr<const Source> source_ptr,
const Transformation& transformation)
│ │ │ │ +
│ │ │ │ +
354 auto children_storage = node_storage_provider<transformed_child_storage_type>(source_ptr->degree());
│ │ │ │ +
355 for (std::size_t k = 0; k < source_ptr->degree(); ++k) {
│ │ │ │ +
356 children_storage[k] = ChildTreeTransformation::transform_storage(source_ptr->childStorage(k),transformation);
│ │ │ │ +
│ │ │ │ +
358 return NodeTransformation::transform_storage(source_ptr,transformation,children_storage);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
365 template<
typename Source,
typename Transformation>
│ │ │ │ +
366 struct TransformTree<Source,Transformation,PowerNodeTag,true>
│ │ │ │ +
367 :
public Impl::RecursivePowerTransformTree<Source,Transformation,PowerNodeTag>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
371 template<
typename Source,
typename Transformation>
│ │ │ │ +
372 struct TransformTree<Source,Transformation,DynamicPowerNodeTag,true>
│ │ │ │ +
373 :
public Impl::RecursivePowerTransformTree<Source,Transformation,DynamicPowerNodeTag>
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
388 template<
typename Node1,
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
391 typename Child2 = void,
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
377 template<
typename S,
typename T>
│ │ │ │ +
378 struct TransformTree<S,T,PowerNodeTag,false>
│ │ │ │ +
379 :
public TransformTreeNonRecursive<S,T>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
383 template<
typename S,
typename T>
│ │ │ │ +
384 struct TransformTree<S,T,DynamicPowerNodeTag,false>
│ │ │ │ +
385 :
public TransformTreeNonRecursive<S,T>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
393 template<
typename S,
typename Children,
typename T>
│ │ │ │ +
394 struct transform_composite_node;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
399 template<
typename S,
typename T,
typename... C>
│ │ │ │ +
400 struct transform_composite_node<S,std::tuple<C...>,T>
│ │ │ │ +
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
453 namespace Experimental::Info {
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
460 template<
class Tree,
class Child,
class TreePath,
class ChildIndex,
class U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
404 typedef ImplementationTag<S> Tag;
│ │ │ │ +
405 typedef typename LookupNodeTransformation<S,T,Tag>::type NodeTransformation;
│ │ │ │ +
406 typedef typename NodeTransformation::template
result<
typename TransformTree<C,
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
409 LookupNodeTransformation<C,T,ImplementationTag<C>>::type::recursive
│ │ │ │ +
410 >::transformed_type...
│ │ │ │ +
411 >::type transformed_type;
│ │ │ │ +
│ │ │ │ +
413 typedef typename NodeTransformation::template
result<
typename TransformTree<C,
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
416 LookupNodeTransformation<C,T,ImplementationTag<C>>::type::recursive
│ │ │ │ +
417 >::transformed_type...
│ │ │ │ +
418 >::storage_type transformed_storage_type;
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
423 template<std::
size_t i>
│ │ │ │ +
424 struct ChildTransformation
│ │ │ │ +
425 :
public TransformTree<typename S::template Child<i>::Type,
│ │ │ │ +
│ │ │ │ +
427 NodeTag<typename S::template Child<i>::Type>,
│ │ │ │ +
428 LookupNodeTransformation<
│ │ │ │ +
429 typename S::template Child<i>::Type,
│ │ │ │ +
│ │ │ │ +
431 ImplementationTag<typename S::template Child<i>::Type>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
436 template<std::
size_t i,
typename Tuple,
typename Value>
│ │ │ │ +
437 static void setElement(Tuple& tuple, Value&& value)
│ │ │ │ +
│ │ │ │ +
439 std::get<i>(tuple) = std::forward<Value>(value);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
442 template<
typename Trafo, std::size_t... i>
│ │ │ │ +
443 static transformed_type transform(
const S& s, Trafo&& t, std::index_sequence<i...> indices)
│ │ │ │ +
│ │ │ │ +
445 std::tuple<typename ChildTransformation<i>::transformed_storage_type...> storage;
│ │ │ │ +
446 Dune::Hybrid::Impl::evaluateFoldExpression<int>({(setElement<i>(storage, ChildTransformation<i>::transform_storage(s.template childStorage<i>(), std::forward<Trafo>(t))),0)...});
│ │ │ │ +
447 return NodeTransformation::transform(s, std::forward<Trafo>(t), std::get<i>(storage)...);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
450 template<
typename Trafo, std::size_t... i>
│ │ │ │ +
451 static transformed_storage_type transform_storage(std::shared_ptr<const S> sp, Trafo&& t, std::index_sequence<i...> indices)
│ │ │ │ +
│ │ │ │ +
453 std::tuple<typename ChildTransformation<i>::transformed_storage_type...> storage;
│ │ │ │ +
454 Dune::Hybrid::Impl::evaluateFoldExpression<int>({(setElement<i>(storage, ChildTransformation<i>::transform_storage(sp->template childStorage<i>(), std::forward<Trafo>(t))),0)...});
│ │ │ │ +
455 return NodeTransformation::transform_storage(sp, std::forward<Trafo>(t), std::get<i>(storage)...);
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
462 template<
typename S,
typename T>
│ │ │ │ +
463 struct TransformTree<S,T,CompositeNodeTag,true>
│ │ │ │ +
│ │ │ │
│ │ │ │ -
466 template<
class Tree,
class Child,
class TreePath,
class U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
469 return std::size_t{u};
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
472 template<
class Tree,
class TreePath,
class U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
475 return Hybrid::plus(u,Dune::Indices::_1);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
468 typedef typename S::ChildTypes ChildTypes;
│ │ │ │ +
│ │ │ │ +
470 static auto child_indices()
│ │ │ │ +
│ │ │ │ +
472 return std::make_index_sequence<S::degree()>();
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
477 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_type transformed_type;
│ │ │ │ +
478 typedef typename transform_composite_node<S,ChildTypes,T>::transformed_storage_type transformed_storage_type;
│ │ │ │
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
483 template<
typename Tree,
typename TreePath,
typename U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
485 return Hybrid::plus(u,Indices::_1);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
494 template<
class Tree,
class TreePath,
class U>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
498 auto depth = Hybrid::plus(path_size,Indices::_1);
│ │ │ │ -
499 return Hybrid::max(
depth,u);
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
505 template<
typename Tree>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
513 template<
typename Tree>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
521 template<
typename Tree>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
529 template<
typename Tree>
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
536 template<
typename Tree>
│ │ │ │ -
537 constexpr bool isDynamic = std::is_same<std::size_t, decltype(leafCount(std::declval<Tree>()))>{};
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
typename impl::_Child< Node, indices... >::type Child
Template alias for the type of a child node given by a list of child indices.
Definition childextraction.hh:223
│ │ │ │ -
constexpr std::size_t treePathSize(const HybridTreePath< T... > &)
Returns the size (number of components) of the given HybridTreePath.
Definition treepath.hh:199
│ │ │ │ +
480 static transformed_type
transform(
const S& s, T& t)
│ │ │ │ +
│ │ │ │ +
482 return transform_composite_node<S,ChildTypes,T>::transform(s,t,child_indices());
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
485 static transformed_type
transform(
const S& s,
const T& t)
│ │ │ │ +
│ │ │ │ +
487 return transform_composite_node<S,ChildTypes,T>::transform(s,t,child_indices());
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
490 static transformed_storage_type
transform_storage(std::shared_ptr<const S> sp, T& t)
│ │ │ │ +
│ │ │ │ +
492 return transform_composite_node<S,ChildTypes,T>::transform_storage(sp,t,child_indices());
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
495 static transformed_storage_type
transform_storage(std::shared_ptr<const S> sp,
const T& t)
│ │ │ │ +
│ │ │ │ +
497 return transform_composite_node<S,ChildTypes,T>::transform_storage(sp,t,child_indices());
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
503 template<
typename S,
typename T>
│ │ │ │ +
504 struct TransformTree<S,T,CompositeNodeTag,false>
│ │ │ │ +
505 :
public TransformTreeNonRecursive<S,T>
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
static const result_type result
Definition accumulate_static.hh:110
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
void registerNodeTransformation(SourceNode *, Transformation *, Tag *)
Register transformation descriptor to transform SourceNode with Transformation.
│ │ │ │
Definition accumulate_static.hh:13
│ │ │ │ -
auto hybridApplyToTree(Tree &&tree, Visitor &&visitor, Init &&init)
Apply hybrid visitor to TypeTree.
Definition accumulate_static.hh:698
│ │ │ │ -
Type
Definition treepath.hh:30
│ │ │ │ -
@ fullyStatic
Definition treepath.hh:30
│ │ │ │ -
@ dynamic
Definition treepath.hh:30
│ │ │ │ -
constexpr bool isDynamic
true if any of the nodes in the tree only has dynamic degree.
Definition visitor.hh:537
│ │ │ │ -
auto leafCount(const Tree &tree)
The number of leaf nodes in the Tree.
Definition visitor.hh:530
│ │ │ │ -
auto nodeCount(const Tree &tree)
The total number of nodes in the Tree.
Definition visitor.hh:522
│ │ │ │ -
constexpr auto depth()
The depth of the Tree.
Definition visitor.hh:514
│ │ │ │ -
A hybrid version of TreePath that supports both compile time and run time indices.
Definition treepath.hh:79
│ │ │ │ -
Visitor interface and base class for TypeTree visitors.
Definition visitor.hh:47
│ │ │ │ -
void in(T &&, TreePath) const
Method for infix tree traversal.
Definition visitor.hh:70
│ │ │ │ -
void afterChild(T &&, Child &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition visitor.hh:120
│ │ │ │ -
void beforeChild(T &&, Child &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition visitor.hh:105
│ │ │ │ -
void post(T &&, TreePath) const
Method for postfix tree traversal.
Definition visitor.hh:81
│ │ │ │ -
void leaf(T &&, TreePath) const
Method for leaf traversal.
Definition visitor.hh:91
│ │ │ │ -
void pre(T &&, TreePath) const
Method for prefix tree traversal.
Definition visitor.hh:58
│ │ │ │ -
Visitor interface and base class for visitors of pairs of TypeTrees.
Definition visitor.hh:162
│ │ │ │ -
void leaf(T1 &&, T2 &&, TreePath) const
Method for leaf traversal.
Definition visitor.hh:214
│ │ │ │ -
void beforeChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for parent-child traversal.
Definition visitor.hh:230
│ │ │ │ -
void pre(T1 &&, T2 &&, TreePath) const
Method for prefix tree traversal.
Definition visitor.hh:174
│ │ │ │ -
void post(T1 &&, T2 &&, TreePath) const
Method for postfix traversal.
Definition visitor.hh:199
│ │ │ │ -
void in(T1 &&, T2 &&, TreePath) const
Method for infix tree traversal.
Definition visitor.hh:187
│ │ │ │ -
void afterChild(T1 &&, Child1 &&, T2 &&, Child2 &&, TreePath, ChildIndex) const
Method for child-parent traversal.
Definition visitor.hh:246
│ │ │ │ -
Hybrid visitor interface and base class for TypeTree hybrid visitors.
Definition visitor.hh:284
│ │ │ │ -
auto post(T &&, TreePath, const U &u) const
Method for postfix tree traversal.
Definition visitor.hh:314
│ │ │ │ -
auto pre(T &&, TreePath, const U &u) const
Method for prefix tree traversal.
Definition visitor.hh:294
│ │ │ │ -
auto leaf(T &&, TreePath, const U &u) const
Method for leaf traversal.
Definition visitor.hh:324
│ │ │ │ -
auto afterChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for child-parent traversal.
Definition visitor.hh:344
│ │ │ │ -
auto in(T &&, TreePath, const U &u) const
Method for infix tree traversal.
Definition visitor.hh:304
│ │ │ │ -
auto beforeChild(T &&, Child &&, TreePath, ChildIndex, const U &u) const
Method for parent-child traversal.
Definition visitor.hh:334
│ │ │ │ -
Mixin base class for visitors that only want to visit the direct children of a node.
Definition visitor.hh:356
│ │ │ │ -
Template struct for determining whether or not to visit a given child.
Definition visitor.hh:368
│ │ │ │ -
static const bool value
Do not visit any child.
Definition visitor.hh:370
│ │ │ │ -
Mixin base class for visitors that want to visit the complete tree.
Definition visitor.hh:382
│ │ │ │ -
Template struct for determining whether or not to visit a given child.
Definition visitor.hh:394
│ │ │ │ -
static const bool value
Visit any child.
Definition visitor.hh:396
│ │ │ │ -
Mixin base class for visitors that require a static TreePath during traversal.
Definition visitor.hh:410
│ │ │ │ -
static const TreePathType::Type treePathType
Use the static tree traversal algorithm.
Definition visitor.hh:412
│ │ │ │ -
Mixin base class for visitors that only need a dynamic TreePath during traversal.
Definition visitor.hh:424
│ │ │ │ -
static const TreePathType::Type treePathType
Use the dynamic tree traversal algorithm.
Definition visitor.hh:426
│ │ │ │ -
Convenience base class for visiting the entire tree.
Definition visitor.hh:433
│ │ │ │ -
Convenience base class for visiting the direct children of a node.
Definition visitor.hh:439
│ │ │ │ -
Convenience base class for visiting an entire tree pair.
Definition visitor.hh:445
│ │ │ │ -
Convenience base class for visiting the direct children of a node pair.
Definition visitor.hh:451
│ │ │ │ -
Definition visitor.hh:459
│ │ │ │ -
auto leaf(Tree &&, TreePath, U u) const
Definition visitor.hh:473
│ │ │ │ -
auto beforeChild(Tree &&, Child &&, TreePath, ChildIndex, U u) const
Definition visitor.hh:461
│ │ │ │ -
std::size_t beforeChild(Tree &&, Child &&, TreePath, std::size_t, U u) const
Definition visitor.hh:467
│ │ │ │ -
Definition visitor.hh:482
│ │ │ │ -
auto pre(Tree &&, TreePath, U u) const
Definition visitor.hh:484
│ │ │ │ -
Definition visitor.hh:493
│ │ │ │ -
auto leaf(Tree &&, TreePath, U u) const
Definition visitor.hh:495
│ │ │ │ +
Transform a TypeTree.
Definition transformation.hh:94
│ │ │ │ +
type Type
Definition transformation.hh:111
│ │ │ │ +
static transformed_type transform(std::shared_ptr< const SourceTree > sp, Transformation &t)
Apply transformation to an existing tree s.
Definition transformation.hh:132
│ │ │ │ +
static transformed_type transform(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition transformation.hh:126
│ │ │ │ +
static transformed_type transform(const SourceTree &s, Transformation &t)
Apply transformation to an existing tree s.
Definition transformation.hh:120
│ │ │ │ +
transformed_type type
The type of the transformed tree.
Definition transformation.hh:109
│ │ │ │ +
static transformed_type transform(const SourceTree &s, const Transformation &t=Transformation())
Apply transformation to an existing tree s.
Definition transformation.hh:114
│ │ │ │ +
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, const Transformation &t=Transformation())
Definition transformation.hh:139
│ │ │ │ +
static transformed_storage_type transform_storage(std::shared_ptr< const SourceTree > sp, Transformation &t)
Definition transformation.hh:146
│ │ │ │ +
Meta function that evaluates its argument iff it inherits from meta_function.
Definition typetraits.hh:140
│ │ │ │