diff options
author | Josh Blum | 2013-03-17 16:20:54 -0700 |
---|---|---|
committer | Josh Blum | 2013-03-17 16:20:54 -0700 |
commit | 420f118ed61c52ae00b765b57be83bae910e0a60 (patch) | |
tree | 45400dd06bf6cb8a00dfe0135111fc6016ed4db9 /lib | |
parent | c70c996658138d0f38a1670f073cc327ff5ab920 (diff) | |
download | sandhi-420f118ed61c52ae00b765b57be83bae910e0a60.tar.gz sandhi-420f118ed61c52ae00b765b57be83bae910e0a60.tar.bz2 sandhi-420f118ed61c52ae00b765b57be83bae910e0a60.zip |
gras: make dispatcher into static helper
Diffstat (limited to 'lib')
-rw-r--r-- | lib/block_props.cpp | 11 | ||||
-rw-r--r-- | lib/gras_impl/block_actor.hpp | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/block_props.cpp b/lib/block_props.cpp index 99edce7..5965085 100644 --- a/lib/block_props.cpp +++ b/lib/block_props.cpp @@ -64,15 +64,16 @@ struct PropAccessReceiver : Theron::Receiver /*********************************************************************** * Handle the get and set calls from the user's call-stack **********************************************************************/ -PMCC BlockActor::prop_access_dispatcher(const std::string &key, const PMCC &value, const bool set) +template <typename ActorType> +static PMCC prop_access_dispatcher(ActorType &actor, const std::string &key, const PMCC &value, const bool set) { PropAccessReceiver receiver; PropAccessMessage message; message.set = set; message.key = key; message.value = value; - this->Push(message, receiver.GetAddress()); - this->highPrioPreNotify(); + actor->Push(message, receiver.GetAddress()); + actor->highPrioPreNotify(); receiver.Wait(); if (not receiver.message.error.empty()) { @@ -88,10 +89,10 @@ void Block::_register_property(const std::string &key, PropertyRegistrySptr pr) void Block::_set_property(const std::string &key, const PMCC &value) { - (*this)->block->prop_access_dispatcher(key, value, true); + prop_access_dispatcher((*this)->block, key, value, true); } PMCC Block::_get_property(const std::string &key) { - return (*this)->block->prop_access_dispatcher(key, PMCC(), false); + return prop_access_dispatcher((*this)->block, key, PMCC(), false); } diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp index 8efc388..89b8230 100644 --- a/lib/gras_impl/block_actor.hpp +++ b/lib/gras_impl/block_actor.hpp @@ -197,7 +197,6 @@ struct BlockActor : Apology::Worker std::vector<std::vector<OutputHintMessage> > output_allocation_hints; //property stuff - PMCC prop_access_dispatcher(const std::string &key, const PMCC &value, const bool set); std::map<std::string, PropertyRegistrySptr> prop_registry; BlockStats stats; |