diff options
author | Josh Blum | 2013-07-27 20:41:50 -0700 |
---|---|---|
committer | Josh Blum | 2013-07-27 20:41:50 -0700 |
commit | 147ae8c83b6237afaafe076feeedf50cc0d374fa (patch) | |
tree | cc5bc69f98815809cb3e06d6f6a9f598ed9a3cdb | |
parent | a3b5a07cf7c64f1a038839d3ef2f7b1d9fbf6c42 (diff) | |
download | sandhi-147ae8c83b6237afaafe076feeedf50cc0d374fa.tar.gz sandhi-147ae8c83b6237afaafe076feeedf50cc0d374fa.tar.bz2 sandhi-147ae8c83b6237afaafe076feeedf50cc0d374fa.zip |
gras: just warn if the factory is already registered
-rw-r--r-- | lib/factory.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/factory.cpp b/lib/factory.cpp index 35b1b24..e07a2f2 100644 --- a/lib/factory.cpp +++ b/lib/factory.cpp @@ -5,6 +5,7 @@ #include <boost/shared_ptr.hpp> #include <boost/thread/mutex.hpp> #include <stdexcept> +#include <iostream> #include <map> using namespace gras; @@ -40,7 +41,7 @@ void Factory::_register_make(const std::string &name, void *entry) boost::mutex::scoped_lock l(mutex); if (get_factory_registry().count(name) != 0) { - throw std::invalid_argument("Factory - function already registered for name: " + name); + std::cerr << "Warning: Factory - function already registered for name: " + name << std::endl; } get_factory_registry()[name].reset(reinterpret_cast<FactoryRegistryEntry *>(entry)); } |