Identifying methods with a specified Id in D [migrated]
- by Ekyo777
I want to have specific methods with a specific pattern recognized at compile time and registered along with a specified id trough mixins in a parent class.
ex.:
take a method 'X' from a class with a predetermined id:5, what I want is that, in a mixin in a parent class, method X will be registered as a delegate with its id to be called later on by its id.
What would be the best way to specify the Id considering I want the id to be of type int and only the specified methods to be registered?
should I (if it is even possible) do it with a custom annotation pretty much like the @property but with an argument, like:
@autoregister(id)
void method(...)
if it is possible to do it this way, an example or a link to the documentation on how to do it would be nice since I didn't find it in the documentation.