[aspectc-user] argument capturing

Hans VB hans.vanbroeckhoven at telenet.be
Wed May 11 03:39:33 CEST 2005


Hi,

Jamal Siadat wrote:

>class A has the following method:
>
>int a(int i, float b);
>and it is callied during the program with the following values
>a(22, 44.1);
>I want to capture those calues and manupilate them in the advice, as
>mentioned I tried tjp->arg but it doesnt do the trick. How else can I go
>about this?
>
>the advice:
>advice execution("int A::a(...)") : around()  {
>  
>
advice execution("int A::a(...)") : around() {
    cout << "arg1 : " << *static_cast<int*>(tjp->arg(0)) << endl;
    cout << "arg2 : " << *static_cast<float*>(tjp->arg(1)) << endl;
}

should do the trick...
If you don't cast you get a 'dereferencing pointer to void' error.

Greets,
Hans




More information about the aspectc-user mailing list