diff options
author | Josh Blum | 2013-05-27 22:09:16 -0700 |
---|---|---|
committer | Josh Blum | 2013-05-27 22:09:16 -0700 |
commit | 8a5db53c3c3e41aa35fbd45aa7db23157619a4a7 (patch) | |
tree | 57c25024c8bf544883aae2cb1eeecb5a9e720320 | |
parent | 2d05959acf5eb0507d9a4aa4effafe3a1b1e28af (diff) | |
download | sandhi-8a5db53c3c3e41aa35fbd45aa7db23157619a4a7.tar.gz sandhi-8a5db53c3c3e41aa35fbd45aa7db23157619a4a7.tar.bz2 sandhi-8a5db53c3c3e41aa35fbd45aa7db23157619a4a7.zip |
gras: update the pop_input_msg documentation
m--------- | grextras | 0 | ||||
-rw-r--r-- | include/gras/block.hpp | 18 |
2 files changed, 11 insertions, 7 deletions
diff --git a/grextras b/grextras -Subproject 9282d9503024841736f604ad852676fbd9effde +Subproject a2f6dc7db62c15a774260160ee7f9bd9b191000 diff --git a/include/gras/block.hpp b/include/gras/block.hpp index aab0a81..59c30c0 100644 --- a/include/gras/block.hpp +++ b/include/gras/block.hpp @@ -225,15 +225,19 @@ struct GRAS_API Block : Element void post_output_msg(const size_t which_output, const PMCC &msg); /*! - * Pop input message convenience routine. - * This routine reads the first input message, - * and erases this message from the given port. - * The intention is to simplify the use case - * for using this for port messages only. - * If no message, the return value is null. + * Pop a message from the specified port. + * This is a non-blocking call, and will return + * a null PMC when no message is available. + * Suppose PMCC msg = this->pop_input_msg(0); + * Use if(msg) to detect if the PMC is valid. + * + * There is no API to discover the queue depth. + * Therefore, users can either pop the queue exhaustively + * or call pop once and wait for work to be called again. + * If there are more messages, work is called again ASAP. * * \param which_input the index of the input port - * \return the message on the front of the queue + * \return the message on the port or null PMC */ PMCC pop_input_msg(const size_t which_input); |