[aspectc-user] First post
Pavlo Korzhyk
pavlo.korzhyk at gmail.com
Wed Jul 19 18:53:47 CEST 2006
I didn't try it, but I've seen a similar problem here - in addition to
"construction" & "destruction"
you must also write a constructor and destructor. Aspects do not affect
functions that are not present in
your code (default constructor etc).
On 7/17/06, Fabian Scheler <fabian.scheler at gmail.com> wrote:
>
> > 2) Why is the following not working?
> >
> > Hello.ah
> >
> >
> > aspect Hello {
> > pointcut A_constructed() = "% A::A(...)";
> >
> > advice execution(A_constructed()) : after () {
> > std::printf("An object of type A is constructed.\n" );
> > }
> > };
> >
> >
> > main.cpp
> >
> > class A {};
> >
> >
> > int main () {
> >
> > A a;
> >
> > return 0;
> > }
>
> you have to use the "construction" pointcut function
>
> > 3) When trying to intercept with the destructor the AOP compiler
> > doesn't like the ~ in the pointcut string?
> >
> > aspect Hello {
> > pointcut A_constructed() = "% A::A(...)";
> > pointcut A_destructed() = "% A::~A(...)";
> >
> > advice execution(A_constructed()) : after () {
> > std::printf("An object of type A is constructed.\n" );
> > }
> >
> > advice execution(A_destructed()) : after () {
> > std::printf("An object of type A is destructed.\n" );
> > }
> >
> > };
>
> you have to use the "destruction" pointcut function
>
> Ciao, Fabian
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
>
--
WBR, Pavlo Korzhyk
ICQ#155870780
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20060719/a800dddf/attachment.html>
More information about the aspectc-user
mailing list