From cfd9e8146f7589f3f04fea979c741267b0454546 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 7 Jul 2013 12:21:36 -0700 Subject: gras: python hooks for factory --- include/gras/detail/factory.hpp | 8 ++++---- include/gras/factory.hpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include/gras') diff --git a/include/gras/detail/factory.hpp b/include/gras/detail/factory.hpp index 0487e76..632e09d 100644 --- a/include/gras/detail/factory.hpp +++ b/include/gras/detail/factory.hpp @@ -116,7 +116,7 @@ inline Element *Factory::make(const std::string &name) { PMCList args(0); - return Factory::_make(name, PMC_M(args)); + return Factory::_handle_make(name, PMC_M(args)); } template @@ -124,7 +124,7 @@ Element *Factory::make(const std::string &name, const Arg0 &a0) { PMCList args(1); args[0] = PMC_M(a0); - return Factory::_make(name, PMC_M(args)); + return Factory::_handle_make(name, PMC_M(args)); } template @@ -133,7 +133,7 @@ Element *Factory::make(const std::string &name, const Arg0 &a0, const Arg1 &a1) PMCList args(2); args[0] = PMC_M(a0); args[1] = PMC_M(a1); - return Factory::_make(name, PMC_M(args)); + return Factory::_handle_make(name, PMC_M(args)); } template @@ -143,7 +143,7 @@ Element *Factory::make(const std::string &name, const Arg0 &a0, const Arg1 &a1, args[0] = PMC_M(a0); args[1] = PMC_M(a1); args[2] = PMC_M(a2); - return Factory::_make(name, PMC_M(args)); + return Factory::_handle_make(name, PMC_M(args)); } } diff --git a/include/gras/factory.hpp b/include/gras/factory.hpp index 926025e..13d1c2b 100644 --- a/include/gras/factory.hpp +++ b/include/gras/factory.hpp @@ -39,10 +39,8 @@ namespace gras * Example call into the factory: * gras::Element *my_block = gras::Factory::make("make_my_block", arg0, arg1); */ -class GRAS_API Factory : Callable +struct GRAS_API Factory { -public: - /******************************************************************* * Register API - don't look here, template magic, not helpful ******************************************************************/ @@ -73,9 +71,11 @@ public: template static Element *make(const std::string &name, const Arg0 &a0, const Arg1 &a1, const Arg2 &a2); -private: + /******************************************************************* + * Private registration hooks + ******************************************************************/ static void _register_make(const std::string &, void *); - static Element *_make(const std::string &, const PMCC &); + static Element *_handle_make(const std::string &, const PMCC &); }; } -- cgit