diff options
author | Josh Blum | 2013-05-27 20:13:34 -0700 |
---|---|---|
committer | Josh Blum | 2013-05-27 20:13:34 -0700 |
commit | c0aaedb595a4e04726c27c54560fd40394d0bac8 (patch) | |
tree | f7f7343f2220b1a04d87008a46b7c097fcd53d8e /include | |
parent | 22d99448cb680652c02464e2aa8b0c043c6ee72b (diff) | |
download | sandhi-c0aaedb595a4e04726c27c54560fd40394d0bac8.tar.gz sandhi-c0aaedb595a4e04726c27c54560fd40394d0bac8.tar.bz2 sandhi-c0aaedb595a4e04726c27c54560fd40394d0bac8.zip |
gras: simplify registration object passing
Diffstat (limited to 'include')
-rw-r--r-- | include/gras/block.hpp | 4 | ||||
-rw-r--r-- | include/gras/detail/block.hpp | 12 |
2 files changed, 6 insertions, 10 deletions
diff --git a/include/gras/block.hpp b/include/gras/block.hpp index 85a6ecc..aab0a81 100644 --- a/include/gras/block.hpp +++ b/include/gras/block.hpp @@ -535,8 +535,8 @@ struct GRAS_API Block : Element * private implementation guts for overloads and template support ******************************************************************/ virtual PMCC _handle_prop_access(const std::string &, const PMCC &, const bool); - void _register_getter(const std::string &, PMCC); - void _register_setter(const std::string &, PMCC); + void _register_getter(const std::string &, void *); + void _register_setter(const std::string &, void *); virtual void _set_property(const std::string &, const PMCC &); virtual PMCC _get_property(const std::string &); }; diff --git a/include/gras/detail/block.hpp b/include/gras/detail/block.hpp index 630117d..ac9a669 100644 --- a/include/gras/detail/block.hpp +++ b/include/gras/detail/block.hpp @@ -14,8 +14,6 @@ struct GRAS_API PropertyRegistry virtual PMCC get(void) = 0; }; -typedef boost::shared_ptr<PropertyRegistry> PropertyRegistrySptr; - template <typename ClassType, typename ValueType> class PropertyRegistryImpl : public PropertyRegistry { @@ -58,9 +56,8 @@ inline void Block::register_getter( ) { ClassType *obj = dynamic_cast<ClassType *>(this); - PropertyRegistrySptr pr; - pr.reset(new PropertyRegistryImpl<ClassType, ValueType>(obj, get, NULL)); - this->_register_getter(key, PMC_M(pr)); + void *pr = new PropertyRegistryImpl<ClassType, ValueType>(obj, get, NULL); + this->_register_getter(key, pr); } template <typename ClassType, typename ValueType> @@ -70,9 +67,8 @@ inline void Block::register_setter( ) { ClassType *obj = dynamic_cast<ClassType *>(this); - PropertyRegistrySptr pr; - pr.reset(new PropertyRegistryImpl<ClassType, ValueType>(obj, NULL, set)); - this->_register_setter(key, PMC_M(pr)); + void *pr = new PropertyRegistryImpl<ClassType, ValueType>(obj, NULL, set); + this->_register_setter(key, pr); } template <typename ValueType> |