# Pass new types to the "make" function

**URL:** <https://www.ruby-forum.com/t/pass-new-types-to-the-make-function/240967>\
**Category:** GNU Radio\
**Created:** [May 8, 2014, 10:20am UTC](https://www.ruby-forum.com/t/pass-new-types-to-the-make-function/240967 "2014-05-08T10:20:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [May 8, 2014, 10:20am UTC](https://www.ruby-forum.com/t/pass-new-types-to-the-make-function/240967/1 "2014-05-08T10:20:01Z")

</div>

hello every body,  
I really have a problem with data types when I want to use my  
out-of-tree  
module in GRC which is written in c++.  
I have a “make” like this:

_make(unsinged int x, usigned char y)_

how could I use this block in GRC?

please help me,

Thank.

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [May 8, 2014, 10:48am UTC](https://www.ruby-forum.com/t/pass-new-types-to-the-make-function/240967/2 "2014-05-08T10:48:19Z")

</div>

Hi Mostafa,

because I hope this will solve your problem as well as make it easier  
for me to understand you and vice versa, I’ve generated a minimal  
example of what you’re trying to do.  
Please clone

> **[GitHub - marcusmueller/gr-unsigned\_inting: Demo of using C++ unsigned ints in...](https://github.com/marcusmueller/gr-unsigned_inting)**
>
> Demo of using C++ unsigned ints in Python/GRC. Contribute to marcusmueller/gr-unsigned\_inting development by creating an account on GitHub.

and tell me if it reflects what you’re trying to do.  
The only files I modified after generation with gr\_modtool were

- lib/try…cc
- python/qa\_try\_…py
- grc/try…xml

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [May 8, 2014, 2:19pm UTC](https://www.ruby-forum.com/t/pass-new-types-to-the-make-function/240967/3 "2014-05-08T14:19:57Z")

</div>

Hi Marcus,  
Thank you for your guides. I clone your files and finally got that I can  
pass “unsinged int” to the make but in the xml file I can put the  
int !!! That’s I wanted. Thank you again.

But one of my blocks must give an array of “int”:

int g[] = {1,2,3};  
…

And the “make” should be like this: \*make(int _g)_  
I looked at the block “vector source” which gives a vector for it’s make  
function. However, I want to pass an array in GRC form of the block i.e.  
xml file!!!  
What do you prefer?

greetings,

---

<div class="post-metadata">

**Author:** ![mostafa\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/5e9695/32.png) [@mostafa\_a](https://www.ruby-forum.com/u/mostafa_a)\
**Post date:** [May 8, 2014, 2:29pm UTC](https://www.ruby-forum.com/t/pass-new-types-to-the-make-function/240967/4 "2014-05-08T14:29:48Z")

</div>

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

SWIG automatically generates wrappers for the python tuple type.  
Refer the mass of examples of tuples being used as parameters in GRC  
blocks for reference 😉  
Again, don’t write anything funky yourself, just use a  
std::vector\* as parameter to your C++ block.

Greetings,  
Marcus

On 08.05.2014 14:18, Mostafa A. wrote:

> block “vector source” which gives a vector for it’s make function.
> 
> > On 08.05.2014 10:18, Mostafa A. wrote:
> > 
> > > Thank.  
> > > [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Discuss-gnuradio  
> mailing list [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

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

iQEcBAEBAgAGBQJTa3g7AAoJEBQ6EdjyzlHtO4sH/ipblc9swgryj1xmBPBW5j33  
7zDlZg1mL9d8WDE4t8rBbxF0esaFnS8qRUrfAtg0L9Lxl7I+rJG9tJZK82XIEVzl  
pmRy5e1Grhz837Bw6Q3JHHzsH4oHi6PZEWGAGm3dD+Qbuj5VHmOgPAvH47udS+ai  
RFWm8P3D0Vg3hTGp05B8FHhSf9nZPggWludcXaB97eaIg0YN3+0lxcQ9Rir198Z7  
bsO/IQV9U79fy0edhJnlV6aqHrY7ShVRests09JDT/E7PiWaE+Obx6ttC3pzA3VZ  
kxl+uxnAE6rFjwu1+/grdUiNRdyK+WlpVaY3Q6/lHxsG66LkJK8s51WN4BXtk80=  
=FnJe  
-----END PGP SIGNATURE-----
