From: Pecevski D. <de...@ig...> - 2009-05-08 09:05:10
|
Hi Chris, The reason why the templates that are used as parameters in another template need to be included in the file holding the definition of the particular template is related to the way Py++ generates code and some optimizations that we made in order to speed-up the compilation of py++ generated files. However, in the newer versions of Py++ (0.9.0 and above) additional flexibility was added that allows one to specify the include files for each exported declaration separately during the code generation process. I've used this new feature to fix the reported problem with the inclusion of the files. You can check out the fixed version from the repository. Cheers, Dejan Chris Nolan wrote: > Hi all, > > I've just been writing a new synapse class, and ran in to a few > templating issues. I appreciate the flexibility of the Generic* design, > however I'm having problems with it and the current PCSIM / python build > system. > > I created a new generic synapse type, originally intending to have it > substitute the GenericStaticSpikingSynapse in a few of my own custom > synapse classes. However it seems that when building the python > objects, they require explicit #includes of the classes that will be > passed as template parameters. For those classes that are being passed > as template parameters to my class, e.g. > > typedef GenericMySpikingSynapse< GenericCurrentBasedSpikingSynapse< > ExponentialDecaySpikeResponse > > GenericMySpikingSynapseType > > I can just include the appropriate headers in my class header, which is > not elegant, but is a workaround. However the next step is problematic, > as I want to use my class as a template parameter to existing classes, > e.g. > > typedef GenericFroemkeDanStdpSynapse< GenericEachPairStdpSynapse< > GenericMySpikingSynapseType > > GenericMyFroemkeDanStdpSynapseType > > so I need to add my class header to existing framework class headers, > which starts to get quite messy. > > Now I realise that you (the designers that is) undoubtedly know all > this, as you've done that very thing in your own classes. I guess my > question is, is there any nicer workaround anyone can think of than > modifying the existing objects, or are there any build system / > structural changes happening that will alleviate this problem? I don't > understand the complete python <-> c++ architecture, so I'm not sure how > deep the problem lies. > > Cheers, > Chris. > > > ------------------------------------------------------------------------------ > Register Now & Save for Velocity, the Web Performance & Operations > Conference from O'Reilly Media. Velocity features a full day of > expert-led, hands-on workshops and two days of sessions from industry > leaders in dedicated Performance & Operations tracks. Use code vel09scf > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf > _______________________________________________ > Pcsim-users mailing list > Pcs...@li... > https://lists.sourceforge.net/lists/listinfo/pcsim-users > -- _______________________________________________ Dejan Pecevski Institute for Theoretical Computer Science Graz University of Technology Inffeldgasse 16b, A-8010 Graz, Austria Tel. +43 316 873 5849 |