[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] using virtual member functions

From: Martin Braun
Subject: Re: [Discuss-gnuradio] using virtual member functions
Date: Fri, 13 Mar 2015 10:30:32 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

When you 'make' a block, it actually returns you a _impl version of the class, even though only the abstract class is declared publically. All the methods are actually defined in the _impl, where also the members reside.

If you're having trouble understanding the polymorphism concepts, I suggest having another look at some C++ literature. If it's the actual GNU Radio block design, have another look at examples of blocks (e.g. in gr-blocks) to see how the abstract methods interact with their definitions.


On 13.03.2015 06:15, Mostafa Alizadeh wrote:
Hello all,

I'm about to use member functions of the abstract base class of qtgui
classes to adjust visualization parameters such as "set_title",
"set_line_label" etc.

There is an explanation of virtual based classes in [1]. So it's
possible to use pure virtual functions by the derived classes.

When we're in GNURadio, there is an abstract class and an implementation
class which is derived from the abstract class. So I expect to be able
of using the pure virtual functions declared in abstract class by having
a pointer of the implementation class. However the members aren't
accessible. What can I do to use them?


[1] http://www.cplusplus.com/doc/tutorial/polymorphism/

Discuss-gnuradio mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]