Hello:

I just have another similar situation where I have to get this work for a C++ interface (pure abstract) class argument returned by reference. e.g.:

C++ method is:
ErrorCode getMyInterfaceClassObject(CNIMyInterfaceClass*& model);

Expected python:

var = CNIMyInterfaceClass ()
err, var = exampleObj.getMyInterfaceClassObject(var)

Unfortunately, declaration "var = CNIMyInterfaceClass ()" fails since it is an abstract class and cannot be initialized. Is it possible to handle such a situation with SWIG?


Thanks,
Santosh

On Fri, 20 Jun 2014 18:22:41 +0530 wrote
>Hello David:
>

>
It worked ! Thanks a lot for taking out your valuable time to help me !
>

>
Santosh
>

>
On Fri, 20 Jun 2014 17:48:47 +0530 wrote
>
>Quoting santosh tanaji patil (2014-06-20 13:59:29)
>

>
> Hello David:
>

>
>
>

>
> Thanks for your valuable time in looking into the problem. If you closely see
>

>
> the "void updateInt (CNInt32& var)" function, it is going to return me the
>

>
> updated integer value from my C++ code.
>

>
> This code is just a sample code and in my (rather somebody else's) original
>

>
> code, C++ code might be doing some number crunching and then update the value.
>

>

>

>
Sorry, I didn't sse that. I think you should use typemaps.i, see:
>

>

>

>
http://swig.org/Doc2.0/Arguments.html
>

>

>

>
Something like this:
>

>

>

>
%include typemaps.i
>

>
%apply int& INOUT { CNInt32& var };
>

>

>

>
And then:
>

>

>

>
var = 5
>

>
var = exampleObj.updateInt(var)
>

>

>

>
------------------------------------------------------------------------------
>

>
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
>

>
Find What Matters Most in Your Big Data with HPCC Systems
>

>
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>

>
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
>

>
http://p.sf.net/sfu/hpccsystems
>

>
_______________________________________________
>

>
Swig-user mailing list
>

>
Swig-user@lists.sourceforge.net
>

>
https://lists.sourceforge.net/lists/listinfo/swig-user
>

>


Santosh Patil
>
M. Tech. (Mechanical)
>
Thermal & Fluids Engineering
>
Indian Institute of Technology,
>
Mumbai - 400076
Get your own FREE website, FREE domain & FREE mobile app with Company email. Know More >


Santosh Patil
Get your own FREE website, FREE domain & FREE mobile app with Company email.  
Know More >