CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
nodeInterface.hpp
1/*
2 * CoDiPack, a Code Differentiation Package
3 *
4 * Copyright (C) 2015-2024 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
5 * Homepage: http://scicomp.rptu.de
6 * Contact: Prof. Nicolas R. Gauger (codi@scicomp.uni-kl.de)
7 *
8 * Lead developers: Max Sagebaum, Johannes Blühdorn (SciComp, University of Kaiserslautern-Landau)
9 *
10 * This file is part of CoDiPack (http://scicomp.rptu.de/software/codi).
11 *
12 * CoDiPack is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, either version 3 of the
15 * License, or (at your option) any later version.
16 *
17 * CoDiPack is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty
19 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * See the GNU General Public License for more details.
22 * You should have received a copy of the GNU
23 * General Public License along with CoDiPack.
24 * If not, see <http://www.gnu.org/licenses/>.
25 *
26 * For other licensing options please contact us.
27 *
28 * Authors:
29 * - SciComp, University of Kaiserslautern-Landau:
30 * - Max Sagebaum
31 * - Johannes Blühdorn
32 * - Former members:
33 * - Tim Albring
34 */
35#pragma once
36
37#include "../../config.h"
38#include "../../misc/macros.hpp"
39
41namespace codi {
42
43 template<typename Logic>
44 struct TraversalLogic;
45
55 template<typename T_Impl>
57 public:
58
59 using Impl = CODI_DD(T_Impl, NodeInterface);
60
62 CODI_INLINE Impl const& cast() const {
63 return static_cast<Impl const&>(*this);
64 }
65
66 /*******************************************************************************/
68
69 static bool constexpr EndPoint = CODI_UNDEFINED_VALUE;
70
73 template<typename Logic, typename... Args>
74 CODI_INLINE void forEachLink(TraversalLogic<Logic>& logic, Args&&... args) const;
75
78 template<typename Logic, typename... Args>
79 CODI_INLINE static typename Logic::ResultType constexpr forEachLinkConstExpr(Args&&... args);
80 };
81}
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
#define CODI_UNDEFINED_VALUE
Used in interface declarations for variables that have to be defined in the specializations.
Definition macros.hpp:117
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
Node side interface for the traversal of expressions.
Definition nodeInterface.hpp:56
T_Impl Impl
See NodeInterface.
Definition nodeInterface.hpp:59
void forEachLink(TraversalLogic< Logic > &logic, Args &&... args) const
static bool constexpr EndPoint
If this expression is handled as a leaf in the tree.
Definition nodeInterface.hpp:69
Impl const & cast() const
Cast to the implementation.
Definition nodeInterface.hpp:62
static Logic::ResultType constexpr forEachLinkConstExpr(Args &&... args)
Traversal of CoDiPack expressions.
Definition traversalLogic.hpp:56