[aspectc-user] More demonstrations for applications of AspectC++?

Olaf Spinczyk os at aspectc.org
Mon Nov 21 17:23:45 CET 2011


Dear Markus,

I am not sure whether I really understood the two questions, but I'll do 
my best to answer...

On 10/27/2011 02:00 PM, Markus Elfring wrote:
>> We have a quite nice tutorial on writing Qt-applications with AspectC++:
>>      
> I am more interested in use cases like the following than your example about addition of a QLabel display for the call of the member function "app.exec()".
>
> 1. Filtering of calls for functions with non-void return types
>      Do you consider corresponding ways for the completion of error detection and exception handling currently?
>    

AspectC++ can filter function signatures so that only non-void functions 
are matched, e.g.

advice execution("% MyClasss::%(...)" && !"void MyClass::%(...)") : ...

or without redundancy

pointcut void_function() = "void ...::%(...)";
advice execution("% MyClasss::%(...)" && !void_function()) : ...

We have used this in an example in which we transformed C-style error 
codes into exceptions. If you are interested, read our ETAPS 2005 paper: 
http://www.aspectc.org/fileadmin/publications/etaps-sc-2005.pdf (can be 
found on the publications page at www.aspectc.org)

> 2. Interception of write accesses to document attributes
>      Is it possible to intercept accesses to model attributes (Gtk::TreeModel::ColumnRecord ⇒ Gtk::TreeModelColumn) from the class library "gtkmm"?
>    

At the moment this would only be possible if write accesses were 
guaranteed to be performed only by (interceptable) setter methods. 
AspectC++ has no set/get pointcut function. I'm sorry, but I don't know 
the internals of gtkmm.

Best regards,

Olaf




More information about the aspectc-user mailing list