From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p9ABUZN6007854 for ; Mon, 10 Oct 2011 13:30:35 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjUBACvWkk7RVdi2kGdsb2JhbABDqA8IIgEBAQEJCQ0HFAQhgWwCLAEbHgMSCQddAREBBQEiLgeHY5dOglgKi1GCYIRQPYhvAgEDBoc9BId3hHGHD40mPYN0 X-IronPort-AV: E=Sophos;i="4.68,517,1312149600"; d="scan'208";a="112327487" Received: from mail-qy0-f182.google.com ([209.85.216.182]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Oct 2011 13:30:30 +0200 Received: by qyk4 with SMTP id 4so5742212qyk.6 for ; Mon, 10 Oct 2011 04:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=0+FB5phLOWH9j/cWV90hAWpYWp7t6D+PnVt9OYrh5Jw=; b=R8dnClEeyScewLGPABQfvwh3s6c66Ik7LAsBKLIsacxWRdBGx7X1ntbozVxfJro0Fs 0IKOPYOJn0KNli0wSGg6YSzWd08Wz2VbcApgfHWjyKzeJ6IxrkI/Yd2PV9VJ6gR4dFPR 3m2cEK+WQBgaPzWa+udDrpOyl3RKBhfLPdexY= MIME-Version: 1.0 Received: by 10.229.42.208 with SMTP id t16mr694077qce.135.1318246229233; Mon, 10 Oct 2011 04:30:29 -0700 (PDT) Received: by 10.229.95.198 with HTTP; Mon, 10 Oct 2011 04:30:29 -0700 (PDT) Date: Mon, 10 Oct 2011 15:30:29 +0400 Message-ID: From: Kakadu To: Caml List Content-Type: multipart/alternative; boundary=001636426873384ef004aef01e7d Subject: [Caml-list] [Lablqt] Map C++ classes to OCaml --001636426873384ef004aef01e7d Content-Type: text/plain; charset=ISO-8859-1 I'm going to implement inheritance of C++ classes in lablqt and I'm prototyping test example. Main idea is to wrap C++ classes by some another class, where all public methods are replaced on calls of caml methods (of course, any this wrapper classes has a pointer to OCaml object). When some method is called, OCaml code run and if this method was overriden then caml code runs, else runs call of C++ method. Known problems are: 1) test example crashes when it trys to call overriden method (it seems that it can't find it in table of virtual methods) 2) there are some problem if we try to override non-virtual methods. for example class A { public: void foo() { boo(); } void boo() {} }; If we override boo(), initial boo() wil be called ofter calling foo(). 3) Maybe will be some difficulties with overriding protected meths.... If problems are not obvious I'll describe them later. Btw, I've heared that there was same problems with creating binding for OClosure, but I've not understanded their realisation yet. I'll be glad if you can formulate more problems or recommend some solutions of some problems. Best wishes, Kakadu --001636426873384ef004aef01e7d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I'm going to implement inheritance of C++ classes in lablqt and I'm= prototyping test example.

Main idea is to wrap C++ classes by some another= class, where all public methods are replaced on calls of caml methods (of = course, any this wrapper classes has a pointer to OCaml object). When some = method is called, OCaml code run and if this method was overriden then caml= code runs, else runs call of C++ method.

Known problems are:
1) test example crashes when it trys to call ove= rriden method (it seems that it can't find it in table of virtual metho= ds)
2) there are some problem if we try to override non-virtual methods.= for example

class A {public:
=A0 void foo() { boo();= }
=A0 void boo() {}
};

If we = override boo(), initial boo() wil be called ofter calling foo().
3) Mayb= e will be some difficulties with overriding protected meths.... If problems= are not obvious I'll describe them later.

Btw, I've heared that there was same problems with creating binding= for OClosure, but I've not understanded their realisation yet.

= I'll be glad if you can formulate more problems or recommend some solut= ions of some problems.

Best wishes,
Kakadu


--001636426873384ef004aef01e7d--