summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine/expression/function_map.hpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-02-22 17:03:21 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-02-22 17:03:21 +0100
commit619def44c1cca9f3cdf63544d5f24f2c7a7d9b77 (patch)
tree01868de723cb82c86842f33743fa7b14e24c1fa3 /src/buildtool/build_engine/expression/function_map.hpp
downloadjustbuild-619def44c1cca9f3cdf63544d5f24f2c7a7d9b77.tar.gz
Initial self-hosting commit
This is the initial version of our tool that is able to build itself. In can be bootstrapped by ./bin/bootstrap.py Co-authored-by: Oliver Reiche <oliver.reiche@huawei.com> Co-authored-by: Victor Moreno <victor.moreno1@huawei.com>
Diffstat (limited to 'src/buildtool/build_engine/expression/function_map.hpp')
-rw-r--r--src/buildtool/build_engine/expression/function_map.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/buildtool/build_engine/expression/function_map.hpp b/src/buildtool/build_engine/expression/function_map.hpp
new file mode 100644
index 00000000..967d5fe0
--- /dev/null
+++ b/src/buildtool/build_engine/expression/function_map.hpp
@@ -0,0 +1,23 @@
+#ifndef INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_EXPRESSION_FUNCTION_MAP_HPP
+#define INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_EXPRESSION_FUNCTION_MAP_HPP
+
+#include <functional>
+#include <string>
+
+#include "src/buildtool/build_engine/expression/linked_map.hpp"
+
+class ExpressionPtr;
+class Configuration;
+
+using SubExprEvaluator =
+ std::function<ExpressionPtr(ExpressionPtr const&, Configuration const&)>;
+
+using FunctionMap =
+ LinkedMap<std::string,
+ std::function<ExpressionPtr(SubExprEvaluator&&,
+ ExpressionPtr const&,
+ Configuration const&)>>;
+
+using FunctionMapPtr = FunctionMap::Ptr;
+
+#endif // INCLUDED_SRC_BUILDTOOL_BUILD_ENGINE_EXPRESSION_FUNCTION_MAP_HPP