The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6fcc22a1f8
commit
516036631c
1508 changed files with 125983 additions and 44037 deletions
|
|
@ -16,18 +16,18 @@ print " Created square $s\n";
|
|||
|
||||
# ----- Access a static member -----
|
||||
|
||||
print "\nA total of $example::Shape_nshapes shapes were created\n";
|
||||
print "\nA total of $example::Shape::nshapes shapes were created\n";
|
||||
|
||||
# ----- Member data access -----
|
||||
|
||||
# Set the location of the object
|
||||
# Set the location of the object.
|
||||
# Note: methods in the base class Shape are used since
|
||||
# x and y are defined there.
|
||||
|
||||
$c->{'x'} = 20;
|
||||
$c->{'y'} = 30;
|
||||
|
||||
# Now use the same functions in the base class
|
||||
$s->{'x'} = -10;
|
||||
$s->{'y'} = 5;
|
||||
$c->{x} = 20;
|
||||
$c->{y} = 30;
|
||||
$s->{x} = -10;
|
||||
$s->{y} = 5;
|
||||
|
||||
print "\nHere is their current position:\n";
|
||||
print " Circle = (",$c->{x},",", $c->{y},")\n";
|
||||
|
|
@ -41,17 +41,16 @@ foreach $o ($c,$s) {
|
|||
print " area = ", $o->area(), "\n";
|
||||
print " perimeter = ", $o->perimeter(), "\n";
|
||||
}
|
||||
# Notice how the Shape_area() and Shape_perimeter() functions really
|
||||
# invoke the appropriate virtual method on each object.
|
||||
|
||||
# ----- Delete everything -----
|
||||
|
||||
print "\nGuess I'll clean up now\n";
|
||||
|
||||
# Note: this invokes the virtual destructor
|
||||
|
||||
$c->DESTROY();
|
||||
$s->DESTROY();
|
||||
|
||||
print $example::Shape_nshapes," shapes remain\n";
|
||||
print $example::Shape::nshapes," shapes remain\n";
|
||||
print "Goodbye\n";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue