[OCaml] Fix member var getters and setters
Add `membervariableHandler()` to the `OCAML` class in ocaml.cxx (it is partly based on the code in python.cxx and octave.cxx). In Lib/ocaml/class.swg, wrapped classes/structs were not being added to `class_master_list`. This is fixed by adding a call to `register_class_byname`. Add a unit test in the form of struct_value_runme.ml.
This commit is contained in:
parent
0c4491eaae
commit
4a912668fc
4 changed files with 40 additions and 19 deletions
|
|
@ -56,6 +56,7 @@ begin
|
|||
(fun mth arg -> invoke_inner raw_ptr mth arg)
|
||||
end
|
||||
|
||||
let _ = register_class_byname "$realname" create_$classname_from_ptr
|
||||
let _ = Callback.register
|
||||
"create_$normalized_from_ptr"
|
||||
create_$classname_from_ptr
|
||||
|
|
|
|||
|
|
@ -155,5 +155,5 @@ let _ = Callback.register "swig_set_type_info" set_type_info
|
|||
let class_master_list = Hashtbl.create 20
|
||||
let register_class_byname nm co =
|
||||
Hashtbl.replace class_master_list nm (Obj.magic co)
|
||||
let create_class nm arg =
|
||||
let create_class nm =
|
||||
try (Obj.magic (Hashtbl.find class_master_list nm)) with _ -> raise (NoSuchClass nm)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue