/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ToolFactory.cc
Go to the documentation of this file.
00001 #include "LafKernel/ToolFactory.h"
00002 #include "LafKernel/ToolBase.h"
00003 #include "LafKernel/ToolMgr.h"
00004 #include "LafKernel/LafException.h"
00005 
00006 ToolFactory::ToolFactory(const std::string& name, ToolBase* (*creator)(const std::string&))
00007 {
00008     typedef ToolBase* (*ToolCreator)(const std::string&);
00009 
00010     std::map<std::string, ToolCreator>::iterator it = ToolMgr::elementCreatorMap.find(name);
00011     if ( it != ToolMgr::elementCreatorMap.end() ) {
00012         std::string msg = std::string("Duplicated tool definition: ") + name;
00013         throw LafException(msg);
00014     }
00015     ToolMgr::elementCreatorMap.insert(std::make_pair<std::string, ToolCreator>(name, creator));
00016 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:50:18 for LafKernel by doxygen 1.7.4