Open tarun550 opened 7 years ago
nbind
currently has somewhat different kind of value objects explained under using objects. If your C++ class has a fromJS
function taking a callback, JavaScript class has a fromJS
function taking a callback and you call binding.bind
to unite them, then you can pass the objects by value between languages.
The only getter/setter code needed then is a single function in both languages to pass all class members to a callback. Of course this is practical only if there is a small number of them.
A .field
method is planned, but not yet implemented.
Thanks for the update. Should I closed this issue or keep it opened until the method is implemented?
Embind has a concept of value_objects which allow us to define "fields" of simple structs.
Is there a similar concept in nbind?
I did see a "filed" macro, but there is no mention of it in the documentation. Basically I wish to avoid adding getter/setter code to my existing code base.