From 4e19b066d27b90355657688f67b6e2f208390a82 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 17 Mar 2013 12:32:43 -0700 Subject: gras: property implementation in lib --- lib/gras_impl/block_actor.hpp | 7 +++++++ lib/gras_impl/messages.hpp | 9 +++++++++ 2 files changed, 16 insertions(+) (limited to 'lib/gras_impl') diff --git a/lib/gras_impl/block_actor.hpp b/lib/gras_impl/block_actor.hpp index 935c87d..d7429f1 100644 --- a/lib/gras_impl/block_actor.hpp +++ b/lib/gras_impl/block_actor.hpp @@ -19,6 +19,7 @@ #include #include #include +#include namespace gras { @@ -61,6 +62,7 @@ struct BlockActor : Apology::Worker this->RegisterHandler(this, &BlockActor::handle_output_alloc); this->RegisterHandler(this, &BlockActor::handle_output_update); + this->RegisterHandler(this, &BlockActor::handle_prop_access); this->RegisterHandler(this, &BlockActor::handle_self_kick); this->RegisterHandler(this, &BlockActor::handle_get_stats); } @@ -90,6 +92,7 @@ struct BlockActor : Apology::Worker void handle_output_alloc(const OutputAllocMessage &, const Theron::Address); void handle_output_update(const OutputUpdateMessage &, const Theron::Address); + void handle_prop_access(const PropAccessMessage &, const Theron::Address); void handle_self_kick(const SelfKickMessage &, const Theron::Address); void handle_get_stats(const GetStatsMessage &, const Theron::Address); @@ -180,6 +183,10 @@ struct BlockActor : Apology::Worker std::vector > output_allocation_hints; + //property stuff + PMCC prop_access_dispatcher(const std::string &key, const PMCC &value, const bool set); + std::map prop_registry; + BlockStats stats; }; diff --git a/lib/gras_impl/messages.hpp b/lib/gras_impl/messages.hpp index 6cc685b..15a7c2e 100644 --- a/lib/gras_impl/messages.hpp +++ b/lib/gras_impl/messages.hpp @@ -131,6 +131,14 @@ struct OutputUpdateMessage //-- do not ack //---------------------------------------------------------------------- +struct PropAccessMessage +{ + bool set; + std::string key; + PMCC value; + std::string error; +}; + struct SelfKickMessage { //empty @@ -172,6 +180,7 @@ THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputHintMessage); THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputAllocMessage); THERON_DECLARE_REGISTERED_MESSAGE(gras::OutputUpdateMessage); +THERON_DECLARE_REGISTERED_MESSAGE(gras::PropAccessMessage); THERON_DECLARE_REGISTERED_MESSAGE(gras::SelfKickMessage); THERON_DECLARE_REGISTERED_MESSAGE(gras::GetStatsMessage); -- cgit