[aspectc-user] calls to members through a pointer to member

Panu Bloigu panu.bloigu at gmail.com
Thu Nov 29 15:28:06 CET 2007


Daniel Lohmann wrote:
>> If this indeed is possible, and I'm doing something wrong, it would be 
>> interesting to hear how this feature is implemented. As far as I can 
>> see, weaver has to somehow gain awareness of the actual value (the 
>> pointed-to function/method) of a pointer-to-function/pointer-to-member 
>> to be able to tell the target of the call.
> Right, and this is the main reason ac++ we hesitate to support this. It 
> could lead to significant extra runtime costs, which is somewhat against 
> the AspectC++ philosophy.

Are you saying that you are not even planning to implement this feature?

I'm asking this because this isn't listed in the paper 'The design and 
implementation of AspectC++' published in Knowledge Based Systems, 
volume 20, issue 7, in the section titled 'Intentionally missing 
features'. This led me to think that the ability to trap calls occurring 
through a pointer would be either already implemented or at least on the 
drawing board.

Of course, I acknowledge the amount of necessary instrumentation that 
implementing this feature would require. However, I would think that at 
least, for example, pointcut function call("void %(int)") could catch 
calls to any function returning void and taking an int as the argument 
-- even if that call occurs through a pointer. I have a hunch that 
implementing this wouldn't cause too much run time expense, as the 
compile time type of a pointer-to-function contains the signature -- 
minus the function name, of course -- of the function that's to be 
called through that pointer.

-- Panu

More information about the aspectc-user mailing list