[aspectc-user] Can I call proceed in a simple method

Fabian Scheler fabian.scheler at gmail.com
Wed Mar 7 21:47:34 CET 2007


As far as I remember you have to use a template class that is
specialized for the particular joinpoint class, like this (maybe I'm
missing some syntax details, so look them up in the manual to be
sure):

> __________________________________________________________
> code of aspect
>
>     pointcut executeTreat() = execution(" void Operations::treatAdd()");
>     advice executeTreat() : around() {
>       SomeClass *obj = SomeClass::getInstance();
>       obj->control_advice(tjp);
>     }

     advice executeTreat() : around() {
       SomeClass< JoinPoint > *obj = SomeClass< JoinPoint >::getInstance();
       obj->control_advice(tjp);
     }


> __________________________________________________________
> .h of a class
>
> #include <?????>
> class SomeClass  {
>     public:
>        void control_advice(?????);
> }
> __________________________________________________________
> .cc of a class

template < class TJP > class SomeClass  {
    public:
       void control_advice(TJP *tjp);
}


void SomeClass::control_advice(TJP *tjp){
    tjp->proceed();
}



More information about the aspectc-user mailing list