swig/Examples/test-suite/template_inherit_abstract.i
William S Fulton d6b81eb831 Revert rev 11187 "Merged with recent changes from trunk."
This reverts commit c595e4d90ebfd63eb55430c735bb121cf690bd59.

Conflicts:

	Source/Modules/c.cxx

From: William S Fulton <wsf@fultondesigns.co.uk>

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@13033 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-05-06 01:13:16 +00:00

68 lines
1.4 KiB
OpenEdge ABL

%module(ruby_minherit="1") template_inherit_abstract
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) oss::test; /* Ruby, wrong class name */
%warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE,
SWIGWARN_CSHARP_MULTIPLE_INHERITANCE,
SWIGWARN_D_MULTIPLE_INHERITANCE,
SWIGWARN_PHP_MULTIPLE_INHERITANCE) oss::Module; /* C#, D, Java, PHP multiple inheritance */
%inline %{
namespace oss
{
template <class C>
struct Wrap
{
};
struct ModuleBase
{
virtual ~ModuleBase() {}
virtual int get() = 0;
};
template <class C>
struct Module : C, ModuleBase
{
virtual ~Module() {}
protected:
Module() {}
};
template <class C>
struct HModule : Module<Wrap<C> >
{
// virtual int get(); // declaration here works
protected:
HModule() {}
};
}
struct B
{
};
%}
namespace oss
{
%template(Wrap_B) Wrap<B>;
%template(Module_B) Module<Wrap<B> >;
%template(HModule_B) HModule<B>;
}
%inline %{
namespace oss
{
#if defined(SWIG) && (defined(SWIGCSHARP) || defined(SWIGD))
%ignore HModule<B>::get(); // Work around for lack of multiple inheritance support - base ModuleBase is ignored.
#endif
struct test : HModule<B>
{
virtual int get() {return 0;} // declaration here breaks swig
};
}
%}