From: Mikko Rasa Date: Wed, 18 Jul 2012 21:10:35 +0000 (+0300) Subject: Comments and member ordering X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=1dbeace0c44127bee08a3a8b231f4c8dcf707b2c;p=builder.git Comments and member ordering --- diff --git a/source/analyzer.h b/source/analyzer.h index 57d6c1a..3e7aff0 100644 --- a/source/analyzer.h +++ b/source/analyzer.h @@ -17,7 +17,7 @@ class Analyzer public: enum Mode { - DEPS, //< Skip over "trivial" targets such as Install and Compile + DEPS, //< Skip over "trivial" targets such as InstalledFile ALLDEPS, //< Print out absolutely every target REBUILD, //< Print targets that are going to be rebuilt RDEPS //< Print targets that depend on the given targets @@ -36,24 +36,20 @@ private: public: Analyzer(Builder &); + void set_mode(Mode m) { mode = m; } void set_max_depth(unsigned m) { max_depth = m; } void set_full_paths(bool f) { full_paths = f; } - /** - Performs the analysis and prints out the resulting dependency tree. - */ + /// Performs the analysis and prints out the resulting dependency tree. void analyze(); private: - /** - Adds rows to the table for the given target and its dependencies. - */ + /** Adds rows for a target, then recursively adds rows for dependencies as + needed. */ void build_depend_table(Target &, unsigned); - /** - Prints out the table that resulted from the analysis. - */ + /// Prints out the table that resulted from the analysis. void print_table() const; static bool target_order(const Target *, const Target *); diff --git a/source/builder.h b/source/builder.h index b6c9ebc..318ba0c 100644 --- a/source/builder.h +++ b/source/builder.h @@ -109,8 +109,8 @@ public: VirtualFileSystem &get_vfs() { return vfs; } const Logger &get_logger() const { return logger; } - /** Adds a target to both the target map and the new target queue. Called - from Target constructor. */ + /** Adds a target. It can later be retrieved by name. Called from Target + constructor. */ void add_target(Target *); /** Adds a target that is a primary build goal. Such targets will be added diff --git a/source/component.h b/source/component.h index 5da2883..32cbe0a 100644 --- a/source/component.h +++ b/source/component.h @@ -58,24 +58,31 @@ public: const SourcePackage &get_package() const { return package; } Type get_type() const { return type; } const std::string &get_name() const { return name; } + + /** Returns a list of sources for the component. They may refer to + directories or individual files. */ const StringList &get_sources() const { return sources; } - const BuildInfo &get_build_info() const { return build_info; } + +protected: + /** Returns a list of all source files for the component. */ + PathList collect_source_files() const; + +public: bool get_install() const { return install; } + const InstallMap &get_install_map() const { return install_map; } const PackageList &get_required_packages() const { return requires; } bool is_default() const { return deflt; } - const InstallMap &get_install_map() const { return install_map; } + /** Prepares any required packages. */ void prepare(); /** Prepares the build information for building. Pulls build info from the parent and dependency packages, and adds any component-specific flags. */ void create_build_info(); - void create_targets() const; + const BuildInfo &get_build_info() const { return build_info; } -protected: - /** Returns a list of all source files for the component. */ - PathList collect_source_files() const; + void create_targets() const; }; #endif diff --git a/source/toolchain.h b/source/toolchain.h index 3da6cda..2c0e3d2 100644 --- a/source/toolchain.h +++ b/source/toolchain.h @@ -6,6 +6,9 @@ class Tool; +/** +A container for tools. Performs lookup based on tag or filename extension. +*/ class Toolchain { private: