[aspectc-user] Weaving in Macros
jstoppe at informatik.uni-bremen.de
Mon Jul 14 22:49:44 CEST 2014
Ah, that was it indeed. Thanks.
I did try it with wildcards though... I just tested it again and my
problem was that %sc_module does /not/ match the classes while
%::sc_module does. The documentation states that
"In such a search pattern the special character "%" is interpreted as a
wildcard for names or parts of a signature. The special character
sequence "..." matches any number of parameters in a function signature
or any number of scopes in a qualified name. A match expression is a
Especially the plural ("names" or "parts" of a signature) made me think
that the % wildcard could be used for more than a single name. Is there
a definition somewhere what exactly is matched by % and what isn't and
what the delta is to the ... wildcard? That'd be very helpful, thank you
Am 14.07.2014 20:16, schrieb Olaf Spinczyk:
> 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,
> Am 14.07.2014 17:44, schrieb Jannis Stoppe:
>> 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
> aspectc-user mailing list
> aspectc-user at aspectc.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the aspectc-user