../../AspectXLib/c/quickSort/aspects/comparisonCounter.axPointcuts | |
| block | allIfBlocks |
|
Points to all if blocks | |
Advices | |
| begin | beginOfIfBlock |
|
Increments the comparison counter for each comparison made | |
| add | addComparison definition |
|
Add comparisonCount declaration | |
| before | beforeTermination |
|
Outputs the number of comparisons
made by the algorithm, before the program exits | |
src:if element. The
if part is then identified by a src:then child element whereas the else
block is identified as a src:else child element. The
if part further can have a src:block child element which contains the block.
Hence if we identify all src:block elements with a parent element
src:then then we get all blocks of all if statements.
Note that if statements without blocks are not affected by weaving!
Triplet: block begin codeFragment
Refers to global pointcut: block allIfBlocks
Triplet: unit add declaration
comparisonCount declaration. Since there is
no weaving rule defined for adding a declaration
at the begin of a unit, the "add include"
weaving rule is used. This works just fine for now, as long
as the "inlude weaving rules" does not perform any tests
whether the added string is an include statement or not.
Local Pointcut: unit (source)
Triplet: return before codeFragment
within.
The instruction that is added to the code prints the value of the comparisonCounter variable.
Local Pointcut: return (source)