From: cfis <cf...@us...> - 2006-03-07 19:44:25
|
Update of /cvsroot/swig/SWIG/Examples/test-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22144 Modified Files: li_factory.i Log Message: Added test for non-static method. Index: li_factory.i =================================================================== RCS file: /cvsroot/swig/SWIG/Examples/test-suite/li_factory.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** li_factory.i 22 Feb 2006 18:42:20 -0000 1.1 --- li_factory.i 7 Mar 2006 19:44:21 -0000 1.2 *************** *** 3,7 **** %newobject Geometry::create; ! %factory(Geometry *Geometry::create, Point, Circle); %inline { --- 3,11 ---- %newobject Geometry::create; ! ! %newobject Geometry::clone; ! %factory(Geometry *Geometry::clone, Point, Circle); ! %factory(Geometry *Point::clone, Point, Circle); ! %factory(Geometry *Circle::clone, Point, Circle); %inline { *************** *** 15,18 **** --- 19,23 ---- virtual int draw() = 0; static Geometry *create(GeomType i); + virtual Geometry *clone() = 0; }; *************** *** 20,23 **** --- 25,29 ---- int draw() { return 1; } double width() { return 1.0; } + Geometry *clone() { return new Point(); } }; *************** *** 25,28 **** --- 31,35 ---- int draw() { return 2; } double radius() { return 1.5; } + Geometry *clone() { return new Circle(); } }; *************** *** 36,37 **** --- 43,45 ---- } + |