Wednesday, August 1, 2018

Re: [Discuss-gnuradio] Calling public C++ function in OOT module using Python

Hi Edwin - Your C++ coding looks fine (to me).

If you added this method -after- building SWIG for the first time, you generally need to "clean" the SWIG build (or, just "make clean" in the top-level build directory; maybe this is the "clean trick" you mention?), since oftentimes CMake doesn't catch these changes for rebuilding SWIG.

If this doesn't work it's much easier for us to help debug if you use a public repo (e.g., on GitHub) & tell us what it is so we can work with the whole OOT.

Hope this is useful. - MLD

On Tue, Jul 31, 2018, at 7:09 PM, Edwin Li wrote:
Hi,

I've been trying to make a function in my OOT module public. The module is called chaotic_prefix_bc. 
I declare a pure virtual function called Logistic_map() in chaotic_prefix_bc.h, and overload it in chaotic_prefix_bc_impl.h and chaotic_prefix_bc_impl.cc.
When I call this function in a vector source(in GNURadio) using: chaos.chaotic_prefix_bc(0.8,3.98,50,'len_tag_key').Logistic_map(0.8,3.98,50), it says 'chaotic_prefix_bc_sptr' object has no attribute 'Logistic_map'. 
I tried the make clean trick mentioned in the mailing list, but to no avail.
I attached my code below. Please help me~

Regards,
Edwin


_______________________________________________
Discuss-gnuradio mailing list

Email had 3 attachments:

  • chaotic_prefix_bc_impl.h
      2k (text/x-chdr)
  • chaotic_prefix_bc_impl.cc
      5k (text/x-c++src)
  • chaotic_prefix_bc.h
      3k (text/x-chdr)

No comments:

Post a Comment