summaryrefslogtreecommitdiff
path: root/lib/block_props.cpp
diff options
context:
space:
mode:
authorJosh Blum2013-06-01 16:43:10 -0400
committerJosh Blum2013-06-01 16:43:10 -0400
commitf1b9b9a44b9f50d6cca8234998d7e0adf64e46af (patch)
tree5f7faed39ad80c0febf26716b874787af294e087 /lib/block_props.cpp
parent41c180eece1af536874c8591539aeb0a23f6e134 (diff)
downloadsandhi-f1b9b9a44b9f50d6cca8234998d7e0adf64e46af.tar.gz
sandhi-f1b9b9a44b9f50d6cca8234998d7e0adf64e46af.tar.bz2
sandhi-f1b9b9a44b9f50d6cca8234998d7e0adf64e46af.zip
props: added query functionality to enumerate properties
Diffstat (limited to 'lib/block_props.cpp')
-rw-r--r--lib/block_props.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/block_props.cpp b/lib/block_props.cpp
index f32dc69..5d536bb 100644
--- a/lib/block_props.cpp
+++ b/lib/block_props.cpp
@@ -45,10 +45,8 @@ void BlockActor::handle_prop_access(
PMCC Block::_handle_prop_access(const std::string &key, const PMCC &value, const bool set)
{
- PropertyRegistrySptr pr = (set)?
- (*this)->block->setter_registry[key] :
- (*this)->block->getter_registry[key]
- ;
+ const PropertyRegistryPair &pair = (*this)->block->property_registry[key];
+ PropertyRegistrySptr pr = (set)? pair.setter : pair.getter;
if (not pr) throw std::invalid_argument("no property registered for key: " + key);
if (set)
{
@@ -99,12 +97,12 @@ static PMCC prop_access_dispatcher(ActorType &actor, const std::string &key, con
void Block::_register_getter(const std::string &key, void *pr)
{
- (*this)->block->getter_registry[key].reset(reinterpret_cast<PropertyRegistry *>(pr));
+ (*this)->block->property_registry[key].getter.reset(reinterpret_cast<PropertyRegistry *>(pr));
}
void Block::_register_setter(const std::string &key, void *pr)
{
- (*this)->block->setter_registry[key].reset(reinterpret_cast<PropertyRegistry *>(pr));
+ (*this)->block->property_registry[key].setter.reset(reinterpret_cast<PropertyRegistry *>(pr));
}
void Block::_set_property(const std::string &key, const PMCC &value)