From: Mikko Rasa Date: Sun, 8 Jul 2012 20:11:01 +0000 (+0300) Subject: Add SubTool class X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=722d53055cc78a7a7d9901d2b1fe23a2a33fb623;p=builder.git Add SubTool class --- 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