Fields

John Moeller <[email protected]>
Newsgroups gmane.comp.lib.boost.langbinding
Message-ID <[email protected]>
I noticed that in Boost.Python, you can define a class such as this that 
lets you wire fields into a Python class (from the Exposing Classes 
tutorial):

class_<Var>("Var", init<std::string>())
     .def_readonly("name", &Var::name)
     .def_readwrite("value", &Var::value);

It seems that it's possible to override field access in Python, and 
possibly other languages.  Because Langbinding will possibly connect to 
languages where this is not possible (such as Java) -- not without some 
kind of sync routine -- is there a plan to support these constructs in a 
reduced fashion, or would these constructs be removed?

I could see exposing some kind of get/setField, or some such, in lieu of 
the field access override.  Something like getName, getValue, and 
setValue might be made available in the above example for those 
languages, and languages like Python could still use them as fields.

-- 

John Moeller
[email protected]


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.