#841 [python] Directors and -fvirtual

closed-fixed
5
2011-02-13
2007-07-24
No

Consider the following example:

============== test.i ================
%module(directors="1") test
%feature("director");

%{
#include "Class1.h"
%}

%include "Class1.h"

%{
#include "Class2.h"
%}

%include "Class2.h"
==================== Class1.h ============
class Class1 {
public:
Class1() {};

virtual ~Class1() {};

virtual void m1();
virtual void m2();
};
===================== Class2.h ============
class Class2 : public Class1 {
public:
void m1();
void m2();
};
=========== Swig command line ===============
swig -DPYTHON -module test -c++ -python -shadow -modern -dirprot -fastdispatch -fvirtual -o test_wrap.cpp test.i
================ End =====================

Note, that this will not create director code for Class2::m1 and Class::m2. Removing -fvirtual from the command line, creates the correct director code snippets.

This has been tested with swig-1.3.31 on Linux and Windows.

Discussion

  • Olly Betts

    Olly Betts - 2007-09-18
    • summary: Directors and -fvirtual --> [python] Directors and -fvirtual
     
  • William Fulton

    William Fulton - 2011-02-13

    Duplicate of 3171793 - which includes patch applied for swig-2.0.2.

     
  • William Fulton

    William Fulton - 2011-02-13
    • assigned_to: marcelomatus --> wsfulton
    • labels: 102864 --> code generation (general)
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks