[aspectc-user] Vocabulary question
David Come
davidbrcz at gmail.com
Sat Jun 13 14:56:28 CEST 2009
Hi all.
I've a simple and dummy question about vocabulary.
There is a simple code:
//a.h
aspect Trace
{
advice execution("% foo(...)"): before()
{
std::cout<<"Before foo"<<std::endl;
}
};
//=========================
//a.cpp
#include <iostream>
void foo(int i){std::cout<<"foo/int: "<<i<<std::endl;}
void foo(const std::string& s){std::cout<<"foo/string: "<<s<<std::endl;}
int main()
{
foo(4);
foo("Hi World");
return 0;
}
In this exemple , we have:
2 joins points: void foo(int){} and void foo(const std::string& s){}
1 pointcut: (call("% foo(...)") composed by 1 pointcut expression (call("%
foo(...)"))
If the advice had been advice call("% ...::foo(...)") && within("A"):
before(), we would have had:
The same joints points
1 poincut composed by 2 poincut expression call("% ...::foo") and
within("A") which are bind by &&.
Am I right ?
Thanks.
David Côme.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20090613/a028c305/attachment.html>
More information about the aspectc-user
mailing list