From: Nitro <ni...@dr...> - 2007-02-06 17:52:48
|
Am 06.02.2007, 18:19 Uhr, schrieb Vaillant Etienne <eva...@an...= >: > >> >> Sure, just add something like this >> >> %pythonappend Toto::Toto >> %{ >> post_action(self) >> %} >> > > It is good but I need to do is for perl and php but perlappend and > phpappend don't exist. There is any solution for php and perl ? I think you could %ignore the default constructor of Toto and use = something like %extend Toto { Toto() { Toto* result =3D new Toto; post_action(result); return result; } } This is not tested and I have no clue if it works (especially %ignore = + %extend). A simpler approach that would work is to define a helper function like %inline %{ Toto* createToto() { Toto* result =3D new Toto; post_action(result); return result; } %} and then instead of doing t =3D mymodule.Toto() you would ask your users to do t =3D mymodule.createToto() |