added a reference polymorphic return type case, and

some extra test for the Java side.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5596 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2003-12-24 06:53:47 +00:00
commit ac011192ae
3 changed files with 41 additions and 0 deletions

View file

@ -16,12 +16,18 @@
{
virtual ~NNumber() {};
virtual NNumber* copy() const = 0;
virtual NNumber& ref_this()
{
return *this;
}
NNumber* nnumber()
{
return this;
}
};
/*
@ -57,8 +63,14 @@
return new NInt(val);
}
virtual NInt& ref_this()
{
return *this;
}
/* See below */
static NInt* narrow(NNumber* nn);
private:
int val;
@ -85,6 +97,11 @@
return new NDouble(val);
}
virtual NDouble& ref_this()
{
return *this;
}
/* See below */
static NDouble* narrow(NNumber* nn);