40#include "../../misc/compileTimeLoop.hpp"
42#include "nodeInterface.hpp"
56 template<
typename T_Impl>
64 return static_cast<Impl&
>(*this);
70 template<
typename Node,
typename... Args>
72 cast().toNode(
node.cast(), std::forward<Args>(args)...);
86 template<
typename Node,
typename... Args>
89 cast().toLinks(
node, std::forward<Args>(args)...);
97 template<
typename Node,
typename... Args>
110 template<
size_t ChildNumber,
typename Child,
typename Root,
typename... Args>
114 cast().toNode(child, std::forward<Args>(args)...);
121#ifndef DOXYGEN_DISABLE
122 template<
typename TraversalImpl,
bool endPo
int = false>
125 template<
typename... Args>
126 CODI_INLINE static void call(TraversalImpl& impl, Args&&... args) {
127 impl.node(std::forward<Args>(args)...);
131 template<
typename TraversalImpl>
132 struct CallSwitch<TraversalImpl, true> {
134 template<
typename... Args>
135 CODI_INLINE static void call(TraversalImpl& impl, Args&&... args) {
136 impl.leaf(std::forward<Args>(args)...);
142 template<
typename Node,
typename... Args>
144 CallSwitch<Impl, 0 == Node::LinkCount>::call(
cast(),
node, std::forward<Args>(args)...);
148 template<
typename Node,
typename... Args>
151 cast().template
link<i.value>(
node.template getLink<i.value>(),
node, std::forward<Args>(args)...);
#define CODI_LAMBDA_INLINE
See codi::Config::ForcedInlines.
Definition config.h:473
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:469
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:96
#define CODI_T(...)
Abbreviation for CODI_TEMPLATE.
Definition macros.hpp:116
CoDiPack - Code Differentiation Package.
Definition codi.hpp:94
inlinevoid static_for(F func, Args &&... args)
Static for with i = 0 .. (N - 1). See CompileTimeLoop for details.
Definition compileTimeLoop.hpp:110
inlinevoid CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:54
Node side interface for the traversal of expressions.
Definition nodeInterface.hpp:56
Traversal of CoDiPack expressions.
Definition traversalLogic.hpp:57
inlinevoid eval(NodeInterface< Node > const &node, Args &&... args)
Start the evaluation of the logic on the given expression.
Definition traversalLogic.hpp:71
inlineImpl & cast()
Cast to the implementation.
Definition traversalLogic.hpp:63
inlinevoid toLinks(Node const &node, Args &&... args)
Helper method which calls link for each child.
Definition traversalLogic.hpp:149
inlinevoid link(Child const &child, Root const &root, Args &&... args)
Called for all links in the expression.
Definition traversalLogic.hpp:111
inlinevoid leaf(Node const &node, Args &&... args)
Called for all leaf nodes in the expression.
Definition traversalLogic.hpp:98
T_Impl Impl
See TraversalLogic.
Definition traversalLogic.hpp:60
inlinevoid toNode(Node const &node, Args &&... args)
Helper method to distinguish between leaf nodes and normal nodes.
Definition traversalLogic.hpp:143
inlinevoid node(Node const &node, Args &&... args)
Called for each node in the expression.
Definition traversalLogic.hpp:87