Need help with control port client

Greetings,

I’m trying to write a control port client in C++ but I got stuck and
need some help.

My problem is that the control port interface gives us a map
containing GNURadio::KnobPtr but to get access to the value I need a
typed pointer, e.g. GNURadio::KnobDPtr, which is derived from KnobPtr.
I tried a static_cast as illustrated in this snippet:
gr-ctrlport client - Pastebin.com - but gcc throws it right back at me with
an error:

In file included from /usr/include/Ice/LocalObjectF.h:15:0,
from /usr/include/Ice/CommunicatorF.h:24,
from /usr/include/Ice/Initialize.h:13,
from /usr/include/Ice/Ice.h:13,
from strx-mon.cpp:1:
/usr/include/Ice/Handle.h: In constructor
IceInternal::Handle::Handle(const IceInternal::Handle&) [with Y
= GNURadio::Knob, T = GNURadio::KnobD]:
strx-mon.cpp:28:72: instantiated from here
/usr/include/Ice/Handle.h:73:9: error: invalid conversion from
GNURadio::Knob* to GNURadio::KnobD* [-fpermissive]

Maybe I’m approaching it all wrong. In any case, I would appreciate
any hints I can get.

Alex

On Thu, Apr 4, 2013 at 1:52 AM, Alexandru C. [email protected]
wrote:

an error:
/usr/include/Ice/Handle.h:73:9: error: invalid conversion from
GNURadio::Knob* to GNURadio::KnobD* [-fpermissive]

Sorry for the noise. I realized that adding -fpermissive to gcc will
make it compile and run as expected. I guess I can now look forward to
being publicly crucified at the next C++ convention… On the other
hand the Python does the same thing behind the scenes so I will not
loose any sleep over this.

Alex

On Thu, Apr 4, 2013 at 6:37 PM, Alexandru C. [email protected]
wrote:

gr-ctrlport client - Pastebin.com - but gcc throws it right back at me with
strx-mon.cpp:28:72: instantiated from here
Alex
Alex,

That’s nice to know. I was waiting until I had more time to help you
out with this, but no need.

It’ll be good to have some C++ apps using ControlPort out there for us
to look at :slight_smile:

Tom