function_begin_codeFragment.xsl
Weaving Rule that weaves a code fragment at the beginning of a function.
The only thing this rule does is copying the advices to the src:block
element. The actual weaving is handled by block_begin_codeFragment.xsl
- srcML element:
src:function - advice type:
begin - codeModifier type:
codeFragment
Example
Base Code
int foo() {
printf("Hello");
}
Code Modifier
<codeModifier type="codeFragment">
<text>printf("Hello World")</text>
</codeModifier>Modified Code
int foo() {
printf("Hello World");
printf("Hello");
}
Examples in AspectX Sample Library
- CarBeginEnd
- CarPreCondition
- CarSynchronizeWindows
- TraceClassEntry
- TraceMethodEntry
- TraceMethodIntParameter
- TraceMethodIntParametersOnly
- TraceMethodLeave
- TraceMethodEntryUsingTracer
- Profiling
- ThreadSafety
- Entry
- CarSynchronizeWindows
- Trace
Examples in AspectX Test Suite
- AllFunctionBeginCodeFragment
- AllFunctionDollarVariables
CVS Id:
Author:
ibirrer
Copyright:
2004, P&P Software GmbH
Match Templates Summary
Template for the function block
src:function[ax:advice[@type='begin' and position() = 1]/ax:codeModifier[@type='codeFragment']] (mode: weaving) - source
Apply tempates with mode
to all (excludig advice elements) child elements
Match Templates Detail
Default copy template
Parameters:
node-set advices - Advices which should be copied to the src:block element.
Template for the function block
Parameters:
node-set advices - Advices which should be copied to the src:block element.
src:function[ax:advice[@type='begin' and position() = 1]/ax:codeModifier[@type='codeFragment']] (mode: weaving) - source
Apply tempates with mode
to all (excludig advice elements) child elements