From fc80d2c0acec4f668b58a05bd5a3a06b0a2a2280 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 5 Jul 2013 18:50:01 -0700 Subject: gras: begin replacing set/get with callable --- include/gras/block.hpp | 98 ++------------------------------------------------ 1 file changed, 2 insertions(+), 96 deletions(-) (limited to 'include/gras/block.hpp') diff --git a/include/gras/block.hpp b/include/gras/block.hpp index f2f1b2b..644a73c 100644 --- a/include/gras/block.hpp +++ b/include/gras/block.hpp @@ -161,97 +161,6 @@ struct GRAS_API Block : Element template void post_input_msg(const size_t which_input, const ValueType &value); - /******************************************************************* - * The property interface: - * Provides polymorphic, thread-safe access to block properties. - ******************************************************************/ - - /*! - * Register property getter method into the property interface. - * Call register_getter() from the contructor of the block. - * - * Example register usage: - * this->register_getter("foo", &MyBlock::get_foo); - * - * Example method declaration: - * int get_foo(void); - * - * \param key the string to identify this property - * \param get the class method to get the property - */ - template - void register_getter( - const std::string &key, - ValueType(ClassType::*get)(void) - ); - - /*! - * Register property setter method into the property interface. - * Call register_setter() from the contructor of the block. - * - * Example register usage: - * this->register_setter("foo", &MyBlock::set_foo); - * - * Example method declaration: - * void set_foo(const int &new_foo); - * - * \param key the string to identify this property - * \param set the class method to set the property - */ - template - void register_setter( - const std::string &key, - void(ClassType::*set)(const ValueType &) - ); - - /*! - * Set the value of a registered property. - * - * This call is synchronous and will not return until - * the block has actually called the registered set operation. - * - * Note: the user must be careful to only use a value - * that is of the exact type associated with this property. - * Otherwise, set_property with throw a type error. - * - * Examples with explicit argument types: - * my_block->set("foo", 42); - * my_block->set("foo", size_t(42)); - * - * \param key the string to identify this property - * \param value the new value to set to this property - */ - template - void set(const std::string &key, const ValueType &value); - - /*! - * Get the value of a registered property with reference semantics. - * - * Note: the user must be careful to only use a value - * that is of the exact type associated with this property. - * Otherwise, get_property with throw a type error. - * - * Example getting property with reference semantics: - * size_t foo; my_block->get("foo", foo); - * - * \param key the string to identify this property - * \param value a reference to set to the result - */ - template - void get(const std::string &key, ValueType &value); - - /*! - * Get the value of a registered property with return semantics. - * - * Example getting property with return value semantics: - * const size_t foo = my_block->get("foo"); - * - * \param key the string to identify this property - * \return the value of this property - */ - template - ValueType get(const std::string &key); - /******************************************************************* * Work related routines and fail states ******************************************************************/ @@ -430,11 +339,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 &, void *); - void _register_setter(const std::string &, void *); - virtual void _set_property(const std::string &, const PMCC &); - virtual PMCC _get_property(const std::string &); + PMCC _handle_call(const std::string &, const PMCC *); + virtual PMCC _handle_call_ts(const std::string &, const PMCC *); void _post_output_msg(const size_t which_output, const PMCC &msg); void _post_input_msg(const size_t which_input, const PMCC &msg); }; -- cgit