Re: Tcl -> C++ -> Metakit - how to bind to library?
[email protected] Thu, 3 Nov 2005 09:14:56 -0000 (GMT)
| Newsgroups | gmane.comp.db.metakit |
|---|---|
| Message-ID | <[email protected]> |
> [email protected] wrote: > >> I have an application where I want to use Metakit as a persistent >> object >> store for some C++ code that happens to be coded as a Tcl >> extension. The >> Tcl code itself has no requirements to directly access the Metakit >> database through mk::whatever calls. >> <snip> > If all you want is MK inside your C++ code, then by all means link to > the C++ dll or lib. It's like using any other C/C++ lib inside a > compiled Tcl extension and simply does not expose MK to Tcl. IOW, as > far as Tcl is concerned MK is an implementation detail of your > extension. > > If you do at some point wish to have access from Tcl, you can relink > to Mk4tcl, which includes the C++ API since it is purely a wrapper > around it. > > Memory management should not be an issue as long as all alloc's (new) > and free's (delete) are done in the same context. Don't free an > object from Tcl if it has been created from C++, and vice-versa. > > -jcw Thank you, Jean-Claude - I'll try the C++ binding route so I can learn a new way of doing things. Much appreciated, Gareth _____________________________________________ Metakit mailing list - [email protected] http://www.equi4.com/mailman/listinfo/metakit