X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftool.h;h=36d1be165b4f614a994d99ca08bcda4b37674ecd;hb=722d53055cc78a7a7d9901d2b1fe23a2a33fb623;hp=1905555e1818955515a25fe8b1fbca2e5149630a;hpb=4facd021514ab372c23b1b132d6b4b62baa4efbf;p=builder.git diff --git a/source/tool.h b/source/tool.h index 1905555..36d1be1 100644 --- a/source/tool.h +++ b/source/tool.h @@ -10,6 +10,10 @@ class Component; class Target; class Task; +/** +Base class for tools. Tools are used to turn targets into other targets. +Examples include compilers and linkers. +*/ class Tool { public: @@ -34,9 +38,23 @@ public: const SearchPath &get_system_path() const { return system_path; } virtual Target *create_source(const Component &, const Msp::FS::Path &) const { return 0; } + virtual Target *create_source(const Msp::FS::Path &) const { return 0; } Target *create_target(Target &, const std::string & = std::string()) const; virtual Target *create_target(const std::list &, const std::string & = std::string()) const = 0; 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