summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-07-31 01:10:32 -0700
committerJosh Blum2013-07-31 01:10:32 -0700
commit20b413bce5c22bcc44bfc58105288df94a0a592d (patch)
treee4df40c82c89fda275ec36df42715b27b7a75708 /lib
parent79128f57c01a2453a71f9b0aa00d919c0a79666f (diff)
parent8fc35a79f138cc9c5d60affd20ca91767d16927f (diff)
downloadsandhi-20b413bce5c22bcc44bfc58105288df94a0a592d.tar.gz
sandhi-20b413bce5c22bcc44bfc58105288df94a0a592d.tar.bz2
sandhi-20b413bce5c22bcc44bfc58105288df94a0a592d.zip
Merge branch 'gras_tool3'
Diffstat (limited to 'lib')
-rw-r--r--lib/callable.cpp2
-rw-r--r--lib/factory.cpp18
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/callable.cpp b/lib/callable.cpp
index 59ada7f..461eebd 100644
--- a/lib/callable.cpp
+++ b/lib/callable.cpp
@@ -67,5 +67,5 @@ CallableRegistryEntry::~CallableRegistryEntry(void)
void CallableRegistryEntry::arg_check(const PMCList &args, const size_t nargs)
{
if (args.size() != nargs) throw std::runtime_error(str(boost::format(
- "callable expected %u arguments but for %u") % nargs % args.size()));
+ "callable expected %u arguments but got %u") % nargs % args.size()));
}
diff --git a/lib/factory.cpp b/lib/factory.cpp
index e07a2f2..7115197 100644
--- a/lib/factory.cpp
+++ b/lib/factory.cpp
@@ -23,7 +23,7 @@ FactoryRegistryEntry::~FactoryRegistryEntry(void)
void FactoryRegistryEntry::arg_check(const PMCList &args, const size_t nargs)
{
if (args.size() != nargs) throw std::runtime_error(str(boost::format(
- "factory expected %u arguments but for %u") % nargs % args.size()));
+ "factory expected %u arguments but got %u") % nargs % args.size()));
}
typedef std::map<std::string, boost::shared_ptr<FactoryRegistryEntry> > FactoryRegistryType;
@@ -36,22 +36,22 @@ static FactoryRegistryType &get_factory_registry(void)
static boost::mutex mutex;
-void Factory::_register_make(const std::string &name, void *entry)
+void Factory::_register_factory(const std::string &path, void *entry)
{
boost::mutex::scoped_lock l(mutex);
- if (get_factory_registry().count(name) != 0)
+ if (get_factory_registry().count(path) != 0)
{
- std::cerr << "Warning: Factory - function already registered for name: " + name << std::endl;
+ std::cerr << "Warning: Factory - function already registered for path: " + path << std::endl;
}
- get_factory_registry()[name].reset(reinterpret_cast<FactoryRegistryEntry *>(entry));
+ get_factory_registry()[path].reset(reinterpret_cast<FactoryRegistryEntry *>(entry));
}
-Element *Factory::_handle_make(const std::string &name, const PMCC &args)
+Element *Factory::_handle_make(const std::string &path, const PMCC &args)
{
boost::mutex::scoped_lock l(mutex);
- if (get_factory_registry().count(name) == 0)
+ if (get_factory_registry().count(path) == 0)
{
- throw std::invalid_argument("Factory - no function registered for name: " + name);
+ throw std::invalid_argument("Factory - no function registered for path: " + path);
}
- return get_factory_registry()[name]->make(args);
+ return get_factory_registry()[path]->make(args);
}