we've just open sourced a small module ("accessors") that helps
to generate getters and setters automatically:
It takes advantage of the UDAs and mixins. A simple example would
private int num_;
It would generate 2 methods "num": one to set num_ and one to get
its value. Of cause you can generate only @Read without @Write
and vice versa. There are some more features, you can find the
full documentation in the README.
"GenerateFieldAccessors" mixin should be added into each
class/struct that wants to use auto generated accessors.