Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] csound.hpp

Date2005-12-07 16:32
FromMichael Gogins
SubjectRe: [Cs-dev] csound.hpp
Why do you not want the glue functions in the virtual table?

I suspect the reason CsoundVST needs the virtual table is that it dynamically loads the library containing CppSound using LoadLibrary. The virtual function addresses are just offsets from the vtbl address, which is the same as the instance address. So the operating system does not need to fix up the function addresses.

Also, did it work on both Windows and Linux for you?

Regards,
Mike

-----Original Message-----
From: Istvan Varga 
Sent: Dec 7, 2005 10:08 AM
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] csound.hpp

On Wednesday 07 December 2005 15:49, Michael Gogins wrote:

> I should probably add, in CsoundVST, CsoundVST itself is not statically
> linked with the Csound API. CsoundVST loads Python, Python loads the Csound
> API and the CppSound class which inherits from the Csound API class, and
> then CsoundVST retrieves a global CppSound instance pointer from the Python
> object and calls functions off its virtual function table. Therefore,
> runtime polymorphism must be supported.
>
> I presume that either the Python wrapper worked for you after you made this
> change, or you did not test the Python wrapper after you made this change.
>
> If it did work for you, I would like to know more about that. I wonder if
> virtual function tables are required for this to work on Windows, but not
> on Linux.

Yes, it does work without virtual methods, both in Python and Java,
as far as using the Csound class in those languages is concerned
(I am aware that there may be problems with CppSound that is a
subclass of Csound, if virtual methods are assumed when CppSound.cpp
is compiled, but not when the SWIG swapper files are generated and
built). I do not know why Windows would be different (the way in which
SWIG handles inline member functions is not really platform dependent),
but if it is, then I will probably remove the new glue functions (that
I prefer not to be included in the virtual table) from the Csound class.

In fact I am not even sure why CsoundVST requires the virtual table
(assuming that it does not use some strange binary hacks), as long
as the declarations are consistent.

Also, does CsoundVST use the other classes (CsoundThreadLock, CsoundRandMT,
and CsoundTimer) ?


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel





-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-12-09 14:17
FromIstvan Varga
SubjectRe: [Cs-dev] csound.hpp
AttachmentsNone