diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-03-10 15:42:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-03-10 15:42:04 +0200 |
commit | 5925c11a1fe8b2e02b790dd40b031ae005d5b68f (patch) | |
tree | 14455da2f4b58d49542023ef0b415414b926d56f /build/rule | |
parent | 5807ff000225acf47064eb7f0be965bf1598faaa (diff) |
Further operation implementation
Diffstat (limited to 'build/rule')
-rw-r--r-- | build/rule | 32 |
1 files changed, 18 insertions, 14 deletions
@@ -11,6 +11,7 @@ #include <unordered_map> #include <build/target> +#include <build/operation> #include <build/prefix-map> namespace build @@ -19,17 +20,20 @@ namespace build { public: virtual void* - match (target&, const std::string& hint) const = 0; + match (action, target&, const std::string& hint) const = 0; virtual recipe - apply (target&, void*) const = 0; + apply (action, target&, void*) const = 0; }; - typedef std::unordered_map< + using target_rule_map = std::unordered_map< std::type_index, - prefix_multimap<std::string, std::reference_wrapper<rule>, '.'>> rule_map; + prefix_multimap<std::string, std::reference_wrapper<rule>, '.'>>; - extern rule_map rules; + using operation_rule_map = std::unordered_map<std::string, target_rule_map>; + + extern operation_rule_map rules; + extern const target_rule_map* current_rules; // Rules for current operation. // Fallback rule that check that the path exists. // @@ -37,39 +41,39 @@ namespace build { public: virtual void* - match (target&, const std::string& hint) const; + match (action, target&, const std::string& hint) const; virtual recipe - apply (target&, void*) const; + apply (action, target&, void*) const; static target_state - update (target&); + update (action, target&); }; class dir_rule: public rule { public: virtual void* - match (target&, const std::string& hint) const; + match (action, target&, const std::string& hint) const; virtual recipe - apply (target&, void*) const; + apply (action, target&, void*) const; static target_state - update (target&); + update (action, target&); }; class fsdir_rule: public rule { public: virtual void* - match (target&, const std::string& hint) const; + match (action, target&, const std::string& hint) const; virtual recipe - apply (target&, void*) const; + apply (action, target&, void*) const; static target_state - update (target&); + update (action, target&); }; } |