* wrapping c++ @ 2010-12-20 22:16 Joel Reymont 2010-12-21 19:59 ` [Caml-list] " ygrek 0 siblings, 1 reply; 2+ messages in thread From: Joel Reymont @ 2010-12-20 22:16 UTC (permalink / raw) To: caml-list Are there any recipes for wrapping a large C++ class that uses callbacks? I would like to implement the callbacks in OCaml for obvious reasons. Thanks, Joel --- http://twitter.com/wagerlabs ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] wrapping c++ 2010-12-20 22:16 wrapping c++ Joel Reymont @ 2010-12-21 19:59 ` ygrek 0 siblings, 0 replies; 2+ messages in thread From: ygrek @ 2010-12-21 19:59 UTC (permalink / raw) To: caml-list On Mon, 20 Dec 2010 22:16:44 +0000 Joel Reymont <joelr1@gmail.com> wrote: > Are there any recipes for wrapping a large C++ class that uses callbacks? All the same as C bindings. But using C++ features one can reduce the amount of boilerplate needed. E.g. see http://ygrek.org.ua/p/code/cxx_wrapped/cxx_wrapped.h for a simple template class to wrap C++ objects as ocaml custom values (bindings to non-trivial C++ lib will probably need wrapping smart_ptr's as well). Also simple tricks like RAII for blocking_section save some typing. But all in all it is the same manual translation. -- ygrek http://ygrek.org.ua ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-21 19:59 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-12-20 22:16 wrapping c++ Joel Reymont 2010-12-21 19:59 ` [Caml-list] " ygrek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox