Version française
Home     About     Download     Resources     Contact us    
Browse thread
question about how to bind c++ classes to ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: micha <micha-1@f...>
Subject: question about how to bind c++ classes to ocaml

when binding an ocaml class  to a c++ class, what's the preferred
way to access member variables of the c++ class?
One is just to implement the get and set function in ocaml to call
the native get/set functions of the c++ class. That way you allways have
some calls from ocaml to c only to get a value of a c++ object.
Another way would be to add similar member variables to the ocaml class
and everytime the c++ side changes a member it updates the ocaml side
too (through direct access). This way you have an additional binding
(the c++ object knows it's ocaml object), but you can access the member
variables in ocaml through normal ocaml methods.

any comments?

 thanks,
 Michael