unit_add_definition.xsl
Weaving Rule that adds a definition to a unit.
- srcML element:
src:unit - advice type:
add - codeModifier type:
definition
The definition is always added at the end of the unit.
Example
#include <stdio.h>
void Foo:foo() {
printf("foo");
}
Code Modifier
<codeModifier type="definition">
<text>void Foo:foo1() {</text>
<text> printf("foo1");</text>
<text>}</text>
</codeModifier>Modified Code
#include <stdio.h>
void Foo:foo() {
printf("foo");
}
void Foo:foo1() {
printf("foo1");
}
Examples in AspectX Sample Library
- CarPostCondition
- CarPreCondition
- CarSynchronizeWindows
- Profiling
- AddGetterMethod
- AddComplexGetterMethod
- PassiveToCyclical
- PassiveToSporadic
- CarSynchronizeWindows
Examples in AspectX Test Suite
- AllFunctionDollarVariables
CVS Id:
Author:
ibirrer
Copyright:
2004, P&P Software GmbH
Match Templates Summary
src:unit[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='definition']] (mode: weaving) - source
Adds a definition to a unit
Match Templates Detail
src:unit[ax:advice[@type='add' and position() = 1]/ax:codeModifier[@type='definition']] (mode: weaving) - source
Adds a definition to a unit