-----BEGIN PGP SIGNED MESSAGE----- Moin,
On Friday 05 March 2004 16:19, Tom Schindl wrote: > Tels wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > > > > Moin, > > > > On Friday 05 March 2004 11:23, Tom Schindl wrote: > >>Hi, > >> > >>how can I create an instance of a Perl-class in XS. > > > > I don't know (dont even understand the question properly). However, I > > could not define a C++ class in XS because apparently "class" is > > considered some keyword. :/ Does "CLASS" workaround this? > > Yes. And no :) It works around the problem in XS, but see this: /* ************************************************************************ */ /* To get events like mouse and keyboard input, or GUI events like "the OK button has been clicked", we need an object wich is derived from the IEventReceiver object. There is only one method to override: OnEvent. This method will be called by the engine when an event happened. */ class MyEventReceiver : public IEventReceiver { public: virtual bool OnEvent(SEvent event) { ..... return true; } }; Add this to an XS file at the top, and xsubpp will barf on it due to "class". Unfortunately, class is an C++ keyword, and I don't think you can just change it (because then the C++ compiler will barf). Hm, maybe using #define to trick xsubpp into not seeing it, but the g++ does? Anyway, just putting the class definition into another file would solve the problem. Oh, and this is not related to your problem at all. Cheers, Tels - -- Signed on Fri Mar 5 17:23:55 2004 with key 0x93B84C15. Visit my photo gallery at http://bloodgate.com/photos/ PGP key on http://bloodgate.com/tels.asc or per email. Marketing lesson #1: The synergy of the result driven leverage can *never* incentivize a paradigm shift. -- Walterk (124748) on 2004-01-16 at /. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2-rc1-SuSE (GNU/Linux) Comment: When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. iQEVAwUBQEiqg3cLPEOTuEwVAQHpmAf+KgwSLKjRbIMxM9mM7lo4jhSvSp9qsK2H pNDrlr98rfxnp5Ovs/qaXWok6U3FY6xjCrjvpMcuTrPdVRbrEVN7rcezHxoSHPvB xMwse8nLrv8zRuwiR8YbRXBC+qQaUMZmOYJw6eYeCWOg5zb8JnlnE5wi7zR78mJA viLgz4ZYrqgj5QBw3n5vgcMr5pod3KzIMTSHu8Eab6wGQBGPNG76b23sOEwmXxpt 7iDOPuZpkLOmZrTUfKVp2oaLk0Af2q14+Vwl6d4UC+UeNZwCwpK/x0ZNl23L5Imj p5FA0PpznzrggenYK97BSG3a/Hl5LBXuAjL6MmY3V9N8m4HgYQ128Q== =mqhC -----END PGP SIGNATURE-----