[zeromq-dev] [zproject] How to detect fresh = "1" attribute?

Michal Vyskocil michal.vyskocil at gmail.com
Sun Jan 3 21:04:21 CET 2016


Hi,

during the last few weeks I have improved the mkapi.py enough the
generated model is almost 1:1 with the one from czmq (I am testing
zactor.xml right now).

My biggest problem is how can I detect fresh = "1" attribute. Right
now code adds fresh="1" to each function, which returns non const
pointer. Which is far from true, as czmq usually have functions
returing the low-level objects The question is how to deal with it?

I see only solution:
Detect phrase "caller is responsible for ..." or so in functions
comment and add fresh="1" only for those functions.

It is a bit hacky, but at least encourage developers to explicitly
document ownership.

What do you think?

--
best regards
     Michal Vyskocil



More information about the zeromq-dev mailing list