[aspectc-user] Several Questions

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Mon Oct 14 13:09:30 CEST 2002


Hi Dominik,

On Thursday 10 October 2002 15:25, you wrote:
> Dear All!
>
> Several questions concerning several topics:
>
> 1) callsto
> Is the "callsto"-keyword still valid in ac++?
> This
>   pointcut pc_ClassX_GETTER() = callsto("% ClassX::get%(...)");
> lets ac++ stop compilation with the error
>   error: Name `callsto' is undefined

callsto is mentioned in our papers, but not supported anymore. Do you have an 
example, where 'call' and 'execution' is not suficient?

> 2) Constructor-Tracing
> How to specify Object-Construction-Pointcuts?
> Only via constructors of inner introduced classes (as seen in
> examples/instances)?
>
> These
>   pointcut pc_ClassX_CONS() = call("% operator new(...)");
>   pointcut pc_ClassX_CONS() = call("% operator new()");
>   pointcut pc_ClassX_CONS() = call("% ClassX::ClassX()");
>   pointcut pc_ClassX_CONS() = call("% ClassX::ClassX(...)");
> do compile but do not bring the expected result.

Constructor tracing is not implemented yet. You can use the 'inner-function 
workaround' instead. One reason for this missing feature is that the weaving 
operation is a bit different for constructors than for ordinary functions. 
More important is the point that one constructor might call others. If a 
programmer just wants some code to be executed, which runs before an object 
of a certain class is instanciated, it is hard to declare advice in a way as 
you mentioned it above, because with "ClassX::ClassX(...)" there might be 
multiple advice code activations while with "ClassX::ClassX()" not every 
instantiation will be detected.

Concerning operator new you have found a bug. 'execution ("% operator 
new(...)")' works and call(...) should work as well. As a workaround for your 
problem you define your own 'operator new' and give advice for this. We will 
try to fix the problem as soon as possible.

Yours,

Olaf



More information about the aspectc-user mailing list