<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.programming.swig">
    <title>gmane.comp.programming.swig</title>
    <link>http://blog.gmane.org/gmane.comp.programming.swig</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19728"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19725"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19724"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19723"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19722"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19721"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19720"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19719"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19714"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19712"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19711"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19708"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19697"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19696"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19694"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19690"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19689"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19688"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19687"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.programming.swig/19684"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19728">
    <title>Applying C# attribute to constructor also applies it to constructor helper</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19728</link>
    <description>&lt;pre&gt;I have a class whose constructor takes a C++ date class as an argument:

class Foo
{
public: 
Foo( CDate d )
{
 // do something
}
};

As in example 19.8.3 in the manual page ( see  here
&amp;lt;http://www.swig.org/Doc2.0/CSharp.html#CSharp_date_marshalling&amp;gt;   ) I'm
using a %typemap(csin) to map CDate onto DateTime in C#.  This causes SWIG
to "split" the Foo constructor into a constructor plus a helper:

  static private IntPtr SwigConstructFoo(System.DateTime d) {
    CDate tempd = new CDate(d.Day, d.Month, d.Year);
    return NDeriviteccPINVOKE.new_Foo(CDate.getCPtr(tempd));
  }

  public Foo(System.DateTime d) : this(Foo.SwigConstructFoo(d), true) {
    if (NDeriviteccPINVOKE.SWIGPendingException.Pending) throw
NDeriviteccPINVOKE.SWIGPendingException.Retrieve();
  }

In addition I need to apply a C# attribute to the Foo constructor which I do
with this line in the interface file:

%csattributes Foo::Foo( CDate d ) "[MyAttribute]"

My problem is that this causes the attribute to be applied to both the
constructor and the constructor helper:

  *[MyAttribute]*
  static private IntPtr SwigConstructFoo(System.DateTime d) {
    CDate tempd = new CDate(d.Day, d.Month, d.Year);
    return NDeriviteccPINVOKE.new_Foo(CDate.getCPtr(tempd));
  }

  *[MyAttribute]*
  public Foo(System.DateTime d) : this(Foo.SwigConstructFoo(d), true) {
    if (NDeriviteccPINVOKE.SWIGPendingException.Pending) throw
NDeriviteccPINVOKE.SWIGPendingException.Retrieve();
  }

Does anyone know a way around this?

Thanks
Marc



--
View this message in context: http://swig.10945.n7.nabble.com/Applying-C-attribute-to-constructor-also-applies-it-to-constructor-helper-tp13311.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
&lt;/pre&gt;</description>
    <dc:creator>Marc Tuckmantel</dc:creator>
    <dc:date>2013-06-19T09:42:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19725">
    <title>constants</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19725</link>
    <description>&lt;pre&gt; Please, help me undestand how I can translate constants from C++ to C# with swig. I am try #define my_const 5 (for example). What I need write in interface file for access this constant from C#. Thank you.


&lt;/pre&gt;</description>
    <dc:creator>Александр Емельянов</dc:creator>
    <dc:date>2013-06-19T06:35:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19724">
    <title>Does SWIG do C# to Java already?</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19724</link>
    <description>&lt;pre&gt; 
 
I have just found out yesterday about the SWIG open source project and I would like to know if there is already the C# 2 Java parsing or if you would be interested in such a topic. From what I have read, it seems that it is rather a C++ to anything oriented. 
 
If the answer is Yes, could you, please, indicate me a link where to read about the (C# &amp;amp; Java) versions it parcses, as well as about the commands to use? 
 
Best regards, 
APlus------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Aretina David</dc:creator>
    <dc:date>2013-06-18T09:23:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19723">
    <title>[C/Lua] a question on variable mapping</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19723</link>
    <description>&lt;pre&gt;Hi,
I'm trying to use SWIG to embed LUA in my program.

My plan is as following.

On C-side, I keep multiple string array tables.
For example,
char        *global_vars[128];
char        *context_vars[256];

On SWIG
%module global
...
%module context
...

On Lua-side, I want to run the following
global.os = "Linux"
global.version= global.version .. "lua"

In this scenario, I think I have to make a symbol mapping layer, because
Lua does not know what is "global.os" and "global.version"

Could you please let me know the starting point ?

Any help or comment will be highly appreciated.

Thanks

-----
weon
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Taehwan Weon</dc:creator>
    <dc:date>2013-06-18T03:31:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19722">
    <title>multiple modules and directors</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19722</link>
    <description>&lt;pre&gt;Hi to all,

I've a weird issue where I'm not able to call a derived class virtual function (using directors and python 3.3) that accepts arguments belonging to another module.. let's make an example:

- I've a module called MOD1 that exports an OBJ1 class
- I've a second module called MOD2 that exports a class that has a method accepting an OBJ1 pointer

when I try to define a derived class that extends the method of the class into MOD2, I get a Director exception executing the function. Off course I've defined the SWIG_TYPE_TABLE to a common name but this does not change the problem.

Any hint ?

Leonardo Bernardini
Chief Technology Officer
Virtual Vertex



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Leonardo Bernardini</dc:creator>
    <dc:date>2013-06-17T17:09:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19721">
    <title>typemap detect wrap of a static vs. non-static member</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19721</link>
    <description>&lt;pre&gt;We need to detect in a typemap whether a wrapped method of a class is a
static method or a non-static method.  I noticed that there is a $static but
that only seems to apply to Java?  I tried and it didn't work for tcl.  We
are wrapping our code for tcl, perl, and python.

I am willing to use a hack temporarily until this is fully supported.

Why do we need this? We are processing varargs using our own loop and need
to avoid the first element for non-static methods (since it is the "this"
pointer).

Thanks for any help,
Stephen



--
View this message in context: http://swig.10945.n7.nabble.com/typemap-detect-wrap-of-a-static-vs-non-static-member-tp13304.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
&lt;/pre&gt;</description>
    <dc:creator>sehmann</dc:creator>
    <dc:date>2013-06-17T13:54:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19720">
    <title>Python director + shared_ptr + ownership</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19720</link>
    <description>&lt;pre&gt;Hello all,

I am making a Python interface for a project, using directors, and I am
confused about the proper way to make sure ownership is correct. The
situation:

I have a C++ class Option, with the following in the header, which is
%include-d in the SWIG interface file:

class Option
{
public:
  Option(std::string const&amp;amp; id);
  std::string getID() const;
  virtual bool isAvailable() { return true; }
};

Furthermore, I have a container for these Options, OptionTree, with the
following interface in the SWIG interface file:

class OptionTree
{
public:
  void addOption(std::shared_ptr&amp;lt;Option&amp;gt; option);
  std::shared_ptr&amp;lt;Option&amp;gt; getOption(std::string const&amp;amp; id) const;
};

As you see, I use std::shared_ptr, I have a %shared_ptr(Option) at the
start of the interface file.

Finally, I extend the class and use it in Python as follows:

class DummyOption(Option):
    def __init__(self, id):
        Option.__init__(self, id)

    def isAvailable(self):
          print(self.getID()) # 1
          return True

def addDummy(tree):
    dummy = DummyOption("dummy")
    tree.addOption(dummy)

OptionTree tree
addDummy(tree)

Then a C++ method is called from Python, which ends up calling isAvailable
on the option. This causes a segfault in the getID call at the line marked
# 1, because after addDummy returns, the Python object is garbage
collected, which also deletes the C++ director object (right?). To overcome
this, I followed the docs and did tree.addOPtion(dummy.__disown__())
instead, but this causes a segfault in swig_pyobj_disown, when it tries to
do a dynamic cast. After digging around with gdb and some printing, my
guess is that there it tries to cast the shared_ptr to an Option, which
blows up.

I now got it working without crashing by setting dummy.thisown = 0, however
I don't think this must be the right way to do it right? With this the
Python object still gets garbage collected, which I see happen when
implementing its __del__ method. However, subsequent calls into Python,
such as isAvailable, still work, even when I access some member variables
in there that I set on the DummyOption in __init__, which confuses me..

So my questions: what is the best way to do it, or can I stick with thisown
= 0? Does SWIG get confused by the shared_ptr?  Do I need some typemap? Is
my thinking completely wrong?

I use SWIG 2.0.10 and Python 3.3.2

Many thanks in advance for any insight you may have!

Sander
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Sander van Dijk</dc:creator>
    <dc:date>2013-06-15T14:12:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19719">
    <title>Syntax error in input(3)</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19719</link>
    <description>&lt;pre&gt;Hello list

I tried to compile the Siconos [1] frontend and got the following error
message:

  /usr/include/boost/smart_ptr/enable_shared_from_this.hpp:28: Error:
Syntax error in input(3).
  make[2]: *** [src/swig/Siconos/KernelPYTHON_wrap.cxx] Error 1
  make[1]: *** [src/swig/Siconos/CMakeFiles/_Kernel.dir/all] Error 2
  make: *** [all] Error 2

The line 28 in enable_shared_from_this.hpp looks like this:

  enable_shared_from_this() BOOST_NOEXCEPT
  {
  }

What is a possible workaround?

Thanks for your help.

Cheers Reza



[1] http://siconos.gforge.inria.fr/
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Reza Housseini</dc:creator>
    <dc:date>2013-06-13T13:08:17</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19714">
    <title>(no subject)</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19714</link>
    <description>&lt;pre&gt;Hello,

I am developing a neutron transport code using a mixture of
C/C++/CUDA/Python package built using setuptools/distutils. I am trying to
build a Python module specifically for the Intel MIC (Xeon Phi), and this
requires me to make use of a number of keywords such as "_Cilk_shared",
"_Cilk_offload", etc which SWIG does not like. For example, I want to make
some of the class attributes and methods shared between CPU and the MIC - a
header file for a simple example that break with SWIG is as follows:

class swigMicTest
{
private:
    _Cilk_shared int A;
public:
    swigMicTest() { setA(1); }
    _Cilk_shared setA(int a) { A = a; }
}

I want to tell SWIG to ignore the "_Cilk_shared" keyword when it wraps this
class but haven't figured out how to successfully do that using the rename,
ignore, etc directives.

Thanks for your help,

Will Boyd
Nuclear Science &amp;amp; Engineering
Massachusetts Institute of Technology
Email: wboyd&amp;lt; at &amp;gt;mit.edu
Cell: 423.413.8469
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Will Boyd</dc:creator>
    <dc:date>2013-06-12T20:38:34</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19712">
    <title>swig 2.0 ,import a module in an embedded python interpreter</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19712</link>
    <description>&lt;pre&gt;Hi list members,

I'm struggling with swig2 to import a module into an embedded python interpreter. I would like to just take into my code the _wrap file and call the PyInit__Modulename to have it registered in the current interpreter, but this does not seems to work.. I get a PyObject* of the module back but any call to the functions fails. Also, importing the shadow class later does not work too, because it seems it still searches the .pyd file.

Any suggestion, or is that impossible with swig2 ? 

Thanks !

Leonardo Bernardini
Chief Technology Officer
Virtual Vertex



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Leonardo Bernardini</dc:creator>
    <dc:date>2013-06-11T16:40:19</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19711">
    <title>SWIG and Twitter Storm</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19711</link>
    <description>&lt;pre&gt;Hello,

I am attempting to make use of native code in twitter storm via swig.  I've
made a wrapper for native bolts and everything works fine when running the
topology locally, however, not so fine when running it in distributed mode. 
My code is layout is as follows.

java.NativeBolt - A wrapper to the swig wrapper.  This maintains state that
is serialized and sent to the storm workers.  
swig.Bolt - The swig wrapper to the native code, used by java.NativeBolt
cxx.Bolt - The native code.

The java.NativeBolt shows up to the worker with the correct state.  From
there in "readResolve()" it attempts to instantiate the swig wrapper (new
swig.Bolt()) which appears to work fine (it returns and
swig.Bolt.getCPtr(bolt) returns a non-null value), however, calling any
function on the swig.Bolt does not return.  Any ideas as to why this could
be happening or how to go about debugging it?

Thanks!
-Ed



--
View this message in context: http://swig.10945.n7.nabble.com/SWIG-and-Twitter-Storm-tp13294.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
&lt;/pre&gt;</description>
    <dc:creator>ebclark2</dc:creator>
    <dc:date>2013-06-11T15:10:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19708">
    <title>SWIG and OpenGL types</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19708</link>
    <description>&lt;pre&gt;Hi,

I have a C++ library, where certain class methods return GLfloat, 
GLubyte, GLenum, etc. When I try to access this from the Python side I get

&amp;lt;Swig Object of type 'GLenum *' at 0x311a690&amp;gt;

Somehow these should also be wrapped in such a way that these values are 
converted to floats, ints, etc.

I have tried looking at typemaps, but find them very hard to understand. 
Also they seem focused on the function input signature rather than the 
return value (I'm probably wrong).

Wrapping the entire &amp;lt;GL/gl.h&amp;gt; header would be overkill.

Any suggestions?

Best regards,

Mads



&lt;/pre&gt;</description>
    <dc:creator>Mads Ipsen</dc:creator>
    <dc:date>2013-06-11T06:53:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19697">
    <title>How to control the value of $null</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19697</link>
    <description>&lt;pre&gt;I'm using SWIG with C# in a method that uses some custom typemaps which 
return a structure to .NET.

I am also using %exception which, of course, uses "return $null". The 
problem is that SWIG uses "return NULL" even though the return value is a 
struct (note that the original C++ type is a pointer; I am returning a 
structure that combines that pointer with a type ID, my custom solution to 
the well-known 
returning-a-derived-class-proxy-when-the-method-returns-a-base-class-pointer 
problem.)

The documentation doesn't say anything about where $null comes from:

http://www.swig.org/Doc1.3/CSharp.html 

Can I customize it for my particular return type?------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>David Piepgrass</dc:creator>
    <dc:date>2013-06-05T22:44:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19696">
    <title>C++ =&gt; Python: 2D array example not working</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19696</link>
    <description>&lt;pre&gt;Like in the example from: http://www.swig.org/Doc1.1/HTML/Python.html I tried
to implement an extension for my Matrix class. I put this already to
stackoverflow..
It doesn't matter how to use my namespaces. It doesn't compile. Also not
with  "%addmethods".



I get this:




--
View this message in context: http://swig.10945.n7.nabble.com/C-Python-2D-array-example-not-working-tp13279.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
&lt;/pre&gt;</description>
    <dc:creator>dgrat</dc:creator>
    <dc:date>2013-06-05T20:19:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19694">
    <title>Using release python library against debug built SWIGinterface</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19694</link>
    <description>&lt;pre&gt;Hello,

It seems quite frequently people want to build our library compiled in debug mode but link against their python library build in release mode on windows. How do other people deal with this? I was hopping there was some magic flag I could pass to swig and it could just work :)

I have seen some work around for this in a non-SWIG project:

https://github.com/Kitware/VTK/blob/master/Utilities/Python/vtkPython.h#L22

Thanks for your suggestions.
Brad
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
&lt;/pre&gt;</description>
    <dc:creator>Bradley Lowekamp</dc:creator>
    <dc:date>2013-06-05T13:07:37</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19690">
    <title>Upgrading .i file for 2.0.x swig</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19690</link>
    <description>&lt;pre&gt;Hello all,


I am in the process of updating a large .i file which was originally written for the 1.3.x version of swig to the latest 2.0.9+. I am doing this because of a need to deal with boost shared pointers better. In my .i file their is an interesting concept of passing a shared_ptr variable out from the  wrapped C++ library (a *.so) to the java library.


My problem is that the old .i file used the basic shared_ptr idea and __deref()__’ed the shared pointer all over the place does anyone have any hints / suggestions / ??? on how to refactor those away to the new style?


Also I am getting a bunch of extra SWIGTYPE_p_ types along with the appropriately wrapped types: example I am getting SWIGTYPE_p_std_vector_One along with the One type. Any ideas why this would occur?


Thanks,


Blair------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Blair Jennings</dc:creator>
    <dc:date>2013-06-03T18:05:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19689">
    <title>Using %attribute to wrap getter/setter into C# property</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19689</link>
    <description>&lt;pre&gt;I have a C++ class with a getter/setter to access a nested object by value:

class Bar
{
Foo GetFoo() const { return( m_foo ); }
void SetFoo( const Foo&amp;amp; foo ) { m_foo = foo; }

private:
Foo m_foo;
};

I'm using the following %attribute to map this into a property in the C#
wrapper class:

%attribute(Bar, Foo, Foo, GetFoo, SetFoo);

In SWIG 2.0.8 I then get this wrapper code:

SWIGEXPORT void * SWIGSTDCALL CSharp_Bar_Foo_get(void * jarg1) {
  void * jresult ;
  Bar *arg1 = (Bar *) 0 ;
  Foo *result = 0 ;
  
  arg1 = (Bar *)jarg1; 
  {
    try {
      result = (Foo *)Bar_Foo_get(arg1);
    } 
  ...
}

The problem is that CSharp_Bar_Foo_get() returns a pointer while
Bar_Foo_get() returns a value, so I need:

      result = (Foo *) &amp;amp;Bar_Foo_get(arg1);

Does anyone know how to fix this?

Thanks
Marc



--
View this message in context: http://swig.10945.n7.nabble.com/Using-attribute-to-wrap-getter-setter-into-C-property-tp13271.html
Sent from the swig-user mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
&lt;/pre&gt;</description>
    <dc:creator>mtuckmantel</dc:creator>
    <dc:date>2013-06-03T14:47:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19688">
    <title>SWIG taking more time.</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19688</link>
    <description>&lt;pre&gt;Hi,

I am using a SWIG version swig-1.3.39.
We are using SWIG for making our PERL programmes use some of our C libraries.
But we found through OProfile (which is a tool, which lists the time taken by each functions.) that the interfaces to SWIG from perl are taking more time. The function is set_value and the C libraray is just setting a value in the structure and we pass only the structure pointer address and value from our PERL file.
This set_value function is taking over 70% of the time of the total stack flow
Is there a way of optimization ?

OR

Was this issue found in older versions and are fixed in new versions, because I saw the latest version was 2.0.14.
Please help me regarding this.


Regards
Manu

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>S, Manu (Manu</dc:creator>
    <dc:date>2013-06-03T11:54:40</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19687">
    <title>Is there a list of SWIG directives</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19687</link>
    <description>&lt;pre&gt;As I read through the pdf file for SWIG I run across several SWIG
directives. The problem is that they are scattered all through the document.
There is no single place that lists all the directives and gives a brief
description of what they do (as there is for the options). Does such a list
exist? I am sure that many new users are in my shoes; the project they have
is complicated (otherwise if I had a simple project I would do the PInvoke
to C# myself) and it will be necessary to invoke many of these directives to
make their projects work.

 

If anyone knows or has such a list I would be most grateful if you could
share it!

 

Thanks

 

Brian Reinhold

    LNI

    tel 603 868 8411 x207

    brianreinhold&amp;lt; at &amp;gt;lampreynetworks.com

 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Brian Reinhold</dc:creator>
    <dc:date>2013-06-01T12:02:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19684">
    <title>Unsuable SWIG varaibles</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19684</link>
    <description>&lt;pre&gt;I created my first SWIG *.i file in Visual Studio containing the following
class definition:

 

class CPPCM

{

public:

    CPPCM(char *shimPath, uint64 systemId);

    ~CPPCM();

 

    std::vector&amp;lt;std::string&amp;gt; GetTransportList(void);

    Transport *CreateTransport(char *shimName,
std::list&amp;lt;eDeviceSpecializationType&amp;gt; *listOfSpecializations, int *result);

};

 

But I got weird 'SWIG_*' variables types in the C# files that I could not
make any sense of for the variables:

 

uint64 (unsigned long long), std::vector&amp;lt;std::string&amp;gt;,
std::list&amp;lt;eDeviceSpecializationType&amp;gt;, and int *

 

All other relevant include files were available for the conversion. What did
I do wrong? I see that these are all classes involving IntPtr in the
generated files but I did not see such stuff in any of the generated files
in the examples I ran. The examples created nice clean classes with easy to
examine class methods. What sections in the document deal with this behavior
(I could not find any such sections or have not yet been able to piece
together all the sections to understand this behavior).

 

Sometimes I wish the examples were a little more complex; all of them are so
simple the *.i files always run the *.h file!

 

Brian Reinhold

    LNI

    tel 603 868 8411 x207

    brianreinhold&amp;lt; at &amp;gt;lampreynetworks.com

 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Brian Reinhold</dc:creator>
    <dc:date>2013-06-01T00:46:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.programming.swig/19683">
    <title>swigging template function for python</title>
    <link>http://comments.gmane.org/gmane.comp.programming.swig/19683</link>
    <description>&lt;pre&gt;Hi,

I am new to swig and wanted to make the function agf_calc_pdf from the 
following src/agf_pdf.cxx file available in python:

        #include "math.h"
        #define _USE_MATH_DEFINES

        struct agf_diag_param {
             unsigned int nd;    //number of squarings
             float f;            //ratio of min. weight to max.
             float W;            //total weight
        };

        template &amp;lt;class real, class index&amp;gt;
        real metric2(real *v1, real *v2, index m)
        {
             real d;
             real diff;

             d = 0;
             for (index i = 0; i &amp;lt; m; i++) {
                 diff = v2[i] - v1[i];
                 d += diff * diff;
             }
             return d;
        }

        template &amp;lt;class real, class index&amp;gt;
        unsigned int agf_calc_w(    real *d2,         //distances squared
                                     index k,       //number of distances
                                     real Wc,        //objective total
        weight
                                     real var[2],    //initial filter width
                                     real *weight,    //returned weights
                                     real &amp;amp;var_f)    //returned final
        filter variance
        {
             unsigned int nd;                  //number of squarings of
        the weights
             real tw_old;                 //previous value of the total
        weight
             real tw;                     //current value of the total
        weight
             real wtint;                  //for interpolation of final
        weights
             //calculate the weights:
             for (index i = 0; i &amp;lt; k; i++) weight[i] = exp( -d2[i] /
        var[1] / 2);
             //repeatedly square the weights until the total is less
        than the threshold:
             tw = 0;
             for (index i = 0; i &amp;lt; k; i++) tw += weight[i];
             nd = 0;
             do {
                 tw_old = tw;
                 tw = 0;
                 for (index i = 0; i &amp;lt; k; i++) {
                     weight[i] *= weight[i];
                     tw += weight[i];
             }
             nd++;
             } while (tw &amp;gt; Wc &amp;amp;&amp;amp; tw &amp;lt; tw_old);
             //interpolate between the current and previous weight:
             wtint = (log(tw_old) - log(Wc)) / (log(tw_old) - log(tw)) /
        2 + 0.5;
             //calculate the final filter width:
             var_f = var[1] / (1 &amp;lt;&amp;lt; nd) / wtint;
             tw = 0;
             for (index i = 0; i &amp;lt; k; i++) {
                 weight[i] = exp(-d2[i] / var_f / 2);
             }
             //return the number of iterations as a diagnostic parameter:
             return nd;
        }

        template &amp;lt;class real, class index&amp;gt;
        real agf_calc_pdf(    real **mat,
                             real *vec,
                             index D,
                             index n,
                             real var[2],
                             real Wc
                             )
        {
             real *d2;            //the distances (squared)
             real var_f;            //final value of the filter width
        (as variance)
             real tw;            //total weight
             real *weight;        //the current value for the weights
             real n1, norm;        //normalisation coeff.
             real pdf;            //final calculated value of pdf
             agf_diag_param* diag_param; // dummy output buffer
             //first we calculate all the distances:
             d2 = new real[n];
             for (index i = 0; i &amp;lt; n; i++) {
                 d2[i] = metric2(vec, mat[i], D);
             }
             //calculate the weights using the central "engine":
             weight = new real[n];
             diag_param-&amp;gt;nd = agf_calc_w(d2, n, Wc, var, weight, var_f);
             tw = 0;
             for (index i = 0; i &amp;lt; n; i++) tw += weight[i];
             //use the final filter width to normalize the pdf:
             n1 = sqrt( var_f * M_PI *2 );
             norm = 1;
             for (index i = 0; i &amp;lt; D; i++) norm *= n1;
             pdf = tw / norm /n;
             //set the diagnostic parameters:
             diag_param-&amp;gt;W = tw;
             delete [] d2;
             delete [] weight;
             return pdf;
        }


I wrote an interface file agf.i for the template function:

        %module agf
        %{
        struct agf_diag_param {
             unsigned int nd;    //number of squarings
             float f;           //ratio of min. weight to max.
             float W;           //total weight
        };

        template &amp;lt;class real, class index&amp;gt;
        real metric2(real *v1, real *v2, index m);

        template &amp;lt;class real, class index&amp;gt;
        unsigned int agf_calc_w(    real *d2,       //distances squared
                                     index k,       //number of distances
                                     real Wc,        //objective total
        weight
                                     real var[2],    //initial filter width
                                     real *weight,   //returned weights
                                     real &amp;amp;var_f);    //returned final
        filter variance

        template &amp;lt;class real, class index&amp;gt;
        real agf_calc_pdf(  real **mat,
                             real *vec,
                             index D,
                             index n,
                             real var[2],
                             real Wc
                             );
        %}

        template &amp;lt;class real, class index&amp;gt;
        real agf_calc_pdf(  real **mat,
                             real *vec,
                             index D,
                             index n,
                             real var[2],
                             real Wc
                             );

        %template(pdf) agf_calc_pdf&amp;lt;double, int&amp;gt;;


and finally a setup.py:

        #!/usr/bin/env python
        from distutils.core import setup, Extension
        module = Extension('_agf',
                            sources=['agf_wrap.cxx', 'src/agf_pdf.cxx'],
                            language="c++"
                            )
        setup (name = 'agf',
                ext_modules = [module],
                py_modules = ["agf"]
                )

Then I invoked swig via:

        swig -c++ -python agf.i

which runs without problems. python setup.py build_ext --inplace gives 
some warnings about unused variables, but nothing else.
I then import the generated agf.py and get an import error "ImportError: 
./_agf.so: undefined symbol: _Z12agf_calc_pdfIdiET_PPS0_S1_T0_S3_S1_S0_"

any ideas?

yours,

Kevin

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with &amp;lt;2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2_______________________________________________
Swig-user mailing list
Swig-user&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user
&lt;/pre&gt;</description>
    <dc:creator>Kevin Kunzmann</dc:creator>
    <dc:date>2013-05-31T18:00:13</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.programming.swig">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.programming.swig</link>
  </textinput>
</rdf:RDF>
