[aspectc-user] introductions into sourcefiles

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Fri Jan 27 11:46:16 CET 2006


Hello Martin,

here is an example:

aspect Foo {
   // introduction of the declaration into the class Body of Bar
   advice "Bar": void func();
};

// introduction of the implementation, e.g. into Bar.cc
advice "Bar" : void Foo::func() { ... }

Note that the aspect name "Foo" in "Foo::func" will be replaced by the 
target class name "Bar" in the generated code.

These "non-inline function introductions" only work if the target class 
already has a non-inline member function or a static data member, 
because the introduced non-inline function will be inserted into the 
same translation unit. If there is no such member, ac++ will stop with 
an error message.

It is rather likely that the *syntax* of non-inline introductions will 
change in one of the next ac++ releases. However, the feature will remain.

- Olaf


Martin Kuhlemann wrote:
> Hello,
> 
> is there a way to force AspectC++ to divide method-introductions into 
> header and sourcefile?
> My code is only compilable by the C++-compiler after I manually put the 
> introduced methods from the headerfile into the cc-file.
> 
> Thank you and best Regards.
> Martin
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user




More information about the aspectc-user mailing list