diff options
Diffstat (limited to 'lib/factory.cpp')
-rw-r--r-- | lib/factory.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/factory.cpp b/lib/factory.cpp index 5c405f3..35b1b24 100644 --- a/lib/factory.cpp +++ b/lib/factory.cpp @@ -1,6 +1,7 @@ // Copyright (C) by Josh Blum. See LICENSE.txt for licensing information. #include <gras/factory.hpp> +#include <boost/format.hpp> #include <boost/shared_ptr.hpp> #include <boost/thread/mutex.hpp> #include <stdexcept> @@ -18,6 +19,12 @@ FactoryRegistryEntry::~FactoryRegistryEntry(void) //NOP } +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())); +} + typedef std::map<std::string, boost::shared_ptr<FactoryRegistryEntry> > FactoryRegistryType; static FactoryRegistryType &get_factory_registry(void) |