Re: [Reflex] Adding support for attributes

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Thu, 24 Jan 2008 17:33:39 +0100


Hi Jean-Francois,

I really like the idea of generalizing (and defining) the attribute framework that we already have in place for ROOT. For me, the goals are

* versatility
* precision
* readability

Let me go through the different suggestions I have:

That boils down to the following syntax suggestion:

//@TYPE.TARGET:NS.KEY(VALUE)

So this
//@Member.MyFunc(int,void):ROOT.doc("a func")

and this
//@ROOT.doc("a func")

would be identical as long as the latter is right in front of the function declaration of MyFunc(). It would also allow e.g.

//@ROOT.doc("a func")
//@Param.a:ROOT.doc("input")
//@Param.b:ROOT.doc("output")
//@ReturnValue:ROOT.doc("nothing")

void MyFunc(int a, int& b)

Now - I can suggest this because I don't expect to be working on it any time soon :-) But it would be nice if we can come up with a syntax that is extensible in the future so some of this can be covered.

Does any of this make any sense to you?

Cheers, Axel.

On 2008-01-22 21:41, Jean-Francois Bastien wrote:

>> Correct.
>>
>> The first MS URL you sent talks about using attributes to 
>> indicate what features an object of some class has.  The 
>> example is a class stating it is serializable.  This use maps 
>> to interfaces well.  If the object can be dynamic_cast'ed to 
>> an "ISerializable" interface then you know it provides the 
>> needed features and you have a way to get them.

>
> I agree with you, but our code base already uses interfaces extensively.
> There is a need for annotations that interfaces can fill to some extent
> but which is much more troublesome and much less flexible. One important
> use is for tools: ideally they don't have instances of the types to work
> with, and they don't even know the types they're going to work with,
> it's the types that tell the tools what can be done with them. With
> interfaces I'd need to modify and recompile my tools for each new
> interface I create.
>
> The user code further needs to have member types deriving from an
> interface, even if it just wants a simple double as a member. With
> introspection and annotations the member can be a double and publish
> certain things without being a class.
>
>
> JF
>
>
Received on Thu Jan 24 2008 - 17:33:41 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 24 2008 - 23:50:01 CET