Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Luca de Alfaro <luca@dealfaro.org>
To: Inria Ocaml Mailing List <caml-list@inria.fr>
Subject: How to wrap around C++?
Date: Sun, 7 Feb 2010 18:13:42 -0800	[thread overview]
Message-ID: <28fa90931002071813k7330ad34s7a2ec8b4cf1c3d11@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

I need to be able to call some C++ functions from my Ocaml code.
Can someone point me to some examples on how this is done?  Is it an issue
if what I need to wrap is C++, rather than the more standard C?

I also would like to know if I can do something more complex... namely, I
would like to create a C++ object, and return it to Ocaml.
Ocaml then needs to be able to call methods of that object.  The object does
not need to be directly accessible from Ocaml, but it needs to be
persistent, so that all Ocaml calls refer to the same object.

Essentially, the C++ object implements access to a file via some
compression, etc, mechanism.  In C++, one creates the object, calls write
and read methods, calls the method for closing the file, and deletes the
object.

How can I wrap around such an object in Ocaml?  Is it possible?  Any
advice?

Many thanks,

Luca

[-- Attachment #2: Type: text/html, Size: 1031 bytes --]

             reply	other threads:[~2010-02-08  2:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  2:13 Luca de Alfaro [this message]
2010-02-08  4:06 ` Michael Ekstrand
2010-02-08  4:17   ` Michael Ekstrand
2010-02-08 16:03   ` [Caml-list] " Luca de Alfaro
2010-02-08 16:33     ` Luca de Alfaro
2010-02-08 17:44       ` Guillaume Yziquel
2010-02-08 17:57         ` Luca de Alfaro
2010-02-09  6:53         ` Basile STARYNKEVITCH
2010-02-08 17:54     ` Guillaume Yziquel
2010-02-09  0:25     ` Michael Ekstrand
2010-02-08 12:38 ` [Caml-list] " Guillaume Yziquel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28fa90931002071813k7330ad34s7a2ec8b4cf1c3d11@mail.gmail.com \
    --to=luca@dealfaro.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox