[aspectc-user] Use of JoinPoint API in introductions
Olaf Spinczyk
Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Jul 8 09:58:43 CEST 2005
Hi,
Manuel Menezes de Sequeira wrote:
> Hi,
>
> I wonder whether it is possible to do something like:
>
> aspect CloneabilityGenerator {
> pointcut classesToMakeCloneable() = "Class1" || "Classe2"|;
>
> advice classesToMakeCloneable() :
> JoinPoint::??* clone() const {
> return new JoinPoint::??(*this);
> }
> };
>
> That is, is there access to the static context of an introduction?
This is a (long) planned feature, but it hasn't been implemented, yet: A
kind of Joinpoint API for Introductions. With this feature you could
replace "??" by "That" and your example would work. Lots of other
interesting things could be done, too.
... maybe during the semester break ...
> (By the way, is JoinPoint a template? It has static members which are
> different for each joinpoint.)
No, not exactly, if the advice code depends on the type JoinPoint, it is
transformed into a template function with the type JoinPoint as a
template parameter. For each JoinPoint a unique class is generated,
which is compatible with the JoinPoint-API, and passed as a template
argumente to the advice code.
Best regards,
Olaf
More information about the aspectc-user
mailing list