Howto override the argument names of certain class member functions
Terry Barnaby <[email protected]>
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <[email protected]> |
I am wrapping a relatively complex C++ class library to produce a Python
interface. One thing I haven't worked out how to do is to tell SWIG to
return certain function reference arguments on the lhs of the function
call only, ie. assume them to be OUTPUT only references. For example
(very simplified):
class DataFile {
public:
Error setInfo(const Info& info); // Input only reference
Error getInfo(Info& info); // Output only reference
};
Now I can rename the getInfo function in the C++ class library to "Error
getInfo(Info& OUTPUT);" say and add the appropriate typemaps to match
this and that works, but I really don't want to rename all of the C++'s
API function arguments for all of the classes in this library (They are
used for doxygen etc).
This there a simple way in SWIG to override/rename the arguments of a
particular function and/or particular classes member function ? So
something like:
%rename("getInfo(Info& OUTPUT)") "getInfo(Info& info)"
%rename("DataFile::getInfo(Info& OUTPUT)") "DataFile::getInfo(Info& info)"
_______________________________________________
Swig-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/swig-user