1 #include <msp/core/maputils.h>
8 Toolchain::~Toolchain()
10 for(ToolMap::iterator i=tools.begin(); i!=tools.end(); ++i)
12 for(ToolchainList::iterator i=chains.begin(); i!=chains.end(); ++i)
16 void Toolchain::add_tool(Tool *tool)
18 insert_unique(tools, tool->get_tag(), tool);
21 void Toolchain::add_toolchain(Toolchain *chain)
23 chains.push_back(chain);
26 bool Toolchain::has_tool(const string &tag) const
30 for(ToolchainList::const_iterator i=chains.begin(); i!=chains.end(); ++i)
31 if((*i)->has_tool(tag))
36 Tool &Toolchain::get_tool(const string &tag) const
40 for(ToolchainList::const_iterator i=chains.begin(); i!=chains.end(); ++i)
41 if((*i)->has_tool(tag))
42 return (*i)->get_tool(tag);
45 return *get_item(tools, tag);
48 Tool *Toolchain::get_tool_for_suffix(const string &suffix, bool aux) const
50 for(ToolMap::const_iterator i=tools.begin(); i!=tools.end(); ++i)
51 if(i->second->accepts_suffix(suffix, aux))
54 for(ToolchainList::const_iterator i=chains.begin(); i!=chains.end(); ++i)
55 if(Tool *tool = (*i)->get_tool_for_suffix(suffix, aux))