I've been doing this dynamically. I define the message class in MyClass.h
and MyClass.cc (using Ptolemy's IntVecData class as a template). Note:
Because I'm using Linux, I have to put all the member definitions in the .h
file, and the only lines in the .cc file are
______________________
#ifdef __GNUG__
#pragma implementation
#endif
#include "MyClass.h"
_______________________
I believe this is a gnu g++ bug.
Then I include MyClass.h & MyClass.cc in the star's .pl file. I load the
star with Shift-L. If I change the MyClass files, I delete all the files
that were created when I compiled my star (eg. SDFStar.cc, SDFStar.h,
SDFStar.o... .o is the most important to delete) leaving only the
SDFStar.pl file. Then from Ptolemy I re-compile my star with Shift-L.
One important point is that if I make any changes to MyClass, I find all
stars with references to the class using
nm -o *.o | grep MyClass
and delete all their files except the .pl files, and recompile them as well.
For this reason, it's not good to use the message class in a lot of stars
until you feel you won't be changing it.
Hope this helps.
Beth Savoy
Corning, Inc
[EMAIL PROTECTED]
> ----------
> From: Thomas Wuensche[SMTP:[EMAIL PROTECTED]]
> Reply To: [EMAIL PROTECTED]
> Sent: Saturday, March 20, 1999 2:07 PM
> To: [EMAIL PROTECTED]
> Subject: Questions about dynamically loading a star
>
> Dear Ptolemy developers,
>
> The stars I'm about to write need a custom message type.
> I would like to dynamically load these stars. Is it pos-
> sible to dynamically load the code defining the message
> type, too? Or do I need to statically build the message
> type code into Ptolemy?
>
> And one more question: During development it would be
> helpful to be able not only to load a star dynamically,
> but also unload it. This would allow to use a new version
> of the star without shutting down Ptolemy (what I do now).
> Is there a possibility to unload a dynamically loaded star?
>
> Thanks for your help,
>
> Thomas Wuensche
> -------------------------------------------------------
> EMS Dr. Thomas Wuensche
> Phone: +49-8441-490260
> Fax +49-8441-81860
>
> Visit also our web-site at http://www.ems-wuensche.com/
> -------------------------------------------------------
>
> --------------------------------------------------------------------------
> --
> Posted to the ptolemy-hackers mailing list. Please send administrative
> mail for this list to: [EMAIL PROTECTED]
>
----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list. Please send administrative
mail for this list to: [EMAIL PROTECTED]