Two_work_functions

Hi,
What is the need for two types of work functions in a block(work and
general_work). Can’t we do that behavioral with single work function?.
Is
there any particular reason behind that.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Siva,

yes, referring to the introductory tutorials I can explain:

gr::block, the mother of all blocks that can process samples, has
general_work. That gets called to process samples, but does not make
any guarantees about the ratio of the numbers of input- and output
items, so you need to call consume() yourself to tell GNU Radio how
many input items you consumed to produce your output.

work is the function of a block that has a defined ratio between the
numbers of in- and output items (gr::sync_block and derived types,
which itself is a subclass of gr::block),
which “wraps” the functionality to alleviate the need to call
consume() yourself, since from the number of items a sync block
produced you directly know how many it consumed.

So, no, by choice of design we can’t have the same behaviour with a
single method.

Hope that was helpful!

Greetings,
Marcus

On 07.02.2014 12:26, Siva Krishna wrote:

Hi, What is the need for two types of work functions in a
block(work and general_work). Can’t we do that behavioral with
single work function?. Is there any particular reason behind that.

_______________________________________________ Discuss-gnuradio
mailing list [email protected]
Discuss-gnuradio Info Page

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS9Qu9AAoJEAFxB7BbsDrLMc0H/R0TH2kR0ixa47SUb1zrxlFQ
CwZIQWOVe/idWiN5/LZ/pZyHESKJ1p8DJ749UW2PJsec5s4QuNKV6PQliH7+o7aq
kVgSFzLy3EZIpg3ECAxO1OCgzh2WXlVBVW5lgFSMlaI4CuPpnOtSCof2K6QGoJ2b
56hYc+Jae59b+lyyjURjvCYgqqk0ksqT0f8A6h7kxWNvUQDwGfuTpXLZ4xyIFXyE
xs6KKvy5kFrQUAzIxCwDz2eDjvZknIWLalp6Ga5ulhLEEh7eAw1T4/zccBiU9xZD
UX+4qIPfYPmgwIfA0WqG9KwRLJNRsLI9f5qPZpj+n5bYPmLQnFFy5rD2iXuvi8A=
=yYRp
-----END PGP SIGNATURE-----