From 17d636eec0ee0da346173066dd4f400a64e96c44 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 30 Jul 2013 20:59:41 -0700 Subject: gras: rename some factory functions --- include/gras/detail/factory.hpp | 88 ++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 44 deletions(-) (limited to 'include/gras/detail') diff --git a/include/gras/detail/factory.hpp b/include/gras/detail/factory.hpp index d1edf81..551ba9e 100644 --- a/include/gras/detail/factory.hpp +++ b/include/gras/detail/factory.hpp @@ -37,10 +37,10 @@ struct FactoryRegistryEntryImpl0 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)()) +void register_factory(const std::string &path, ReturnType(*fcn)()) { void *r = new FactoryRegistryEntryImpl0(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -61,10 +61,10 @@ struct FactoryRegistryEntryImpl1 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &)) { void *r = new FactoryRegistryEntryImpl1(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -85,10 +85,10 @@ struct FactoryRegistryEntryImpl2 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &)) { void *r = new FactoryRegistryEntryImpl2(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -109,10 +109,10 @@ struct FactoryRegistryEntryImpl3 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &)) { void *r = new FactoryRegistryEntryImpl3(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -133,10 +133,10 @@ struct FactoryRegistryEntryImpl4 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &)) { void *r = new FactoryRegistryEntryImpl4(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -157,10 +157,10 @@ struct FactoryRegistryEntryImpl5 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &)) { void *r = new FactoryRegistryEntryImpl5(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -181,10 +181,10 @@ struct FactoryRegistryEntryImpl6 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &)) { void *r = new FactoryRegistryEntryImpl6(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -205,10 +205,10 @@ struct FactoryRegistryEntryImpl7 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &)) { void *r = new FactoryRegistryEntryImpl7(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -229,10 +229,10 @@ struct FactoryRegistryEntryImpl8 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &)) { void *r = new FactoryRegistryEntryImpl8(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -253,10 +253,10 @@ struct FactoryRegistryEntryImpl9 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &, const A8 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &, const A8 &)) { void *r = new FactoryRegistryEntryImpl9(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** @@ -277,62 +277,62 @@ struct FactoryRegistryEntryImpl10 : FactoryRegistryEntry }; template -void register_make(const std::string &name, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &, const A8 &, const A9 &)) +void register_factory(const std::string &path, ReturnType(*fcn)(const A0 &, const A1 &, const A2 &, const A3 &, const A4 &, const A5 &, const A6 &, const A7 &, const A8 &, const A9 &)) { void *r = new FactoryRegistryEntryImpl10(fcn); - Factory::_register_make(name, r); + Factory::_register_factory(path, r); } /*********************************************************************** * Templated make implementations **********************************************************************/ inline -Element *make(const std::string &name) +Element *make(const std::string &path) { PMCList args(0); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0) +Element *make(const std::string &path, const A0 &a0) { PMCList args(1); args[0] = PMC_M(a0); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1) +Element *make(const std::string &path, const A0 &a0, const A1 &a1) { PMCList args(2); args[0] = PMC_M(a0); args[1] = PMC_M(a1); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2) { PMCList args(3); args[0] = PMC_M(a0); args[1] = PMC_M(a1); args[2] = PMC_M(a2); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3) { PMCList args(4); args[0] = PMC_M(a0); args[1] = PMC_M(a1); args[2] = PMC_M(a2); args[3] = PMC_M(a3); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4) { PMCList args(5); args[0] = PMC_M(a0); @@ -340,11 +340,11 @@ Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, args[2] = PMC_M(a2); args[3] = PMC_M(a3); args[4] = PMC_M(a4); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5) { PMCList args(6); args[0] = PMC_M(a0); @@ -353,11 +353,11 @@ Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, args[3] = PMC_M(a3); args[4] = PMC_M(a4); args[5] = PMC_M(a5); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6) { PMCList args(7); args[0] = PMC_M(a0); @@ -367,11 +367,11 @@ Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, args[4] = PMC_M(a4); args[5] = PMC_M(a5); args[6] = PMC_M(a6); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7) { PMCList args(8); args[0] = PMC_M(a0); @@ -382,11 +382,11 @@ Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, args[5] = PMC_M(a5); args[6] = PMC_M(a6); args[7] = PMC_M(a7); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) { PMCList args(9); args[0] = PMC_M(a0); @@ -398,11 +398,11 @@ Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, args[6] = PMC_M(a6); args[7] = PMC_M(a7); args[8] = PMC_M(a8); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } template -Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) +Element *make(const std::string &path, const A0 &a0, const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4, const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8, const A9 &a9) { PMCList args(10); args[0] = PMC_M(a0); @@ -415,7 +415,7 @@ Element *make(const std::string &name, const A0 &a0, const A1 &a1, const A2 &a2, args[7] = PMC_M(a7); args[8] = PMC_M(a8); args[9] = PMC_M(a9); - return Factory::_handle_make(name, PMC_M(args)); + return Factory::_handle_make(path, PMC_M(args)); } } -- cgit