[aspectc-user] Weaving in Macros
Olaf Spinczyk
os at aspectc.org
Mon Jul 14 20:16:53 CEST 2014
Hi!
It looks as if the signature of the base class is "sc_core::sc_module"
(and not "sc_module"). Therefore, derived classes can only be matched by
derived("sc_core::sc_module").
If you are not sure about how the signatures of your classes and
functions look like, e.g. because macros or fancy templates are
involved, compile your project and generate a project repository file
(-r option). It contains all signatures of all functions and classes of
your project. If you have that file (XML), you can use the -x option of
ac++ 1.2 to match pointcut expressions against the model elements on the
command line without having to compile the code.
BTW, derived("A") also matches "A" itself. If you don't want that, use
derived("A") && !"A".
Best regards,
Olaf
Am 14.07.2014 17:44, schrieb Jannis Stoppe:
> Hi.
>
> The website states "AspectC++ Release 1.1 is available at the Download
> page. It has a faster and much better parser and supports weaving in
> macro-generated code." Do I need to enable something to actually be able
> to accomplish that? This aspect:
>
> pointcut module() = derived("sc_module");
>
> advice construction(module()) : after()
> {
> std::cout << "instance created: ...\n";
> }
>
> Does nothing for instances that are created using the SC_MODULE macro...
> Which should be defined by SC_MODULE(user_module_name) struct
> user_module_name : ::sc_core::sc_module .
>
> Any idea what the problem might be? Thanks in advance.
> _______________________________________________
> 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