From fc98eaf2a00e000841cb16d962f83c118e4824c2 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 13 Jul 2013 12:58:22 -0700 Subject: gras: added comments and renamed tmpl args --- tmpl/factory_detail.tmpl.hpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tmpl/factory_detail.tmpl.hpp') diff --git a/tmpl/factory_detail.tmpl.hpp b/tmpl/factory_detail.tmpl.hpp index 1238c38..87a0756 100644 --- a/tmpl/factory_detail.tmpl.hpp +++ b/tmpl/factory_detail.tmpl.hpp @@ -22,24 +22,24 @@ struct GRAS_API FactoryRegistryEntry /*********************************************************************** * Templated registration - $NARGS args **********************************************************************/ -template +template struct FactoryRegistryEntryImpl$(NARGS) : FactoryRegistryEntry { - typedef ReturnType(*Fcn)($expand('const Arg%d &', $NARGS)); + typedef ReturnType(*Fcn)($expand('const A%d &', $NARGS)); FactoryRegistryEntryImpl$(NARGS)(Fcn fcn):_fcn(fcn){} Element *make(const PMCC &args) { const PMCList &a = args.as(); if (a.size() < $NARGS) throw a; - return _fcn($expand('a[%d].safe_as()', $NARGS)); + return _fcn($expand('a[%d].safe_as()', $NARGS)); } Fcn _fcn; }; -template -void Factory::register_make(const std::string &name, ReturnType(*fcn)($expand('const Arg%d &', $NARGS))) +template +void Factory::register_make(const std::string &name, ReturnType(*fcn)($expand('const A%d &', $NARGS))) { - void *r = new FactoryRegistryEntryImpl$(NARGS)(fcn); + void *r = new FactoryRegistryEntryImpl$(NARGS)(fcn); Factory::_register_make(name, r); } @@ -48,8 +48,8 @@ void Factory::register_make(const std::string &name, ReturnType(*fcn)($expand('c * Templated make implementations **********************************************************************/ #for $NARGS in range($MAX_ARGS) -template <$expand('typename Arg%d', $NARGS)> -Element *Factory::make(const std::string &name, $expand('const Arg%d &a%d', $NARGS)) +template <$expand('typename A%d', $NARGS)> +Element *Factory::make(const std::string &name, $expand('const A%d &a%d', $NARGS)) { PMCList args($NARGS); #for $i in range($NARGS): -- cgit