[aspectc-user] First post

Christian Henning chhenning at gmail.com
Mon Jul 17 03:25:00 CEST 2006


Hi there, I'm new here and would like to congratulate all for this
wonderful toolkit. I'm using the add-on for Visual Studio.
Installation was easy and all examples could be compiled and tested.

1) I have a couple of questions. To avoid asking for issues this
mailing list has already dealt with, where can I find the search
mailing list option?

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;
}

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" );
	}

};



I guess my example is very primitive and might be better solved
differently. But he, I just started with AOP and so try to bang on it.
Of course, if there is a better way just let me know.

Regards,
Christian



More information about the aspectc-user mailing list