diff options
author | Josh Blum | 2012-11-12 00:58:52 -0800 |
---|---|---|
committer | Josh Blum | 2012-11-12 00:58:52 -0800 |
commit | 502b13e296cb7d7a20ed8b7dc202bbe9b4e607b1 (patch) | |
tree | 4398d8afe1c5e0760a733281f44af306123ecb21 /include | |
parent | be29a706ae227628b2e4a952f6aae97c9c66d5da (diff) | |
download | sandhi-502b13e296cb7d7a20ed8b7dc202bbe9b4e607b1.tar.gz sandhi-502b13e296cb7d7a20ed8b7dc202bbe9b4e607b1.tar.bz2 sandhi-502b13e296cb7d7a20ed8b7dc202bbe9b4e607b1.zip |
more get methods for all
Diffstat (limited to 'include')
-rw-r--r-- | include/gras/block.hpp | 22 | ||||
-rw-r--r-- | include/gras/top_block.hpp | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/include/gras/block.hpp b/include/gras/block.hpp index ec4941f..bde70b1 100644 --- a/include/gras/block.hpp +++ b/include/gras/block.hpp @@ -107,13 +107,13 @@ struct GRAS_API Block : Element ******************************************************************/ //! Get the configuration rules of an input port - InputPortConfig input_config(const size_t which_input) const; + InputPortConfig get_input_config(const size_t which_input) const; //! Set the configuration rules for an input port void set_input_config(const size_t which_input, const InputPortConfig &config); //! Get the configuration rules of an output port - OutputPortConfig output_config(const size_t which_output) const; + OutputPortConfig get_output_config(const size_t which_output) const; //! Set the configuration rules for an output port void set_output_config(const size_t which_output, const OutputPortConfig &config); @@ -129,10 +129,10 @@ struct GRAS_API Block : Element void produce(const size_t num_items, const size_t which_output); //! Get absolute count of all items consumed on the given input port - item_index_t num_items_consumed(const size_t which_input); + item_index_t get_consumed(const size_t which_input); //! Get absolute count of all items produced on the given output port - item_index_t num_items_produced(const size_t which_output); + item_index_t get_produced(const size_t which_output); /******************************************************************* * Deal with tag handling and tag configuration @@ -145,6 +145,18 @@ struct GRAS_API Block : Element TagIter get_input_tags(const size_t which_input); /*! + * Erase all tags on the given input port. + * This method may be called from the work() context + * to erase all of the queued up tags on the input. + * Once erased, messages cannot be propagated downstream. + * This method allows a user to treat an input port + * as an async message source without a data stream. + * In this case, after processing messages from get_input_tags(), + * the user should call erase_input_tags() before retuning from work(). + */ + void erase_input_tags(const size_t which_input); + + /*! * Overload me to implement tag propagation logic: * * Propagate tags will be given an iterator for all input tags @@ -157,7 +169,7 @@ struct GRAS_API Block : Element virtual void propagate_tags(const size_t which_input, const TagIter &iter); /******************************************************************* - * Work related routines from basic block + * Work related routines and fail states ******************************************************************/ //! Called when the flow graph is started, can overload diff --git a/include/gras/top_block.hpp b/include/gras/top_block.hpp index 6a14bdf..2f0dc87 100644 --- a/include/gras/top_block.hpp +++ b/include/gras/top_block.hpp @@ -37,7 +37,7 @@ struct GRAS_API TopBlock : HierBlock TopBlock(const std::string &name); //! Get the global block config settings - GlobalBlockConfig global_config(void) const; + GlobalBlockConfig get_global_config(void) const; //! Set the global block config settings void set_global_config(const GlobalBlockConfig &config); |