]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Convert all list containers to vectors
[builder.git] / source / builder.cpp
index a49624d13201d6eb8d9112f6653c1546909cf85f..1b8ed3c16eb538d17afbc3933089f750bd12e4be 100644 (file)
@@ -1,4 +1,6 @@
+#include <deque>
 #include <set>
+#include <msp/core/except.h>
 #include <msp/core/maputils.h>
 #include <msp/datafile/parser.h>
 #include <msp/fs/dir.h>
@@ -70,6 +72,13 @@ vector<string> Builder::get_build_types() const
        return keys;
 }
 
+const BuildType &Builder::get_build_type() const
+{
+       if(!build_type)
+               throw invalid_state("no build type");
+       return *build_type;
+}
+
 void Builder::set_build_type(const string &name)
 {
        build_type = &get_item(build_types, name);
@@ -105,9 +114,9 @@ void Builder::set_logger(const Logger *l)
        logger = (l ? l : &default_logger);
 }
 
-list<string> Builder::collect_problems() const
+vector<string> Builder::collect_problems() const
 {
-       list<string> problems;
+       vector<string> problems;
        set<const Package *> broken_packages;
        set<const Component *> broken_components;
        set<const Tool *> broken_tools;
@@ -259,7 +268,7 @@ int Builder::clean(bool all, bool dry_run)
        // Cleaning doesn't care about ordering, so a simpler method can be used
 
        set<Target *> clean_tgts;
-       list<Target *> queue;
+       deque<Target *> queue;
        queue.push_back(&build_graph.get_goals());
 
        while(!queue.empty())