[aspectc-user] if(...) in pointcut-expressions

Fabian Scheler fabian.scheler at gmail.com
Wed Jun 22 20:27:58 CEST 2005


Hi,

I don't know if such a pointcut-function is planned for future
releases of AspectC++, but what is wrong with:

> aspect foo {
>     bool flag;
>     pointcut bar() = call("% %::func()") && if(flag);
> 
>     advice bar() : after() {
         if(flag) {
           // advice stuff
         }
>     }
> 
>     advice ... : after() {
>        // manipulation of flag
>     }
> 
> };

or maybe the cflow() pointcut-function allows a proper solution for
your problem, too.

Ciao, Fabian




More information about the aspectc-user mailing list