swig/Examples/test-suite/smart_pointer_extend.i
Marcelo Matus c5f1c1bdf9 more smart_pointer fixes + cases
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6844 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-12-07 23:32:11 +00:00

71 lines
916 B
OpenEdge ABL

%module smart_pointer_extend
%inline %{
namespace hi
{
struct CBase
{
static int hello()
{
return 1;
}
};
class CDerived : public CBase
{
};
class CPtr
{
public:
CDerived* operator->(void) {return 0;};
};
int get_hello(CPtr ptr)
{
return ptr->hello();
}
class CPtrConst
{
public:
CDerived* operator->(void) const {return 0;};
};
}
%}
%extend hi::CBase {
int foo(void) {return 1;};
int bar(void) {return 2;};
int boo(int i) {return i;};
}
%extend hi::CDerived {
int foo(void) {return 1;};
}
%extend Foo
{
int extension(int i, int j) { return i; }
int extension(int i) { return i; }
int extension() { return 1; }
}
%inline %{
struct Foo {
};
class Bar {
Foo *f;
public:
Bar(Foo *f) : f(f) { }
Foo *operator->() {
return f;
}
};
%}