[aspectc-user] Aspectc++ and Symbian?

Daniel Lohmann daniel.lohmann at informatik.uni-erlangen.de
Tue Apr 27 15:45:49 CEST 2004

gyula.kun-szabo at nokia.com wrote:

>Has anybody tried to use aspectc with symbian os 6.1 or 7.0s?
>I would like know your experiences.
Hi Gyula,

I personally have no experience in developing for Symbian or using the 
available SDKs. However, I did a short test with the "HelloWorld" 
example from the Symbian 7.0s SDK, VisualStudio.NET 2003 and the 
AspectC++ AddIn for VisualStudio. I used the abld command to generate a 
VC6 workspace and opened this with VC7.1. It worked quite well, I had to 
do only some slight modifications:

- The path for "Intermediate files" in the project settings was an 
absolute path, while the ac++ AddIn expects a relative path from the 
project directory here. So I simply changed it..

- I wrote a simple aspect that gives advice to the "LOCAL_C void 
doExampleL()" function:

#ifndef __ACTEST_AH__
#define __ACTEST_AH__
#include <e32base.h>
#include <e32cons.h>

extern CConsoleBase* console; // write all your messages to this

aspect ACTest {
    advice execution( "% doExampleL(...)" ) : before() {
        _LIT(KHelloWorldText,"Hello from Aspect\n");

- The weaver had some problems to match the pointcut because of the 
"LOCAL_C" macro in front of the "doExampleL()" definition.
As "LOCAL_C" is defined as "static", I just replaced the macro by its 
meaning and everything worked fine. I executed the resulting 
"HelloWorld.exe" in the simulator and the aspect output appeared.

- To have access to the "console" object from within the aspect I moved 
it's definition from the "commonframework.h" header to the 
"helloworld.cpp" file and defined it as non-static. (The idea of 
defining these things in a header looks  somewhat strange to me anyway.)

So finally, there seem to be no parser problems with the Symbian header 
files, which are good news. I am pretty sure the LOCAL_C macro problem 
of the weaver wiill be fixed in the next release. For production builds 
some work is  necessary to integrate ac++ into the tool chain, as they 
are built with g++ and generated makefiles. However, this shouldn't be 
that difficult.

Hope that helps


More information about the aspectc-user mailing list