[aspectc-user] Re: [aspectc-user] intercepting flow of executioRe: [aspectc-user] intercepting flow of execution of the method declaredinside aspect

Bartosz Blimke masb at chorwacja.com
Thu May 27 11:49:28 CEST 2004


> Here is an example of some working AspectC++ code that disables the
> advice for the execution of "func()" when "func()" was called from the
> aspect member function "run()".
>
> =======main.cc=========
> #include <stdio.h>
>
> void func () {
>    printf ("func\n");
> }
>
> int main () {
>    func ();
> }
>
> ====CFlowTest.ah========
> #ifndef __CFlowTest_ah__
> #define __CFlowTest_ah__
>
> aspect CFlowTest {
>    pointcut methods() = execution("% func()");
>
>    void run(AC::Action &action) {
>      action.trigger();
>    }
>
>    advice methods() && !cflow(execution("% CFlowTest::run(...)")) :
> around () {
>      run(tjp->action ());
>    }
>
> };
>
> #endif // __CFlowTest_ah__
>
> I hope that this is what you wanted to achieve. Please tell me if I'm
> wrong.
>

Hello Olaf,

Sorry, for not being clear in the first mail, I will try
next time to write more clear what I want.
This example that you wrote me is exactly what I want to use.
Anyway, I'm not able to compile it, I have still the same
compiling error. I'm using VC++ .NET 2003 with AspectC++ Add-In: 1.0.7
(Mar 19 2004) and that means ac++ ver 0.8.
Is this the problem of 0.8 version ?


Linking...
main.obj : error LNK2005: "public: __thiscall `private: void __thiscall
CFlowTest::run(struct AC::Action &)'::`3'::Trigger::Trigger(void)"
(??0Trigger@?2??run at CFlowTest@@AAEXAAUAction at AC@@@Z at QAE@XZ) already
defined in TestAspectProject_LinkOnce.obj
main.obj : error LNK2005: "public: __thiscall `private: void __thiscall
CFlowTest::run(struct AC::Action &)'::`3'::Trigger::~Trigger(void)"
(??1Trigger@?2??run at CFlowTest@@AAEXAAUAction at AC@@@Z at QAE@XZ) already
defined in TestAspectProject_LinkOnce.obj
Debug\TestAspectProject.exe : fatal error LNK1169: one or more multiply
defined symbols found


Greets,

Bartosz Blimke
Siemens AG, SE2
masb at chorwacja.com




More information about the aspectc-user mailing list