diff options
author | Michael Jones <jonesmz@jonesmz.com> | 2018-04-06 01:13:04 (GMT) |
---|---|---|
committer | Michael Jones <jonesmz@jonesmz.com> | 2020-09-30 21:19:11 (GMT) |
commit | a5aae85a3c8a4032ab18b82afe6c77673125d888 (patch) | |
tree | 0a2a857d7c717d15d4d1cf04b3cab414b9e52f21 /src/state.h | |
parent | ff4f2a0db21b738bba743ad543d8553417aca7b0 (diff) | |
download | Ninja-a5aae85a3c8a4032ab18b82afe6c77673125d888.zip Ninja-a5aae85a3c8a4032ab18b82afe6c77673125d888.tar.gz Ninja-a5aae85a3c8a4032ab18b82afe6c77673125d888.tar.bz2 |
Remove 'using namespace std' from header files, properly namespace all std symbols
Diffstat (limited to 'src/state.h')
-rw-r--r-- | src/state.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/state.h b/src/state.h index 6fe886c..f553ed4 100644 --- a/src/state.h +++ b/src/state.h @@ -19,7 +19,6 @@ #include <set> #include <string> #include <vector> -using namespace std; #include "eval_env.h" #include "hash_map.h" @@ -38,13 +37,13 @@ struct Rule; /// the total scheduled weight diminishes enough (i.e. when a scheduled edge /// completes). struct Pool { - Pool(const string& name, int depth) + Pool(const std::string& name, int depth) : name_(name), current_use_(0), depth_(depth), delayed_(&WeightedEdgeCmp) {} // A depth of 0 is infinite bool is_valid() const { return depth_ >= 0; } int depth() const { return depth_; } - const string& name() const { return name_; } + const std::string& name() const { return name_; } int current_use() const { return current_use_; } /// true if the Pool might delay this edge @@ -62,13 +61,13 @@ struct Pool { void DelayEdge(Edge* edge); /// Pool will add zero or more edges to the ready_queue - void RetrieveReadyEdges(set<Edge*>* ready_queue); + void RetrieveReadyEdges(std::set<Edge*>* ready_queue); /// Dump the Pool and its edges (useful for debugging). void Dump() const; private: - string name_; + std::string name_; /// |current_use_| is the total of the weights of the edges which are /// currently scheduled in the Plan (i.e. the edges in Plan::ready_). @@ -77,7 +76,7 @@ struct Pool { static bool WeightedEdgeCmp(const Edge* a, const Edge* b); - typedef set<Edge*,bool(*)(const Edge*, const Edge*)> DelayedEdges; + typedef std::set<Edge*,bool(*)(const Edge*, const Edge*)> DelayedEdges; DelayedEdges delayed_; }; @@ -90,17 +89,17 @@ struct State { State(); void AddPool(Pool* pool); - Pool* LookupPool(const string& pool_name); + Pool* LookupPool(const std::string& pool_name); Edge* AddEdge(const Rule* rule); Node* GetNode(StringPiece path, uint64_t slash_bits); Node* LookupNode(StringPiece path) const; - Node* SpellcheckNode(const string& path); + Node* SpellcheckNode(const std::string& path); void AddIn(Edge* edge, StringPiece path, uint64_t slash_bits); bool AddOut(Edge* edge, StringPiece path, uint64_t slash_bits); - bool AddDefault(StringPiece path, string* error); + bool AddDefault(StringPiece path, std::string* error); /// Reset state. Keeps all nodes and edges, but restores them to the /// state where we haven't yet examined the disk for dirty state. @@ -111,21 +110,21 @@ struct State { /// @return the root node(s) of the graph. (Root nodes have no output edges). /// @param error where to write the error message if somethings went wrong. - vector<Node*> RootNodes(string* error) const; - vector<Node*> DefaultNodes(string* error) const; + std::vector<Node*> RootNodes(std::string* error) const; + std::vector<Node*> DefaultNodes(std::string* error) const; /// Mapping of path -> Node. typedef ExternalStringHashMap<Node*>::Type Paths; Paths paths_; /// All the pools used in the graph. - map<string, Pool*> pools_; + std::map<std::string, Pool*> pools_; /// All the edges of the graph. - vector<Edge*> edges_; + std::vector<Edge*> edges_; BindingEnv bindings_; - vector<Node*> defaults_; + std::vector<Node*> defaults_; }; #endif // NINJA_STATE_H_ |