From 722d53055cc78a7a7d9901d2b1fe23a2a33fb623 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 8 Jul 2012 23:11:01 +0300 Subject: [PATCH] Add SubTool class --- source/tool.cpp | 6 ++++++ source/tool.h | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/source/tool.cpp b/source/tool.cpp index 5556cb3..1ab3660 100644 --- a/source/tool.cpp +++ b/source/tool.cpp @@ -24,3 +24,9 @@ Target *Tool::create_target(Target &source, const string &arg) const sources.push_back(&source); return create_target(sources, arg); } + + +SubTool::SubTool(Tool &p): + Tool(p), + parent(p) +{ } diff --git a/source/tool.h b/source/tool.h index d1d7103..36d1be1 100644 --- a/source/tool.h +++ b/source/tool.h @@ -44,4 +44,17 @@ public: virtual Task *run(const Target &) const = 0; }; +/** +Intermediate base class for tool facets. For example, a linker may need to +use different commands depending on whether C++ source files are present or +not, but their presence can't be directly determined from the object files. +*/ +class SubTool: public Tool +{ +protected: + Tool &parent; + + SubTool(Tool &); +}; + #endif -- 2.43.0