Swig use in gnuradio

Hi, everyone

I want use the hydra architecture for our MAC protocol design.
When I browse hydra code, I see some code like:

inline gr_msg_queue_sptr inputQ() const { return d_tx.inputQ(); }
inline gr_msg_queue_sptr ctrlQ() const { return d_rx.ctrlQ(); }
inline gr_msg_queue_sptr outputQ() const { return d_rx.outputQ(); }

As I know, gr_msg_queue_sptr use smart pointer of boost, when I build my
code like this, and call these function in my python code:

m=A.get_queue().delete_head()

the error occur:

AttributeError :‘PySwigObject’ object has no attribute ‘delete_head’
swig/python detected a memory leak of type ‘gr_msg_queue_sptr *’, no
destructor found.

And if I just use gr_msg_queue for test like below, the delete_head is
exist and print is ok:

test_queue2 = gr.msg_queue()
s = “hello world”
test_queue2.insert_tail(gr.message_from_string(s))
k = test_queue2.delete_head()
print k.to_string()

so I want to know, why hydra’s code can run successful?
any other work it do for this? as I know, swig do not support pointer to
function, how do I handle with these problem?

2010-04-05

Chen Xiao-Hui ( 陈 å°æƒ )
Dept. of Electronics and Information Engineering,
Huazhong University of Science and Technology,
E-mail address: [email protected] or [email protected]