# Block struct change

**URL:** <https://www.ruby-forum.com/t/block-struct-change/231426>\
**Category:** GNU Radio\
**Created:** [August 7, 2014, 2:16pm UTC](https://www.ruby-forum.com/t/block-struct-change/231426 "2014-08-07T14:16:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 7, 2014, 2:16pm UTC](https://www.ruby-forum.com/t/block-struct-change/231426/1 "2014-08-07T14:16:44Z")

</div>

## Hi All, I want know to why the block has been split into two class: “block\_name.cc” and “block\_name\_impl.cc”, why do we need a virtual class, and use a “\_impl” to inherit it? As we know, the older gnuradio just use a single class. Is there any advantage of this change?

Thanks  
Tiankun

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [August 7, 2014, 2:19pm UTC](https://www.ruby-forum.com/t/block-struct-change/231426/2 "2014-08-07T14:19:08Z")

</div>

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

Hi Tiankun,

the advantage lies in the fact that the user of your block just has to  
look at the block\_name.h (and also SWIG), and you can exchange,  
implement, extend and subclass your implementation to your heart’s  
delight in the block\_name\_impl.h. This simplifies SWIG wrapping a lot,  
and thus has, at least for me, decreased development complexity  
significantly.

Greetings,  
Marcus

On 07.08.2014 14:15, Tiankun Hu wrote:

> Hi All, I want know to why the block has been split into two class:  
> “block\_name.cc” and “block\_name\_impl.cc”, why do we need a virtual  
> class, and use a “\_impl” to inherit it? As we know, the older  
> gnuradio just use a single class. Is there any advantage of this  
> change?  
> -----BEGIN PGP SIGNATURE-----  
> Version: GnuPG v1

iQEcBAEBAgAGBQJT4256AAoJEAFxB7BbsDrLVkIH/3cGvhUk0TZKaUdWz+YQ5Z3G  
Vj2QaXF6t0Kx8b0SSv47sgVNoz7TCaeL7BcQy3ptbpBsC1rmzxck+mOLyuEd5kZF  
eog377YacFix5lj4Xv3KLkaDN8kZ2OpE/9eCp7PJpE3cEFeKlX+Qaan1+X1eE52f  
uujWuYVGISWj9X7fToPiRa4n8gNMaJgAh/82hloqhCtAToPnDg7RGa4hlClsr/dE  
WOiu4z7pkcxnA+9Y4F1fnOlYOUBafrGXT15fSzIoVTnb2KmdJ1FwVWVymPeh46dW  
fffyu1THeOKmS48L64a23Fpv9mbHVj3OIqX4jONVBebgSOgAj321xDWBT48kG1M=  
=x3Nx  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [August 7, 2014, 2:52pm UTC](https://www.ruby-forum.com/t/block-struct-change/231426/3 "2014-08-07T14:52:28Z")

</div>

Yes 🙂

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [August 7, 2014, 2:41pm UTC](https://www.ruby-forum.com/t/block-struct-change/231426/4 "2014-08-07T14:41:45Z")

</div>

Thanks Marcus,  
My understand is we can define the member function that Pyton want to  
know in block\_name.h  
and other thing that Python not interesting in block\_name\_impl.h, and  
then swig.i only include block\_name.h, so this will simplify SWIG’s  
config, right?

在 2014年08月07日 20:18, Marcus Müller 写道:

> significantly.
> 
> Greetings,  
> Marcus
> 
> On 07.08.2014 14:15, Tiankun Hu wrote:
> 
> > Hi All, I want know to why the block has been split into two class:  
> > “block\_name.cc” and “block\_name\_impl.cc”, why do we need a virtual  
> > class, and use a “\_impl” to inherit it? As we know, the older  
> > gnuradio just use a single class. Is there any advantage of this  
> > change?

–  
Thanks  
Tiankun

---

<div class="post-metadata">

**Author:** ![Tiankun\_Hu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/46a35a/32.png) [@Tiankun\_Hu](https://www.ruby-forum.com/u/Tiankun_Hu)\
**Post date:** [August 7, 2014, 5:11pm UTC](https://www.ruby-forum.com/t/block-struct-change/231426/5 "2014-08-07T17:11:47Z")

</div>

Also, ABI stability.

M
