~ubuntu-branches/ubuntu/jaunty/aspectc++/jaunty

« back to all changes in this revision

Viewing changes to AspectC++/doc/LanguageReference/LanguageReference.lyx

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-07-07 14:41:02 UTC
  • mfrom: (1.1.3 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080707144102-lzml7t07f3sl00r5
Tags: 1.0pre4~svn.20080711-1
* new upstream snapshot.
* include all upstream documentation. Clarifying emails regarding
  licensing has been included into debian/copyright.
* reformat description following recomendations of
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Description
  (Closes: #480316)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#LyX 1.4.3 created this file. For more info see http://www.lyx.org/
 
2
\lyxformat 245
 
3
\begin_document
 
4
\begin_header
 
5
\textclass article
 
6
\begin_preamble
 
7
%--------------------------------------------------------------------
 
8
% PDF related
 
9
%--------------------------------------------------------------------
 
10
\newif\ifpdf 
 
11
\ifx\pdfoutput\undefined 
 
12
  \pdffalse                     % we are not running PDFLaTeX 
 
13
\else 
 
14
  \pdfoutput=1                % we are running PDFLaTeX 
 
15
  \pdftrue 
 
16
\fi
 
17
 
 
18
%--------------------------------------------------------------------
 
19
% setup hyperref
 
20
%--------------------------------------------------------------------
 
21
\ifpdf
 
22
  \usepackage{color}
 
23
  \pagecolor{white}
 
24
  \usepackage{hyperref}  
 
25
  \hypersetup{% 
 
26
    %
 
27
    %% general document information
 
28
    pdftitle          = {AspectC++ Language Reference}, 
 
29
    pdfsubject     = {Dokumentation}, 
 
30
    pdfkeywords  = {AOP, AspectC++, pure-systems}, 
 
31
    pdfauthor      = {\textcopyright\ pure-systems GmbH and Olaf Spinczyk}, 
 
32
    pdfcreator     = {\LaTeX\ with package \flqq hyperref\frqq},
 
33
    pdfproducer  = {pdfTeX-0.\the\pdftexversion\pdftexrevision},
 
34
    %
 
35
    %% document style
 
36
    colorlinks=true,                  % colored link
 
37
    urlcolor=blue,                    % blue URL links
 
38
    bookmarks=true,                % generate bookmarks
 
39
    bookmarksnumbered=true,  % generate section numbers
 
40
    pdfpagemode=None           % don't open bookmarks
 
41
  } 
 
42
  
 
43
  %% set document creation date to 10.7.2003 00:00
 
44
  \pdfinfo {/CreationDate (D:20051206000000)}
 
45
\fi
 
46
 
 
47
%--------------------------------------------------------------------
 
48
% create hyperrefs depending on the use of pdflatex
 
49
%--------------------------------------------------------------------
 
50
\newcommand\depref[2]{%
 
51
  \ifpdf
 
52
    \href{#1}{#2}
 
53
  \else  
 
54
    {#2}
 
55
  \fi
 
56
}
 
57
 
 
58
%--------------------------------------------------------------------
 
59
% setup pure-systems style
 
60
%--------------------------------------------------------------------
 
61
\usepackage{floatflt}
 
62
\usepackage{../styles/pure-systems}
 
63
\doctype{Documentation:}
 
64
\credit{
 
65
  \noindent\small{(c) 2002-2005 Olaf Spinczyk and pure-systems GmbH\\All rights reserved.}}
 
66
\pslogo{
 
67
  \resizebox{6cm}{!}{\includegraphics{../images/ps-logo}}}
 
68
\otherlogo{
 
69
  \resizebox{4cm}{!}{\includegraphics{../images/ac++logo}}}
 
70
\sloppy
 
71
\remark{
 
72
  \small{(c) 2002-2005 Olaf Spinczyk$^1$ and pure-systems GmbH$^2$\\~\\
 
73
$^1$\depref{mailto:os@aspectc.org}{os@aspectc.org}\\
 
74
\depref{http://www.aspectc.org}{www.aspectc.org}\\~\\
 
75
$^2$\depref{mailto:aspectc@pure-systems.com}{aspectc@pure-systems.com}\\
 
76
\depref{http://www.pure-systems.com}{www.pure-systems.com}\\
 
77
Agnetenstr. 14\\
 
78
39106 Magdeburg\\
 
79
Germany
 
80
}}
 
81
\version{1.6, \today}
 
82
 
 
83
%--------------------------------------------------------------------
 
84
% place footnotes at the bottom of the page
 
85
%--------------------------------------------------------------------
 
86
\renewcommand\footnoterule{%
 
87
  \vfill
 
88
  \kern-3\p@
 
89
  \hrule\@width.3\columnwidth
 
90
  \kern2.6\p@}
 
91
 
 
92
%--------------------------------------------------------------------
 
93
% leave less than one and a half space between lines
 
94
%--------------------------------------------------------------------
 
95
\setstretch{1.15}
 
96
 
 
97
%--------------------------------------------------------------------
 
98
% 'list of examples' environment
 
99
%--------------------------------------------------------------------
 
100
\newcommand\examplesname{List of Examples}
 
101
\newenvironment{examples} 
 
102
  {\section*{\examplesname}% 
 
103
   \@mkboth{\MakeUppercase\examplesname}% 
 
104
                 {\MakeUppercase\examplesname}% 
 
105
   \thispagestyle{plain}
 
106
   \parindent\z@ \parskip\z@ \@plus .3\p@\relax} %
 
107
  {\clearpage}
 
108
 
 
109
%--------------------------------------------------------------------
 
110
% environment 'comment' 
 
111
%--------------------------------------------------------------------
 
112
\usepackage{comment}
 
113
 
 
114
%--------------------------------------------------------------------
 
115
% add 'Index' to table of contents 
 
116
%--------------------------------------------------------------------
 
117
\let\old@theindex\theindex
 
118
\def\theindex{
 
119
  \old@theindex
 
120
  \addcontentsline{toc}{section}{\indexname}}
 
121
\end_preamble
 
122
\language english
 
123
\inputencoding auto
 
124
\fontscheme pslatex
 
125
\graphics default
 
126
\paperfontsize 12
 
127
\spacing onehalf
 
128
\papersize default
 
129
\use_geometry false
 
130
\use_amsmath 1
 
131
\cite_engine basic
 
132
\use_bibtopic false
 
133
\paperorientation portrait
 
134
\secnumdepth 3
 
135
\tocdepth 3
 
136
\paragraph_separation indent
 
137
\defskip medskip
 
138
\quotes_language english
 
139
\papercolumns 1
 
140
\papersides 2
 
141
\paperpagestyle default
 
142
\tracking_changes false
 
143
\output_changes true
 
144
\end_header
 
145
 
 
146
\begin_body
 
147
 
 
148
\begin_layout Title
 
149
 
 
150
\emph on
 
151
AspectC++ Language Reference
 
152
\end_layout
 
153
 
 
154
\begin_layout Author
 
155
Matthias Urban
 
156
\size largest
 
157
 
 
158
\newline
 
159
 
 
160
\begin_inset ERT
 
161
status collapsed
 
162
 
 
163
\begin_layout Standard
 
164
 
 
165
 
 
166
\backslash
 
167
vspace{8mm}
 
168
\end_layout
 
169
 
 
170
\end_inset
 
171
 
 
172
and Olaf Spinczyk
 
173
\end_layout
 
174
 
 
175
\begin_layout Standard
 
176
\begin_inset LatexCommand \tableofcontents{}
 
177
 
 
178
\end_inset
 
179
 
 
180
 
 
181
\begin_inset ERT
 
182
status collapsed
 
183
 
 
184
\begin_layout Standard
 
185
 
 
186
 
 
187
\backslash
 
188
clearpage
 
189
\end_layout
 
190
 
 
191
\end_inset
 
192
 
 
193
 
 
194
\end_layout
 
195
 
 
196
\begin_layout Section
 
197
About
 
198
\end_layout
 
199
 
 
200
\begin_layout Standard
 
201
This document is intended to be used as a reference book for the AspectC++
 
202
 language elements.
 
203
 It describes in-depth the use and meaning of each element providing examples.
 
204
 For experienced users the contents of this document is summarized in the
 
205
\emph on
 
206
 
 
207
\emph default
 
208
 
 
209
\begin_inset ERT
 
210
status collapsed
 
211
 
 
212
\begin_layout Standard
 
213
 
 
214
 
 
215
\backslash
 
216
depref{http://www.aspectc.com/ac++quickref.pdf}{
 
217
\backslash
 
218
emph{AspectC++ Quick Reference}}
 
219
\backslash
 
220
hspace{-4pt}
 
221
\end_layout
 
222
 
 
223
\end_inset
 
224
 
 
225
.
 
226
 A step-by-step introduction how to program with AspectC++ is given in the
 
227
 
 
228
\begin_inset ERT
 
229
status collapsed
 
230
 
 
231
\begin_layout Standard
 
232
 
 
233
 
 
234
\backslash
 
235
depref{http://www.aspectc.com/doc.html}{
 
236
\backslash
 
237
emph{AspectC++ Programming Guide}}
 
238
\backslash
 
239
hspace{-4pt}
 
240
\end_layout
 
241
 
 
242
\end_inset
 
243
 
 
244
 
 
245
\begin_inset Foot
 
246
status open
 
247
 
 
248
\begin_layout Standard
 
249
Sorry, but the Programming Guide is not written yet 
 
250
\family typewriter
 
251
:-(
 
252
\end_layout
 
253
 
 
254
\end_inset
 
255
 
 
256
.
 
257
 Detailed information about the AspectC++ compiler 
 
258
\series bold
 
259
ac++
 
260
\series default
 
261
 
 
262
\begin_inset LatexCommand \index{ac++@\texttt{ac++}}
 
263
 
 
264
\end_inset
 
265
 
 
266
 can be looked up in the 
 
267
\begin_inset ERT
 
268
status collapsed
 
269
 
 
270
\begin_layout Standard
 
271
 
 
272
 
 
273
\backslash
 
274
depref{http://www.aspectc.com/ac++compilerman.pdf}{
 
275
\backslash
 
276
emph{AC++ Compiler Manual}}
 
277
\backslash
 
278
hspace{-4pt}
 
279
\end_layout
 
280
 
 
281
\end_inset
 
282
 
 
283
.
 
284
 
 
285
\end_layout
 
286
 
 
287
\begin_layout Standard
 
288
AspectC++ is an aspect-oriented extension to the C++ language
 
289
\begin_inset Foot
 
290
status collapsed
 
291
 
 
292
\begin_layout Standard
 
293
defined in the ISO/IEC 14882:1998(E) standard
 
294
\end_layout
 
295
 
 
296
\end_inset
 
297
 
 
298
.
 
299
 It is similar to AspectJ
 
300
\begin_inset Foot
 
301
status collapsed
 
302
 
 
303
\begin_layout Standard
 
304
 
 
305
\family typewriter
 
306
\begin_inset ERT
 
307
status open
 
308
 
 
309
\begin_layout Standard
 
310
 
 
311
 
 
312
\backslash
 
313
depref{http://www.aspectj.org}{
 
314
\backslash
 
315
texttt{www.aspectj.org}}
 
316
\end_layout
 
317
 
 
318
\end_inset
 
319
 
 
320
 
 
321
\end_layout
 
322
 
 
323
\end_inset
 
324
 
 
325
 but, due to the nature of C++, in some points completely different.
 
326
 The first part of this document introduces the basic concepts of the AspectC++
 
327
 language.
 
328
 The in-depth description of each language element is subject of the second
 
329
 part.
 
330
\end_layout
 
331
 
 
332
\begin_layout Section
 
333
Basic Concepts
 
334
\end_layout
 
335
 
 
336
\begin_layout Subsection
 
337
Pointcuts
 
338
\begin_inset LatexCommand \index{pointcut|(}
 
339
 
 
340
\end_inset
 
341
 
 
342
 
 
343
\end_layout
 
344
 
 
345
\begin_layout Standard
 
346
Aspects in AspectC++ implement crosscutting concerns
 
347
\begin_inset LatexCommand \index{crosscutting concern}
 
348
 
 
349
\end_inset
 
350
 
 
351
 in a modular way.
 
352
 With this in mind the most important element of the AspectC++ language
 
353
 is the pointcut.
 
354
 Pointcuts describe a set of join points
 
355
\begin_inset LatexCommand \index{join point}
 
356
 
 
357
\end_inset
 
358
 
 
359
 by determining on which condition an aspect shall take effect.
 
360
 Thereby each join point can either refer to a function, an attribute, a
 
361
 type, a variable, or a point from which a join point is accessed so that
 
362
 this condition can be for instance the event of reaching a designated code
 
363
 position
 
364
\begin_inset ERT
 
365
status collapsed
 
366
 
 
367
\begin_layout Standard
 
368
 
 
369
 
 
370
\backslash
 
371
begin{comment}
 
372
\end_layout
 
373
 
 
374
\end_inset
 
375
 
 
376
 or the allocation of a variable with a certain value
 
377
\begin_inset ERT
 
378
status collapsed
 
379
 
 
380
\begin_layout Standard
 
381
 
 
382
\end_layout
 
383
 
 
384
\begin_layout Standard
 
385
 
 
386
\end_layout
 
387
 
 
388
\begin_layout Standard
 
389
 
 
390
 
 
391
\backslash
 
392
end{comment}
 
393
\end_layout
 
394
 
 
395
\begin_layout Standard
 
396
 
 
397
\end_layout
 
398
 
 
399
\end_inset
 
400
 
 
401
.
 
402
 Depending on the kind of pointcuts, they are evaluated at compile time
 
403
 or at runtime.
 
404
\end_layout
 
405
 
 
406
\begin_layout Subsubsection
 
407
Match Expressions
 
408
\begin_inset LatexCommand \index{match expression|(}
 
409
 
 
410
\end_inset
 
411
 
 
412
 
 
413
\begin_inset LatexCommand \index{search pattern!match expression|(}
 
414
 
 
415
\end_inset
 
416
 
 
417
 
 
418
\end_layout
 
419
 
 
420
\begin_layout Standard
 
421
There are two types of pointcuts in AspectC++: 
 
422
\emph on
 
423
code pointcuts
 
424
\emph default
 
425
 and 
 
426
\emph on
 
427
name pointcuts
 
428
\emph default
 
429
.
 
430
 Name pointcuts
 
431
\begin_inset LatexCommand \index{name pointcut}
 
432
 
 
433
\end_inset
 
434
 
 
435
 
 
436
\begin_inset LatexCommand \index{pointcut!name}
 
437
 
 
438
\end_inset
 
439
 
 
440
 describe a set of (statically) known program entities like types, attributes,
 
441
 functions, variables, or namespaces.
 
442
 All name pointcuts are based on match expressions.
 
443
 A match expression can be understood as a search pattern
 
444
\begin_inset LatexCommand \index{search pattern}
 
445
 
 
446
\end_inset
 
447
 
 
448
 
 
449
\begin_inset LatexCommand \index{match expression!search pattern}
 
450
 
 
451
\end_inset
 
452
 
 
453
.
 
454
 In such a search pattern the special character 
 
455
\begin_inset Quotes eld
 
456
\end_inset
 
457
 
 
458
%
 
459
\begin_inset Quotes erd
 
460
\end_inset
 
461
 
 
462
 is interpreted as a wildcard for names or parts of a signature.
 
463
 The special character sequence 
 
464
\begin_inset Quotes eld
 
465
\end_inset
 
466
 
 
467
...
 
468
\begin_inset Quotes erd
 
469
\end_inset
 
470
 
 
471
 matches any number of parameters in a function signature or any number
 
472
 of scopes in a qualified name.
 
473
 A match expression is a quoted string.
 
474
\end_layout
 
475
 
 
476
\begin_layout Subsubsection*
 
477
Example: match expressions (name pointcuts)
 
478
\begin_inset LatexCommand \label{exa:match-expressions}
 
479
 
 
480
\end_inset
 
481
 
 
482
 
 
483
\end_layout
 
484
 
 
485
\begin_layout Description
 
486
 
 
487
\family typewriter
 
488
\series medium
 
489
"int
 
490
\series default
 
491
\InsetSpace ~
 
492
 
 
493
\series medium
 
494
C::%(...)"
 
495
\family default
 
496
\series default
 
497
 \InsetSpace ~
 
498
 
 
499
\newline
 
500
matches all member functions of the class C that return an 
 
501
\family typewriter
 
502
int
 
503
\end_layout
 
504
 
 
505
\begin_layout Description
 
506
 
 
507
\family typewriter
 
508
\series medium
 
509
"%List"
 
510
\family default
 
511
\series default
 
512
 \InsetSpace ~
 
513
 
 
514
\newline
 
515
matches any class, struct, union, or enum whose name ends with 
 
516
\begin_inset Quotes eld
 
517
\end_inset
 
518
 
 
519
List
 
520
\begin_inset Quotes erd
 
521
\end_inset
 
522
 
 
523
 
 
524
\end_layout
 
525
 
 
526
\begin_layout Description
 
527
 
 
528
\family typewriter
 
529
\series medium
 
530
"% 
 
531
\series default
 
532
printf(const char *, ...)"
 
533
\family default
 
534
 \InsetSpace ~
 
535
 
 
536
\newline
 
537
matches the function 
 
538
\family typewriter
 
539
printf
 
540
\family default
 
541
 (defined in the global scope) having at least one parameter of type 
 
542
\family typewriter
 
543
const\InsetSpace ~
 
544
char\InsetSpace ~
 
545
*
 
546
\family default
 
547
 and returning any type
 
548
\end_layout
 
549
 
 
550
\begin_layout Description
 
551
 
 
552
\family typewriter
 
553
\series medium
 
554
"const
 
555
\series default
 
556
\InsetSpace ~
 
557
 
 
558
\series medium
 
559
%&\InsetSpace ~
 
560
...::%(...)" 
 
561
\series default
 
562
\InsetSpace ~
 
563
 
 
564
\newline
 
565
 
 
566
\family default
 
567
matches all functions that return a reference to a constant object
 
568
\end_layout
 
569
 
 
570
\begin_layout Standard
 
571
Match expressions select program entities with respect to their definition
 
572
 scope, their type, and their name.
 
573
 A detailed description of the match expression semantics follows in section
 
574
 
 
575
\begin_inset LatexCommand \vref{sec:Match-Expressions}
 
576
 
 
577
\end_inset
 
578
 
 
579
.
 
580
 The grammar which defines syntactically valid match expressions is shown
 
581
 in appendix 
 
582
\begin_inset LatexCommand \vref{sec:Match-Expression-Grammar}
 
583
 
 
584
\end_inset
 
585
 
 
586
.
 
587
 
 
588
\begin_inset LatexCommand \index{match expression|)}
 
589
 
 
590
\end_inset
 
591
 
 
592
 
 
593
\begin_inset LatexCommand \index{search pattern!match expression|)}
 
594
 
 
595
\end_inset
 
596
 
 
597
 
 
598
\end_layout
 
599
 
 
600
\begin_layout Subsubsection
 
601
Pointcut Expressions
 
602
\begin_inset LatexCommand \index{pointcut!expression|(}
 
603
 
 
604
\end_inset
 
605
 
 
606
 
 
607
\end_layout
 
608
 
 
609
\begin_layout Standard
 
610
The other type of pointcuts, the code pointcuts
 
611
\begin_inset LatexCommand \index{code pointcut}
 
612
 
 
613
\end_inset
 
614
 
 
615
 
 
616
\begin_inset LatexCommand \index{pointcut!code}
 
617
 
 
618
\end_inset
 
619
 
 
620
, describe an intersection through the set of the points in the control
 
621
 flow
 
622
\begin_inset LatexCommand \index{control flow}
 
623
 
 
624
\end_inset
 
625
 
 
626
 of a program.
 
627
 A code pointcut can refer to a call or execution point of a function
 
628
\begin_inset ERT
 
629
status collapsed
 
630
 
 
631
\begin_layout Standard
 
632
 
 
633
 
 
634
\backslash
 
635
begin{comment}
 
636
\end_layout
 
637
 
 
638
\end_inset
 
639
 
 
640
 but also to write and read points of attributes and variables
 
641
\begin_inset ERT
 
642
status collapsed
 
643
 
 
644
\begin_layout Standard
 
645
 
 
646
\end_layout
 
647
 
 
648
\begin_layout Standard
 
649
 
 
650
\end_layout
 
651
 
 
652
\begin_layout Standard
 
653
 
 
654
 
 
655
\backslash
 
656
end{comment}
 
657
\end_layout
 
658
 
 
659
\begin_layout Standard
 
660
 
 
661
\end_layout
 
662
 
 
663
\end_inset
 
664
 
 
665
.
 
666
 They can only be created with the help of name pointcuts because all join
 
667
 points supported by AspectC++ require at least one name to be defined.
 
668
 This is done by calling predefined pointcut functions
 
669
\begin_inset LatexCommand \index{pointcut function}
 
670
 
 
671
\end_inset
 
672
 
 
673
 
 
674
\begin_inset LatexCommand \index{pointcut!function}
 
675
 
 
676
\end_inset
 
677
 
 
678
 in a pointcut expression that expect a pointcut as argument.
 
679
 Such a pointcut function is for instance 
 
680
\series bold
 
681
within
 
682
\series default
 
683
(
 
684
\emph on
 
685
pointcut
 
686
\emph default
 
687
), which filters all join points that are within the functions or classes
 
688
 in the given pointcut.
 
689
\end_layout
 
690
 
 
691
\begin_layout Standard
 
692
Name and code pointcuts can be combined in pointcut expressions by using
 
693
 the algebraic operators 
 
694
\begin_inset Quotes eld
 
695
\end_inset
 
696
 
 
697
&&
 
698
\begin_inset Quotes erd
 
699
\end_inset
 
700
 
 
701
 
702
\begin_inset Quotes eld
 
703
\end_inset
 
704
 
 
705
||
 
706
\begin_inset Quotes erd
 
707
\end_inset
 
708
 
 
709
, and 
 
710
\begin_inset Quotes eld
 
711
\end_inset
 
712
 
 
713
!
 
714
\begin_inset Quotes erd
 
715
\end_inset
 
716
 
 
717
.
 
718
\end_layout
 
719
 
 
720
\begin_layout Subsubsection*
 
721
Example: pointcut expressions
 
722
\begin_inset LatexCommand \label{exa:pointcut-expressions}
 
723
 
 
724
\end_inset
 
725
 
 
726
 
 
727
\end_layout
 
728
 
 
729
\begin_layout Description
 
730
 
 
731
\family typewriter
 
732
\series medium
 
733
"%List"\InsetSpace ~
 
734
&&\InsetSpace ~
 
735
!derived("Queue")
 
736
\family default
 
737
\series default
 
738
 \InsetSpace ~
 
739
 
 
740
\newline
 
741
describes the set of classes with names that end with 
 
742
\begin_inset Quotes eld
 
743
\end_inset
 
744
 
 
745
List
 
746
\begin_inset Quotes erd
 
747
\end_inset
 
748
 
 
749
 and that are not derived from the class 
 
750
\family typewriter
 
751
Queue
 
752
\end_layout
 
753
 
 
754
\begin_layout Description
 
755
 
 
756
\family typewriter
 
757
\series medium
 
758
call("void 
 
759
\series default
 
760
draw()
 
761
\series medium
 
762
")\InsetSpace ~
 
763
 
 
764
\series default
 
765
&&\InsetSpace ~
 
766
within
 
767
\series medium
 
768
("
 
769
\series default
 
770
Shape
 
771
\series medium
 
772
")
 
773
\family default
 
774
\series default
 
775
 \InsetSpace ~
 
776
 
 
777
\newline
 
778
describes the set of calls to the function 
 
779
\family typewriter
 
780
draw
 
781
\family default
 
782
 that are within methods of the class 
 
783
\family typewriter
 
784
Shape
 
785
\family default
 
786
 
 
787
\begin_inset LatexCommand \index{pointcut!expression|)}
 
788
 
 
789
\end_inset
 
790
 
 
791
 
 
792
\end_layout
 
793
 
 
794
\begin_layout Subsubsection
 
795
Types of Join Points
 
796
\begin_inset LatexCommand \index{join point|(}
 
797
 
 
798
\end_inset
 
799
 
 
800
 
 
801
\end_layout
 
802
 
 
803
\begin_layout Standard
 
804
According to the two types of pointcuts supported by AspectC++ there are
 
805
 also two types of join points.
 
806
 Based on a short code fragment the differences and relations between these
 
807
 two types of join points shall be clarified.
 
808
\end_layout
 
809
 
 
810
\begin_layout LyX-Code
 
811
class Shape;
 
812
\newline
 
813
void draw(Shape&);
 
814
\newline
 
815
 
 
816
\newline
 
817
namespace Circle {
 
818
\newline
 
819
  typedef int PRECISION;
 
820
\newline
 
821
 
 
822
  
 
823
\newline
 
824
  class S_Circle : public Shape {
 
825
\newline
 
826
    PRECISION m_radius;
 
827
\newline
 
828
  public:
 
829
\newline
 
830
    ...
 
831
\end_layout
 
832
 
 
833
\begin_layout LyX-Code
 
834
    void radius(PRECISION r) { m_radius=r; }
 
835
\newline
 
836
  };
 
837
\newline
 
838
  
 
839
\newline
 
840
  void draw(PRECISION
 
841
 r) {
 
842
\end_layout
 
843
 
 
844
\begin_layout LyX-Code
 
845
    S_Circle circle;
 
846
\end_layout
 
847
 
 
848
\begin_layout LyX-Code
 
849
    circle.radius(r);
 
850
\end_layout
 
851
 
 
852
\begin_layout LyX-Code
 
853
    draw(circle);
 
854
\newline
 
855
  }
 
856
\newline
 
857
}
 
858
\newline
 
859
 
 
860
\newline
 
861
int main() {
 
862
\newline
 
863
  Circle::draw(10);
 
864
\newline
 
865
  return 0;
 
866
\newline
 
867
}
 
868
\end_layout
 
869
 
 
870
\begin_layout Standard
 
871
Code join points
 
872
\begin_inset LatexCommand \index{code join point}
 
873
 
 
874
\end_inset
 
875
 
 
876
 
 
877
\begin_inset LatexCommand \index{join point!code}
 
878
 
 
879
\end_inset
 
880
 
 
881
 are used to form code pointcuts and name join points (i.e.\InsetSpace ~
 
882
names) are used
 
883
 to form name pointcuts.
 
884
 Figure 
 
885
\begin_inset LatexCommand \vref{fig:join-points}
 
886
 
 
887
\end_inset
 
888
 
 
889
 shows some join points of the code fragment and how they correlate.
 
890
 
 
891
\end_layout
 
892
 
 
893
\begin_layout Standard
 
894
\begin_inset Float figure
 
895
wide false
 
896
sideways false
 
897
status collapsed
 
898
 
 
899
\begin_layout Standard
 
900
\align center
 
901
\begin_inset Graphics
 
902
        filename ../images/JoinPointModel.eps
 
903
        scale 65
 
904
 
 
905
\end_inset
 
906
 
 
907
 
 
908
\end_layout
 
909
 
 
910
\begin_layout Caption
 
911
\begin_inset LatexCommand \label{fig:join-points}
 
912
 
 
913
\end_inset
 
914
 
 
915
join points and their relations
 
916
\end_layout
 
917
 
 
918
\end_inset
 
919
 
 
920
 
 
921
\end_layout
 
922
 
 
923
\begin_layout Standard
 
924
Every 
 
925
\series bold
 
926
execution
 
927
\series default
 
928
 
 
929
\begin_inset LatexCommand \index{execution join point}
 
930
 
 
931
\end_inset
 
932
 
 
933
 
 
934
\begin_inset LatexCommand \index{join point!execution}
 
935
 
 
936
\end_inset
 
937
 
 
938
 join point is associated with the name of an executable function.
 
939
 Pure virtual functions
 
940
\begin_inset LatexCommand \index{pure virtual!functions}
 
941
 
 
942
\end_inset
 
943
 
 
944
 are not executable.
 
945
 Thus, advice code for execution join points would never be triggered for
 
946
 this kind of function.
 
947
 However, the call of such a function, i.e.\InsetSpace ~
 
948
 
949
\series bold
 
950
call
 
951
\series default
 
952
 join point with this function as target, is absolutely possible.
 
953
\end_layout
 
954
 
 
955
\begin_layout Standard
 
956
Every 
 
957
\series bold
 
958
call
 
959
\series default
 
960
 
 
961
\begin_inset LatexCommand \index{call join point}
 
962
 
 
963
\end_inset
 
964
 
 
965
 
 
966
\begin_inset LatexCommand \index{join point!call}
 
967
 
 
968
\end_inset
 
969
 
 
970
 join point is associated with two names: the name of the source and the
 
971
 target function of a function call.
 
972
 As there can be multiple function calls within the same function, each
 
973
 function name can be associated with a list of 
 
974
\series bold
 
975
call
 
976
\series default
 
977
 join points
 
978
\begin_inset LatexCommand \index{join point|)}
 
979
 
 
980
\end_inset
 
981
 
 
982
.
 
983
 
 
984
\begin_inset ERT
 
985
status collapsed
 
986
 
 
987
\begin_layout Standard
 
988
 
 
989
 
 
990
\backslash
 
991
begin{comment}
 
992
\end_layout
 
993
 
 
994
\end_inset
 
995
 
 
996
The same holds for 
 
997
\series bold
 
998
set
 
999
\series default
 
1000
 
 
1001
\begin_inset LatexCommand \index{set join point}
 
1002
 
 
1003
\end_inset
 
1004
 
 
1005
 
 
1006
\begin_inset LatexCommand \index{join point!set}
 
1007
 
 
1008
\end_inset
 
1009
 
 
1010
 and 
 
1011
\series bold
 
1012
get
 
1013
\series default
 
1014
 
 
1015
\begin_inset LatexCommand \index{get join point}
 
1016
 
 
1017
\end_inset
 
1018
 
 
1019
 
 
1020
\begin_inset LatexCommand \index{join point!get}
 
1021
 
 
1022
\end_inset
 
1023
 
 
1024
 join points, which represent write resp.\InsetSpace ~
 
1025
read operations on attributes or
 
1026
 global variables.
 
1027
 Each of these join points is associated with the name of the function that
 
1028
 contains the join point and the name of the accessed attribute or global
 
1029
 variable.
 
1030
\begin_inset ERT
 
1031
status collapsed
 
1032
 
 
1033
\begin_layout Standard
 
1034
 
 
1035
\end_layout
 
1036
 
 
1037
\begin_layout Standard
 
1038
 
 
1039
\end_layout
 
1040
 
 
1041
\begin_layout Standard
 
1042
 
 
1043
 
 
1044
\backslash
 
1045
end{comment}
 
1046
\end_layout
 
1047
 
 
1048
\begin_layout Standard
 
1049
 
 
1050
\end_layout
 
1051
 
 
1052
\end_inset
 
1053
 
 
1054
 
1055
\series bold
 
1056
construction
 
1057
\series default
 
1058
 joinpoint means the class specific instruction sequence executed when an
 
1059
 instance is created.
 
1060
 In analogy, a 
 
1061
\series bold
 
1062
destruction
 
1063
\series default
 
1064
 joinpoint means the object destruction.
 
1065
\end_layout
 
1066
 
 
1067
\begin_layout Subsubsection
 
1068
Pointcut declarations
 
1069
\series bold
 
1070
 
 
1071
\begin_inset LatexCommand \index{pointcut!declaration|(}
 
1072
 
 
1073
\end_inset
 
1074
 
 
1075
 
 
1076
\end_layout
 
1077
 
 
1078
\begin_layout Standard
 
1079
AspectC++ provides the possibility to name pointcut
 
1080
\begin_inset LatexCommand \index{name pointcut}
 
1081
 
 
1082
\end_inset
 
1083
 
 
1084
 
 
1085
\begin_inset LatexCommand \index{pointcut!name}
 
1086
 
 
1087
\end_inset
 
1088
 
 
1089
 expressions with the help of pointcut declarations.
 
1090
 This makes it possible to reuse pointcut expressions in different parts
 
1091
 of a program.
 
1092
 They are allowed where C++ declarations are allowed.
 
1093
 Thereby the usual C++ name lookup and inheritance rules are also applicable
 
1094
 for pointcut declarations.
 
1095
\end_layout
 
1096
 
 
1097
\begin_layout Standard
 
1098
A pointcut declaration is introduced by the keyword 
 
1099
\family typewriter
 
1100
pointcut
 
1101
\family default
 
1102
.
 
1103
 
 
1104
\end_layout
 
1105
 
 
1106
\begin_layout Subsubsection*
 
1107
Example: pointcut declaration
 
1108
\begin_inset LatexCommand \label{exa:pointcut-declaration}
 
1109
 
 
1110
\end_inset
 
1111
 
 
1112
 
 
1113
\end_layout
 
1114
 
 
1115
\begin_layout Description
 
1116
 
 
1117
\family typewriter
 
1118
\series medium
 
1119
pointcut
 
1120
\series default
 
1121
\InsetSpace ~
 
1122
 
 
1123
\series medium
 
1124
lists()\InsetSpace ~
 
1125
=
 
1126
\series default
 
1127
\InsetSpace ~
 
1128
 
 
1129
\series medium
 
1130
derived("List");
 
1131
\family default
 
1132
\series default
 
1133
 \InsetSpace ~
 
1134
 
 
1135
\newline
 
1136
 
 
1137
\family typewriter
 
1138
lists
 
1139
\family default
 
1140
 can now be used everywhere in a program where a pointcut expression can
 
1141
 be used to refer to 
 
1142
\family typewriter
 
1143
derived("List")
 
1144
\end_layout
 
1145
 
 
1146
\begin_layout Standard
 
1147
Furthermore pointcut declarations can be used to define pure virtual pointcuts
 
1148
\begin_inset LatexCommand \index{pure virtual!pointcut}
 
1149
 
 
1150
\end_inset
 
1151
 
 
1152
 
 
1153
\begin_inset LatexCommand \index{pointcut!pure virtual}
 
1154
 
 
1155
\end_inset
 
1156
 
 
1157
.
 
1158
 This enables the possibility of having re-usable abstract aspects
 
1159
\begin_inset LatexCommand \index{aspect}
 
1160
 
 
1161
\end_inset
 
1162
 
 
1163
 
 
1164
\begin_inset LatexCommand \index{abstract aspect}
 
1165
 
 
1166
\end_inset
 
1167
 
 
1168
 
 
1169
\begin_inset LatexCommand \index{aspect!abstract}
 
1170
 
 
1171
\end_inset
 
1172
 
 
1173
 that are discussed in section 
 
1174
\begin_inset LatexCommand \ref{sub:Aspects}
 
1175
 
 
1176
\end_inset
 
1177
 
 
1178
.
 
1179
 The syntax of pure virtual pointcut declarations is the same as for usual
 
1180
 pointcut declarations except the keyword 
 
1181
\family typewriter
 
1182
virtual
 
1183
\family default
 
1184
 following 
 
1185
\family typewriter
 
1186
pointcut
 
1187
\family default
 
1188
 and that the pointcut expression is 
 
1189
\begin_inset Quotes eld
 
1190
\end_inset
 
1191
 
 
1192
0
 
1193
\begin_inset Quotes erd
 
1194
\end_inset
 
1195
 
 
1196
.
 
1197
\end_layout
 
1198
 
 
1199
\begin_layout Subsubsection*
 
1200
Example: pure virtual pointcut declaration
 
1201
\begin_inset LatexCommand \label{exa:pure-virtual}
 
1202
 
 
1203
\end_inset
 
1204
 
 
1205
 
 
1206
\end_layout
 
1207
 
 
1208
\begin_layout Description
 
1209
 
 
1210
\family typewriter
 
1211
\series medium
 
1212
pointcut
 
1213
\series default
 
1214
\InsetSpace ~
 
1215
 
 
1216
\series medium
 
1217
virtual\InsetSpace ~
 
1218
methods()\InsetSpace ~
 
1219
=
 
1220
\series default
 
1221
\InsetSpace ~
 
1222
 
 
1223
\series medium
 
1224
0;
 
1225
\family default
 
1226
\series default
 
1227
 \InsetSpace ~
 
1228
 
 
1229
\newline
 
1230
 
 
1231
\family typewriter
 
1232
methods
 
1233
\family default
 
1234
 is a pure virtual pointcut that has to be redefined in a derived aspect
 
1235
 to refer to the actual pointcut
 
1236
\begin_inset LatexCommand \index{pointcut|)}
 
1237
 
 
1238
\end_inset
 
1239
 
 
1240
 expression
 
1241
\series bold
 
1242
 
 
1243
\begin_inset LatexCommand \index{pointcut!declaration|)}
 
1244
 
 
1245
\end_inset
 
1246
 
 
1247
 
 
1248
\end_layout
 
1249
 
 
1250
\begin_layout Subsection
 
1251
Slices
 
1252
\begin_inset LatexCommand \index{slice|(}
 
1253
 
 
1254
\end_inset
 
1255
 
 
1256
 
 
1257
\end_layout
 
1258
 
 
1259
\begin_layout Standard
 
1260
 
1261
\emph on
 
1262
slice
 
1263
\emph default
 
1264
 is a fragment of a C++ language element that defines a scope.
 
1265
 It can be used by advice to extend the static structure of the programm.
 
1266
 For example, the elements of a class slice can be merged into one or more
 
1267
 target classes by introduction advice.
 
1268
 The following example shows a simple class slice declaration.
 
1269
\end_layout
 
1270
 
 
1271
\begin_layout Subsubsection*
 
1272
Example: class slice declaration
 
1273
\begin_inset LatexCommand \label{exa:class-slice-declaration}
 
1274
 
 
1275
\end_inset
 
1276
 
 
1277
 
 
1278
\end_layout
 
1279
 
 
1280
\begin_layout LyX-Code
 
1281
slice class Chain {
 
1282
\end_layout
 
1283
 
 
1284
\begin_layout LyX-Code
 
1285
  Chain *_next;
 
1286
\end_layout
 
1287
 
 
1288
\begin_layout LyX-Code
 
1289
public:
 
1290
\end_layout
 
1291
 
 
1292
\begin_layout LyX-Code
 
1293
  Chain *next () const { return _next; }
 
1294
\end_layout
 
1295
 
 
1296
\begin_layout LyX-Code
 
1297
};
 
1298
\end_layout
 
1299
 
 
1300
\begin_layout Standard
 
1301
\begin_inset LatexCommand \index{slice|)}
 
1302
 
 
1303
\end_inset
 
1304
 
 
1305
 
 
1306
\end_layout
 
1307
 
 
1308
\begin_layout Subsection
 
1309
Advice Code
 
1310
\begin_inset LatexCommand \index{advice|(}
 
1311
 
 
1312
\end_inset
 
1313
 
 
1314
 
 
1315
\begin_inset LatexCommand \index{advice!code|(}
 
1316
 
 
1317
\end_inset
 
1318
 
 
1319
 
 
1320
\end_layout
 
1321
 
 
1322
\begin_layout Standard
 
1323
To a code join point
 
1324
\begin_inset LatexCommand \index{code join point}
 
1325
 
 
1326
\end_inset
 
1327
 
 
1328
 
 
1329
\begin_inset LatexCommand \index{join point!code}
 
1330
 
 
1331
\end_inset
 
1332
 
 
1333
 so-called advice code can be bound.
 
1334
 Advice code can be understood as an action
 
1335
\begin_inset LatexCommand \index{action}
 
1336
 
 
1337
\end_inset
 
1338
 
 
1339
 
 
1340
\begin_inset LatexCommand \index{runtime support!action}
 
1341
 
 
1342
\end_inset
 
1343
 
 
1344
 activated by an aspect when a corresponding code join point in a program
 
1345
 is reached.
 
1346
 The activation of the advice code can happen before
 
1347
\begin_inset LatexCommand \index{before}
 
1348
 
 
1349
\end_inset
 
1350
 
 
1351
 
 
1352
\begin_inset LatexCommand \index{advice!before}
 
1353
 
 
1354
\end_inset
 
1355
 
 
1356
, after
 
1357
\begin_inset LatexCommand \index{after}
 
1358
 
 
1359
\end_inset
 
1360
 
 
1361
 
 
1362
\begin_inset LatexCommand \index{advice!after}
 
1363
 
 
1364
\end_inset
 
1365
 
 
1366
, or before and after the code join point is reached.
 
1367
 The AspectC++ language element to specify advice code is the advice declaration
 
1368
\begin_inset LatexCommand \index{advice!declaration}
 
1369
 
 
1370
\end_inset
 
1371
 
 
1372
.
 
1373
 It is introduced by the keyword 
 
1374
\family typewriter
 
1375
advice
 
1376
\family default
 
1377
 followed by a pointcut expression defining where and under which conditions
 
1378
 the advice code shall be activated.
 
1379
 
 
1380
\end_layout
 
1381
 
 
1382
\begin_layout Subsubsection*
 
1383
Example: advice declaration
 
1384
\begin_inset LatexCommand \label{exa:advice-declaration}
 
1385
 
 
1386
\end_inset
 
1387
 
 
1388
 
 
1389
\end_layout
 
1390
 
 
1391
\begin_layout LyX-Code
 
1392
advice execution("void login(...)") : before() {
 
1393
\newline
 
1394
  cout << "Logging in." << endl;
 
1395
\newline
 
1396
}
 
1397
\end_layout
 
1398
 
 
1399
\begin_layout Standard
 
1400
The code fragment 
 
1401
\family typewriter
 
1402
:before()
 
1403
\family default
 
1404
 following the pointcut expression determines that the advice code shall
 
1405
 be activated directly 
 
1406
\series bold
 
1407
before
 
1408
\series default
 
1409
 
 
1410
\begin_inset LatexCommand \index{before}
 
1411
 
 
1412
\end_inset
 
1413
 
 
1414
 
 
1415
\begin_inset LatexCommand \index{advice!before}
 
1416
 
 
1417
\end_inset
 
1418
 
 
1419
 the code join point is reached.
 
1420
 It is also possible here to use 
 
1421
\family typewriter
 
1422
:after()
 
1423
\family default
 
1424
 which means 
 
1425
\series bold
 
1426
after
 
1427
\series default
 
1428
 
 
1429
\begin_inset LatexCommand \index{after}
 
1430
 
 
1431
\end_inset
 
1432
 
 
1433
 
 
1434
\begin_inset LatexCommand \index{advice!after}
 
1435
 
 
1436
\end_inset
 
1437
 
 
1438
 reaching the code join point respectively 
 
1439
\family typewriter
 
1440
:around()
 
1441
\family default
 
1442
 which means that the advice code shall be executed instead of the code
 
1443
 described by the code join point.
 
1444
 In an 
 
1445
\series bold
 
1446
around
 
1447
\series default
 
1448
 
 
1449
\begin_inset LatexCommand \index{around}
 
1450
 
 
1451
\end_inset
 
1452
 
 
1453
 
 
1454
\begin_inset LatexCommand \index{advice!around}
 
1455
 
 
1456
\end_inset
 
1457
 
 
1458
 advice the advice code can explicitly trigger the execution of the program
 
1459
 code at the join point so that advice code can be executed 
 
1460
\series bold
 
1461
before
 
1462
\series default
 
1463
 and 
 
1464
\series bold
 
1465
after
 
1466
\series default
 
1467
 the join point.
 
1468
 There are no special access rights of advice code regarding to program
 
1469
 code at a join point.
 
1470
\end_layout
 
1471
 
 
1472
\begin_layout Standard
 
1473
Beside the pure description of join points pointcuts can also bind variables
 
1474
 to context
 
1475
\begin_inset LatexCommand \index{context variables}
 
1476
 
 
1477
\end_inset
 
1478
 
 
1479
 information of a join point.
 
1480
 Thus for instance the actual argument values of a function call can be
 
1481
 made accessible to the advice code.
 
1482
\end_layout
 
1483
 
 
1484
\begin_layout Subsubsection*
 
1485
Example: advice declaration with access to context information
 
1486
\begin_inset LatexCommand \label{exa:advice-declaration-with}
 
1487
 
 
1488
\end_inset
 
1489
 
 
1490
 
 
1491
\end_layout
 
1492
 
 
1493
\begin_layout LyX-Code
 
1494
pointcut new_user(const char *name) = 
 
1495
\newline
 
1496
  execution("void login(...)") && args(name);
 
1497
 
 
1498
\newline
 
1499
 
 
1500
\newline
 
1501
advice new_user(name) : before(const char *name) { 
 
1502
\newline
 
1503
  cout << "User " <<
 
1504
 name << " is logging in." << endl; 
 
1505
\newline
 
1506
}
 
1507
\end_layout
 
1508
 
 
1509
\begin_layout Standard
 
1510
In the example above at first the pointcut 
 
1511
\family typewriter
 
1512
new_user
 
1513
\family default
 
1514
 is defined including a context variable
 
1515
\begin_inset LatexCommand \index{context variables}
 
1516
 
 
1517
\end_inset
 
1518
 
 
1519
 
 
1520
\family typewriter
 
1521
name
 
1522
\family default
 
1523
 that is bound to it.
 
1524
 This means that a value of type 
 
1525
\family typewriter
 
1526
const char*
 
1527
\family default
 
1528
 is supplied every time the join point described by the pointcut 
 
1529
\family typewriter
 
1530
new_user
 
1531
\family default
 
1532
 is reached.
 
1533
 The pointcut function 
 
1534
\family typewriter
 
1535
args
 
1536
\family default
 
1537
 used in the pointcut expression delivers all join points in the program
 
1538
 where an argument of type 
 
1539
\family typewriter
 
1540
const char*
 
1541
\family default
 
1542
 is used.
 
1543
 Therefore 
 
1544
\family typewriter
 
1545
args(name)
 
1546
\family default
 
1547
 in touch with the 
 
1548
\series bold
 
1549
execution
 
1550
\series default
 
1551
 
 
1552
\begin_inset LatexCommand \index{execution join point}
 
1553
 
 
1554
\end_inset
 
1555
 
 
1556
 
 
1557
\begin_inset LatexCommand \index{join point!execution}
 
1558
 
 
1559
\end_inset
 
1560
 
 
1561
 join point binds 
 
1562
\family typewriter
 
1563
name
 
1564
\family default
 
1565
 to the first and only parameter of the function 
 
1566
\family typewriter
 
1567
login
 
1568
\family default
 
1569
.
 
1570
 
 
1571
\end_layout
 
1572
 
 
1573
\begin_layout Standard
 
1574
The advice declaration in the example above following the pointcut declaration
 
1575
 binds the execution of advice code to the event when a join point described
 
1576
 in 
 
1577
\family typewriter
 
1578
new_user
 
1579
\family default
 
1580
 is reached.
 
1581
 The context variable
 
1582
\begin_inset LatexCommand \index{context variables}
 
1583
 
 
1584
\end_inset
 
1585
 
 
1586
 that holds the actual value of the parameter of the reached join point
 
1587
 has to be declared as a formal parameter of 
 
1588
\family typewriter
 
1589
before
 
1590
\family default
 
1591
 
1592
\family typewriter
 
1593
after
 
1594
\family default
 
1595
, or 
 
1596
\family typewriter
 
1597
around
 
1598
\family default
 
1599
.
 
1600
 This parameter can be used in the advice code like an oridinary function
 
1601
 parameter.
 
1602
\end_layout
 
1603
 
 
1604
\begin_layout Standard
 
1605
Beside the pointcut function 
 
1606
\family typewriter
 
1607
args
 
1608
\family default
 
1609
 
 
1610
\begin_inset LatexCommand \index{args@\texttt{args()}}
 
1611
 
 
1612
\end_inset
 
1613
 
 
1614
 
 
1615
\begin_inset LatexCommand \index{pointcut function!args@\texttt{args()}}
 
1616
 
 
1617
\end_inset
 
1618
 
 
1619
 the binding of context variables is performed by 
 
1620
\family typewriter
 
1621
that
 
1622
\family default
 
1623
 
 
1624
\begin_inset LatexCommand \index{that@\texttt{that()}}
 
1625
 
 
1626
\end_inset
 
1627
 
 
1628
 
 
1629
\begin_inset LatexCommand \index{pointcut function!that@\texttt{that()}}
 
1630
 
 
1631
\end_inset
 
1632
 
 
1633
,
 
1634
\family typewriter
 
1635
 target
 
1636
\family default
 
1637
 
 
1638
\begin_inset LatexCommand \index{target@\texttt{target()}}
 
1639
 
 
1640
\end_inset
 
1641
 
 
1642
 
 
1643
\begin_inset LatexCommand \index{pointcut function!target@\texttt{target()}}
 
1644
 
 
1645
\end_inset
 
1646
 
 
1647
, and 
 
1648
\family typewriter
 
1649
result
 
1650
\family default
 
1651
 
 
1652
\begin_inset LatexCommand \index{result@\texttt{result()}}
 
1653
 
 
1654
\end_inset
 
1655
 
 
1656
 
 
1657
\begin_inset LatexCommand \index{pointcut function!base@\texttt{base()}}
 
1658
 
 
1659
\end_inset
 
1660
 
 
1661
.
 
1662
 At the same time these pointcut functions act as filters corresponding
 
1663
 to the type of the context variable.
 
1664
 For instance 
 
1665
\family typewriter
 
1666
args
 
1667
\family default
 
1668
 in the example above filters all join points having an argument of type
 
1669
 
 
1670
\family typewriter
 
1671
const char*
 
1672
\family default
 
1673
.
 
1674
\begin_inset LatexCommand \index{advice!code|)}
 
1675
 
 
1676
\end_inset
 
1677
 
 
1678
 
 
1679
\end_layout
 
1680
 
 
1681
\begin_layout Subsubsection
 
1682
Introductions
 
1683
\begin_inset LatexCommand \index{introduction|(}
 
1684
 
 
1685
\end_inset
 
1686
 
 
1687
 
 
1688
\begin_inset LatexCommand \index{advice!introduction|(}
 
1689
 
 
1690
\end_inset
 
1691
 
 
1692
 
 
1693
\end_layout
 
1694
 
 
1695
\begin_layout Standard
 
1696
The second type of advice supported by AspectC++ are the introductions.
 
1697
 Introductions are used to extend program code and data structures in particular.
 
1698
 The following example extends two classes each by an attribute and a method.
 
1699
\end_layout
 
1700
 
 
1701
\begin_layout Subsubsection*
 
1702
Example: introductions
 
1703
\begin_inset LatexCommand \label{exa:introductions}
 
1704
 
 
1705
\end_inset
 
1706
 
 
1707
 
 
1708
\end_layout
 
1709
 
 
1710
\begin_layout LyX-Code
 
1711
pointcut shapes() = "Circle" || "Polygon";
 
1712
\newline
 
1713
 
 
1714
\newline
 
1715
advice shapes() : slice class
 
1716
 {
 
1717
\newline
 
1718
  bool m_shaded;
 
1719
\newline
 
1720
  void shaded(bool state) {
 
1721
\newline
 
1722
    m_shaded = state;
 
1723
\newline
 
1724
  }
 
1725
\newline
 
1726
};
 
1727
\end_layout
 
1728
 
 
1729
\begin_layout Standard
 
1730
Like an ordinary advice declaration an introduction is introduced by the
 
1731
 keyword 
 
1732
\family typewriter
 
1733
advice
 
1734
\family default
 
1735
.
 
1736
 If the following pointcut is a name pointcut
 
1737
\begin_inset LatexCommand \index{name pointcut}
 
1738
 
 
1739
\end_inset
 
1740
 
 
1741
 
 
1742
\begin_inset LatexCommand \index{pointcut!name}
 
1743
 
 
1744
\end_inset
 
1745
 
 
1746
 the slice declaration following the token 
 
1747
\begin_inset Quotes eld
 
1748
\end_inset
 
1749
 
 
1750
:
 
1751
\begin_inset Quotes erd
 
1752
\end_inset
 
1753
 
 
1754
 is introduced in the classes and aspects described by the pointcut.
 
1755
 Introduced code can then be used in normal program code like any other
 
1756
 function, attribute, etc.
 
1757
 Advice code in introductions has full access rights
 
1758
\begin_inset LatexCommand \index{introduction!access rights}
 
1759
 
 
1760
\end_inset
 
1761
 
 
1762
 regarding to program code at a join point, i.e.\InsetSpace ~
 
1763
a method introduced in a class
 
1764
 has access even to private members of that class.
 
1765
\end_layout
 
1766
 
 
1767
\begin_layout Standard
 
1768
Slices can also be used to introduce new base classes.
 
1769
 In the first line of the following example it is made sure that every class
 
1770
 with a name that ends with 
 
1771
\begin_inset Quotes eld
 
1772
\end_inset
 
1773
 
 
1774
Object
 
1775
\begin_inset Quotes erd
 
1776
\end_inset
 
1777
 
 
1778
 is derived from a class 
 
1779
\family typewriter
 
1780
MemoryPool
 
1781
\family default
 
1782
.
 
1783
 This class may implement an own memory management by overloading the 
 
1784
\family typewriter
 
1785
new
 
1786
\family default
 
1787
 and 
 
1788
\family typewriter
 
1789
delete
 
1790
\family default
 
1791
 operators.
 
1792
 Classes that inherit from 
 
1793
\family typewriter
 
1794
MemoryPool
 
1795
\family default
 
1796
 must redefine the pure virtual method 
 
1797
\family typewriter
 
1798
release
 
1799
\family default
 
1800
 that is part of the implemented memory management.
 
1801
 This is done in the second line for all classes in the pointcut
 
1802
\begin_inset LatexCommand \index{advice|)}
 
1803
 
 
1804
\end_inset
 
1805
 
 
1806
 
 
1807
\begin_inset LatexCommand \index{introduction|)}
 
1808
 
 
1809
\end_inset
 
1810
 
 
1811
 
 
1812
\begin_inset LatexCommand \index{advice!introduction|)}
 
1813
 
 
1814
\end_inset
 
1815
 
 
1816
.
 
1817
\end_layout
 
1818
 
 
1819
\begin_layout Subsubsection*
 
1820
Example: base class introduction
 
1821
\begin_inset LatexCommand \label{exa:base-class-intro}
 
1822
 
 
1823
\end_inset
 
1824
 
 
1825
 
 
1826
\end_layout
 
1827
 
 
1828
\begin_layout LyX-Code
 
1829
advice "%Object" : slice class : public MemoryPool {
 
1830
\newline
 
1831
  virtual void release()
 
1832
 = 0;
 
1833
\newline
 
1834
}
 
1835
\end_layout
 
1836
 
 
1837
\begin_layout Subsubsection
 
1838
Advice Ordering
 
1839
\begin_inset LatexCommand \index{ordering|(}
 
1840
 
 
1841
\end_inset
 
1842
 
 
1843
 
 
1844
\end_layout
 
1845
 
 
1846
\begin_layout Standard
 
1847
If more than one advice affects the same join point it might be necessary
 
1848
 to define an order of advice execution if there is a dependency between
 
1849
 the advice codes (
 
1850
\begin_inset Quotes eld
 
1851
\end_inset
 
1852
 
 
1853
aspect interaction
 
1854
\begin_inset Quotes erd
 
1855
\end_inset
 
1856
 
 
1857
 
 
1858
\begin_inset LatexCommand \index{aspect interaction}
 
1859
 
 
1860
\end_inset
 
1861
 
 
1862
).
 
1863
 The following example shows how the precedence of advice code can be defined
 
1864
 in AspectC++.
 
1865
\end_layout
 
1866
 
 
1867
\begin_layout Subsubsection*
 
1868
Example: advice ordering
 
1869
\begin_inset LatexCommand \label{exa:order}
 
1870
 
 
1871
\end_inset
 
1872
 
 
1873
 
 
1874
\end_layout
 
1875
 
 
1876
\begin_layout LyX-Code
 
1877
advice execution("void send(...)") : order("Encrypt", "Log")
 
1878
\begin_inset LatexCommand \index{order}
 
1879
 
 
1880
\end_inset
 
1881
 
 
1882
 
 
1883
\begin_inset LatexCommand \index{advice!order}
 
1884
 
 
1885
\end_inset
 
1886
 
 
1887
;
 
1888
\end_layout
 
1889
 
 
1890
\begin_layout Standard
 
1891
If advice of both aspects (see 
 
1892
\begin_inset LatexCommand \ref{sub:Aspects}
 
1893
 
 
1894
\end_inset
 
1895
 
 
1896
 
1897
\family typewriter
 
1898
Encrypt
 
1899
\family default
 
1900
 and 
 
1901
\family typewriter
 
1902
Log
 
1903
\family default
 
1904
 should be run when the function 
 
1905
\family typewriter
 
1906
send(...)
 
1907
\family default
 
1908
 is executed this order declaration defines that the advice of 
 
1909
\family typewriter
 
1910
Encrypt
 
1911
\family default
 
1912
 has a higher precedence.
 
1913
 More details on advice ordering and precedence 
 
1914
\begin_inset LatexCommand \index{precedence}
 
1915
 
 
1916
\end_inset
 
1917
 
 
1918
 can be found in section 
 
1919
\begin_inset LatexCommand \vref{sec:ordering}
 
1920
 
 
1921
\end_inset
 
1922
 
 
1923
.
 
1924
\end_layout
 
1925
 
 
1926
\begin_layout Subsection
 
1927
Aspects
 
1928
\begin_inset LatexCommand \label{sub:Aspects}
 
1929
 
 
1930
\end_inset
 
1931
 
 
1932
 
 
1933
\begin_inset LatexCommand \index{aspect|(}
 
1934
 
 
1935
\end_inset
 
1936
 
 
1937
 
 
1938
\end_layout
 
1939
 
 
1940
\begin_layout Standard
 
1941
The aspect is the language element of AspectC++ to collect introductions
 
1942
 and advice code implementing a common crosscutting concern
 
1943
\begin_inset LatexCommand \index{crosscutting concern}
 
1944
 
 
1945
\end_inset
 
1946
 
 
1947
 in a modular way.
 
1948
 This put aspects in a position to manage common state information.
 
1949
 They are formulated by means of aspect declarations
 
1950
\begin_inset LatexCommand \index{aspect!declaration}
 
1951
 
 
1952
\end_inset
 
1953
 
 
1954
 as a extension to the class concept of C++.
 
1955
 The basic structure of an aspect declaration is exactly the same as an
 
1956
 usual C++ class definition, except for the keyword 
 
1957
\family typewriter
 
1958
aspect
 
1959
\family default
 
1960
 instead of 
 
1961
\family typewriter
 
1962
class
 
1963
\family default
 
1964
 
1965
\family typewriter
 
1966
struct
 
1967
\family default
 
1968
 or 
 
1969
\family typewriter
 
1970
union
 
1971
\family default
 
1972
.
 
1973
 According to that, aspects can have attributes and methods and can inherit
 
1974
 from classes and even other aspects.
 
1975
\end_layout
 
1976
 
 
1977
\begin_layout Subsubsection*
 
1978
Example: aspect declaration
 
1979
\begin_inset LatexCommand \label{exa:aspect-decl}
 
1980
 
 
1981
\end_inset
 
1982
 
 
1983
 
 
1984
\end_layout
 
1985
 
 
1986
\begin_layout LyX-Code
 
1987
aspect Counter { 
 
1988
\newline
 
1989
  static int m_count;
 
1990
\newline
 
1991
  
 
1992
\newline
 
1993
  pointcut counted() = "Circle"
 
1994
 || "Polygon";
 
1995
\newline
 
1996
  
 
1997
\newline
 
1998
  advice counted() : slice struct {
 
1999
\newline
 
2000
    class Helper {
 
2001
\newline
 
2002
  
 
2003
    Helper() { Counter::m_count++; }
 
2004
\newline
 
2005
    } m_counter;
 
2006
\newline
 
2007
  };
 
2008
\newline
 
2009
  
 
2010
\newline
 
2011
  advice execution("%
 
2012
 main(...)") : after() {
 
2013
\newline
 
2014
    cout << "Final count: " << m_count << " objects"
 
2015
 << endl;
 
2016
\newline
 
2017
  }
 
2018
\newline
 
2019
};
 
2020
\newline
 
2021
...
 
2022
 and at an appropriate place
 
2023
\newline
 
2024
#include "Counter.ah"
 
2025
\newline
 
2026
int Counter::m_count = 0;
 
2027
\end_layout
 
2028
 
 
2029
\begin_layout Standard
 
2030
In this example the count of object instantiations for a set of classes
 
2031
 is determined.
 
2032
 Therefore, an attribute 
 
2033
\family typewriter
 
2034
m_counter
 
2035
\family default
 
2036
 is introduced into the classes described by the pointcut incrementing a
 
2037
 global counter on construction time.
 
2038
 By applying advice code for the function 
 
2039
\family typewriter
 
2040
main
 
2041
\family default
 
2042
 the final count of object instantiations is displayed when the program
 
2043
 terminates.
 
2044
 
 
2045
\end_layout
 
2046
 
 
2047
\begin_layout Standard
 
2048
This example can also be rewritten as an abstract aspect
 
2049
\begin_inset LatexCommand \index{abstract aspect}
 
2050
 
 
2051
\end_inset
 
2052
 
 
2053
 
 
2054
\begin_inset LatexCommand \index{aspect!abstract}
 
2055
 
 
2056
\end_inset
 
2057
 
 
2058
 that can for instance be archived in an aspect library for the purpose
 
2059
 of reuse.
 
2060
 It only require to reimplement the pointcut declaration to be pure virtual
 
2061
\begin_inset LatexCommand \index{pure virtual!pointcut}
 
2062
 
 
2063
\end_inset
 
2064
 
 
2065
.
 
2066
\end_layout
 
2067
 
 
2068
\begin_layout Subsubsection*
 
2069
Example: abstract aspect
 
2070
\begin_inset LatexCommand \label{exa:abstract-aspect}
 
2071
 
 
2072
\end_inset
 
2073
 
 
2074
 
 
2075
\end_layout
 
2076
 
 
2077
\begin_layout LyX-Code
 
2078
aspect Counter { 
 
2079
\newline
 
2080
  static int m_count;
 
2081
\newline
 
2082
  Counter() : m_count(0) {}
 
2083
\newline
 
2084
  
 
2085
\newline
 
2086
  pointcut
 
2087
 virtual counted() = 0;
 
2088
\newline
 
2089
  ...
 
2090
\newline
 
2091
};
 
2092
\end_layout
 
2093
 
 
2094
\begin_layout Standard
 
2095
It is now possible to inherit from 
 
2096
\family typewriter
 
2097
Counter
 
2098
\family default
 
2099
 to reuse its functionality by reimplementing 
 
2100
\family typewriter
 
2101
counted
 
2102
\family default
 
2103
 to refer to the actual pointcut expression.
 
2104
\end_layout
 
2105
 
 
2106
\begin_layout Subsubsection*
 
2107
Example: reused abstract aspect
 
2108
\begin_inset LatexCommand \label{exa:reused-abstract}
 
2109
 
 
2110
\end_inset
 
2111
 
 
2112
 
 
2113
\end_layout
 
2114
 
 
2115
\begin_layout LyX-Code
 
2116
aspect MyCounter : public Counter { 
 
2117
\newline
 
2118
  pointcut counted() = derived("Shape");
 
2119
\newline
 
2120
};
 
2121
\end_layout
 
2122
 
 
2123
\begin_layout Subsubsection
 
2124
Aspect Instantiation
 
2125
\begin_inset LatexCommand \index{aspect!instantiation|(}
 
2126
 
 
2127
\end_inset
 
2128
 
 
2129
 
 
2130
\end_layout
 
2131
 
 
2132
\begin_layout Standard
 
2133
By default aspects in AspectC++ are automatically instantiated as global
 
2134
 objects.
 
2135
 The idea behind it is that aspects can also provide global program properties
 
2136
 and therefore have to be always accessible.
 
2137
 However in some special cases it may be desired to change this behavior,
 
2138
 e.g.\InsetSpace ~
 
2139
in the context of operating systems when an aspect shall be instantiated
 
2140
 per process or per thread.
 
2141
 
 
2142
\end_layout
 
2143
 
 
2144
\begin_layout Standard
 
2145
The default instantiation scheme can be changed by defining the static method
 
2146
 
 
2147
\family typewriter
 
2148
aspectof
 
2149
\family default
 
2150
 
 
2151
\begin_inset LatexCommand \index{aspectof@\texttt{aspectof()}}
 
2152
 
 
2153
\end_inset
 
2154
 
 
2155
 resp.\InsetSpace ~
 
2156
 
 
2157
\family typewriter
 
2158
aspectOf
 
2159
\family default
 
2160
 
 
2161
\begin_inset LatexCommand \index{aspectOf@\texttt{aspectOf()}}
 
2162
 
 
2163
\end_inset
 
2164
 
 
2165
 that is otherwise generated for an aspect.
 
2166
 This method is intended to be always able to return an instance of the
 
2167
 appropriate aspect.
 
2168
\end_layout
 
2169
 
 
2170
\begin_layout Subsubsection*
 
2171
Example: aspect instantiation using 
 
2172
\family typewriter
 
2173
aspectof
 
2174
\begin_inset LatexCommand \label{exa:aspect-aspectof}
 
2175
 
 
2176
\end_inset
 
2177
 
 
2178
 
 
2179
\end_layout
 
2180
 
 
2181
\begin_layout LyX-Code
 
2182
aspect ThreadCounter : public Counter {
 
2183
\newline
 
2184
  pointcut counted() = "Thread";
 
2185
\newline
 
2186
 
 
2187
  
 
2188
\newline
 
2189
  advice counted() : ThreadCounter m_instance;
 
2190
\newline
 
2191
  
 
2192
\newline
 
2193
  static ThreadCounter
 
2194
 *aspectof() {
 
2195
\newline
 
2196
    return tjp->target()->m_instance;
 
2197
\newline
 
2198
  }
 
2199
\newline
 
2200
};
 
2201
\end_layout
 
2202
 
 
2203
\begin_layout Standard
 
2204
The introduction of 
 
2205
\family typewriter
 
2206
m_instance
 
2207
\family default
 
2208
 into 
 
2209
\family typewriter
 
2210
Thread
 
2211
\family default
 
2212
 guarantees that every thread object has an instance of the aspect.
 
2213
 By calling 
 
2214
\family typewriter
 
2215
aspectof
 
2216
\family default
 
2217
 it is possible to get this instance at any join point which is essential
 
2218
 for accessing advice code and members of the aspect.
 
2219
 For this purpose code in 
 
2220
\family typewriter
 
2221
aspectof
 
2222
\family default
 
2223
 has full access to the actual join point in a way described in the next
 
2224
 section.
 
2225
\begin_inset LatexCommand \index{aspect|)}
 
2226
 
 
2227
\end_inset
 
2228
 
 
2229
 
 
2230
\begin_inset LatexCommand \index{aspect!instantiation|)}
 
2231
 
 
2232
\end_inset
 
2233
 
 
2234
 
 
2235
\end_layout
 
2236
 
 
2237
\begin_layout Subsection
 
2238
Runtime Support
 
2239
\begin_inset LatexCommand \index{runtime support|(}
 
2240
 
 
2241
\end_inset
 
2242
 
 
2243
 
 
2244
\end_layout
 
2245
 
 
2246
\begin_layout Subsubsection
 
2247
Support for Advice Code
 
2248
\begin_inset LatexCommand \index{runtime support!for advice code|(}
 
2249
 
 
2250
\end_inset
 
2251
 
 
2252
 
 
2253
\begin_inset LatexCommand \index{advice!runtime support|(}
 
2254
 
 
2255
\end_inset
 
2256
 
 
2257
 
 
2258
\end_layout
 
2259
 
 
2260
\begin_layout Standard
 
2261
For many aspects access to context variables
 
2262
\begin_inset LatexCommand \index{context variables}
 
2263
 
 
2264
\end_inset
 
2265
 
 
2266
 may not be sufficient to get enough information about the join point where
 
2267
 advice code was activated.
 
2268
 For instance a control flow
 
2269
\begin_inset LatexCommand \index{control flow}
 
2270
 
 
2271
\end_inset
 
2272
 
 
2273
 aspect for a complete logging of function calls in a program would need
 
2274
 information about function arguments and its types on runtime to be able
 
2275
 to produce a type-compatible output.
 
2276
 
 
2277
\end_layout
 
2278
 
 
2279
\begin_layout Standard
 
2280
In AspectC++ this information is provided by the members of the class 
 
2281
\family typewriter
 
2282
JoinPoint
 
2283
\family default
 
2284
 
 
2285
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}}
 
2286
 
 
2287
\end_inset
 
2288
 
 
2289
 
 
2290
\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}}
 
2291
 
 
2292
\end_inset
 
2293
 
 
2294
 
 
2295
\begin_inset ERT
 
2296
status collapsed
 
2297
 
 
2298
\begin_layout Standard
 
2299
 
 
2300
 
 
2301
\backslash
 
2302
begin{comment}
 
2303
\end_layout
 
2304
 
 
2305
\end_inset
 
2306
 
 
2307
available both in advice code and introductions 
 
2308
\begin_inset ERT
 
2309
status collapsed
 
2310
 
 
2311
\begin_layout Standard
 
2312
 
 
2313
\end_layout
 
2314
 
 
2315
\begin_layout Standard
 
2316
 
 
2317
\end_layout
 
2318
 
 
2319
\begin_layout Standard
 
2320
 
 
2321
 
 
2322
\backslash
 
2323
end{comment}
 
2324
\end_layout
 
2325
 
 
2326
\begin_layout Standard
 
2327
 
 
2328
\end_layout
 
2329
 
 
2330
\end_inset
 
2331
 
 
2332
(see table below).
 
2333
 
 
2334
\end_layout
 
2335
 
 
2336
\begin_layout Standard
 
2337
\begin_inset Tabular
 
2338
<lyxtabular version="3" rows="21" columns="2">
 
2339
<features islongtable="true">
 
2340
<column alignment="center" valignment="top" leftline="true" width="0cm">
 
2341
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0cm">
 
2342
<row topline="true">
 
2343
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2344
\begin_inset Text
 
2345
 
 
2346
\begin_layout Standard
 
2347
 
 
2348
\series bold
 
2349
types:
 
2350
\end_layout
 
2351
 
 
2352
\end_inset
 
2353
</cell>
 
2354
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2355
\begin_inset Text
 
2356
 
 
2357
\begin_layout Standard
 
2358
 
 
2359
\end_layout
 
2360
 
 
2361
\end_inset
 
2362
</cell>
 
2363
</row>
 
2364
<row topline="true">
 
2365
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2366
\begin_inset Text
 
2367
 
 
2368
\begin_layout Standard
 
2369
 
 
2370
\family typewriter
 
2371
Result
 
2372
\end_layout
 
2373
 
 
2374
\end_inset
 
2375
</cell>
 
2376
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2377
\begin_inset Text
 
2378
 
 
2379
\begin_layout Standard
 
2380
result type
 
2381
\end_layout
 
2382
 
 
2383
\end_inset
 
2384
</cell>
 
2385
</row>
 
2386
<row topline="true">
 
2387
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2388
\begin_inset Text
 
2389
 
 
2390
\begin_layout Standard
 
2391
 
 
2392
\family typewriter
 
2393
That
 
2394
\end_layout
 
2395
 
 
2396
\end_inset
 
2397
</cell>
 
2398
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2399
\begin_inset Text
 
2400
 
 
2401
\begin_layout Standard
 
2402
object type
 
2403
\end_layout
 
2404
 
 
2405
\end_inset
 
2406
</cell>
 
2407
</row>
 
2408
<row topline="true">
 
2409
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2410
\begin_inset Text
 
2411
 
 
2412
\begin_layout Standard
 
2413
 
 
2414
\family typewriter
 
2415
Target
 
2416
\end_layout
 
2417
 
 
2418
\end_inset
 
2419
</cell>
 
2420
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2421
\begin_inset Text
 
2422
 
 
2423
\begin_layout Standard
 
2424
target type
 
2425
\end_layout
 
2426
 
 
2427
\end_inset
 
2428
</cell>
 
2429
</row>
 
2430
<row topline="true">
 
2431
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2432
\begin_inset Text
 
2433
 
 
2434
\begin_layout Standard
 
2435
 
 
2436
\family typewriter
 
2437
AC::Type
 
2438
\end_layout
 
2439
 
 
2440
\end_inset
 
2441
</cell>
 
2442
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2443
\begin_inset Text
 
2444
 
 
2445
\begin_layout Standard
 
2446
encoded type of an object
 
2447
\end_layout
 
2448
 
 
2449
\end_inset
 
2450
</cell>
 
2451
</row>
 
2452
<row topline="true" bottomline="true">
 
2453
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2454
\begin_inset Text
 
2455
 
 
2456
\begin_layout Standard
 
2457
 
 
2458
\family typewriter
 
2459
AC::JPType
 
2460
\end_layout
 
2461
 
 
2462
\end_inset
 
2463
</cell>
 
2464
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2465
\begin_inset Text
 
2466
 
 
2467
\begin_layout Standard
 
2468
join point types
 
2469
\end_layout
 
2470
 
 
2471
\end_inset
 
2472
</cell>
 
2473
</row>
 
2474
<row topline="true">
 
2475
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2476
\begin_inset Text
 
2477
 
 
2478
\begin_layout Standard
 
2479
 
 
2480
\series bold
 
2481
static methods:
 
2482
\end_layout
 
2483
 
 
2484
\end_inset
 
2485
</cell>
 
2486
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2487
\begin_inset Text
 
2488
 
 
2489
\begin_layout Standard
 
2490
 
 
2491
\end_layout
 
2492
 
 
2493
\end_inset
 
2494
</cell>
 
2495
</row>
 
2496
<row topline="true">
 
2497
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2498
\begin_inset Text
 
2499
 
 
2500
\begin_layout Standard
 
2501
 
 
2502
\family typewriter
 
2503
int args()
 
2504
\end_layout
 
2505
 
 
2506
\end_inset
 
2507
</cell>
 
2508
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2509
\begin_inset Text
 
2510
 
 
2511
\begin_layout Standard
 
2512
number of arguments
 
2513
\end_layout
 
2514
 
 
2515
\end_inset
 
2516
</cell>
 
2517
</row>
 
2518
<row topline="true">
 
2519
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2520
\begin_inset Text
 
2521
 
 
2522
\begin_layout Standard
 
2523
 
 
2524
\family typewriter
 
2525
AC::Type type()
 
2526
\end_layout
 
2527
 
 
2528
\end_inset
 
2529
</cell>
 
2530
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2531
\begin_inset Text
 
2532
 
 
2533
\begin_layout Standard
 
2534
typ of the function or attribute
 
2535
\end_layout
 
2536
 
 
2537
\end_inset
 
2538
</cell>
 
2539
</row>
 
2540
<row topline="true">
 
2541
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2542
\begin_inset Text
 
2543
 
 
2544
\begin_layout Standard
 
2545
 
 
2546
\family typewriter
 
2547
AC::Type argtype(int)
 
2548
\end_layout
 
2549
 
 
2550
\end_inset
 
2551
</cell>
 
2552
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2553
\begin_inset Text
 
2554
 
 
2555
\begin_layout Standard
 
2556
types of the arguments
 
2557
\end_layout
 
2558
 
 
2559
\end_inset
 
2560
</cell>
 
2561
</row>
 
2562
<row topline="true">
 
2563
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2564
\begin_inset Text
 
2565
 
 
2566
\begin_layout Standard
 
2567
 
 
2568
\family typewriter
 
2569
const char *signature()
 
2570
\end_layout
 
2571
 
 
2572
\end_inset
 
2573
</cell>
 
2574
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2575
\begin_inset Text
 
2576
 
 
2577
\begin_layout Standard
 
2578
signature of the function or attribute
 
2579
\end_layout
 
2580
 
 
2581
\end_inset
 
2582
</cell>
 
2583
</row>
 
2584
<row topline="true">
 
2585
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2586
\begin_inset Text
 
2587
 
 
2588
\begin_layout Standard
 
2589
 
 
2590
\family typewriter
 
2591
unsigned id()
 
2592
\end_layout
 
2593
 
 
2594
\end_inset
 
2595
</cell>
 
2596
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2597
\begin_inset Text
 
2598
 
 
2599
\begin_layout Standard
 
2600
identification of the join point
 
2601
\end_layout
 
2602
 
 
2603
\end_inset
 
2604
</cell>
 
2605
</row>
 
2606
<row topline="true">
 
2607
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2608
\begin_inset Text
 
2609
 
 
2610
\begin_layout Standard
 
2611
 
 
2612
\family typewriter
 
2613
AC::Type resulttype()
 
2614
\end_layout
 
2615
 
 
2616
\end_inset
 
2617
</cell>
 
2618
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2619
\begin_inset Text
 
2620
 
 
2621
\begin_layout Standard
 
2622
result type
 
2623
\end_layout
 
2624
 
 
2625
\end_inset
 
2626
</cell>
 
2627
</row>
 
2628
<row topline="true" bottomline="true">
 
2629
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2630
\begin_inset Text
 
2631
 
 
2632
\begin_layout Standard
 
2633
 
 
2634
\family typewriter
 
2635
AC::JPType jptype()
 
2636
\end_layout
 
2637
 
 
2638
\end_inset
 
2639
</cell>
 
2640
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2641
\begin_inset Text
 
2642
 
 
2643
\begin_layout Standard
 
2644
type of join point
 
2645
\end_layout
 
2646
 
 
2647
\end_inset
 
2648
</cell>
 
2649
</row>
 
2650
<row topline="true">
 
2651
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2652
\begin_inset Text
 
2653
 
 
2654
\begin_layout Standard
 
2655
 
 
2656
\series bold
 
2657
non-static methods:
 
2658
\end_layout
 
2659
 
 
2660
\end_inset
 
2661
</cell>
 
2662
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2663
\begin_inset Text
 
2664
 
 
2665
\begin_layout Standard
 
2666
 
 
2667
\end_layout
 
2668
 
 
2669
\end_inset
 
2670
</cell>
 
2671
</row>
 
2672
<row topline="true">
 
2673
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2674
\begin_inset Text
 
2675
 
 
2676
\begin_layout Standard
 
2677
 
 
2678
\family typewriter
 
2679
void *arg(int)
 
2680
\end_layout
 
2681
 
 
2682
\end_inset
 
2683
</cell>
 
2684
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2685
\begin_inset Text
 
2686
 
 
2687
\begin_layout Standard
 
2688
actual argument
 
2689
\end_layout
 
2690
 
 
2691
\end_inset
 
2692
</cell>
 
2693
</row>
 
2694
<row topline="true">
 
2695
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2696
\begin_inset Text
 
2697
 
 
2698
\begin_layout Standard
 
2699
 
 
2700
\family typewriter
 
2701
Result *result()
 
2702
\end_layout
 
2703
 
 
2704
\end_inset
 
2705
</cell>
 
2706
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2707
\begin_inset Text
 
2708
 
 
2709
\begin_layout Standard
 
2710
result value
 
2711
\end_layout
 
2712
 
 
2713
\end_inset
 
2714
</cell>
 
2715
</row>
 
2716
<row topline="true">
 
2717
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2718
\begin_inset Text
 
2719
 
 
2720
\begin_layout Standard
 
2721
 
 
2722
\family typewriter
 
2723
That *that()
 
2724
\end_layout
 
2725
 
 
2726
\end_inset
 
2727
</cell>
 
2728
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2729
\begin_inset Text
 
2730
 
 
2731
\begin_layout Standard
 
2732
object refered to by 
 
2733
\family typewriter
 
2734
\size small
 
2735
this
 
2736
\end_layout
 
2737
 
 
2738
\end_inset
 
2739
</cell>
 
2740
</row>
 
2741
<row topline="true">
 
2742
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2743
\begin_inset Text
 
2744
 
 
2745
\begin_layout Standard
 
2746
 
 
2747
\family typewriter
 
2748
Target *target()
 
2749
\end_layout
 
2750
 
 
2751
\end_inset
 
2752
</cell>
 
2753
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2754
\begin_inset Text
 
2755
 
 
2756
\begin_layout Standard
 
2757
target object of a call
 
2758
\end_layout
 
2759
 
 
2760
\end_inset
 
2761
</cell>
 
2762
</row>
 
2763
<row topline="true">
 
2764
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2765
\begin_inset Text
 
2766
 
 
2767
\begin_layout Standard
 
2768
 
 
2769
\family typewriter
 
2770
void proceed()
 
2771
\end_layout
 
2772
 
 
2773
\end_inset
 
2774
</cell>
 
2775
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2776
\begin_inset Text
 
2777
 
 
2778
\begin_layout Standard
 
2779
execute join point code
 
2780
\end_layout
 
2781
 
 
2782
\end_inset
 
2783
</cell>
 
2784
</row>
 
2785
<row topline="true" bottomline="true">
 
2786
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
2787
\begin_inset Text
 
2788
 
 
2789
\begin_layout Standard
 
2790
 
 
2791
\family typewriter
 
2792
AC::Action &action()
 
2793
\end_layout
 
2794
 
 
2795
\end_inset
 
2796
</cell>
 
2797
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
2798
\begin_inset Text
 
2799
 
 
2800
\begin_layout Standard
 
2801
 
 
2802
\family typewriter
 
2803
Action
 
2804
\family default
 
2805
 structure
 
2806
\end_layout
 
2807
 
 
2808
\end_inset
 
2809
</cell>
 
2810
</row>
 
2811
</lyxtabular>
 
2812
 
 
2813
\end_inset
 
2814
 
 
2815
 
 
2816
\end_layout
 
2817
 
 
2818
\begin_layout Standard
 
2819
\align center
 
2820
Table 1: API of class 
 
2821
\family typewriter
 
2822
JoinPoint
 
2823
\family default
 
2824
 available in advice code
 
2825
\end_layout
 
2826
 
 
2827
\begin_layout Standard
 
2828
Types and static methods of the 
 
2829
\family typewriter
 
2830
JoinPoint
 
2831
\family default
 
2832
 API deliver information that is the same for every advice code activation.
 
2833
 The non-static methods deliver information that differ from one activation
 
2834
 to another.
 
2835
 These methods are accessed by the object 
 
2836
\family typewriter
 
2837
tjp
 
2838
\family default
 
2839
 
 
2840
\begin_inset LatexCommand \index{tjp@\texttt{tjp}}
 
2841
 
 
2842
\end_inset
 
2843
 
 
2844
 
 
2845
\begin_inset LatexCommand \index{runtime support!thisJoinPoint@\texttt{thisJoinPoint}}
 
2846
 
 
2847
\end_inset
 
2848
 
 
2849
 resp.\InsetSpace ~
 
2850
 
 
2851
\family typewriter
 
2852
thisJoinPoint
 
2853
\family default
 
2854
 
 
2855
\begin_inset LatexCommand \index{thisJoinPoint@\texttt{thisJoinPoint}}
 
2856
 
 
2857
\end_inset
 
2858
 
 
2859
 
 
2860
\begin_inset LatexCommand \index{runtime support!thisJoinPoint@\texttt{thisJoinPoint}}
 
2861
 
 
2862
\end_inset
 
2863
 
 
2864
 which is of type 
 
2865
\family typewriter
 
2866
JoinPoint
 
2867
\family default
 
2868
 and is always available in advice code
 
2869
\begin_inset ERT
 
2870
status collapsed
 
2871
 
 
2872
\begin_layout Standard
 
2873
 
 
2874
 
 
2875
\backslash
 
2876
begin{comment}
 
2877
\end_layout
 
2878
 
 
2879
\end_inset
 
2880
 
 
2881
 and introductions
 
2882
\begin_inset ERT
 
2883
status collapsed
 
2884
 
 
2885
\begin_layout Standard
 
2886
 
 
2887
\end_layout
 
2888
 
 
2889
\begin_layout Standard
 
2890
 
 
2891
\end_layout
 
2892
 
 
2893
\begin_layout Standard
 
2894
 
 
2895
 
 
2896
\backslash
 
2897
end{comment}
 
2898
\end_layout
 
2899
 
 
2900
\begin_layout Standard
 
2901
 
 
2902
\end_layout
 
2903
 
 
2904
\end_inset
 
2905
 
 
2906
, too.
 
2907
\end_layout
 
2908
 
 
2909
\begin_layout Standard
 
2910
The following example illustrates how to implement a re-usable control flow
 
2911
\begin_inset LatexCommand \index{control flow}
 
2912
 
 
2913
\end_inset
 
2914
 
 
2915
 aspect using the 
 
2916
\family typewriter
 
2917
JoinPoint
 
2918
\family default
 
2919
 API.
 
2920
 
 
2921
\end_layout
 
2922
 
 
2923
\begin_layout Subsubsection*
 
2924
Example: re-usable trace aspect
 
2925
\begin_inset LatexCommand \label{exa:re-usable-trace}
 
2926
 
 
2927
\end_inset
 
2928
 
 
2929
 
 
2930
\end_layout
 
2931
 
 
2932
\begin_layout LyX-Code
 
2933
aspect Trace {
 
2934
\newline
 
2935
  pointcut virtual methods() = 0;
 
2936
\newline
 
2937
  
 
2938
\newline
 
2939
  advice execution(methods())
 
2940
 : around() {
 
2941
\newline
 
2942
    cout << "before " << JoinPoint::signature() << "(";
 
2943
\end_layout
 
2944
 
 
2945
\begin_layout LyX-Code
 
2946
    for (unsigned i = 0; i < JoinPoint::args(); i++)
 
2947
\newline
 
2948
      printvalue(tjp->arg(i)
 
2949
, JoinPoint::argtype(i));
 
2950
\newline
 
2951
    cout << ")" << endl;
 
2952
\newline
 
2953
    tjp->proceed()
 
2954
\series bold
 
2955
;
 
2956
\newline
 
2957
 
 
2958
\series default
 
2959
    cout << "after" << endl;
 
2960
\newline
 
2961
  } 
 
2962
\newline
 
2963
};
 
2964
\end_layout
 
2965
 
 
2966
\begin_layout Standard
 
2967
This aspect weaves tracing code into every function specified by the virtual
 
2968
 pointcut
 
2969
\begin_inset LatexCommand \index{pure virtual!pointcut}
 
2970
 
 
2971
\end_inset
 
2972
 
 
2973
 redefined in a derived aspect.
 
2974
 The helper function 
 
2975
\family typewriter
 
2976
printvalue
 
2977
\family default
 
2978
 is responsible for the formated output of the arguments given at the function
 
2979
 call.
 
2980
 After calling 
 
2981
\family typewriter
 
2982
printvalue
 
2983
\family default
 
2984
 for every argument the program code of the actual join point is executed
 
2985
 by calling 
 
2986
\family typewriter
 
2987
proceed
 
2988
\family default
 
2989
 
 
2990
\begin_inset LatexCommand \index{proceed@\texttt{proceed()}}
 
2991
 
 
2992
\end_inset
 
2993
 
 
2994
 
 
2995
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!proceed()@\texttt{proceed()}}
 
2996
 
 
2997
\end_inset
 
2998
 
 
2999
 on the 
 
3000
\family typewriter
 
3001
JoinPoint
 
3002
\family default
 
3003
 object.
 
3004
 The functionality of 
 
3005
\family typewriter
 
3006
proceed
 
3007
\family default
 
3008
 is achieved by making use of the so-called actions.
 
3009
\end_layout
 
3010
 
 
3011
\begin_layout Subsubsection
 
3012
Actions
 
3013
\begin_inset LatexCommand \index{action|(}
 
3014
 
 
3015
\end_inset
 
3016
 
 
3017
 
 
3018
\begin_inset LatexCommand \index{runtime support!action|(}
 
3019
 
 
3020
\end_inset
 
3021
 
 
3022
 
 
3023
\end_layout
 
3024
 
 
3025
\begin_layout Standard
 
3026
In AspectC++ an action is the statement sequence that would follow a reached
 
3027
 join point in a running program if advice code would not have been activated.
 
3028
 Thus 
 
3029
\family typewriter
 
3030
tjp->proceed()
 
3031
\family default
 
3032
 
 
3033
\begin_inset LatexCommand \index{proceed@\texttt{proceed()}}
 
3034
 
 
3035
\end_inset
 
3036
 
 
3037
 
 
3038
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!proceed()@\texttt{proceed()}}
 
3039
 
 
3040
\end_inset
 
3041
 
 
3042
 triggers the execution of the program code of a join point.
 
3043
 This can be the call or execution of a function
 
3044
\begin_inset ERT
 
3045
status collapsed
 
3046
 
 
3047
\begin_layout Standard
 
3048
 
 
3049
 
 
3050
\backslash
 
3051
begin{comment}
 
3052
\end_layout
 
3053
 
 
3054
\end_inset
 
3055
 
 
3056
 as well as the writing or reading of attributes or variables
 
3057
\begin_inset ERT
 
3058
status collapsed
 
3059
 
 
3060
\begin_layout Standard
 
3061
 
 
3062
\end_layout
 
3063
 
 
3064
\begin_layout Standard
 
3065
 
 
3066
\end_layout
 
3067
 
 
3068
\begin_layout Standard
 
3069
 
 
3070
 
 
3071
\backslash
 
3072
end{comment}
 
3073
\end_layout
 
3074
 
 
3075
\begin_layout Standard
 
3076
 
 
3077
\end_layout
 
3078
 
 
3079
\end_inset
 
3080
 
 
3081
.
 
3082
 The actions concept is realized in the 
 
3083
\family typewriter
 
3084
AC::Action
 
3085
\family default
 
3086
 structure.
 
3087
 In fact, 
 
3088
\family typewriter
 
3089
proceed
 
3090
\family default
 
3091
 is equivalent to 
 
3092
\family typewriter
 
3093
action().trigger()
 
3094
\family default
 
3095
 
 
3096
\begin_inset LatexCommand \index{trigger@\texttt{trigger()}}
 
3097
 
 
3098
\end_inset
 
3099
 
 
3100
 
 
3101
\begin_inset LatexCommand \index{action!trigger@\texttt{trigger()}}
 
3102
 
 
3103
\end_inset
 
3104
 
 
3105
 so that 
 
3106
\family typewriter
 
3107
tjp->proceed()
 
3108
\family default
 
3109
 may also be replaced by 
 
3110
\family typewriter
 
3111
tjp->action().trigger()
 
3112
\family default
 
3113
.
 
3114
 Thereby the method 
 
3115
\family typewriter
 
3116
action()
 
3117
\family default
 
3118
 
 
3119
\begin_inset LatexCommand \index{action@\texttt{action()}}
 
3120
 
 
3121
\end_inset
 
3122
 
 
3123
 
 
3124
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!action@\texttt{action()}}
 
3125
 
 
3126
\end_inset
 
3127
 
 
3128
 of the 
 
3129
\family typewriter
 
3130
JoinPoint
 
3131
\family default
 
3132
 
 
3133
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}}
 
3134
 
 
3135
\end_inset
 
3136
 
 
3137
 
 
3138
\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}}
 
3139
 
 
3140
\end_inset
 
3141
 
 
3142
 API returns the actual action object for a join point.
 
3143
\begin_inset LatexCommand \index{runtime support!for advice code|)}
 
3144
 
 
3145
\end_inset
 
3146
 
 
3147
 
 
3148
\begin_inset LatexCommand \index{advice!runtime support|)}
 
3149
 
 
3150
\end_inset
 
3151
 
 
3152
 
 
3153
\begin_inset LatexCommand \index{action|)}
 
3154
 
 
3155
\end_inset
 
3156
 
 
3157
 
 
3158
\begin_inset LatexCommand \index{runtime support!action|)}
 
3159
 
 
3160
\end_inset
 
3161
 
 
3162
 
 
3163
\end_layout
 
3164
 
 
3165
\begin_layout Standard
 
3166
\begin_inset ERT
 
3167
status collapsed
 
3168
 
 
3169
\begin_layout Standard
 
3170
 
 
3171
 
 
3172
\backslash
 
3173
begin{comment}
 
3174
\end_layout
 
3175
 
 
3176
\end_inset
 
3177
 
 
3178
 
 
3179
\end_layout
 
3180
 
 
3181
\begin_layout Subsubsection
 
3182
Support for Introductions
 
3183
\begin_inset LatexCommand \index{runtime support!for introductions|(}
 
3184
 
 
3185
\end_inset
 
3186
 
 
3187
 
 
3188
\begin_inset LatexCommand \index{introduction!runtime support|(}
 
3189
 
 
3190
\end_inset
 
3191
 
 
3192
 
 
3193
\end_layout
 
3194
 
 
3195
\begin_layout Standard
 
3196
The 
 
3197
\family typewriter
 
3198
JoinPoint
 
3199
\family default
 
3200
 API available in code introduced by an introduction is listed in the following
 
3201
 table.
 
3202
\end_layout
 
3203
 
 
3204
\begin_layout Standard
 
3205
\begin_inset Float table
 
3206
placement H
 
3207
wide false
 
3208
sideways false
 
3209
status open
 
3210
 
 
3211
\begin_layout Standard
 
3212
\align center
 
3213
\begin_inset Tabular
 
3214
<lyxtabular version="3" rows="6" columns="2">
 
3215
<features>
 
3216
<column alignment="center" valignment="top" leftline="true" width="0pt">
 
3217
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0cm">
 
3218
<row topline="true">
 
3219
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3220
\begin_inset Text
 
3221
 
 
3222
\begin_layout Standard
 
3223
 
 
3224
\series bold
 
3225
static methods:
 
3226
\end_layout
 
3227
 
 
3228
\end_inset
 
3229
</cell>
 
3230
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3231
\begin_inset Text
 
3232
 
 
3233
\begin_layout Standard
 
3234
 
 
3235
\end_layout
 
3236
 
 
3237
\end_inset
 
3238
</cell>
 
3239
</row>
 
3240
<row topline="true">
 
3241
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3242
\begin_inset Text
 
3243
 
 
3244
\begin_layout Standard
 
3245
 
 
3246
\family typewriter
 
3247
const char *signature()
 
3248
\end_layout
 
3249
 
 
3250
\end_inset
 
3251
</cell>
 
3252
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3253
\begin_inset Text
 
3254
 
 
3255
\begin_layout Standard
 
3256
signature of the function or attribute
 
3257
\end_layout
 
3258
 
 
3259
\end_inset
 
3260
</cell>
 
3261
</row>
 
3262
<row topline="true">
 
3263
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3264
\begin_inset Text
 
3265
 
 
3266
\begin_layout Standard
 
3267
 
 
3268
\family typewriter
 
3269
unsigned id()
 
3270
\end_layout
 
3271
 
 
3272
\end_inset
 
3273
</cell>
 
3274
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3275
\begin_inset Text
 
3276
 
 
3277
\begin_layout Standard
 
3278
identification of the join point
 
3279
\end_layout
 
3280
 
 
3281
\end_inset
 
3282
</cell>
 
3283
</row>
 
3284
<row topline="true">
 
3285
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3286
\begin_inset Text
 
3287
 
 
3288
\begin_layout Standard
 
3289
 
 
3290
\family typewriter
 
3291
AC::JPType jptype()
 
3292
\end_layout
 
3293
 
 
3294
\end_inset
 
3295
</cell>
 
3296
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3297
\begin_inset Text
 
3298
 
 
3299
\begin_layout Standard
 
3300
type of join point
 
3301
\end_layout
 
3302
 
 
3303
\end_inset
 
3304
</cell>
 
3305
</row>
 
3306
<row topline="true">
 
3307
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3308
\begin_inset Text
 
3309
 
 
3310
\begin_layout Standard
 
3311
 
 
3312
\series bold
 
3313
types:
 
3314
\end_layout
 
3315
 
 
3316
\end_inset
 
3317
</cell>
 
3318
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3319
\begin_inset Text
 
3320
 
 
3321
\begin_layout Standard
 
3322
 
 
3323
\end_layout
 
3324
 
 
3325
\end_inset
 
3326
</cell>
 
3327
</row>
 
3328
<row topline="true" bottomline="true">
 
3329
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3330
\begin_inset Text
 
3331
 
 
3332
\begin_layout Standard
 
3333
 
 
3334
\family typewriter
 
3335
Aspect
 
3336
\end_layout
 
3337
 
 
3338
\end_inset
 
3339
</cell>
 
3340
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3341
\begin_inset Text
 
3342
 
 
3343
\begin_layout Standard
 
3344
type of the aspect
 
3345
\end_layout
 
3346
 
 
3347
\end_inset
 
3348
</cell>
 
3349
</row>
 
3350
</lyxtabular>
 
3351
 
 
3352
\end_inset
 
3353
 
 
3354
 
 
3355
\end_layout
 
3356
 
 
3357
\begin_layout Caption
 
3358
 
 
3359
\family typewriter
 
3360
JoinPoint
 
3361
\family default
 
3362
 API for introductions
 
3363
\end_layout
 
3364
 
 
3365
\end_inset
 
3366
 
 
3367
 
 
3368
\end_layout
 
3369
 
 
3370
\begin_layout Standard
 
3371
In difference to the API available for advice code the API for introduction
 
3372
 only provides static information about a join point.
 
3373
 A nice demonstration of this API is shown in the following example.
 
3374
\end_layout
 
3375
 
 
3376
\begin_layout Subsubsection*
 
3377
Example: static type identification using introductions
 
3378
\begin_inset LatexCommand \label{exa:static-type-id}
 
3379
 
 
3380
\end_inset
 
3381
 
 
3382
 
 
3383
\end_layout
 
3384
 
 
3385
\begin_layout LyX-Code
 
3386
aspect TypeInfo {
 
3387
\newline
 
3388
  pointcut virtual typed() = 0;
 
3389
\newline
 
3390
  
 
3391
\newline
 
3392
  advice typed() : static
 
3393
 unsigned type_id() {
 
3394
\newline
 
3395
    return JoinPoint::id();
 
3396
\newline
 
3397
  }
 
3398
\newline
 
3399
  
 
3400
\newline
 
3401
  advice typed() :
 
3402
 virtual unsigned type() { 
 
3403
\newline
 
3404
    return type_id(); 
 
3405
\newline
 
3406
  }
 
3407
\newline
 
3408
};
 
3409
\end_layout
 
3410
 
 
3411
\begin_layout Standard
 
3412
The first introduction of this aspect introduces a static method 
 
3413
\family typewriter
 
3414
type_id
 
3415
\family default
 
3416
 into a set of classes returning an unique integer value.
 
3417
 By introducing a second non-static but virtual method type into these classes
 
3418
 also returning the unique integer value a type identification can be realized
 
3419
 like this:
 
3420
\end_layout
 
3421
 
 
3422
\begin_layout LyX-Code
 
3423
if (obj->type() == AClass::type_id())
 
3424
\newline
 
3425
  ...
 
3426
\newline
 
3427
else if (obj->type() == AnotherClass::typ
 
3428
e_id())
 
3429
\newline
 
3430
  ...
 
3431
\end_layout
 
3432
 
 
3433
\begin_layout Standard
 
3434
This implements a nice alternative to the C++ RTTI mechanism especially
 
3435
 when the RTTI support of a compiler is switched off.
 
3436
 
 
3437
\end_layout
 
3438
 
 
3439
\begin_layout Standard
 
3440
Code of introductions have to use the type 
 
3441
\family typewriter
 
3442
Aspect
 
3443
\family default
 
3444
 
 
3445
\begin_inset LatexCommand \index{Aspect@\texttt{Aspect}}
 
3446
 
 
3447
\end_inset
 
3448
 
 
3449
 
 
3450
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Aspect@\texttt{Aspect}}
 
3451
 
 
3452
\end_inset
 
3453
 
 
3454
 to get access to the methods and attributes of an aspect, e.g.\InsetSpace ~
 
3455
by calling
 
3456
 
 
3457
\family typewriter
 
3458
Aspect::aspectof()
 
3459
\family default
 
3460
.
 
3461
 Because the static function 
 
3462
\family typewriter
 
3463
aspectof
 
3464
\family default
 
3465
 
 
3466
\begin_inset LatexCommand \index{aspectof@\texttt{aspectof()}}
 
3467
 
 
3468
\end_inset
 
3469
 
 
3470
 is always generated for an aspect, except when it is already explicitly
 
3471
 defined, 
 
3472
\family typewriter
 
3473
aspectof
 
3474
\family default
 
3475
 always returns the actual aspect instance.
 
3476
 By courtesy of this technique the example 
 
3477
\begin_inset LatexCommand \vpageref{exa:aspect-decl}
 
3478
 
 
3479
\end_inset
 
3480
 
 
3481
 can be changed to provide not only the count of all threads but to provide
 
3482
 a count for every thread.
 
3483
\end_layout
 
3484
 
 
3485
\begin_layout Subsubsection*
 
3486
Example: 
 
3487
\begin_inset LatexCommand \label{exa:extended-thread}
 
3488
 
 
3489
\end_inset
 
3490
 
 
3491
extended thread counting
 
3492
\begin_inset LatexCommand \index{runtime support|)}
 
3493
 
 
3494
\end_inset
 
3495
 
 
3496
 
 
3497
\begin_inset LatexCommand \index{runtime support!for introductions|)}
 
3498
 
 
3499
\end_inset
 
3500
 
 
3501
 
 
3502
\begin_inset LatexCommand \index{introduction!runtime support|)}
 
3503
 
 
3504
\end_inset
 
3505
 
 
3506
 
 
3507
\end_layout
 
3508
 
 
3509
\begin_layout LyX-Code
 
3510
aspect Counter { 
 
3511
\newline
 
3512
  int m_count;
 
3513
\newline
 
3514
  ...
 
3515
\newline
 
3516
  advice counted() : class Helper {
 
3517
\newline
 
3518
   
 
3519
 Helper() { Aspect::aspectof()->m_count++; }
 
3520
\newline
 
3521
  } m_counter;
 
3522
\newline
 
3523
  ...
 
3524
\newline
 
3525
};
 
3526
\end_layout
 
3527
 
 
3528
\begin_layout Standard
 
3529
\begin_inset ERT
 
3530
status collapsed
 
3531
 
 
3532
\begin_layout Standard
 
3533
 
 
3534
\end_layout
 
3535
 
 
3536
\begin_layout Standard
 
3537
 
 
3538
\end_layout
 
3539
 
 
3540
\begin_layout Standard
 
3541
 
 
3542
 
 
3543
\backslash
 
3544
end{comment}
 
3545
\end_layout
 
3546
 
 
3547
\begin_layout Standard
 
3548
 
 
3549
\end_layout
 
3550
 
 
3551
\end_inset
 
3552
 
 
3553
 
 
3554
\end_layout
 
3555
 
 
3556
\begin_layout Section
 
3557
\begin_inset LatexCommand \label{sec:Match-Expressions}
 
3558
 
 
3559
\end_inset
 
3560
 
 
3561
Match Expressions
 
3562
\begin_inset LatexCommand \index{match expression|(}
 
3563
 
 
3564
\end_inset
 
3565
 
 
3566
 
 
3567
\begin_inset LatexCommand \index{search pattern!match expression|(}
 
3568
 
 
3569
\end_inset
 
3570
 
 
3571
 
 
3572
\end_layout
 
3573
 
 
3574
\begin_layout Standard
 
3575
Match expressions are a used to describe a set of statically known program
 
3576
 entities in an AspectC++ program.
 
3577
 They can either be match expressions for functions or for types.
 
3578
 A class is seen as a special kind of type in this context.
 
3579
 
 
3580
\end_layout
 
3581
 
 
3582
\begin_layout Standard
 
3583
For function matching a match expression is internally decomposed into the
 
3584
 function type pattern
 
3585
\begin_inset LatexCommand \index{type pattern}
 
3586
 
 
3587
\end_inset
 
3588
 
 
3589
, the scope pattern
 
3590
\begin_inset LatexCommand \index{scope pattern}
 
3591
 
 
3592
\end_inset
 
3593
 
 
3594
, and the name pattern
 
3595
\begin_inset LatexCommand \index{name pattern}
 
3596
 
 
3597
\end_inset
 
3598
 
 
3599
.
 
3600
\end_layout
 
3601
 
 
3602
\begin_layout Subsubsection*
 
3603
Example: type, scope, and name parts of a function match expression 
 
3604
\family typewriter
 
3605
 
 
3606
\begin_inset LatexCommand \label{exa:match-expr-parts}
 
3607
 
 
3608
\end_inset
 
3609
 
 
3610
 
 
3611
\end_layout
 
3612
 
 
3613
\begin_layout LyX-Code
 
3614
"const % Puma::...::parse_% (Token *)"
 
3615
\end_layout
 
3616
 
 
3617
\begin_layout Standard
 
3618
This match expression describes the following requirements on a compared
 
3619
 function name:
 
3620
\end_layout
 
3621
 
 
3622
\begin_layout Description
 
3623
name: the function name has to match the name pattern 
 
3624
\family typewriter
 
3625
parse_%
 
3626
\end_layout
 
3627
 
 
3628
\begin_layout Description
 
3629
scope: the scope in which the function is defined has to match 
 
3630
\family typewriter
 
3631
Puma::...::
 
3632
\end_layout
 
3633
 
 
3634
\begin_layout Description
 
3635
type: the function type has to match 
 
3636
\family typewriter
 
3637
const %(Token *)
 
3638
\end_layout
 
3639
 
 
3640
\begin_layout Standard
 
3641
For classes and other types this decomposion is not necessary.
 
3642
 For example, the type name 
 
3643
\begin_inset Quotes eld
 
3644
\end_inset
 
3645
 
 
3646
 
 
3647
\family typewriter
 
3648
Puma::CCParser
 
3649
\family default
 
3650
 
 
3651
\begin_inset Quotes erd
 
3652
\end_inset
 
3653
 
 
3654
 is sufficient to describe a class, because this is the same as the class
 
3655
 name.
 
3656
\end_layout
 
3657
 
 
3658
\begin_layout Standard
 
3659
If an entity matches all parts of the match expression, it becomes an element
 
3660
 of the set, which should be defined by the match expression.
 
3661
\end_layout
 
3662
 
 
3663
\begin_layout Standard
 
3664
The grammar used for match expression parsing is shown in appendix 
 
3665
\begin_inset LatexCommand \vref{sec:Match-Expression-Grammar}
 
3666
 
 
3667
\end_inset
 
3668
 
 
3669
.
 
3670
 The following subsections separately describe the name, scope, and type
 
3671
 matching mechanisms.
 
3672
 Note, that name and scope matching is used for matching of function names
 
3673
 as well as matching of named types like classes.
 
3674
\end_layout
 
3675
 
 
3676
\begin_layout Subsection
 
3677
\begin_inset LatexCommand \label{sub:Name-Matching}
 
3678
 
 
3679
\end_inset
 
3680
 
 
3681
Name Matching
 
3682
\begin_inset LatexCommand \index{match expression!name matching|(}
 
3683
 
 
3684
\end_inset
 
3685
 
 
3686
 
 
3687
\begin_inset LatexCommand \index{name matching|(}
 
3688
 
 
3689
\end_inset
 
3690
 
 
3691
 
 
3692
\end_layout
 
3693
 
 
3694
\begin_layout Subsubsection
 
3695
Simple Name Matching
 
3696
\end_layout
 
3697
 
 
3698
\begin_layout Standard
 
3699
Name matching is trivial as long as the compared name is a normal C++ identifier.
 
3700
 If the 
 
3701
\emph on
 
3702
name pattern
 
3703
\emph default
 
3704
 
 
3705
\begin_inset LatexCommand \index{name pattern}
 
3706
 
 
3707
\end_inset
 
3708
 
 
3709
 does 
 
3710
\emph on
 
3711
not
 
3712
\emph default
 
3713
 contain the special wildcard character %
 
3714
\begin_inset LatexCommand \index{\%}
 
3715
 
 
3716
\end_inset
 
3717
 
 
3718
, it matches a name only if it is exactly the same.
 
3719
 Otherwise each wildcard character matches an arbitrary sequence of characters
 
3720
 in the compared name.
 
3721
 The wildcard character also matches an empty sequence.
 
3722
\end_layout
 
3723
 
 
3724
\begin_layout Subsubsection*
 
3725
Example: simple name patterns 
 
3726
\family typewriter
 
3727
 
 
3728
\begin_inset LatexCommand \label{exa:match-name-patterns}
 
3729
 
 
3730
\end_inset
 
3731
 
 
3732
 
 
3733
\family default
 
3734
 
 
3735
\begin_inset LatexCommand \index{match expression!simple name pattern}
 
3736
 
 
3737
\end_inset
 
3738
 
 
3739
 
 
3740
\begin_inset LatexCommand \index{simple name pattern}
 
3741
 
 
3742
\end_inset
 
3743
 
 
3744
 
 
3745
\end_layout
 
3746
 
 
3747
\begin_layout Standard
 
3748
\begin_inset Tabular
 
3749
<lyxtabular version="3" rows="5" columns="2">
 
3750
<features>
 
3751
<column alignment="left" valignment="top" width="0">
 
3752
<column alignment="block" valignment="top" width="12cm">
 
3753
<row>
 
3754
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3755
\begin_inset Text
 
3756
 
 
3757
\begin_layout Standard
 
3758
 
 
3759
\family typewriter
 
3760
Token
 
3761
\end_layout
 
3762
 
 
3763
\end_inset
 
3764
</cell>
 
3765
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3766
\begin_inset Text
 
3767
 
 
3768
\begin_layout Standard
 
3769
only matches 
 
3770
\family typewriter
 
3771
Token
 
3772
\end_layout
 
3773
 
 
3774
\end_inset
 
3775
</cell>
 
3776
</row>
 
3777
<row>
 
3778
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3779
\begin_inset Text
 
3780
 
 
3781
\begin_layout Standard
 
3782
 
 
3783
\family typewriter
 
3784
%
 
3785
\end_layout
 
3786
 
 
3787
\end_inset
 
3788
</cell>
 
3789
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3790
\begin_inset Text
 
3791
 
 
3792
\begin_layout Standard
 
3793
matches any name
 
3794
\end_layout
 
3795
 
 
3796
\end_inset
 
3797
</cell>
 
3798
</row>
 
3799
<row>
 
3800
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3801
\begin_inset Text
 
3802
 
 
3803
\begin_layout Standard
 
3804
 
 
3805
\family typewriter
 
3806
parse_%
 
3807
\end_layout
 
3808
 
 
3809
\end_inset
 
3810
</cell>
 
3811
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3812
\begin_inset Text
 
3813
 
 
3814
\begin_layout Standard
 
3815
matches any name beginning with 
 
3816
\family typewriter
 
3817
parse_
 
3818
\family default
 
3819
 like 
 
3820
\family typewriter
 
3821
parse_declarator
 
3822
\family default
 
3823
 or 
 
3824
\family typewriter
 
3825
parse_
 
3826
\end_layout
 
3827
 
 
3828
\end_inset
 
3829
</cell>
 
3830
</row>
 
3831
<row>
 
3832
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3833
\begin_inset Text
 
3834
 
 
3835
\begin_layout Standard
 
3836
 
 
3837
\family typewriter
 
3838
parse_%_id%
 
3839
\end_layout
 
3840
 
 
3841
\end_inset
 
3842
</cell>
 
3843
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3844
\begin_inset Text
 
3845
 
 
3846
\begin_layout Standard
 
3847
matches names like 
 
3848
\family typewriter
 
3849
parse_type_id
 
3850
\family default
 
3851
 
3852
\family typewriter
 
3853
parse_private_identifier
 
3854
\family default
 
3855
, etc.
 
3856
\end_layout
 
3857
 
 
3858
\end_inset
 
3859
</cell>
 
3860
</row>
 
3861
<row>
 
3862
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
3863
\begin_inset Text
 
3864
 
 
3865
\begin_layout Standard
 
3866
 
 
3867
\family typewriter
 
3868
%_token
 
3869
\end_layout
 
3870
 
 
3871
\end_inset
 
3872
</cell>
 
3873
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
3874
\begin_inset Text
 
3875
 
 
3876
\begin_layout Standard
 
3877
matches all names that end with 
 
3878
\family typewriter
 
3879
_token
 
3880
\family default
 
3881
 like 
 
3882
\family typewriter
 
3883
start_token
 
3884
\family default
 
3885
 
3886
\family typewriter
 
3887
end_token
 
3888
\family default
 
3889
, and 
 
3890
\family typewriter
 
3891
_token
 
3892
\end_layout
 
3893
 
 
3894
\end_inset
 
3895
</cell>
 
3896
</row>
 
3897
</lyxtabular>
 
3898
 
 
3899
\end_inset
 
3900
 
 
3901
 
 
3902
\begin_inset VSpace bigskip
 
3903
\end_inset
 
3904
 
 
3905
 
 
3906
\end_layout
 
3907
 
 
3908
\begin_layout Subsubsection
 
3909
Operator Function and Conversion Function Name Matching
 
3910
\end_layout
 
3911
 
 
3912
\begin_layout Standard
 
3913
The name matching mechanism is more complicated if the pattern is compared
 
3914
 with the name of a conversion function or an operator function.
 
3915
 Both are matched by the name pattern 
 
3916
\family typewriter
 
3917
%
 
3918
\family default
 
3919
 
 
3920
\begin_inset LatexCommand \index{\%}
 
3921
 
 
3922
\end_inset
 
3923
 
 
3924
.
 
3925
 However, with a different name pattern than 
 
3926
\family typewriter
 
3927
%
 
3928
\family default
 
3929
 they are only matched if the pattern begins with "
 
3930
\family typewriter
 
3931
operator
 
3932
\family default
 
3933
\InsetSpace ~
 
3934
".
 
3935
 The pattern "
 
3936
\family typewriter
 
3937
operator\InsetSpace ~
 
3938
%
 
3939
\family default
 
3940
" matches any operator function or conversion function name.
 
3941
\end_layout
 
3942
 
 
3943
\begin_layout Standard
 
3944
C++ defines a fixed set of operators which are allowed to be overloaded.
 
3945
 In a name pattern the same operators may be used after the "
 
3946
\family typewriter
 
3947
operator
 
3948
\family default
 
3949
\InsetSpace ~
 
3950
" prefix to match a specific operator function name.
 
3951
 Operator names in name patterns are not allowed to contain the wildcard
 
3952
 character.
 
3953
 For ambiguity resolution the operators 
 
3954
\family typewriter
 
3955
%
 
3956
\family default
 
3957
 and 
 
3958
\family typewriter
 
3959
%=
 
3960
\family default
 
3961
 are matched by 
 
3962
\family typewriter
 
3963
%%
 
3964
\family default
 
3965
 and 
 
3966
\family typewriter
 
3967
%%=
 
3968
\family default
 
3969
 
 
3970
\begin_inset LatexCommand \index{\%\%}
 
3971
 
 
3972
\end_inset
 
3973
 
 
3974
in a name pattern.
 
3975
\end_layout
 
3976
 
 
3977
\begin_layout Subsubsection*
 
3978
Example: operator name patterns
 
3979
\begin_inset LatexCommand \index{match expression!operator name pattern}
 
3980
 
 
3981
\end_inset
 
3982
 
 
3983
 
 
3984
\begin_inset LatexCommand \index{operator name pattern}
 
3985
 
 
3986
\end_inset
 
3987
 
 
3988
 
 
3989
\family typewriter
 
3990
 
 
3991
\begin_inset LatexCommand \label{exa:match-operator-name-patterns}
 
3992
 
 
3993
\end_inset
 
3994
 
 
3995
 
 
3996
\end_layout
 
3997
 
 
3998
\begin_layout Standard
 
3999
\begin_inset Tabular
 
4000
<lyxtabular version="3" rows="3" columns="2">
 
4001
<features>
 
4002
<column alignment="left" valignment="top" width="0">
 
4003
<column alignment="block" valignment="top" width="11cm">
 
4004
<row>
 
4005
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4006
\begin_inset Text
 
4007
 
 
4008
\begin_layout Standard
 
4009
 
 
4010
\family typewriter
 
4011
operator\InsetSpace ~
 
4012
%
 
4013
\end_layout
 
4014
 
 
4015
\end_inset
 
4016
</cell>
 
4017
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4018
\begin_inset Text
 
4019
 
 
4020
\begin_layout Standard
 
4021
matches any operator function name (as well as any conversion function name)
 
4022
\end_layout
 
4023
 
 
4024
\end_inset
 
4025
</cell>
 
4026
</row>
 
4027
<row>
 
4028
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4029
\begin_inset Text
 
4030
 
 
4031
\begin_layout Standard
 
4032
 
 
4033
\family typewriter
 
4034
operator\InsetSpace ~
 
4035
+=
 
4036
\end_layout
 
4037
 
 
4038
\end_inset
 
4039
</cell>
 
4040
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4041
\begin_inset Text
 
4042
 
 
4043
\begin_layout Standard
 
4044
matches only the name of a 
 
4045
\family typewriter
 
4046
+=
 
4047
\family default
 
4048
 operator
 
4049
\end_layout
 
4050
 
 
4051
\end_inset
 
4052
</cell>
 
4053
</row>
 
4054
<row>
 
4055
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4056
\begin_inset Text
 
4057
 
 
4058
\begin_layout Standard
 
4059
 
 
4060
\family typewriter
 
4061
operator\InsetSpace ~
 
4062
%%
 
4063
\end_layout
 
4064
 
 
4065
\end_inset
 
4066
</cell>
 
4067
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4068
\begin_inset Text
 
4069
 
 
4070
\begin_layout Standard
 
4071
matches the name of an 
 
4072
\family typewriter
 
4073
operator\InsetSpace ~
 
4074
%
 
4075
\end_layout
 
4076
 
 
4077
\end_inset
 
4078
</cell>
 
4079
</row>
 
4080
</lyxtabular>
 
4081
 
 
4082
\end_inset
 
4083
 
 
4084
 
 
4085
\begin_inset VSpace bigskip
 
4086
\end_inset
 
4087
 
 
4088
 
 
4089
\end_layout
 
4090
 
 
4091
\begin_layout Standard
 
4092
Conversion functions don't have a real name.
 
4093
 For example, the conversion function 
 
4094
\family typewriter
 
4095
operator int*()
 
4096
\family default
 
4097
 defined in a class 
 
4098
\family typewriter
 
4099
C
 
4100
\family default
 
4101
 defines a conversion from a 
 
4102
\family typewriter
 
4103
C
 
4104
\family default
 
4105
 instance into an object of type 
 
4106
\family typewriter
 
4107
int*
 
4108
\family default
 
4109
.
 
4110
 To match conversion functions the name pattern may contain a type pattern
 
4111
 after the prefix "
 
4112
\family typewriter
 
4113
operator 
 
4114
\family default
 
4115
".
 
4116
 The type matching mechanism is explained in section 
 
4117
\begin_inset LatexCommand \ref{sub:Type-Matching}
 
4118
 
 
4119
\end_inset
 
4120
 
 
4121
.
 
4122
\end_layout
 
4123
 
 
4124
\begin_layout Subsubsection*
 
4125
Example: conversion function name patterns
 
4126
\begin_inset LatexCommand \index{match expression!conversion function name pattern}
 
4127
 
 
4128
\end_inset
 
4129
 
 
4130
 
 
4131
\begin_inset LatexCommand \index{conversion function name pattern}
 
4132
 
 
4133
\end_inset
 
4134
 
 
4135
 
 
4136
\family typewriter
 
4137
 
 
4138
\begin_inset LatexCommand \label{exa:match-conversion-function-name-patterns}
 
4139
 
 
4140
\end_inset
 
4141
 
 
4142
 
 
4143
\end_layout
 
4144
 
 
4145
\begin_layout Standard
 
4146
\begin_inset Tabular
 
4147
<lyxtabular version="3" rows="3" columns="2">
 
4148
<features>
 
4149
<column alignment="left" valignment="top" width="0">
 
4150
<column alignment="block" valignment="top" width="11cm">
 
4151
<row>
 
4152
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4153
\begin_inset Text
 
4154
 
 
4155
\begin_layout Standard
 
4156
 
 
4157
\family typewriter
 
4158
operator\InsetSpace ~
 
4159
%
 
4160
\end_layout
 
4161
 
 
4162
\end_inset
 
4163
</cell>
 
4164
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4165
\begin_inset Text
 
4166
 
 
4167
\begin_layout Standard
 
4168
matches any conversion function name
 
4169
\end_layout
 
4170
 
 
4171
\end_inset
 
4172
</cell>
 
4173
</row>
 
4174
<row>
 
4175
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4176
\begin_inset Text
 
4177
 
 
4178
\begin_layout Standard
 
4179
 
 
4180
\family typewriter
 
4181
operator\InsetSpace ~
 
4182
int*
 
4183
\end_layout
 
4184
 
 
4185
\end_inset
 
4186
</cell>
 
4187
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4188
\begin_inset Text
 
4189
 
 
4190
\begin_layout Standard
 
4191
matches any name of a conversion that converts something into an 
 
4192
\family typewriter
 
4193
int*
 
4194
\family default
 
4195
 object
 
4196
\end_layout
 
4197
 
 
4198
\end_inset
 
4199
</cell>
 
4200
</row>
 
4201
<row>
 
4202
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4203
\begin_inset Text
 
4204
 
 
4205
\begin_layout Standard
 
4206
 
 
4207
\family typewriter
 
4208
operator\InsetSpace ~
 
4209
%*
 
4210
\end_layout
 
4211
 
 
4212
\end_inset
 
4213
</cell>
 
4214
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4215
\begin_inset Text
 
4216
 
 
4217
\begin_layout Standard
 
4218
matches any conversion function name if that function converts something
 
4219
 into a pointer
 
4220
\end_layout
 
4221
 
 
4222
\end_inset
 
4223
</cell>
 
4224
</row>
 
4225
</lyxtabular>
 
4226
 
 
4227
\end_inset
 
4228
 
 
4229
 
 
4230
\begin_inset VSpace bigskip
 
4231
\end_inset
 
4232
 
 
4233
 
 
4234
\end_layout
 
4235
 
 
4236
\begin_layout Subsubsection
 
4237
Constructors and Destructors
 
4238
\end_layout
 
4239
 
 
4240
\begin_layout Standard
 
4241
Name patterns cannot be used to match constructor or destructor names.
 
4242
\end_layout
 
4243
 
 
4244
\begin_layout Subsubsection
 
4245
Scope Restrictions
 
4246
\end_layout
 
4247
 
 
4248
\begin_layout Standard
 
4249
In a match expression a name pattern can optionally be prefixed by a scope
 
4250
 pattern.
 
4251
 A scope pattern (see section 
 
4252
\begin_inset LatexCommand \ref{sub:Scope-Matching}
 
4253
 
 
4254
\end_inset
 
4255
 
 
4256
) is used to describe restrictions on the definition scope of matched entities.
 
4257
 If no scope pattern is given, a compared function or type has to be defined
 
4258
 in the global scope to be matched.
 
4259
\begin_inset LatexCommand \index{name matching|)}
 
4260
 
 
4261
\end_inset
 
4262
 
 
4263
 
 
4264
\begin_inset LatexCommand \index{match expression!name matching|)}
 
4265
 
 
4266
\end_inset
 
4267
 
 
4268
 
 
4269
\begin_inset VSpace bigskip
 
4270
\end_inset
 
4271
 
 
4272
 
 
4273
\end_layout
 
4274
 
 
4275
\begin_layout Subsection
 
4276
\begin_inset LatexCommand \label{sub:Scope-Matching}
 
4277
 
 
4278
\end_inset
 
4279
 
 
4280
Scope Matching
 
4281
\begin_inset LatexCommand \index{match expression!scope matching|(}
 
4282
 
 
4283
\end_inset
 
4284
 
 
4285
 
 
4286
\begin_inset LatexCommand \index{scope matching|(}
 
4287
 
 
4288
\end_inset
 
4289
 
 
4290
 
 
4291
\end_layout
 
4292
 
 
4293
\begin_layout Standard
 
4294
Restrictions on definition scopes can be described by 
 
4295
\emph on
 
4296
scope patterns
 
4297
\emph default
 
4298
 
 
4299
\begin_inset LatexCommand \index{scope pattern}
 
4300
 
 
4301
\end_inset
 
4302
 
 
4303
.
 
4304
 This is a sequence of name patterns (or the special 
 
4305
\emph on
 
4306
any scope sequence
 
4307
\emph default
 
4308
 
 
4309
\begin_inset LatexCommand \index{any scope sequence}
 
4310
 
 
4311
\end_inset
 
4312
 
 
4313
pattern 
 
4314
\family typewriter
 
4315
...
 
4316
\family default
 
4317
 
 
4318
\begin_inset LatexCommand \index{...}
 
4319
 
 
4320
\end_inset
 
4321
 
 
4322
), which are separated by 
 
4323
\family typewriter
 
4324
::
 
4325
\family default
 
4326
, like in 
 
4327
\family typewriter
 
4328
Puma::...::
 
4329
\family default
 
4330
.
 
4331
 A scope pattern always ends with 
 
4332
\family typewriter
 
4333
::
 
4334
\family default
 
4335
 and should never start with 
 
4336
\family typewriter
 
4337
::
 
4338
\family default
 
4339
, because scope patterns are interpreted relative to the global scope anyway
 
4340
\begin_inset Foot
 
4341
status collapsed
 
4342
 
 
4343
\begin_layout Standard
 
4344
This restriction is also needed to avoid ambiguities in the match expression
 
4345
 grammer: Does 
 
4346
\begin_inset Quotes eld
 
4347
\end_inset
 
4348
 
 
4349
 
 
4350
\family typewriter
 
4351
A\InsetSpace ~
 
4352
::\InsetSpace ~
 
4353
B\InsetSpace ~
 
4354
::\InsetSpace ~
 
4355
C(int)
 
4356
\family default
 
4357
 
 
4358
\begin_inset Quotes erd
 
4359
\end_inset
 
4360
 
 
4361
 mean 
 
4362
\begin_inset Quotes eld
 
4363
\end_inset
 
4364
 
 
4365
 
 
4366
\family typewriter
 
4367
A\InsetSpace ~
 
4368
::B::C(int)
 
4369
\family default
 
4370
 
 
4371
\begin_inset Quotes erd
 
4372
\end_inset
 
4373
 
 
4374
 or 
 
4375
\begin_inset Quotes eld
 
4376
\end_inset
 
4377
 
 
4378
 
 
4379
\family typewriter
 
4380
A::B\InsetSpace ~
 
4381
::C(int)
 
4382
\family default
 
4383
 
 
4384
\begin_inset Quotes erd
 
4385
\end_inset
 
4386
 
 
4387
?
 
4388
\end_layout
 
4389
 
 
4390
\end_inset
 
4391
 
 
4392
.
 
4393
 The definition scope can either be a namespace or a class.
 
4394
\end_layout
 
4395
 
 
4396
\begin_layout Standard
 
4397
A scope pattern matches the definition scope of a compared function or type
 
4398
 if every part can successfully be matched with a corresponding part in
 
4399
 the qualified name of the definition scope.
 
4400
 The compared qualified name has to be relative to the global scope and
 
4401
 should not start with 
 
4402
\family typewriter
 
4403
::
 
4404
\family default
 
4405
, which is optional in a C++ nested-name-specifier.
 
4406
 The special 
 
4407
\family typewriter
 
4408
...
 
4409
 
 
4410
\family default
 
4411
 pattern matches any (even empty) sequence of scope names.
 
4412
\end_layout
 
4413
 
 
4414
\begin_layout Subsubsection*
 
4415
Example: scope patterns 
 
4416
\family typewriter
 
4417
 
 
4418
\begin_inset LatexCommand \label{exa:match-scope-patterns}
 
4419
 
 
4420
\end_inset
 
4421
 
 
4422
 
 
4423
\family default
 
4424
 
 
4425
\begin_inset LatexCommand \index{match expression!scope pattern}
 
4426
 
 
4427
\end_inset
 
4428
 
 
4429
 
 
4430
\begin_inset LatexCommand \index{scope pattern}
 
4431
 
 
4432
\end_inset
 
4433
 
 
4434
 
 
4435
\end_layout
 
4436
 
 
4437
\begin_layout Standard
 
4438
\begin_inset Tabular
 
4439
<lyxtabular version="3" rows="4" columns="2">
 
4440
<features>
 
4441
<column alignment="left" valignment="top" width="0">
 
4442
<column alignment="block" valignment="top" width="11cm">
 
4443
<row>
 
4444
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4445
\begin_inset Text
 
4446
 
 
4447
\begin_layout Standard
 
4448
 
 
4449
\family typewriter
 
4450
...::
 
4451
\end_layout
 
4452
 
 
4453
\end_inset
 
4454
</cell>
 
4455
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4456
\begin_inset Text
 
4457
 
 
4458
\begin_layout Standard
 
4459
matches any definition scope, even the global scope
 
4460
\end_layout
 
4461
 
 
4462
\end_inset
 
4463
</cell>
 
4464
</row>
 
4465
<row>
 
4466
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4467
\begin_inset Text
 
4468
 
 
4469
\begin_layout Standard
 
4470
 
 
4471
\family typewriter
 
4472
Puma::CCParser::
 
4473
\end_layout
 
4474
 
 
4475
\end_inset
 
4476
</cell>
 
4477
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4478
\begin_inset Text
 
4479
 
 
4480
\begin_layout Standard
 
4481
matches the scope 
 
4482
\family typewriter
 
4483
Puma::CCParser
 
4484
\family default
 
4485
 exactly
 
4486
\end_layout
 
4487
 
 
4488
\end_inset
 
4489
</cell>
 
4490
</row>
 
4491
<row>
 
4492
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4493
\begin_inset Text
 
4494
 
 
4495
\begin_layout Standard
 
4496
 
 
4497
\family typewriter
 
4498
...::%Compiler%::
 
4499
\end_layout
 
4500
 
 
4501
\end_inset
 
4502
</cell>
 
4503
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4504
\begin_inset Text
 
4505
 
 
4506
\begin_layout Standard
 
4507
matches any class or namespace, which matches the name pattern 
 
4508
\family typewriter
 
4509
%Compiler%
 
4510
\family default
 
4511
, in any scope
 
4512
\end_layout
 
4513
 
 
4514
\end_inset
 
4515
</cell>
 
4516
</row>
 
4517
<row>
 
4518
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4519
\begin_inset Text
 
4520
 
 
4521
\begin_layout Standard
 
4522
 
 
4523
\family typewriter
 
4524
Puma::...::
 
4525
\end_layout
 
4526
 
 
4527
\end_inset
 
4528
</cell>
 
4529
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4530
\begin_inset Text
 
4531
 
 
4532
\begin_layout Standard
 
4533
matches any scope defined within the class or namespace 
 
4534
\family typewriter
 
4535
Puma 
 
4536
\family default
 
4537
and 
 
4538
\family typewriter
 
4539
Puma
 
4540
\family default
 
4541
 itself
 
4542
\end_layout
 
4543
 
 
4544
\end_inset
 
4545
</cell>
 
4546
</row>
 
4547
</lyxtabular>
 
4548
 
 
4549
\end_inset
 
4550
 
 
4551
 
 
4552
\begin_inset LatexCommand \index{scope matching|)}
 
4553
 
 
4554
\end_inset
 
4555
 
 
4556
 
 
4557
\begin_inset LatexCommand \index{match expression!scope matching|)}
 
4558
 
 
4559
\end_inset
 
4560
 
 
4561
 
 
4562
\begin_inset VSpace bigskip
 
4563
\end_inset
 
4564
 
 
4565
 
 
4566
\end_layout
 
4567
 
 
4568
\begin_layout Subsection
 
4569
\begin_inset LatexCommand \label{sub:Type-Matching}
 
4570
 
 
4571
\end_inset
 
4572
 
 
4573
Type Matching
 
4574
\begin_inset LatexCommand \index{match expression!type matching|(}
 
4575
 
 
4576
\end_inset
 
4577
 
 
4578
 
 
4579
\begin_inset LatexCommand \index{type matching|(}
 
4580
 
 
4581
\end_inset
 
4582
 
 
4583
 
 
4584
\end_layout
 
4585
 
 
4586
\begin_layout Subsubsection
 
4587
The Match Mechanism
 
4588
\end_layout
 
4589
 
 
4590
\begin_layout Standard
 
4591
C++ types can be represented as a tree.
 
4592
 For example, the function type 
 
4593
\family typewriter
 
4594
int(double)
 
4595
\family default
 
4596
 is a function type node with two children, one is an 
 
4597
\family typewriter
 
4598
int
 
4599
\family default
 
4600
 node, the other a 
 
4601
\family typewriter
 
4602
double
 
4603
\family default
 
4604
 node.
 
4605
 Both children are leafs of the tree.
 
4606
\end_layout
 
4607
 
 
4608
\begin_layout Standard
 
4609
The types used in match expressions can also be interpreted as trees.
 
4610
 As an addition to normal C++ types they can also contain the %
 
4611
\begin_inset LatexCommand \index{\%}
 
4612
 
 
4613
\end_inset
 
4614
 
 
4615
 wildcard character, name patterns, and scope patterns.
 
4616
 A single wildcard character in a type pattern becomes a special 
 
4617
\emph on
 
4618
any type node
 
4619
\emph default
 
4620
 
 
4621
\begin_inset LatexCommand \index{any type node}
 
4622
 
 
4623
\end_inset
 
4624
 
 
4625
 in the tree representation.
 
4626
\end_layout
 
4627
 
 
4628
\begin_layout Standard
 
4629
For comparing a type pattern with a specific type the tree representation
 
4630
 is used and the 
 
4631
\emph on
 
4632
any type node
 
4633
\emph default
 
4634
 matches an arbitrary type (sub-)tree.
 
4635
 
 
4636
\end_layout
 
4637
 
 
4638
\begin_layout Subsubsection*
 
4639
Example: type patterns with the wildcard character 
 
4640
\family typewriter
 
4641
 
 
4642
\begin_inset LatexCommand \label{exa:match-type-patterns-wildcard}
 
4643
 
 
4644
\end_inset
 
4645
 
 
4646
 
 
4647
\family default
 
4648
 
 
4649
\begin_inset LatexCommand \index{match expression!type pattern with \%}
 
4650
 
 
4651
\end_inset
 
4652
 
 
4653
 
 
4654
\begin_inset LatexCommand \index{type pattern with \%}
 
4655
 
 
4656
\end_inset
 
4657
 
 
4658
 
 
4659
\end_layout
 
4660
 
 
4661
\begin_layout Standard
 
4662
\begin_inset Tabular
 
4663
<lyxtabular version="3" rows="3" columns="2">
 
4664
<features>
 
4665
<column alignment="left" valignment="top" width="0">
 
4666
<column alignment="block" valignment="top" width="11cm">
 
4667
<row>
 
4668
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4669
\begin_inset Text
 
4670
 
 
4671
\begin_layout Standard
 
4672
 
 
4673
\family typewriter
 
4674
%
 
4675
\end_layout
 
4676
 
 
4677
\end_inset
 
4678
</cell>
 
4679
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4680
\begin_inset Text
 
4681
 
 
4682
\begin_layout Standard
 
4683
matches any type
 
4684
\end_layout
 
4685
 
 
4686
\end_inset
 
4687
</cell>
 
4688
</row>
 
4689
<row>
 
4690
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4691
\begin_inset Text
 
4692
 
 
4693
\begin_layout Standard
 
4694
 
 
4695
\family typewriter
 
4696
void (*)(%)
 
4697
\end_layout
 
4698
 
 
4699
\end_inset
 
4700
</cell>
 
4701
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4702
\begin_inset Text
 
4703
 
 
4704
\begin_layout Standard
 
4705
matches any pointer type that points to functions with a single argument
 
4706
 and a 
 
4707
\family typewriter
 
4708
void
 
4709
\family default
 
4710
 result type
 
4711
\end_layout
 
4712
 
 
4713
\end_inset
 
4714
</cell>
 
4715
</row>
 
4716
<row>
 
4717
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4718
\begin_inset Text
 
4719
 
 
4720
\begin_layout Standard
 
4721
%*
 
4722
\end_layout
 
4723
 
 
4724
\end_inset
 
4725
</cell>
 
4726
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4727
\begin_inset Text
 
4728
 
 
4729
\begin_layout Standard
 
4730
matches any pointer type
 
4731
\end_layout
 
4732
 
 
4733
\end_inset
 
4734
</cell>
 
4735
</row>
 
4736
</lyxtabular>
 
4737
 
 
4738
\end_inset
 
4739
 
 
4740
 
 
4741
\begin_inset VSpace bigskip
 
4742
\end_inset
 
4743
 
 
4744
 
 
4745
\end_layout
 
4746
 
 
4747
\begin_layout Subsubsection
 
4748
Matching of Named Types
 
4749
\end_layout
 
4750
 
 
4751
\begin_layout Standard
 
4752
Type patterns may also contain name and scope patterns.
 
4753
 They become a 
 
4754
\emph on
 
4755
named type node
 
4756
\begin_inset LatexCommand \index{named type}
 
4757
 
 
4758
\end_inset
 
4759
 
 
4760
 
 
4761
\emph default
 
4762
 in the tree representation and match any union, struct, class, or enumeration
 
4763
 type if its name and scope match the given pattern (see section 
 
4764
\begin_inset LatexCommand \ref{sub:Name-Matching}
 
4765
 
 
4766
\end_inset
 
4767
 
 
4768
 and 
 
4769
\begin_inset LatexCommand \ref{sub:Scope-Matching}
 
4770
 
 
4771
\end_inset
 
4772
 
 
4773
).
 
4774
\end_layout
 
4775
 
 
4776
\begin_layout Subsubsection
 
4777
Matching of 
 
4778
\begin_inset Quotes eld
 
4779
\end_inset
 
4780
 
 
4781
Pointer to Member
 
4782
\begin_inset Quotes erd
 
4783
\end_inset
 
4784
 
 
4785
 Types
 
4786
\end_layout
 
4787
 
 
4788
\begin_layout Standard
 
4789
Patterns for pointers to members
 
4790
\begin_inset LatexCommand \index{pointer to member}
 
4791
 
 
4792
\end_inset
 
4793
 
 
4794
 also contain a scope pattern, e.g.
 
4795
 
 
4796
\family typewriter
 
4797
%\InsetSpace ~
 
4798
(Puma::CSyntax::*)()
 
4799
\family default
 
4800
.
 
4801
 In this context the scope pattern is mandatory.
 
4802
 The pattern is used for matching the class associated with a pointer to
 
4803
 member type.
 
4804
\end_layout
 
4805
 
 
4806
\begin_layout Subsubsection
 
4807
Matching of Qualified Types (
 
4808
\family typewriter
 
4809
const
 
4810
\family default
 
4811
/
 
4812
\family typewriter
 
4813
volatile
 
4814
\family default
 
4815
)
 
4816
\end_layout
 
4817
 
 
4818
\begin_layout Standard
 
4819
Many C++ types can be qualified as 
 
4820
\family typewriter
 
4821
const
 
4822
\family default
 
4823
 
 
4824
\begin_inset LatexCommand \index{const}
 
4825
 
 
4826
\end_inset
 
4827
 
 
4828
or 
 
4829
\family typewriter
 
4830
volatile
 
4831
\family default
 
4832
 
 
4833
\begin_inset LatexCommand \index{volatile}
 
4834
 
 
4835
\end_inset
 
4836
 
 
4837
.
 
4838
 In a type pattern these qualifier can also be used, but they are interpreted
 
4839
 restrictions.
 
4840
 If no 
 
4841
\family typewriter
 
4842
const
 
4843
\family default
 
4844
 or 
 
4845
\family typewriter
 
4846
volatile
 
4847
\family default
 
4848
 qualifier is given in a type pattern, the pattern also matches qualified
 
4849
 types
 
4850
\begin_inset Foot
 
4851
status open
 
4852
 
 
4853
\begin_layout Standard
 
4854
Matching only non-constant or non-volatile types can be achieved by using
 
4855
 the operators explained in section 
 
4856
\begin_inset LatexCommand \vref{sub:Algebraic-Operators}
 
4857
 
 
4858
\end_inset
 
4859
 
 
4860
.
 
4861
 For example, 
 
4862
\family typewriter
 
4863
!"const\InsetSpace ~
 
4864
%"
 
4865
\family default
 
4866
 describes all types which are not constant.
 
4867
\end_layout
 
4868
 
 
4869
\end_inset
 
4870
 
 
4871
.
 
4872
\end_layout
 
4873
 
 
4874
\begin_layout Subsubsection*
 
4875
Example: type patterns with 
 
4876
\family typewriter
 
4877
const
 
4878
\family default
 
4879
 and 
 
4880
\family typewriter
 
4881
volatile
 
4882
\family default
 
4883
 
 
4884
\family typewriter
 
4885
 
 
4886
\begin_inset LatexCommand \label{exa:match-type-patterns-cv}
 
4887
 
 
4888
\end_inset
 
4889
 
 
4890
 
 
4891
\family default
 
4892
 
 
4893
\begin_inset LatexCommand \index{match expression!type pattern with cv qualifier}
 
4894
 
 
4895
\end_inset
 
4896
 
 
4897
 
 
4898
\begin_inset LatexCommand \index{type pattern with cv qualifier}
 
4899
 
 
4900
\end_inset
 
4901
 
 
4902
 
 
4903
\end_layout
 
4904
 
 
4905
\begin_layout Standard
 
4906
\begin_inset Tabular
 
4907
<lyxtabular version="3" rows="3" columns="2">
 
4908
<features>
 
4909
<column alignment="left" valignment="top" width="0">
 
4910
<column alignment="block" valignment="top" width="9cm">
 
4911
<row>
 
4912
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4913
\begin_inset Text
 
4914
 
 
4915
\begin_layout Standard
 
4916
 
 
4917
\family typewriter
 
4918
%
 
4919
\end_layout
 
4920
 
 
4921
\end_inset
 
4922
</cell>
 
4923
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4924
\begin_inset Text
 
4925
 
 
4926
\begin_layout Standard
 
4927
matches any type, even types qualified with 
 
4928
\family typewriter
 
4929
const
 
4930
\family default
 
4931
 or 
 
4932
\family typewriter
 
4933
volatile
 
4934
\family default
 
4935
 
 
4936
\end_layout
 
4937
 
 
4938
\end_inset
 
4939
</cell>
 
4940
</row>
 
4941
<row>
 
4942
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4943
\begin_inset Text
 
4944
 
 
4945
\begin_layout Standard
 
4946
 
 
4947
\family typewriter
 
4948
const %
 
4949
\end_layout
 
4950
 
 
4951
\end_inset
 
4952
</cell>
 
4953
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4954
\begin_inset Text
 
4955
 
 
4956
\begin_layout Standard
 
4957
matches only types qualified by 
 
4958
\family typewriter
 
4959
const
 
4960
\end_layout
 
4961
 
 
4962
\end_inset
 
4963
</cell>
 
4964
</row>
 
4965
<row>
 
4966
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
4967
\begin_inset Text
 
4968
 
 
4969
\begin_layout Standard
 
4970
 
 
4971
\family typewriter
 
4972
% (*)() const volatile
 
4973
\end_layout
 
4974
 
 
4975
\end_inset
 
4976
</cell>
 
4977
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
4978
\begin_inset Text
 
4979
 
 
4980
\begin_layout Standard
 
4981
matches the type of all pointers to functions that are qualified by 
 
4982
\family typewriter
 
4983
const
 
4984
\family default
 
4985
 and 
 
4986
\family typewriter
 
4987
volatile
 
4988
\end_layout
 
4989
 
 
4990
\end_inset
 
4991
</cell>
 
4992
</row>
 
4993
</lyxtabular>
 
4994
 
 
4995
\end_inset
 
4996
 
 
4997
 
 
4998
\begin_inset VSpace bigskip
 
4999
\end_inset
 
5000
 
 
5001
 
 
5002
\end_layout
 
5003
 
 
5004
\begin_layout Subsubsection
 
5005
Handling of Conversion Function Types
 
5006
\end_layout
 
5007
 
 
5008
\begin_layout Standard
 
5009
The result type of conversion functions is interpreted as a special 
 
5010
\emph on
 
5011
undefined
 
5012
\emph default
 
5013
 type in type patterns as well as in compared types.
 
5014
 The 
 
5015
\emph on
 
5016
undefined
 
5017
\emph default
 
5018
 
 
5019
\begin_inset LatexCommand \index{undefined type}
 
5020
 
 
5021
\end_inset
 
5022
 
 
5023
 type is only matched by the 
 
5024
\emph on
 
5025
any type
 
5026
\emph default
 
5027
 node and the 
 
5028
\emph on
 
5029
undefined type
 
5030
\emph default
 
5031
 node.
 
5032
\end_layout
 
5033
 
 
5034
\begin_layout Subsubsection
 
5035
Ellipses in Function Type Patterns
 
5036
\end_layout
 
5037
 
 
5038
\begin_layout Standard
 
5039
In the list of function argument types the type pattern 
 
5040
\family typewriter
 
5041
...
 
5042
 
 
5043
\family default
 
5044
 
 
5045
\begin_inset LatexCommand \index{...}
 
5046
 
 
5047
\end_inset
 
5048
 
 
5049
can be used to match an arbitrary (even empty) list of types.
 
5050
 The 
 
5051
\family typewriter
 
5052
...
 
5053
 
 
5054
\family default
 
5055
 pattern should not be followed by other argument type patterns in the list
 
5056
 of argument types.
 
5057
\end_layout
 
5058
 
 
5059
\begin_layout Subsubsection
 
5060
Matching of Virtual Functions
 
5061
\end_layout
 
5062
 
 
5063
\begin_layout Standard
 
5064
The 
 
5065
\emph on
 
5066
decl-specifier-seq
 
5067
\emph default
 
5068
 of a function type match expression may include the keyword 
 
5069
\family typewriter
 
5070
\size small
 
5071
virtual
 
5072
\family default
 
5073
\size default
 
5074
.
 
5075
 In this case the function type match expression only matches virtual or
 
5076
 pure virtual member functions.
 
5077
 As 
 
5078
\family typewriter
 
5079
\size small
 
5080
const
 
5081
\family default
 
5082
\size default
 
5083
 and 
 
5084
\family typewriter
 
5085
\size small
 
5086
volatile
 
5087
\family default
 
5088
\size default
 
5089
, the 
 
5090
\family typewriter
 
5091
\size small
 
5092
virtual
 
5093
\family default
 
5094
\size default
 
5095
 keyword is regarded as a restriction.
 
5096
 This means that a function type match expression without 
 
5097
\family typewriter
 
5098
\size small
 
5099
virtual
 
5100
\family default
 
5101
\size default
 
5102
 matches virtual and non-virtual functions.
 
5103
\end_layout
 
5104
 
 
5105
\begin_layout Subsubsection*
 
5106
Example: type patterns with 
 
5107
\family typewriter
 
5108
virtual
 
5109
\family default
 
5110
 
 
5111
\family typewriter
 
5112
 
 
5113
\begin_inset LatexCommand \label{exa:match-type-patterns-virtual}
 
5114
 
 
5115
\end_inset
 
5116
 
 
5117
 
 
5118
\family default
 
5119
 
 
5120
\begin_inset LatexCommand \index{match expression!type pattern with virtual keyword}
 
5121
 
 
5122
\end_inset
 
5123
 
 
5124
 
 
5125
\begin_inset LatexCommand \index{type pattern with virtual keyword}
 
5126
 
 
5127
\end_inset
 
5128
 
 
5129
 
 
5130
\end_layout
 
5131
 
 
5132
\begin_layout Standard
 
5133
\begin_inset Tabular
 
5134
<lyxtabular version="3" rows="2" columns="2">
 
5135
<features>
 
5136
<column alignment="left" valignment="top" width="0">
 
5137
<column alignment="block" valignment="top" width="9cm">
 
5138
<row>
 
5139
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
5140
\begin_inset Text
 
5141
 
 
5142
\begin_layout Standard
 
5143
 
 
5144
\family typewriter
 
5145
virtual % ...::%(...)
 
5146
\end_layout
 
5147
 
 
5148
\end_inset
 
5149
</cell>
 
5150
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
5151
\begin_inset Text
 
5152
 
 
5153
\begin_layout Standard
 
5154
matches all virtual or pure virtual functions in any scope
 
5155
\end_layout
 
5156
 
 
5157
\end_inset
 
5158
</cell>
 
5159
</row>
 
5160
<row>
 
5161
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
5162
\begin_inset Text
 
5163
 
 
5164
\begin_layout Standard
 
5165
 
 
5166
\family typewriter
 
5167
% C::%(...)
 
5168
\end_layout
 
5169
 
 
5170
\end_inset
 
5171
</cell>
 
5172
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
5173
\begin_inset Text
 
5174
 
 
5175
\begin_layout Standard
 
5176
matches all member functions of C, even if they are virtual
 
5177
\end_layout
 
5178
 
 
5179
\end_inset
 
5180
</cell>
 
5181
</row>
 
5182
</lyxtabular>
 
5183
 
 
5184
\end_inset
 
5185
 
 
5186
 
 
5187
\begin_inset VSpace bigskip
 
5188
\end_inset
 
5189
 
 
5190
 
 
5191
\end_layout
 
5192
 
 
5193
\begin_layout Subsubsection
 
5194
Argument Type Adjustment
 
5195
\end_layout
 
5196
 
 
5197
\begin_layout Standard
 
5198
Argument types 
 
5199
\begin_inset LatexCommand \index{argument types}
 
5200
 
 
5201
\end_inset
 
5202
 
 
5203
 in type patterns are adjusted according to the usual C++ rules, i.e.
 
5204
 array and function types are converted to pointers to the given type and
 
5205
 
 
5206
\family typewriter
 
5207
const
 
5208
\family default
 
5209
/
 
5210
\family typewriter
 
5211
volatile
 
5212
\family default
 
5213
 qualifiers are removed.
 
5214
 Futhermore, argument type lists containing a single 
 
5215
\family typewriter
 
5216
void
 
5217
\family default
 
5218
 type are converted into an empty argument type list.
 
5219
\begin_inset LatexCommand \index{type matching|)}
 
5220
 
 
5221
\end_inset
 
5222
 
 
5223
 
 
5224
\begin_inset LatexCommand \index{match expression!type matching|)}
 
5225
 
 
5226
\end_inset
 
5227
 
 
5228
 
 
5229
\end_layout
 
5230
 
 
5231
\begin_layout Description
 
5232
\begin_inset LatexCommand \index{match expression|)}
 
5233
 
 
5234
\end_inset
 
5235
 
 
5236
 
 
5237
\begin_inset LatexCommand \index{search pattern!match expression|)}
 
5238
 
 
5239
\end_inset
 
5240
 
 
5241
 
 
5242
\end_layout
 
5243
 
 
5244
\begin_layout Section
 
5245
Predefined Pointcut Functions
 
5246
\begin_inset LatexCommand \label{sec:Predefined}
 
5247
 
 
5248
\end_inset
 
5249
 
 
5250
 
 
5251
\begin_inset LatexCommand \index{pointcut function|(}
 
5252
 
 
5253
\end_inset
 
5254
 
 
5255
 
 
5256
\begin_inset LatexCommand \index{pointcut!function|(}
 
5257
 
 
5258
\end_inset
 
5259
 
 
5260
 
 
5261
\end_layout
 
5262
 
 
5263
\begin_layout Standard
 
5264
On the following pages a complete list of the pointcut functions supported
 
5265
 by AspectC++ is presented.
 
5266
 For every pointcut function it is indicated which type of pointcut is expected
 
5267
 as argument(s) and of which type the result pointcut is.
 
5268
 Thereby 
 
5269
\begin_inset Quotes eld
 
5270
\end_inset
 
5271
 
 
5272
N
 
5273
\begin_inset Quotes erd
 
5274
\end_inset
 
5275
 
 
5276
 stands for name pointcut and 
 
5277
\begin_inset Quotes eld
 
5278
\end_inset
 
5279
 
 
5280
C
 
5281
\begin_inset Quotes erd
 
5282
\end_inset
 
5283
 
 
5284
 for code pointcut.
 
5285
 The optionally given index is an assurance about the type of join point(s)
 
5286
 described by the result pointcut
 
5287
\begin_inset Foot
 
5288
status collapsed
 
5289
 
 
5290
\begin_layout Standard
 
5291
C, C
 
5292
\begin_inset Formula $_{\textrm{C}}$
 
5293
\end_inset
 
5294
 
 
5295
, C
 
5296
\begin_inset Formula $_{\textrm{E}}$
 
5297
\end_inset
 
5298
 
 
5299
, C
 
5300
\begin_inset Formula $_{\textrm{S}}$
 
5301
\end_inset
 
5302
 
 
5303
, C
 
5304
\begin_inset Formula $_{\textrm{G}}$
 
5305
\end_inset
 
5306
 
 
5307
: Code (any, only 
 
5308
\emph on
 
5309
\bar under
 
5310
C
 
5311
\bar default
 
5312
all
 
5313
\emph default
 
5314
, only 
 
5315
\emph on
 
5316
\bar under
 
5317
E
 
5318
\bar default
 
5319
xecution
 
5320
\emph default
 
5321
, only 
 
5322
\emph on
 
5323
\bar under
 
5324
S
 
5325
\bar default
 
5326
et
 
5327
\emph default
 
5328
, only 
 
5329
\emph on
 
5330
\bar under
 
5331
G
 
5332
\bar default
 
5333
et
 
5334
\emph default
 
5335
); N, N
 
5336
\begin_inset Formula $_{N}$
 
5337
\end_inset
 
5338
 
 
5339
, N
 
5340
\begin_inset Formula $_{C}$
 
5341
\end_inset
 
5342
 
 
5343
, N
 
5344
\begin_inset Formula $_{F}$
 
5345
\end_inset
 
5346
 
 
5347
, N
 
5348
\begin_inset Formula $_{T}$
 
5349
\end_inset
 
5350
 
 
5351
: Names (any, only 
 
5352
\emph on
 
5353
\bar under
 
5354
N
 
5355
\bar default
 
5356
amespace
 
5357
\emph default
 
5358
, only 
 
5359
\emph on
 
5360
\bar under
 
5361
C
 
5362
\bar default
 
5363
lass
 
5364
\emph default
 
5365
, only 
 
5366
\emph on
 
5367
\bar under
 
5368
F
 
5369
\bar default
 
5370
unction
 
5371
\emph default
 
5372
, only 
 
5373
\emph on
 
5374
\bar under
 
5375
T
 
5376
\bar default
 
5377
ype
 
5378
\emph default
 
5379
)
 
5380
\end_layout
 
5381
 
 
5382
\end_inset
 
5383
 
 
5384
.
 
5385
 
 
5386
\end_layout
 
5387
 
 
5388
\begin_layout Subsection
 
5389
Types
 
5390
\end_layout
 
5391
 
 
5392
\begin_layout Description
 
5393
base
 
5394
\series medium
 
5395
(
 
5396
\emph on
 
5397
pointcut
 
5398
\emph default
 
5399
)
 
5400
\family typewriter
 
5401
\series default
 
5402
 
 
5403
\family default
 
5404
 
 
5405
\begin_inset LatexCommand \index{base@\texttt{base()}}
 
5406
 
 
5407
\end_inset
 
5408
 
 
5409
 
 
5410
\begin_inset LatexCommand \index{pointcut function!base@\texttt{base()}}
 
5411
 
 
5412
\end_inset
 
5413
 
 
5414
 
 
5415
\begin_inset ERT
 
5416
status collapsed
 
5417
 
 
5418
\begin_layout Standard
 
5419
 
 
5420
 
 
5421
\backslash
 
5422
hfill 
 
5423
\end_layout
 
5424
 
 
5425
\end_inset
 
5426
 
 
5427
N
 
5428
\begin_inset Formula $\rightarrow$
 
5429
\end_inset
 
5430
 
 
5431
N
 
5432
\begin_inset Formula $_{C,F}$
 
5433
\end_inset
 
5434
 
 
5435
 
 
5436
\newline
 
5437
returns all base classes 
 
5438
\begin_inset ERT
 
5439
status collapsed
 
5440
 
 
5441
\begin_layout Standard
 
5442
 
 
5443
 
 
5444
\backslash
 
5445
begin{comment}
 
5446
\end_layout
 
5447
 
 
5448
\end_inset
 
5449
 
 
5450
resp.\InsetSpace ~
 
5451
redefined functions 
 
5452
\begin_inset ERT
 
5453
status collapsed
 
5454
 
 
5455
\begin_layout Standard
 
5456
 
 
5457
\end_layout
 
5458
 
 
5459
\begin_layout Standard
 
5460
 
 
5461
\end_layout
 
5462
 
 
5463
\begin_layout Standard
 
5464
 
 
5465
 
 
5466
\backslash
 
5467
end{comment}
 
5468
\end_layout
 
5469
 
 
5470
\begin_layout Standard
 
5471
 
 
5472
\end_layout
 
5473
 
 
5474
\end_inset
 
5475
 
 
5476
of classes in the pointcut
 
5477
\end_layout
 
5478
 
 
5479
\begin_layout Description
 
5480
derived
 
5481
\series medium
 
5482
(
 
5483
\emph on
 
5484
pointcut
 
5485
\emph default
 
5486
)
 
5487
\family typewriter
 
5488
\series default
 
5489
 
 
5490
\family default
 
5491
 
 
5492
\begin_inset LatexCommand \index{derived@\texttt{derived()}}
 
5493
 
 
5494
\end_inset
 
5495
 
 
5496
 
 
5497
\begin_inset LatexCommand \index{pointcut function!derived@\texttt{derived()}}
 
5498
 
 
5499
\end_inset
 
5500
 
 
5501
 
 
5502
\begin_inset ERT
 
5503
status collapsed
 
5504
 
 
5505
\begin_layout Standard
 
5506
 
 
5507
 
 
5508
\backslash
 
5509
hfill 
 
5510
\end_layout
 
5511
 
 
5512
\end_inset
 
5513
 
 
5514
N
 
5515
\begin_inset Formula $\rightarrow$
 
5516
\end_inset
 
5517
 
 
5518
N
 
5519
\begin_inset Formula $_{C,F}$
 
5520
\end_inset
 
5521
 
 
5522
 
 
5523
\newline
 
5524
returns all classes in the pointcut and all classes derived from them
 
5525
\begin_inset ERT
 
5526
status collapsed
 
5527
 
 
5528
\begin_layout Standard
 
5529
 
 
5530
 
 
5531
\backslash
 
5532
begin{comment}
 
5533
\end_layout
 
5534
 
 
5535
\end_inset
 
5536
 
 
5537
 resp.\InsetSpace ~
 
5538
all redefined functions of derived classes
 
5539
\begin_inset ERT
 
5540
status collapsed
 
5541
 
 
5542
\begin_layout Standard
 
5543
 
 
5544
\end_layout
 
5545
 
 
5546
\begin_layout Standard
 
5547
 
 
5548
\end_layout
 
5549
 
 
5550
\begin_layout Standard
 
5551
 
 
5552
 
 
5553
\backslash
 
5554
end{comment}
 
5555
\end_layout
 
5556
 
 
5557
\begin_layout Standard
 
5558
 
 
5559
\end_layout
 
5560
 
 
5561
\end_inset
 
5562
 
 
5563
 
 
5564
\end_layout
 
5565
 
 
5566
\begin_layout Subsubsection*
 
5567
Example: type matching
 
5568
\begin_inset LatexCommand \label{exa:type-matching}
 
5569
 
 
5570
\end_inset
 
5571
 
 
5572
 
 
5573
\end_layout
 
5574
 
 
5575
\begin_layout Standard
 
5576
A software may contain the following class hierarchy.
 
5577
 
 
5578
\end_layout
 
5579
 
 
5580
\begin_layout LyX-Code
 
5581
class Shape { ...
 
5582
 };
 
5583
\newline
 
5584
class Point : public Shape { ...
 
5585
 };
 
5586
\newline
 
5587
...
 
5588
\newline
 
5589
class Rectangle : public Line, public Rotatable { ...
 
5590
 };
 
5591
\end_layout
 
5592
 
 
5593
\begin_layout Standard
 
5594
With the following aspect a special feature is added to a designated set
 
5595
 of classes of this class hierarchy.
 
5596
\end_layout
 
5597
 
 
5598
\begin_layout LyX-Code
 
5599
aspect Scale {
 
5600
\newline
 
5601
  pointcut scalable() = 
 
5602
\newline
 
5603
    (base("Rectangle") && derived("Point")
 
5604
) || "Rectangle";
 
5605
\newline
 
5606
  
 
5607
\newline
 
5608
  advice "Point" : baseclass("Scalable");
 
5609
\newline
 
5610
  advice scalable()
 
5611
 : void scale(int value) { ...
 
5612
 }
 
5613
\newline
 
5614
};
 
5615
\end_layout
 
5616
 
 
5617
\begin_layout Standard
 
5618
The pointcut describes the classes 
 
5619
\family typewriter
 
5620
Point
 
5621
\family default
 
5622
 and 
 
5623
\family typewriter
 
5624
Rectangle
 
5625
\family default
 
5626
 and all classes derived from 
 
5627
\family typewriter
 
5628
Point
 
5629
\family default
 
5630
 that are direct or indirect base classes of 
 
5631
\family typewriter
 
5632
Rectangle
 
5633
\family default
 
5634
.
 
5635
 With the first advice 
 
5636
\family typewriter
 
5637
Point
 
5638
\family default
 
5639
 gets a new base class.
 
5640
 The second advice adds a corresponding method to all classes in the pointcut.
 
5641
\end_layout
 
5642
 
 
5643
\begin_layout Subsection
 
5644
Control Flow
 
5645
\begin_inset LatexCommand \index{control flow|(}
 
5646
 
 
5647
\end_inset
 
5648
 
 
5649
 
 
5650
\end_layout
 
5651
 
 
5652
\begin_layout Description
 
5653
cflow
 
5654
\series medium
 
5655
(
 
5656
\emph on
 
5657
pointcut
 
5658
\emph default
 
5659
)
 
5660
\family typewriter
 
5661
\series default
 
5662
 
 
5663
\family default
 
5664
 
 
5665
\begin_inset LatexCommand \index{cflow@\texttt{cflow()}}
 
5666
 
 
5667
\end_inset
 
5668
 
 
5669
 
 
5670
\begin_inset LatexCommand \index{pointcut function!cflow@\texttt{cflow()}}
 
5671
 
 
5672
\end_inset
 
5673
 
 
5674
 
 
5675
\begin_inset ERT
 
5676
status collapsed
 
5677
 
 
5678
\begin_layout Standard
 
5679
 
 
5680
 
 
5681
\backslash
 
5682
hfill 
 
5683
\end_layout
 
5684
 
 
5685
\end_inset
 
5686
 
 
5687
C
 
5688
\begin_inset Formula $\rightarrow$
 
5689
\end_inset
 
5690
 
 
5691
C
 
5692
\newline
 
5693
captures join points occuring in the dynamic execution context of join
 
5694
 points in the pointcut.
 
5695
 Currently the language features being used in the argument pointcut are
 
5696
 restricted.
 
5697
 The argument ist not allowed to contain any context variable bindings (see
 
5698
 
 
5699
\begin_inset LatexCommand \ref{sub:context}
 
5700
 
 
5701
\end_inset
 
5702
 
 
5703
) or other pointcut functions which have to be evaluated at runtime like
 
5704
 
 
5705
\series bold
 
5706
cflow
 
5707
\series default
 
5708
(
 
5709
\emph on
 
5710
pointcut
 
5711
\emph default
 
5712
) itself.
 
5713
\end_layout
 
5714
 
 
5715
\begin_layout Subsubsection*
 
5716
Example: control flow dependant advice activation
 
5717
\begin_inset LatexCommand \label{exa:control-flow}
 
5718
 
 
5719
\end_inset
 
5720
 
 
5721
 
 
5722
\end_layout
 
5723
 
 
5724
\begin_layout Standard
 
5725
The following example demonstrates the use of the 
 
5726
\series bold
 
5727
cflow
 
5728
\series default
 
5729
 pointcut function.
 
5730
\end_layout
 
5731
 
 
5732
\begin_layout LyX-Code
 
5733
class Bus {
 
5734
\newline
 
5735
  void out (unsigned char);
 
5736
\newline
 
5737
  unsigned char in ();
 
5738
\newline
 
5739
};
 
5740
\end_layout
 
5741
 
 
5742
\begin_layout Standard
 
5743
Consider the class 
 
5744
\family typewriter
 
5745
Bus
 
5746
\family default
 
5747
 shown above.
 
5748
 It might be part of an operating system kernel and is used there to access
 
5749
 peripheral devices via a special I/O bus.
 
5750
 The execution of the member functions 
 
5751
\family typewriter
 
5752
in()
 
5753
\family default
 
5754
 and 
 
5755
\family typewriter
 
5756
out()
 
5757
\family default
 
5758
 should not be interrupted, because this would break the timing of the bus
 
5759
 communication.
 
5760
 Therefore, we decide to implement an interrupt synchronization aspect that
 
5761
 disables interrupts during the execution of in() and out():
 
5762
\end_layout
 
5763
 
 
5764
\begin_layout LyX-Code
 
5765
aspect BusIntSync {
 
5766
\newline
 
5767
  pointcut critical() = execution("% Bus::%(...)");
 
5768
\newline
 
5769
  advice
 
5770
 critical() && !cflow(execution("% os::int_handler()")) : 
 
5771
\newline
 
5772
  around() {
 
5773
\newline
 
5774
 
 
5775
   os::disable_ints();
 
5776
\newline
 
5777
    tjp->proceed();
 
5778
\newline
 
5779
    os::enable_ints();
 
5780
\newline
 
5781
  }
 
5782
\newline
 
5783
};
 
5784
\end_layout
 
5785
 
 
5786
\begin_layout Standard
 
5787
As the bus driver code might also be called from an interrupt handler, the
 
5788
 interrupts should not be disabled in any case.
 
5789
 Therefore, the pointcut expression exploits the 
 
5790
\series bold
 
5791
cflow()
 
5792
\series default
 
5793
 pointcut function to add a runtime condition for the advice activation.
 
5794
 The advice body should only be executed if the control flow did not come
 
5795
 from the interrupt handler 
 
5796
\family typewriter
 
5797
os::int_handler()
 
5798
\family default
 
5799
, because it is not interruptable by definition and 
 
5800
\family typewriter
 
5801
os::enable_ints()
 
5802
\family default
 
5803
 in the advice body would turn on the interrupts too early.
 
5804
\begin_inset LatexCommand \index{control flow|)}
 
5805
 
 
5806
\end_inset
 
5807
 
 
5808
 
 
5809
\end_layout
 
5810
 
 
5811
\begin_layout Subsection
 
5812
Scope
 
5813
\end_layout
 
5814
 
 
5815
\begin_layout Description
 
5816
within
 
5817
\series medium
 
5818
(
 
5819
\emph on
 
5820
pointcut
 
5821
\emph default
 
5822
)
 
5823
\family typewriter
 
5824
\series default
 
5825
 
 
5826
\family default
 
5827
 
 
5828
\begin_inset LatexCommand \index{within@\texttt{within()}}
 
5829
 
 
5830
\end_inset
 
5831
 
 
5832
 
 
5833
\begin_inset LatexCommand \index{pointcut function!within@\texttt{within()}}
 
5834
 
 
5835
\end_inset
 
5836
 
 
5837
 
 
5838
\begin_inset ERT
 
5839
status collapsed
 
5840
 
 
5841
\begin_layout Standard
 
5842
 
 
5843
 
 
5844
\backslash
 
5845
hfill 
 
5846
\end_layout
 
5847
 
 
5848
\end_inset
 
5849
 
 
5850
N
 
5851
\begin_inset Formula $\rightarrow$
 
5852
\end_inset
 
5853
 
 
5854
C
 
5855
\newline
 
5856
filters all join points that are within the functions or classes in the
 
5857
 pointcut
 
5858
\end_layout
 
5859
 
 
5860
\begin_layout Subsubsection*
 
5861
Example: matching in scopes
 
5862
\begin_inset LatexCommand \label{exa:matching-in-scopes}
 
5863
 
 
5864
\end_inset
 
5865
 
 
5866
 
 
5867
\end_layout
 
5868
 
 
5869
\begin_layout LyX-Code
 
5870
aspect Logger {
 
5871
\newline
 
5872
  pointcut calls() = 
 
5873
\newline
 
5874
    call("void transmit()") && within("Trans
 
5875
mitter");
 
5876
\newline
 
5877
  
 
5878
\newline
 
5879
  advice calls() : around() {
 
5880
\newline
 
5881
    cout << "transmitting ...
 
5882
 " << flush;
 
5883
\newline
 
5884
    tjp->proceed();
 
5885
\newline
 
5886
    cout << "finished." << endl;
 
5887
\newline
 
5888
  }
 
5889
\newline
 
5890
};
 
5891
\end_layout
 
5892
 
 
5893
\begin_layout Standard
 
5894
This aspect inserts code logging all calls to 
 
5895
\family typewriter
 
5896
transmit
 
5897
\family default
 
5898
 that are within the methods of class 
 
5899
\family typewriter
 
5900
Transmitter
 
5901
\family default
 
5902
.
 
5903
 
 
5904
\end_layout
 
5905
 
 
5906
\begin_layout Subsection
 
5907
Functions
 
5908
\end_layout
 
5909
 
 
5910
\begin_layout Description
 
5911
call
 
5912
\series medium
 
5913
(
 
5914
\emph on
 
5915
pointcut
 
5916
\emph default
 
5917
)
 
5918
\family typewriter
 
5919
\series default
 
5920
 
 
5921
\family default
 
5922
 
 
5923
\begin_inset LatexCommand \index{call@\texttt{call()}}
 
5924
 
 
5925
\end_inset
 
5926
 
 
5927
 
 
5928
\begin_inset LatexCommand \index{pointcut function!call@\texttt{call()}}
 
5929
 
 
5930
\end_inset
 
5931
 
 
5932
 
 
5933
\begin_inset ERT
 
5934
status collapsed
 
5935
 
 
5936
\begin_layout Standard
 
5937
 
 
5938
 
 
5939
\backslash
 
5940
hfill 
 
5941
\end_layout
 
5942
 
 
5943
\end_inset
 
5944
 
 
5945
N
 
5946
\begin_inset Formula $\rightarrow$
 
5947
\end_inset
 
5948
 
 
5949
C
 
5950
\begin_inset Formula $_{C}$
 
5951
\end_inset
 
5952
 
 
5953
 
 
5954
\newline
 
5955
Provides all join points where a named entity in the pointcut is called.
 
5956
 The pointcut may contain function names or class names.
 
5957
 In the case of a class name all calls to methods of that class are provided.
 
5958
\end_layout
 
5959
 
 
5960
\begin_layout Description
 
5961
execution
 
5962
\series medium
 
5963
(
 
5964
\emph on
 
5965
pointcut
 
5966
\emph default
 
5967
)
 
5968
\family typewriter
 
5969
\series default
 
5970
 
 
5971
\family default
 
5972
 
 
5973
\begin_inset LatexCommand \index{execution@\texttt{execution()}}
 
5974
 
 
5975
\end_inset
 
5976
 
 
5977
 
 
5978
\begin_inset LatexCommand \index{pointcut function!execution@\texttt{execution()}}
 
5979
 
 
5980
\end_inset
 
5981
 
 
5982
 
 
5983
\begin_inset ERT
 
5984
status collapsed
 
5985
 
 
5986
\begin_layout Standard
 
5987
 
 
5988
 
 
5989
\backslash
 
5990
hfill 
 
5991
\end_layout
 
5992
 
 
5993
\end_inset
 
5994
 
 
5995
N
 
5996
\begin_inset Formula $\rightarrow$
 
5997
\end_inset
 
5998
 
 
5999
C
 
6000
\begin_inset Formula $_{E}$
 
6001
\end_inset
 
6002
 
 
6003
 
 
6004
\newline
 
6005
provides all join points referring to the implementation of a named entity
 
6006
 in the pointcut.
 
6007
 The pointcut may contain function names or class names.
 
6008
 In the case of a class name all implementations of methods of that class
 
6009
 are provided.
 
6010
\end_layout
 
6011
 
 
6012
\begin_layout Subsubsection*
 
6013
Example: function matching
 
6014
\begin_inset LatexCommand \label{exa:function-matching}
 
6015
 
 
6016
\end_inset
 
6017
 
 
6018
 
 
6019
\end_layout
 
6020
 
 
6021
\begin_layout Standard
 
6022
The following aspect weaves debugging code into a program that checks whether
 
6023
 a method is called on a null pointer and whether the argument of the call
 
6024
 is null.
 
6025
\end_layout
 
6026
 
 
6027
\begin_layout LyX-Code
 
6028
aspect Debug {
 
6029
\newline
 
6030
  pointcut fct() = "% MemPool::dealloc(void*)";
 
6031
\newline
 
6032
  pointcut
 
6033
 exec() = execution(fct());
 
6034
\newline
 
6035
  pointcut calls() = call(fct());
 
6036
\newline
 
6037
  
 
6038
\newline
 
6039
  advice exec()
 
6040
 && args(ptr) : before(void *ptr) {
 
6041
\newline
 
6042
    assert(ptr && "argument is NULL");
 
6043
\newline
 
6044
 
 
6045
  }
 
6046
\newline
 
6047
  advice calls() : before() {
 
6048
\newline
 
6049
    assert(tjp->target() && "'this' is NULL");
 
6050
\newline
 
6051
 
 
6052
  }
 
6053
\newline
 
6054
};
 
6055
\end_layout
 
6056
 
 
6057
\begin_layout Standard
 
6058
The first advice provides code to check the argument of the function 
 
6059
\family typewriter
 
6060
dealloc
 
6061
\family default
 
6062
 before the function is executed.
 
6063
 A check whether 
 
6064
\family typewriter
 
6065
dealloc
 
6066
\family default
 
6067
 is called on a null object is provided by the second advice.
 
6068
 This is realized by checking the target of the call.
 
6069
\end_layout
 
6070
 
 
6071
\begin_layout Subsection
 
6072
Object Construction and Destruction
 
6073
\end_layout
 
6074
 
 
6075
\begin_layout Description
 
6076
construction
 
6077
\series medium
 
6078
(
 
6079
\emph on
 
6080
pointcut
 
6081
\emph default
 
6082
)
 
6083
\family typewriter
 
6084
\series default
 
6085
 
 
6086
\family default
 
6087
 
 
6088
\begin_inset LatexCommand \index{construction@\texttt{construction()}}
 
6089
 
 
6090
\end_inset
 
6091
 
 
6092
 
 
6093
\begin_inset LatexCommand \index{pointcut function!construction@\texttt{construction()}}
 
6094
 
 
6095
\end_inset
 
6096
 
 
6097
 
 
6098
\begin_inset ERT
 
6099
status collapsed
 
6100
 
 
6101
\begin_layout Standard
 
6102
 
 
6103
 
 
6104
\backslash
 
6105
hfill 
 
6106
\end_layout
 
6107
 
 
6108
\end_inset
 
6109
 
 
6110
N
 
6111
\begin_inset Formula $\rightarrow$
 
6112
\end_inset
 
6113
 
 
6114
C
 
6115
\begin_inset Formula $_{Cons}$
 
6116
\end_inset
 
6117
 
 
6118
 
 
6119
\newline
 
6120
all join points where an instance of the given class(es) is constructed.
 
6121
 The construction joinpoint begins after all base class and member construction
 
6122
 joinpoints.
 
6123
 It can be imagined as the execution of the constructor.
 
6124
 However, advice for construction joinpoints work, even if there is no construct
 
6125
or defined explicitly.
 
6126
 A construction joinpoint has arguments and argument types, which can be
 
6127
 exposed or filtered, e.g.
 
6128
 by using the 
 
6129
\series bold
 
6130
args
 
6131
\series default
 
6132
 pointcut function.
 
6133
\end_layout
 
6134
 
 
6135
\begin_layout Description
 
6136
destruction
 
6137
\series medium
 
6138
(
 
6139
\emph on
 
6140
pointcut
 
6141
\emph default
 
6142
)
 
6143
\family typewriter
 
6144
\series default
 
6145
 
 
6146
\family default
 
6147
 
 
6148
\begin_inset LatexCommand \index{destruction@\texttt{destruction()}}
 
6149
 
 
6150
\end_inset
 
6151
 
 
6152
 
 
6153
\begin_inset LatexCommand \index{pointcut function!destruction@\texttt{destruction()}}
 
6154
 
 
6155
\end_inset
 
6156
 
 
6157
 
 
6158
\begin_inset ERT
 
6159
status collapsed
 
6160
 
 
6161
\begin_layout Standard
 
6162
 
 
6163
 
 
6164
\backslash
 
6165
hfill 
 
6166
\end_layout
 
6167
 
 
6168
\end_inset
 
6169
 
 
6170
N
 
6171
\begin_inset Formula $\rightarrow$
 
6172
\end_inset
 
6173
 
 
6174
C
 
6175
\begin_inset Formula $_{Des}$
 
6176
\end_inset
 
6177
 
 
6178
 
 
6179
\newline
 
6180
all join points where an instance of the given class(es) is destructed.
 
6181
 The destruction joinpoint ends before the destruction joinpoint of all
 
6182
 members and base classes.
 
6183
 It can be imagined as the execution of the destructor, although a destructor
 
6184
 does not to be defined explicitly.
 
6185
 A destruction joinpoint has an empty argument list.
 
6186
\end_layout
 
6187
 
 
6188
\begin_layout Subsubsection*
 
6189
Example: instance counting
 
6190
\begin_inset LatexCommand \label{exa:instance-counting}
 
6191
 
 
6192
\end_inset
 
6193
 
 
6194
 
 
6195
\end_layout
 
6196
 
 
6197
\begin_layout Standard
 
6198
The following aspect counts how many instances of the class 
 
6199
\family typewriter
 
6200
ClassOfInterest
 
6201
\family default
 
6202
 are created and destroyed.
 
6203
\end_layout
 
6204
 
 
6205
\begin_layout LyX-Code
 
6206
aspect InstanceCounting { 
 
6207
\newline
 
6208
  // the class for which instances should be counted
 
6209
 
 
6210
\newline
 
6211
  pointcut observed() = "ClassOfInterest";
 
6212
\newline
 
6213
  // count constructions and
 
6214
 destructions 
 
6215
\newline
 
6216
  advice construction (observed ()) : before () { _created++;
 
6217
 } 
 
6218
\newline
 
6219
  advice destruction (observed ())  : after ()  { _destroyed++; }
 
6220
\newline
 
6221
public:
 
6222
 
 
6223
\newline
 
6224
  // Singleton aspects can have a default constructor 
 
6225
\newline
 
6226
  InstanceCounting
 
6227
 () { _created = _destroyed = 0; }
 
6228
\newline
 
6229
private: 
 
6230
\newline
 
6231
  // counters
 
6232
\end_layout
 
6233
 
 
6234
\begin_layout LyX-Code
 
6235
  int _created;
 
6236
\end_layout
 
6237
 
 
6238
\begin_layout LyX-Code
 
6239
  int _destroyed;
 
6240
\end_layout
 
6241
 
 
6242
\begin_layout LyX-Code
 
6243
}; 
 
6244
\end_layout
 
6245
 
 
6246
\begin_layout Standard
 
6247
The implementation of this aspect is straightforward.
 
6248
 Two counters are initialized by the aspect constructor and incremented
 
6249
 by the construction/destruction advice.
 
6250
 By defining 
 
6251
\family typewriter
 
6252
observed()
 
6253
\family default
 
6254
 as a pure virtual pointcut the aspect can easily be transformed into a
 
6255
 reusable abstract aspect.
 
6256
\end_layout
 
6257
 
 
6258
\begin_layout Standard
 
6259
\begin_inset ERT
 
6260
status collapsed
 
6261
 
 
6262
\begin_layout Standard
 
6263
 
 
6264
 
 
6265
\backslash
 
6266
begin{comment}
 
6267
\end_layout
 
6268
 
 
6269
\end_inset
 
6270
 
 
6271
 
 
6272
\end_layout
 
6273
 
 
6274
\begin_layout Subsection
 
6275
Attributes
 
6276
\end_layout
 
6277
 
 
6278
\begin_layout Standard
 
6279
The 
 
6280
\series bold
 
6281
set
 
6282
\series default
 
6283
 and 
 
6284
\series bold
 
6285
get
 
6286
\series default
 
6287
 pointcut functions are not yet implemented in the AspectC++ compiler 
 
6288
\series bold
 
6289
ac++
 
6290
\begin_inset LatexCommand \index{ac++@\texttt{ac++}}
 
6291
 
 
6292
\end_inset
 
6293
 
 
6294
 
 
6295
\series default
 
6296
.
 
6297
\end_layout
 
6298
 
 
6299
\begin_layout Description
 
6300
set
 
6301
\series medium
 
6302
(
 
6303
\emph on
 
6304
pointcut
 
6305
\emph default
 
6306
 
6307
\series default
 
6308
 
 
6309
\begin_inset LatexCommand \index{set@\texttt{set()}}
 
6310
 
 
6311
\end_inset
 
6312
 
 
6313
 
 
6314
\begin_inset LatexCommand \index{pointcut function!set@\texttt{set()}}
 
6315
 
 
6316
\end_inset
 
6317
 
 
6318
 
 
6319
\begin_inset ERT
 
6320
status collapsed
 
6321
 
 
6322
\begin_layout Standard
 
6323
 
 
6324
 
 
6325
\backslash
 
6326
hfill 
 
6327
\end_layout
 
6328
 
 
6329
\end_inset
 
6330
 
 
6331
N
 
6332
\begin_inset Formula $\rightarrow$
 
6333
\end_inset
 
6334
 
 
6335
C
 
6336
\begin_inset Formula $_{S}$
 
6337
\end_inset
 
6338
 
 
6339
 
 
6340
\newline
 
6341
selects all join points where the value of an attribute or global variable
 
6342
 is modified
 
6343
\end_layout
 
6344
 
 
6345
\begin_layout Description
 
6346
get
 
6347
\series medium
 
6348
(
 
6349
\emph on
 
6350
pointcut
 
6351
\emph default
 
6352
)
 
6353
\family typewriter
 
6354
\series default
 
6355
 
 
6356
\family default
 
6357
 
 
6358
\begin_inset LatexCommand \index{get@\texttt{get()}}
 
6359
 
 
6360
\end_inset
 
6361
 
 
6362
 
 
6363
\begin_inset LatexCommand \index{pointcut function!get@\texttt{get()}}
 
6364
 
 
6365
\end_inset
 
6366
 
 
6367
 
 
6368
\begin_inset ERT
 
6369
status collapsed
 
6370
 
 
6371
\begin_layout Standard
 
6372
 
 
6373
 
 
6374
\backslash
 
6375
hfill 
 
6376
\end_layout
 
6377
 
 
6378
\end_inset
 
6379
 
 
6380
N
 
6381
\begin_inset Formula $\rightarrow$
 
6382
\end_inset
 
6383
 
 
6384
C
 
6385
\begin_inset Formula $_{G}$
 
6386
\end_inset
 
6387
 
 
6388
 
 
6389
\newline
 
6390
selects all join points where the value of an attribute or global variable
 
6391
 is read
 
6392
\end_layout
 
6393
 
 
6394
\begin_layout Subsubsection*
 
6395
Example: attribute matching
 
6396
\begin_inset LatexCommand \label{exa:attribute-matching}
 
6397
 
 
6398
\end_inset
 
6399
 
 
6400
 
 
6401
\end_layout
 
6402
 
 
6403
\begin_layout Standard
 
6404
\begin_inset ERT
 
6405
status collapsed
 
6406
 
 
6407
\begin_layout Standard
 
6408
 
 
6409
\end_layout
 
6410
 
 
6411
\begin_layout Standard
 
6412
 
 
6413
\end_layout
 
6414
 
 
6415
\begin_layout Standard
 
6416
 
 
6417
 
 
6418
\backslash
 
6419
end{comment}
 
6420
\end_layout
 
6421
 
 
6422
\begin_layout Standard
 
6423
 
 
6424
\end_layout
 
6425
 
 
6426
\end_inset
 
6427
 
 
6428
 
 
6429
\end_layout
 
6430
 
 
6431
\begin_layout Subsection
 
6432
\begin_inset LatexCommand \label{sub:context}
 
6433
 
 
6434
\end_inset
 
6435
 
 
6436
Context
 
6437
\end_layout
 
6438
 
 
6439
\begin_layout Description
 
6440
that
 
6441
\series medium
 
6442
(
 
6443
\emph on
 
6444
type\InsetSpace ~
 
6445
pattern
 
6446
\emph default
 
6447
)
 
6448
\family typewriter
 
6449
\series default
 
6450
 
 
6451
\family default
 
6452
 
 
6453
\begin_inset LatexCommand \index{that@\texttt{that()}}
 
6454
 
 
6455
\end_inset
 
6456
 
 
6457
 
 
6458
\begin_inset LatexCommand \index{pointcut function!that@\texttt{that()}}
 
6459
 
 
6460
\end_inset
 
6461
 
 
6462
 
 
6463
\begin_inset ERT
 
6464
status collapsed
 
6465
 
 
6466
\begin_layout Standard
 
6467
 
 
6468
 
 
6469
\backslash
 
6470
hfill 
 
6471
\end_layout
 
6472
 
 
6473
\end_inset
 
6474
 
 
6475
N
 
6476
\begin_inset Formula $\rightarrow$
 
6477
\end_inset
 
6478
 
 
6479
C
 
6480
\newline
 
6481
returns all join points where the current C++ 
 
6482
\family typewriter
 
6483
this
 
6484
\family default
 
6485
 pointer refers to an object which is an instance of a type that is compatible
 
6486
 to the type described by the type pattern
 
6487
\end_layout
 
6488
 
 
6489
\begin_layout Description
 
6490
target
 
6491
\series medium
 
6492
(
 
6493
\emph on
 
6494
type\InsetSpace ~
 
6495
pattern
 
6496
\emph default
 
6497
)
 
6498
\family typewriter
 
6499
\series default
 
6500
 
 
6501
\family default
 
6502
 
 
6503
\begin_inset LatexCommand \index{target@\texttt{target()}}
 
6504
 
 
6505
\end_inset
 
6506
 
 
6507
 
 
6508
\begin_inset LatexCommand \index{pointcut function!target@\texttt{target()}}
 
6509
 
 
6510
\end_inset
 
6511
 
 
6512
 
 
6513
\begin_inset ERT
 
6514
status collapsed
 
6515
 
 
6516
\begin_layout Standard
 
6517
 
 
6518
 
 
6519
\backslash
 
6520
hfill 
 
6521
\end_layout
 
6522
 
 
6523
\end_inset
 
6524
 
 
6525
N
 
6526
\begin_inset Formula $\rightarrow$
 
6527
\end_inset
 
6528
 
 
6529
C
 
6530
\newline
 
6531
returns all join points where the target object of a call is an instance
 
6532
 of a type
 
6533
\emph on
 
6534
 
 
6535
\emph default
 
6536
that is compatible to the type described by the type pattern
 
6537
\end_layout
 
6538
 
 
6539
\begin_layout Description
 
6540
result
 
6541
\series medium
 
6542
(
 
6543
\emph on
 
6544
type\InsetSpace ~
 
6545
pattern
 
6546
\emph default
 
6547
)
 
6548
\family typewriter
 
6549
\series default
 
6550
 
 
6551
\family default
 
6552
 
 
6553
\begin_inset LatexCommand \index{result@\texttt{result()}}
 
6554
 
 
6555
\end_inset
 
6556
 
 
6557
 
 
6558
\begin_inset LatexCommand \index{pointcut function!base@\texttt{base()}}
 
6559
 
 
6560
\end_inset
 
6561
 
 
6562
 
 
6563
\begin_inset ERT
 
6564
status collapsed
 
6565
 
 
6566
\begin_layout Standard
 
6567
 
 
6568
 
 
6569
\backslash
 
6570
hfill 
 
6571
\end_layout
 
6572
 
 
6573
\end_inset
 
6574
 
 
6575
N
 
6576
\begin_inset Formula $\rightarrow$
 
6577
\end_inset
 
6578
 
 
6579
C
 
6580
\newline
 
6581
returns all join points where the result object of a call/execution is
 
6582
 an instance of a type matched by the type pattern
 
6583
\end_layout
 
6584
 
 
6585
\begin_layout Description
 
6586
args
 
6587
\series medium
 
6588
(
 
6589
\emph on
 
6590
type\InsetSpace ~
 
6591
pattern
 
6592
\emph default
 
6593
,\InsetSpace ~
 
6594
...)
 
6595
\family typewriter
 
6596
\series default
 
6597
 
 
6598
\family default
 
6599
 
 
6600
\begin_inset LatexCommand \index{args@\texttt{args()}}
 
6601
 
 
6602
\end_inset
 
6603
 
 
6604
 
 
6605
\begin_inset LatexCommand \index{pointcut function!args@\texttt{args()}}
 
6606
 
 
6607
\end_inset
 
6608
 
 
6609
 
 
6610
\begin_inset ERT
 
6611
status collapsed
 
6612
 
 
6613
\begin_layout Standard
 
6614
 
 
6615
 
 
6616
\backslash
 
6617
hfill 
 
6618
\end_layout
 
6619
 
 
6620
\end_inset
 
6621
 
 
6622
(N,...)
 
6623
\begin_inset Formula $\rightarrow$
 
6624
\end_inset
 
6625
 
 
6626
C
 
6627
\newline
 
6628
The argument list of 
 
6629
\series bold
 
6630
args
 
6631
\series default
 
6632
 contains type patterns that are used to filter all joinpoints, e.g.
 
6633
 calls to functions or function executions, with a matching signature.
 
6634
 
 
6635
\end_layout
 
6636
 
 
6637
\begin_layout Standard
 
6638
Instead of the type pattern it is also possible here to pass the name of
 
6639
 a variable to which the context information is bound (a 
 
6640
\series bold
 
6641
context variable
 
6642
\series default
 
6643
).
 
6644
 In this case the type of the variable is used for the type matching.
 
6645
 Context variables must be declared in the argument list of 
 
6646
\series bold
 
6647
before()
 
6648
\series default
 
6649
 
6650
\series bold
 
6651
after()
 
6652
\series default
 
6653
, or 
 
6654
\series bold
 
6655
around()
 
6656
\series default
 
6657
 and can be used like a function argument in the advice body.
 
6658
\end_layout
 
6659
 
 
6660
\begin_layout Standard
 
6661
The 
 
6662
\series bold
 
6663
that()
 
6664
\series default
 
6665
 and 
 
6666
\series bold
 
6667
target()
 
6668
\series default
 
6669
 pointcut functions are special, because they might cause a run-time type
 
6670
 check.
 
6671
 The 
 
6672
\series bold
 
6673
args()
 
6674
\series default
 
6675
 and 
 
6676
\series bold
 
6677
result()
 
6678
\series default
 
6679
 functions are evaluated at compile time.
 
6680
\end_layout
 
6681
 
 
6682
\begin_layout Subsubsection*
 
6683
Example: context matching
 
6684
\begin_inset LatexCommand \label{exa:context-matching}
 
6685
 
 
6686
\end_inset
 
6687
 
 
6688
 
 
6689
\end_layout
 
6690
 
 
6691
\begin_layout Subsection
 
6692
\begin_inset LatexCommand \label{sub:Algebraic-Operators}
 
6693
 
 
6694
\end_inset
 
6695
 
 
6696
Algebraic Operators
 
6697
\end_layout
 
6698
 
 
6699
\begin_layout Description
 
6700
 
 
6701
\series medium
 
6702
\emph on
 
6703
pointcut
 
6704
\series default
 
6705
\emph default
 
6706
\InsetSpace ~
 
6707
&&
 
6708
\series medium
 
6709
\emph on
 
6710
\InsetSpace ~
 
6711
pointcut
 
6712
\family typewriter
 
6713
\series default
 
6714
\emph default
 
6715
 
 
6716
\family default
 
6717
 
 
6718
\begin_inset ERT
 
6719
status collapsed
 
6720
 
 
6721
\begin_layout Standard
 
6722
 
 
6723
 
 
6724
\backslash
 
6725
hfill 
 
6726
\end_layout
 
6727
 
 
6728
\end_inset
 
6729
 
 
6730
(N,N)
 
6731
\begin_inset Formula $\rightarrow$
 
6732
\end_inset
 
6733
 
 
6734
N, (C,C)
 
6735
\begin_inset Formula $\rightarrow$
 
6736
\end_inset
 
6737
 
 
6738
C
 
6739
\newline
 
6740
intersection of the join points in the pointcuts
 
6741
\end_layout
 
6742
 
 
6743
\begin_layout Description
 
6744
 
 
6745
\series medium
 
6746
\emph on
 
6747
pointcut
 
6748
\series default
 
6749
\emph default
 
6750
\InsetSpace ~
 
6751
||
 
6752
\series medium
 
6753
\emph on
 
6754
\InsetSpace ~
 
6755
pointcut
 
6756
\family typewriter
 
6757
\series default
 
6758
\emph default
 
6759
 
 
6760
\family default
 
6761
 
 
6762
\begin_inset ERT
 
6763
status collapsed
 
6764
 
 
6765
\begin_layout Standard
 
6766
 
 
6767
 
 
6768
\backslash
 
6769
hfill 
 
6770
\end_layout
 
6771
 
 
6772
\end_inset
 
6773
 
 
6774
(N,N)
 
6775
\begin_inset Formula $\rightarrow$
 
6776
\end_inset
 
6777
 
 
6778
N, (C,C)
 
6779
\begin_inset Formula $\rightarrow$
 
6780
\end_inset
 
6781
 
 
6782
C
 
6783
\newline
 
6784
union of the join points in the pointcuts
 
6785
\end_layout
 
6786
 
 
6787
\begin_layout Description
 
6788
!
 
6789
\series medium
 
6790
\emph on
 
6791
\InsetSpace ~
 
6792
pointcut
 
6793
\family typewriter
 
6794
\series default
 
6795
\emph default
 
6796
 
 
6797
\family default
 
6798
 
 
6799
\begin_inset ERT
 
6800
status collapsed
 
6801
 
 
6802
\begin_layout Standard
 
6803
 
 
6804
 
 
6805
\backslash
 
6806
hfill 
 
6807
\end_layout
 
6808
 
 
6809
\end_inset
 
6810
 
 
6811
N
 
6812
\begin_inset Formula $\rightarrow$
 
6813
\end_inset
 
6814
 
 
6815
N, C
 
6816
\begin_inset Formula $\rightarrow$
 
6817
\end_inset
 
6818
 
 
6819
C
 
6820
\newline
 
6821
exclusion of the join points in the pointcut
 
6822
\end_layout
 
6823
 
 
6824
\begin_layout Subsubsection*
 
6825
Example: 
 
6826
\begin_inset LatexCommand \label{exa:combining-pointcut}
 
6827
 
 
6828
\end_inset
 
6829
 
 
6830
combining pointcut expressions
 
6831
\begin_inset LatexCommand \index{pointcut function|)}
 
6832
 
 
6833
\end_inset
 
6834
 
 
6835
 
 
6836
\begin_inset LatexCommand \index{pointcut!function|)}
 
6837
 
 
6838
\end_inset
 
6839
 
 
6840
 
 
6841
\end_layout
 
6842
 
 
6843
\begin_layout Section
 
6844
Slices
 
6845
\end_layout
 
6846
 
 
6847
\begin_layout Standard
 
6848
This section defines the syntax and semantics of slice declarations.
 
6849
 The next section will describe how slices can be used by advice in order
 
6850
 to introduce code.
 
6851
 Currently, only class slices are defined in AspectC++.
 
6852
\end_layout
 
6853
 
 
6854
\begin_layout Subsection
 
6855
Class Slice Declarations
 
6856
\end_layout
 
6857
 
 
6858
\begin_layout Standard
 
6859
Class slices may be declared in any class or namespace scope.
 
6860
 They may be defined only once, but there may be an arbitrary number forward
 
6861
 declarations.
 
6862
 A qualified name may be used if a class slice that is already declared
 
6863
 in a certain scope is redeclared or defined as shown in the following example:
 
6864
\end_layout
 
6865
 
 
6866
\begin_layout LyX-Code
 
6867
slice class ASlice;
 
6868
\end_layout
 
6869
 
 
6870
\begin_layout LyX-Code
 
6871
namespace N {
 
6872
\end_layout
 
6873
 
 
6874
\begin_layout LyX-Code
 
6875
 slice class ASlice; // a different slice!
 
6876
\end_layout
 
6877
 
 
6878
\begin_layout LyX-Code
 
6879
}
 
6880
\end_layout
 
6881
 
 
6882
\begin_layout LyX-Code
 
6883
slice class ASlice { // definition of the ::ASlice
 
6884
\end_layout
 
6885
 
 
6886
\begin_layout LyX-Code
 
6887
  int elem;
 
6888
\end_layout
 
6889
 
 
6890
\begin_layout LyX-Code
 
6891
};
 
6892
\end_layout
 
6893
 
 
6894
\begin_layout LyX-Code
 
6895
slice class N::ASlice { // definition of the N::ASlice
 
6896
\end_layout
 
6897
 
 
6898
\begin_layout LyX-Code
 
6899
  long elem;
 
6900
\end_layout
 
6901
 
 
6902
\begin_layout LyX-Code
 
6903
};
 
6904
\end_layout
 
6905
 
 
6906
\begin_layout Standard
 
6907
If a class slice only defines a base class, an abbreviated syntax may be
 
6908
 used:
 
6909
\end_layout
 
6910
 
 
6911
\begin_layout LyX-Code
 
6912
slice class Chained : public Chain;
 
6913
\end_layout
 
6914
 
 
6915
\begin_layout Standard
 
6916
Class slices may be anonymous.
 
6917
 However, this only makes sense as part of an advice declaration.
 
6918
 A class slice my also be declared with the 
 
6919
\family typewriter
 
6920
aspect
 
6921
\family default
 
6922
 or 
 
6923
\family typewriter
 
6924
struct
 
6925
\family default
 
6926
 keyword instead of 
 
6927
\family typewriter
 
6928
class
 
6929
\family default
 
6930
.
 
6931
 While there is no difference between class and aspect slices, the default
 
6932
 access rights to the elements of a struct slice in the target classes are
 
6933
 public instead of private.
 
6934
 It is forbidden to declare aspects, pointcuts, advice, or slices as members
 
6935
 of a class slice.
 
6936
\end_layout
 
6937
 
 
6938
\begin_layout Standard
 
6939
Class slices may have members that are not defined within the body of a
 
6940
 class slice declaration, e.g.
 
6941
 static attributes or non-inline functions:
 
6942
\end_layout
 
6943
 
 
6944
\begin_layout LyX-Code
 
6945
slice class SL {
 
6946
\end_layout
 
6947
 
 
6948
\begin_layout LyX-Code
 
6949
  static int answer;
 
6950
\end_layout
 
6951
 
 
6952
\begin_layout LyX-Code
 
6953
  void f();
 
6954
\end_layout
 
6955
 
 
6956
\begin_layout LyX-Code
 
6957
};
 
6958
\end_layout
 
6959
 
 
6960
\begin_layout LyX-Code
 
6961
//...
 
6962
\end_layout
 
6963
 
 
6964
\begin_layout LyX-Code
 
6965
slice int SL::answer = 42;
 
6966
\end_layout
 
6967
 
 
6968
\begin_layout LyX-Code
 
6969
slice void SL::f() { ...
 
6970
 }
 
6971
\end_layout
 
6972
 
 
6973
\begin_layout Standard
 
6974
These external member declarations have to appear after the corresponding
 
6975
 slice declaration in the source code.
 
6976
\end_layout
 
6977
 
 
6978
\begin_layout Section
 
6979
Advice
 
6980
\begin_inset LatexCommand \index{advice!declaration|(}
 
6981
 
 
6982
\end_inset
 
6983
 
 
6984
 
 
6985
\end_layout
 
6986
 
 
6987
\begin_layout Standard
 
6988
This section describes the different types of advice offered by AspectC++.
 
6989
 Advice be categorized in advice for join points in the dynamic control
 
6990
 flow of the running program, e.
 
6991
 g.
 
6992
 function call or executions, and advice for static join points like introductio
 
6993
ns into classes.
 
6994
\end_layout
 
6995
 
 
6996
\begin_layout Standard
 
6997
In either case the compiler makes sure that the code of the aspect header
 
6998
 file, which contains the advice definition (if this is the case), is compiled
 
6999
 prior to the affected join point location.
 
7000
\end_layout
 
7001
 
 
7002
\begin_layout Subsection
 
7003
Advice for Dynamic Join Points
 
7004
\end_layout
 
7005
 
 
7006
\begin_layout Description
 
7007
before
 
7008
\series medium
 
7009
(...)
 
7010
\family typewriter
 
7011
\series default
 
7012
 
 
7013
\family default
 
7014
 
 
7015
\begin_inset LatexCommand \index{before}
 
7016
 
 
7017
\end_inset
 
7018
 
 
7019
 
 
7020
\begin_inset LatexCommand \index{advice!before}
 
7021
 
 
7022
\end_inset
 
7023
 
 
7024
\InsetSpace ~
 
7025
 
 
7026
\newline
 
7027
the advice code is executed before the join points in the pointcut
 
7028
\end_layout
 
7029
 
 
7030
\begin_layout Description
 
7031
after
 
7032
\series medium
 
7033
(...)
 
7034
\family typewriter
 
7035
\series default
 
7036
 
 
7037
\family default
 
7038
 
 
7039
\begin_inset LatexCommand \index{after}
 
7040
 
 
7041
\end_inset
 
7042
 
 
7043
 
 
7044
\begin_inset LatexCommand \index{advice!after}
 
7045
 
 
7046
\end_inset
 
7047
 
 
7048
\InsetSpace ~
 
7049
 
 
7050
\newline
 
7051
the advice code is executed after the join points in the pointcut
 
7052
\end_layout
 
7053
 
 
7054
\begin_layout Description
 
7055
around
 
7056
\series medium
 
7057
(...)
 
7058
\family typewriter
 
7059
\series default
 
7060
 
 
7061
\family default
 
7062
 
 
7063
\begin_inset LatexCommand \index{around}
 
7064
 
 
7065
\end_inset
 
7066
 
 
7067
 
 
7068
\begin_inset LatexCommand \index{advice!around}
 
7069
 
 
7070
\end_inset
 
7071
 
 
7072
\InsetSpace ~
 
7073
 
 
7074
\newline
 
7075
the advice code is executed in place of the join points in the pointcut
 
7076
\end_layout
 
7077
 
 
7078
\begin_layout Subsection
 
7079
Advice for Static Join Points
 
7080
\end_layout
 
7081
 
 
7082
\begin_layout Standard
 
7083
Static join points in AspectC++ are classes or aspects.
 
7084
 Advice for classes or aspects can introduce new members or add a base class.
 
7085
 Whether the new member or base class becomes 
 
7086
\series bold
 
7087
private
 
7088
\series default
 
7089
 
7090
\series bold
 
7091
protected
 
7092
\series default
 
7093
, or 
 
7094
\series bold
 
7095
public
 
7096
\series default
 
7097
 in the target class depends on the protection in the advice declaration
 
7098
 in the aspect.
 
7099
\end_layout
 
7100
 
 
7101
\begin_layout Description
 
7102
baseclass
 
7103
\series medium
 
7104
(
 
7105
\emph on
 
7106
classname
 
7107
\emph default
 
7108
)
 
7109
\family typewriter
 
7110
\series default
 
7111
 
 
7112
\family default
 
7113
 
 
7114
\begin_inset LatexCommand \index{baseclass}
 
7115
 
 
7116
\end_inset
 
7117
 
 
7118
 
 
7119
\begin_inset LatexCommand \index{advice!baseclass}
 
7120
 
 
7121
\end_inset
 
7122
 
 
7123
\InsetSpace ~
 
7124
 
 
7125
\newline
 
7126
a new base class is introduced to the classes in the pointcut 
 
7127
\end_layout
 
7128
 
 
7129
\begin_layout Description
 
7130
 
 
7131
\emph on
 
7132
introduction\InsetSpace ~
 
7133
declaration 
 
7134
\emph default
 
7135
 
 
7136
\begin_inset LatexCommand \index{introduction declaration}
 
7137
 
 
7138
\end_inset
 
7139
 
 
7140
 
 
7141
\begin_inset LatexCommand \index{advice!introduction declaration}
 
7142
 
 
7143
\end_inset
 
7144
 
 
7145
\InsetSpace ~
 
7146
 
 
7147
\newline
 
7148
a new attribute, member function, or type is introduced
 
7149
\end_layout
 
7150
 
 
7151
\begin_layout Standard
 
7152
Introduction declarations are only semantically analyzed in the context
 
7153
 of the target.
 
7154
 Therefore, the declaration may refer, for instance, to types or constants,
 
7155
 which are not known in the aspect definition, but only in the target class
 
7156
 or classes.
 
7157
 To introduce a constructor or destructor the name of the aspect, to which
 
7158
 the introduction belongs, has to be taken as the constructor/destructor
 
7159
 name.
 
7160
\end_layout
 
7161
 
 
7162
\begin_layout Standard
 
7163
 
 
7164
\emph on
 
7165
Non-inline introductions
 
7166
\emph default
 
7167
 can be used for introductions of static attributes or member function introduct
 
7168
ion with separate declaration an definition.
 
7169
 The name of the introduced member has to be a qualified name in which the
 
7170
 nested name specifier is the name of the aspect to which the introduction
 
7171
 belongs.
 
7172
\end_layout
 
7173
 
 
7174
\begin_layout Subsubsection*
 
7175
\begin_inset LatexCommand \index{advice!declaration|)}
 
7176
 
 
7177
\end_inset
 
7178
 
 
7179
 
 
7180
\end_layout
 
7181
 
 
7182
\begin_layout Section
 
7183
 
 
7184
\family typewriter
 
7185
JoinPoint
 
7186
\family default
 
7187
 API
 
7188
\family typewriter
 
7189
 
 
7190
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}|(}
 
7191
 
 
7192
\end_inset
 
7193
 
 
7194
 
 
7195
\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}|(}
 
7196
 
 
7197
\end_inset
 
7198
 
 
7199
 
 
7200
\end_layout
 
7201
 
 
7202
\begin_layout Standard
 
7203
The following sections provide a complete description of the 
 
7204
\family typewriter
 
7205
JoinPoint
 
7206
\family default
 
7207
 API.
 
7208
 
 
7209
\end_layout
 
7210
 
 
7211
\begin_layout Subsection
 
7212
Types
 
7213
\end_layout
 
7214
 
 
7215
\begin_layout Description
 
7216
 
 
7217
\family typewriter
 
7218
\series medium
 
7219
Result
 
7220
\series default
 
7221
 
 
7222
\family default
 
7223
 
 
7224
\begin_inset LatexCommand \index{Result@\texttt{Result}}
 
7225
 
 
7226
\end_inset
 
7227
 
 
7228
 
 
7229
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Result@\texttt{Result}}
 
7230
 
 
7231
\end_inset
 
7232
 
 
7233
\InsetSpace ~
 
7234
 
 
7235
\newline
 
7236
result type of a function
 
7237
\end_layout
 
7238
 
 
7239
\begin_layout Description
 
7240
 
 
7241
\family typewriter
 
7242
\series medium
 
7243
That
 
7244
\series default
 
7245
 
 
7246
\family default
 
7247
 
 
7248
\begin_inset LatexCommand \index{That@\texttt{That}}
 
7249
 
 
7250
\end_inset
 
7251
 
 
7252
 
 
7253
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!That@\texttt{That}}
 
7254
 
 
7255
\end_inset
 
7256
 
 
7257
\InsetSpace ~
 
7258
 
 
7259
\newline
 
7260
object type (object initiating a call)
 
7261
\end_layout
 
7262
 
 
7263
\begin_layout Description
 
7264
 
 
7265
\family typewriter
 
7266
\series medium
 
7267
Target
 
7268
\series default
 
7269
 
 
7270
\family default
 
7271
 
 
7272
\begin_inset LatexCommand \index{Target@\texttt{Target}}
 
7273
 
 
7274
\end_inset
 
7275
 
 
7276
 
 
7277
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Target@\texttt{Target}}
 
7278
 
 
7279
\end_inset
 
7280
 
 
7281
\InsetSpace ~
 
7282
 
 
7283
\newline
 
7284
target object type (target object of a call)
 
7285
\begin_inset ERT
 
7286
status collapsed
 
7287
 
 
7288
\begin_layout Standard
 
7289
 
 
7290
 
 
7291
\backslash
 
7292
begin{comment}
 
7293
\end_layout
 
7294
 
 
7295
\end_inset
 
7296
 
 
7297
 
 
7298
\end_layout
 
7299
 
 
7300
\begin_layout Description
 
7301
 
 
7302
\family typewriter
 
7303
\series medium
 
7304
Aspect
 
7305
\family default
 
7306
\series default
 
7307
 
 
7308
\begin_inset LatexCommand \index{Aspect@\texttt{Aspect}}
 
7309
 
 
7310
\end_inset
 
7311
 
 
7312
 
 
7313
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Aspect@\texttt{Aspect}}
 
7314
 
 
7315
\end_inset
 
7316
 
 
7317
\InsetSpace ~
 
7318
 
 
7319
\newline
 
7320
type of the aspect (only available in introductions)
 
7321
\begin_inset ERT
 
7322
status collapsed
 
7323
 
 
7324
\begin_layout Standard
 
7325
 
 
7326
\end_layout
 
7327
 
 
7328
\begin_layout Standard
 
7329
 
 
7330
\end_layout
 
7331
 
 
7332
\begin_layout Standard
 
7333
 
 
7334
 
 
7335
\backslash
 
7336
end{comment}
 
7337
\end_layout
 
7338
 
 
7339
\begin_layout Standard
 
7340
 
 
7341
\end_layout
 
7342
 
 
7343
\end_inset
 
7344
 
 
7345
 
 
7346
\end_layout
 
7347
 
 
7348
\begin_layout Subsubsection*
 
7349
Example: type usage
 
7350
\begin_inset LatexCommand \label{exa:type-usage}
 
7351
 
 
7352
\end_inset
 
7353
 
 
7354
 
 
7355
\end_layout
 
7356
 
 
7357
\begin_layout Subsection
 
7358
Functions
 
7359
\end_layout
 
7360
 
 
7361
\begin_layout Description
 
7362
 
 
7363
\family typewriter
 
7364
\series medium
 
7365
static\InsetSpace ~
 
7366
AC::Type
 
7367
\emph on
 
7368
\InsetSpace ~
 
7369
 
 
7370
\emph default
 
7371
type()
 
7372
\series default
 
7373
 
 
7374
\family default
 
7375
 
 
7376
\begin_inset LatexCommand \index{type@\texttt{type()}}
 
7377
 
 
7378
\end_inset
 
7379
 
 
7380
 
 
7381
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!type@\texttt{type()}}
 
7382
 
 
7383
\end_inset
 
7384
 
 
7385
\InsetSpace ~
 
7386
 
 
7387
\newline
 
7388
returns the encoded type for the join point conforming with the C++ ABI
 
7389
 V3 specification
 
7390
\begin_inset Foot
 
7391
status collapsed
 
7392
 
 
7393
\begin_layout Standard
 
7394
\begin_inset ERT
 
7395
status collapsed
 
7396
 
 
7397
\begin_layout Standard
 
7398
 
 
7399
 
 
7400
\backslash
 
7401
depref{http://www.codesourcery.com/cxx-abi/abi.html
 
7402
\backslash
 
7403
#mangling}{
 
7404
\backslash
 
7405
texttt{www.codesourcery.com/cxx-abi/abi.html
 
7406
\backslash
 
7407
#mangling}}
 
7408
\end_layout
 
7409
 
 
7410
\end_inset
 
7411
 
 
7412
 
 
7413
\end_layout
 
7414
 
 
7415
\end_inset
 
7416
 
 
7417
 
 
7418
\end_layout
 
7419
 
 
7420
\begin_layout Description
 
7421
 
 
7422
\family typewriter
 
7423
\series medium
 
7424
static\InsetSpace ~
 
7425
int
 
7426
\emph on
 
7427
\InsetSpace ~
 
7428
 
 
7429
\emph default
 
7430
args()
 
7431
\series default
 
7432
 
 
7433
\family default
 
7434
 
 
7435
\begin_inset LatexCommand \index{args@\texttt{args()}}
 
7436
 
 
7437
\end_inset
 
7438
 
 
7439
 
 
7440
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!args@\texttt{args()}}
 
7441
 
 
7442
\end_inset
 
7443
 
 
7444
\InsetSpace ~
 
7445
 
 
7446
\newline
 
7447
returns the number of arguments of a function for call and execution join
 
7448
 points
 
7449
\end_layout
 
7450
 
 
7451
\begin_layout Description
 
7452
 
 
7453
\family typewriter
 
7454
\series medium
 
7455
static\InsetSpace ~
 
7456
AC::Type
 
7457
\emph on
 
7458
\InsetSpace ~
 
7459
 
 
7460
\emph default
 
7461
argtype(int
 
7462
\series default
 
7463
\InsetSpace ~
 
7464
 
 
7465
\series medium
 
7466
number)
 
7467
\series default
 
7468
 
 
7469
\family default
 
7470
 
 
7471
\begin_inset LatexCommand \index{argtype@\texttt{argtype()}}
 
7472
 
 
7473
\end_inset
 
7474
 
 
7475
 
 
7476
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!argtype@\texttt{argtype()}}
 
7477
 
 
7478
\end_inset
 
7479
 
 
7480
\InsetSpace ~
 
7481
 
 
7482
\newline
 
7483
returns the encoded type of an argument conforming with the C++ ABI V3 specifica
 
7484
tion
 
7485
\end_layout
 
7486
 
 
7487
\begin_layout Description
 
7488
 
 
7489
\family typewriter
 
7490
\series medium
 
7491
static\InsetSpace ~
 
7492
const\InsetSpace ~
 
7493
char
 
7494
\series default
 
7495
\emph on
 
7496
\InsetSpace ~
 
7497
 
 
7498
\series medium
 
7499
\emph default
 
7500
*signature()
 
7501
\series default
 
7502
 
 
7503
\family default
 
7504
 
 
7505
\begin_inset LatexCommand \index{signature@\texttt{signature()}}
 
7506
 
 
7507
\end_inset
 
7508
 
 
7509
 
 
7510
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!signature@\texttt{signature()}}
 
7511
 
 
7512
\end_inset
 
7513
 
 
7514
\InsetSpace ~
 
7515
 
 
7516
\newline
 
7517
gives a textual description of the join point (function name, class name,
 
7518
 ...)
 
7519
\end_layout
 
7520
 
 
7521
\begin_layout Description
 
7522
 
 
7523
\family typewriter
 
7524
\series medium
 
7525
static\InsetSpace ~
 
7526
unsigned\InsetSpace ~
 
7527
int
 
7528
\series default
 
7529
\emph on
 
7530
\InsetSpace ~
 
7531
 
 
7532
\series medium
 
7533
\emph default
 
7534
id()
 
7535
\series default
 
7536
 
 
7537
\family default
 
7538
 
 
7539
\begin_inset LatexCommand \index{id@\texttt{id()}}
 
7540
 
 
7541
\end_inset
 
7542
 
 
7543
 
 
7544
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!id@\texttt{id()}}
 
7545
 
 
7546
\end_inset
 
7547
 
 
7548
\InsetSpace ~
 
7549
 
 
7550
\newline
 
7551
returns a unique numeric identifier for this join point
 
7552
\end_layout
 
7553
 
 
7554
\begin_layout Description
 
7555
 
 
7556
\family typewriter
 
7557
\series medium
 
7558
static\InsetSpace ~
 
7559
const\InsetSpace ~
 
7560
char
 
7561
\series default
 
7562
\emph on
 
7563
\InsetSpace ~
 
7564
 
 
7565
\series medium
 
7566
\emph default
 
7567
*filename()
 
7568
\series default
 
7569
 
 
7570
\family default
 
7571
 
 
7572
\begin_inset LatexCommand \index{filename@\texttt{filename()}}
 
7573
 
 
7574
\end_inset
 
7575
 
 
7576
 
 
7577
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!filename@\texttt{filename()}}
 
7578
 
 
7579
\end_inset
 
7580
 
 
7581
\InsetSpace ~
 
7582
 
 
7583
\newline
 
7584
returns the name of the file in which the join-point (shadow) is located
 
7585
\end_layout
 
7586
 
 
7587
\begin_layout Description
 
7588
 
 
7589
\family typewriter
 
7590
\series medium
 
7591
static\InsetSpace ~
 
7592
int
 
7593
\series default
 
7594
\emph on
 
7595
\InsetSpace ~
 
7596
 
 
7597
\series medium
 
7598
\emph default
 
7599
line()
 
7600
\series default
 
7601
 
 
7602
\family default
 
7603
 
 
7604
\begin_inset LatexCommand \index{line@\texttt{line()}}
 
7605
 
 
7606
\end_inset
 
7607
 
 
7608
 
 
7609
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!line@\texttt{line()}}
 
7610
 
 
7611
\end_inset
 
7612
 
 
7613
\InsetSpace ~
 
7614
 
 
7615
\newline
 
7616
the number of the line in which the join-point (shadow) is located
 
7617
\end_layout
 
7618
 
 
7619
\begin_layout Description
 
7620
 
 
7621
\family typewriter
 
7622
\series medium
 
7623
static\InsetSpace ~
 
7624
AC::Type
 
7625
\emph on
 
7626
\InsetSpace ~
 
7627
 
 
7628
\emph default
 
7629
resulttype()
 
7630
\series default
 
7631
 
 
7632
\family default
 
7633
 
 
7634
\begin_inset LatexCommand \index{resulttype@\texttt{resulttype()}}
 
7635
 
 
7636
\end_inset
 
7637
 
 
7638
 
 
7639
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!resulttype@\texttt{resulttype()}}
 
7640
 
 
7641
\end_inset
 
7642
 
 
7643
\InsetSpace ~
 
7644
 
 
7645
\newline
 
7646
returns the encoded type of the result type conforming with the C++ ABI
 
7647
 V3 specification
 
7648
\end_layout
 
7649
 
 
7650
\begin_layout Description
 
7651
 
 
7652
\family typewriter
 
7653
\series medium
 
7654
static\InsetSpace ~
 
7655
AC::JPType
 
7656
\emph on
 
7657
\InsetSpace ~
 
7658
 
 
7659
\emph default
 
7660
jptype()
 
7661
\series default
 
7662
 
 
7663
\family default
 
7664
 
 
7665
\begin_inset LatexCommand \index{jptype@\texttt{jptype()}}
 
7666
 
 
7667
\end_inset
 
7668
 
 
7669
 
 
7670
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!jptype@\texttt{jptype()}}
 
7671
 
 
7672
\end_inset
 
7673
 
 
7674
\InsetSpace ~
 
7675
 
 
7676
\newline
 
7677
returns a unique identifier describing the type of the join point
 
7678
\end_layout
 
7679
 
 
7680
\begin_layout Subsubsection*
 
7681
Example: static function usage
 
7682
\begin_inset LatexCommand \label{exa:static-function-usage}
 
7683
 
 
7684
\end_inset
 
7685
 
 
7686
 
 
7687
\end_layout
 
7688
 
 
7689
\begin_layout Description
 
7690
 
 
7691
\family typewriter
 
7692
\series medium
 
7693
void\InsetSpace ~
 
7694
*arg(int
 
7695
\series default
 
7696
\InsetSpace ~
 
7697
 
 
7698
\series medium
 
7699
number)
 
7700
\family default
 
7701
\series default
 
7702
 
 
7703
\begin_inset LatexCommand \index{arg@\texttt{arg()}}
 
7704
 
 
7705
\end_inset
 
7706
 
 
7707
 
 
7708
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!arg@\texttt{arg()}}
 
7709
 
 
7710
\end_inset
 
7711
 
 
7712
\InsetSpace ~
 
7713
 
 
7714
\newline
 
7715
returns a pointer to the memory position holding the argument value with
 
7716
 index 
 
7717
\family typewriter
 
7718
number
 
7719
\end_layout
 
7720
 
 
7721
\begin_layout Description
 
7722
 
 
7723
\family typewriter
 
7724
\series medium
 
7725
Result
 
7726
\emph on
 
7727
\InsetSpace ~
 
7728
 
 
7729
\emph default
 
7730
*result()
 
7731
\family default
 
7732
\series default
 
7733
 
 
7734
\family typewriter
 
7735
 
 
7736
\begin_inset LatexCommand \index{result@\texttt{result()}}
 
7737
 
 
7738
\end_inset
 
7739
 
 
7740
 
 
7741
\family default
 
7742
 
 
7743
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!result@\texttt{result()}}
 
7744
 
 
7745
\end_inset
 
7746
 
 
7747
\InsetSpace ~
 
7748
 
 
7749
\newline
 
7750
returns a pointer to the memory location designated for the result value
 
7751
 or 0 if the function has no result value
 
7752
\end_layout
 
7753
 
 
7754
\begin_layout Description
 
7755
 
 
7756
\family typewriter
 
7757
\series medium
 
7758
That\InsetSpace ~
 
7759
*that()
 
7760
\family default
 
7761
\series default
 
7762
 
 
7763
\family typewriter
 
7764
 
 
7765
\begin_inset LatexCommand \index{that@\texttt{that()}}
 
7766
 
 
7767
\end_inset
 
7768
 
 
7769
 
 
7770
\family default
 
7771
 
 
7772
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!that@\texttt{that()}}
 
7773
 
 
7774
\end_inset
 
7775
 
 
7776
\InsetSpace ~
 
7777
 
 
7778
\newline
 
7779
returns a pointer to the object initiating a call or 0 if it is a static
 
7780
 method or a global function
 
7781
\end_layout
 
7782
 
 
7783
\begin_layout Description
 
7784
 
 
7785
\family typewriter
 
7786
\series medium
 
7787
Target\InsetSpace ~
 
7788
*target()
 
7789
\family default
 
7790
\series default
 
7791
 
 
7792
\family typewriter
 
7793
 
 
7794
\begin_inset LatexCommand \index{target@\texttt{target()}}
 
7795
 
 
7796
\end_inset
 
7797
 
 
7798
 
 
7799
\family default
 
7800
 
 
7801
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!target@\texttt{target()}}
 
7802
 
 
7803
\end_inset
 
7804
 
 
7805
\InsetSpace ~
 
7806
 
 
7807
\newline
 
7808
returns a pointer to the object that is the target of a call or 0 if it
 
7809
 is a static method or a global function
 
7810
\end_layout
 
7811
 
 
7812
\begin_layout Description
 
7813
 
 
7814
\family typewriter
 
7815
\series medium
 
7816
void\InsetSpace ~
 
7817
proceed()
 
7818
\family default
 
7819
\series default
 
7820
 
 
7821
\begin_inset LatexCommand \index{proceed@\texttt{proceed()}}
 
7822
 
 
7823
\end_inset
 
7824
 
 
7825
 
 
7826
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!proceed()@\texttt{proceed()}}
 
7827
 
 
7828
\end_inset
 
7829
 
 
7830
\InsetSpace ~
 
7831
 
 
7832
\newline
 
7833
executes the original join point code in an around advice by calling 
 
7834
\family typewriter
 
7835
action().trigger()
 
7836
\end_layout
 
7837
 
 
7838
\begin_layout Description
 
7839
 
 
7840
\family typewriter
 
7841
\series medium
 
7842
AC::Action\InsetSpace ~
 
7843
&action()
 
7844
\family default
 
7845
\series default
 
7846
 
 
7847
\begin_inset LatexCommand \index{action@\texttt{action()}}
 
7848
 
 
7849
\end_inset
 
7850
 
 
7851
 
 
7852
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!action@\texttt{action()}}
 
7853
 
 
7854
\end_inset
 
7855
 
 
7856
\InsetSpace ~
 
7857
 
 
7858
\newline
 
7859
returns the runtime action object containing the execution environment to
 
7860
 execute the original functionality encapsulated by an around advice
 
7861
\end_layout
 
7862
 
 
7863
\begin_layout Subsubsection*
 
7864
Example: 
 
7865
\begin_inset LatexCommand \label{exa:non-static-function-usage}
 
7866
 
 
7867
\end_inset
 
7868
 
 
7869
non-static function usage
 
7870
\family typewriter
 
7871
 
 
7872
\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}|)}
 
7873
 
 
7874
\end_inset
 
7875
 
 
7876
 
 
7877
\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}|)}
 
7878
 
 
7879
\end_inset
 
7880
 
 
7881
 
 
7882
\end_layout
 
7883
 
 
7884
\begin_layout Section
 
7885
\begin_inset LatexCommand \label{sec:ordering}
 
7886
 
 
7887
\end_inset
 
7888
 
 
7889
Advice Ordering
 
7890
\begin_inset LatexCommand \index{advice!ordering|(}
 
7891
 
 
7892
\end_inset
 
7893
 
 
7894
 
 
7895
\end_layout
 
7896
 
 
7897
\begin_layout Subsection
 
7898
\begin_inset LatexCommand \label{sub:aspect-precedence}
 
7899
 
 
7900
\end_inset
 
7901
 
 
7902
Aspect Precedence
 
7903
\begin_inset LatexCommand \index{precedence!of aspects|(}
 
7904
 
 
7905
\end_inset
 
7906
 
 
7907
 
 
7908
\end_layout
 
7909
 
 
7910
\begin_layout Standard
 
7911
AspectC++ provides a very flexible mechanism to define aspect precedence.
 
7912
 The precedence is used to determine the execution order of advice code
 
7913
 if more than one aspect affect the same join point.
 
7914
 The precedence in AspectC++ is an attribute of a join point.
 
7915
 This means that the precedence relationship between two aspects might vary
 
7916
 in different parts of the system.
 
7917
 The compiler checks the following conditions to determine the precendence
 
7918
 of aspects:
 
7919
\end_layout
 
7920
 
 
7921
\begin_layout Description
 
7922
order\InsetSpace ~
 
7923
declaration: if the programmer provides an order declaration, which
 
7924
 defines the precedence relationship between two aspects for a join point,
 
7925
 the compiler will obey this definition or abort with a compile-time error
 
7926
 if there is a cycle in the precedence graph.
 
7927
 Order declarations have the following syntax:
 
7928
\family typewriter
 
7929
\series bold
 
7930
 
 
7931
\newline
 
7932
advice
 
7933
\family default
 
7934
\series default
 
7935
 
 
7936
\emph on
 
7937
pointcut-expr
 
7938
\emph default
 
7939
 : 
 
7940
\family typewriter
 
7941
\series bold
 
7942
order
 
7943
\family default
 
7944
\series default
 
7945
 
 
7946
\family typewriter
 
7947
\series bold
 
7948
(
 
7949
\family default
 
7950
\series default
 
7951
 
 
7952
\emph on
 
7953
high
 
7954
\family typewriter
 
7955
\series bold
 
7956
\emph default
 
7957
,
 
7958
\family default
 
7959
\series default
 
7960
 ...
 
7961
\emph on
 
7962
low
 
7963
\emph default
 
7964
 
 
7965
\family typewriter
 
7966
\series bold
 
7967
)
 
7968
\newline
 
7969
 
 
7970
\family default
 
7971
\series default
 
7972
The argument list of 
 
7973
\family typewriter
 
7974
order
 
7975
\family default
 
7976
 has to contain at least two elements.
 
7977
 Each element is a pointcut expression, which describes a set of aspects.
 
7978
 Each aspect in a certain set has a higher precedence than all aspects,
 
7979
 which are part of a set following later in the list (on the right hand
 
7980
 side).
 
7981
 For example '
 
7982
\family typewriter
 
7983
("A1"||"A2","A3"||"A4")
 
7984
\family default
 
7985
' means that 
 
7986
\family typewriter
 
7987
A1
 
7988
\family default
 
7989
 has precedence over 
 
7990
\family typewriter
 
7991
A3
 
7992
\family default
 
7993
 and 
 
7994
\family typewriter
 
7995
A4
 
7996
\family default
 
7997
 and that 
 
7998
\family typewriter
 
7999
A2
 
8000
\family default
 
8001
 has precedence over 
 
8002
\family typewriter
 
8003
A3
 
8004
\family default
 
8005
 and 
 
8006
\family typewriter
 
8007
A4
 
8008
\family default
 
8009
.
 
8010
 This order directive does 
 
8011
\emph on
 
8012
not
 
8013
\emph default
 
8014
 define the relation between 
 
8015
\family typewriter
 
8016
A1
 
8017
\family default
 
8018
 and 
 
8019
\family typewriter
 
8020
A2
 
8021
\family default
 
8022
 or 
 
8023
\family typewriter
 
8024
A3
 
8025
\family default
 
8026
 and 
 
8027
\family typewriter
 
8028
A4
 
8029
\family default
 
8030
.
 
8031
 Of course, the pointcut expressions in the argument list of 
 
8032
\family typewriter
 
8033
order
 
8034
\family default
 
8035
 may contain named pointcuts and even pure virtual pointcuts.
 
8036
\end_layout
 
8037
 
 
8038
\begin_layout Description
 
8039
inheritance\InsetSpace ~
 
8040
relation: if there is no order declaration given and one aspect
 
8041
 has a base aspect the derived aspect has a higher precedence than the base
 
8042
 aspect.
 
8043
\end_layout
 
8044
 
 
8045
\begin_layout Subsection
 
8046
\begin_inset LatexCommand \label{sub:advice-precedence}
 
8047
 
 
8048
\end_inset
 
8049
 
 
8050
Advice Precedence
 
8051
\begin_inset LatexCommand \index{precedence!of advice|(}
 
8052
 
 
8053
\end_inset
 
8054
 
 
8055
 
 
8056
\end_layout
 
8057
 
 
8058
\begin_layout Standard
 
8059
The precedence of advice is determined with a very simple scheme:
 
8060
\end_layout
 
8061
 
 
8062
\begin_layout Itemize
 
8063
if two advice declarations belong to different aspects and there is a precedence
 
8064
 relation between these aspects (see section 
 
8065
\begin_inset LatexCommand \vref{sub:aspect-precedence}
 
8066
 
 
8067
\end_inset
 
8068
 
 
8069
) the same relation will be assumed for the advice.
 
8070
\end_layout
 
8071
 
 
8072
\begin_layout Itemize
 
8073
if two advice declarations belong to the same aspect the one that is declared
 
8074
 first has the higher precedence.
 
8075
\end_layout
 
8076
 
 
8077
\begin_layout Subsection
 
8078
Effects of Advice Precedence
 
8079
\begin_inset LatexCommand \index{precedence!effects|(}
 
8080
 
 
8081
\end_inset
 
8082
 
 
8083
 
 
8084
\end_layout
 
8085
 
 
8086
\begin_layout Standard
 
8087
Only advice predecence has an effect on the generated code.
 
8088
 The effect depends on the kind of join point, which is affected by two
 
8089
 advice declarations.
 
8090
\end_layout
 
8091
 
 
8092
\begin_layout Subsubsection*
 
8093
Class Join Points
 
8094
\end_layout
 
8095
 
 
8096
\begin_layout Standard
 
8097
Advice on class join points can extend the attribute list or base class
 
8098
 list.
 
8099
 If advice has a higher precedence than another it will be handled first.
 
8100
 For example, an introduced new base class of advice with a high precedence
 
8101
 will appear in the base class list on the left side of a base class, which
 
8102
 was inserted by advice with lower precedence.
 
8103
 This means that the execution order of the constructors of introduced base
 
8104
 classes can be influenced, for instance, by order declarations.
 
8105
\end_layout
 
8106
 
 
8107
\begin_layout Standard
 
8108
The order of introduced attributes also has an impact on the constructor/destruc
 
8109
tor execution order as well as the object layout.
 
8110
\end_layout
 
8111
 
 
8112
\begin_layout Subsubsection*
 
8113
Code Join Points
 
8114
\end_layout
 
8115
 
 
8116
\begin_layout Standard
 
8117
Advice on code join points can be 
 
8118
\family typewriter
 
8119
before
 
8120
\family default
 
8121
 
8122
\family typewriter
 
8123
after
 
8124
\family default
 
8125
, or 
 
8126
\family typewriter
 
8127
around
 
8128
\family default
 
8129
 advice.
 
8130
 For 
 
8131
\family typewriter
 
8132
before
 
8133
\family default
 
8134
 and 
 
8135
\family typewriter
 
8136
around
 
8137
\family default
 
8138
 advice a higher precedence means that the corresponding advice code will
 
8139
 be run first.
 
8140
 For 
 
8141
\family typewriter
 
8142
after
 
8143
\family default
 
8144
 advice a higher precedence means that the advice code will be run later.
 
8145
\end_layout
 
8146
 
 
8147
\begin_layout Standard
 
8148
If 
 
8149
\family typewriter
 
8150
around
 
8151
\family default
 
8152
 advice code does not call 
 
8153
\family typewriter
 
8154
tjp->proceed()
 
8155
\family default
 
8156
 or 
 
8157
\family typewriter
 
8158
trigger()
 
8159
\family default
 
8160
 on the action object no advice code with lower precedence will be run.
 
8161
 The execution of advice with higher precedence is not affected by 
 
8162
\family typewriter
 
8163
around
 
8164
\family default
 
8165
 advice with lower precedence.
 
8166
\end_layout
 
8167
 
 
8168
\begin_layout Standard
 
8169
For example, consider an aspect that defines advice
 
8170
\begin_inset Foot
 
8171
status collapsed
 
8172
 
 
8173
\begin_layout Standard
 
8174
BE is 
 
8175
\family typewriter
 
8176
before
 
8177
\family default
 
8178
 advice, AF 
 
8179
\family typewriter
 
8180
after
 
8181
\family default
 
8182
 advice, and AR 
 
8183
\family typewriter
 
8184
around
 
8185
\family default
 
8186
 advice
 
8187
\end_layout
 
8188
 
 
8189
\end_inset
 
8190
 
 
8191
 in the following order: BE1, AF1, AF2, AR1, BE2, AR2, AF3.
 
8192
 As described in section 
 
8193
\begin_inset LatexCommand \vref{sub:advice-precedence}
 
8194
 
 
8195
\end_inset
 
8196
 
 
8197
 the declaration order also defines the precedence: BE1 has the highest
 
8198
 and AF3 the lowest.
 
8199
 The result is the following advice code execution sequence:
 
8200
\end_layout
 
8201
 
 
8202
\begin_layout Enumerate
 
8203
BE1 (highest precedence)
 
8204
\end_layout
 
8205
 
 
8206
\begin_layout Enumerate
 
8207
AR1 (the indented advice will only be executed if 
 
8208
\family typewriter
 
8209
proceed()
 
8210
\family default
 
8211
 is called!)
 
8212
\end_layout
 
8213
 
 
8214
\begin_deeper
 
8215
\begin_layout Enumerate
 
8216
BE2 (before AR2, buts depends on AR1)
 
8217
\end_layout
 
8218
 
 
8219
\begin_layout Enumerate
 
8220
AR2 (the indented code will only be executed if 
 
8221
\family typewriter
 
8222
proceed()
 
8223
\family default
 
8224
 is called!)
 
8225
\end_layout
 
8226
 
 
8227
\begin_deeper
 
8228
\begin_layout Enumerate
 
8229
original code under the join point
 
8230
\end_layout
 
8231
 
 
8232
\begin_layout Enumerate
 
8233
AF3
 
8234
\end_layout
 
8235
 
 
8236
\end_deeper
 
8237
\end_deeper
 
8238
\begin_layout Enumerate
 
8239
AF2 (does not depend on AR1 and AR2, because of higher precedence)
 
8240
\end_layout
 
8241
 
 
8242
\begin_layout Enumerate
 
8243
AF1 (run after AF2, because it has a higher precedence)
 
8244
\end_layout
 
8245
 
 
8246
\begin_layout Section
 
8247
\start_of_appendix
 
8248
Grammar
 
8249
\begin_inset LatexCommand \index{grammar}
 
8250
 
 
8251
\end_inset
 
8252
 
 
8253
 
 
8254
\end_layout
 
8255
 
 
8256
\begin_layout Standard
 
8257
The AspectC++ syntax is an extension to the C++ syntax.
 
8258
 It adds four new keywords to the C++ language: 
 
8259
\family typewriter
 
8260
aspect
 
8261
\family default
 
8262
 
8263
\family typewriter
 
8264
advice
 
8265
\family default
 
8266
 
8267
\family typewriter
 
8268
slice
 
8269
\family default
 
8270
, and 
 
8271
\family typewriter
 
8272
pointcut
 
8273
\family default
 
8274
.
 
8275
 Additionally it extends the C++ language by advice and pointcut declarations.
 
8276
 In contrast to pointcut declarations, advice declarations may only occur
 
8277
 in aspect declarations.
 
8278
 
 
8279
\end_layout
 
8280
 
 
8281
\begin_layout Description
 
8282
 
 
8283
\series medium
 
8284
\shape italic
 
8285
class-key:
 
8286
\series default
 
8287
\shape default
 
8288
 
 
8289
\series bold
 
8290
\InsetSpace ~
 
8291
 
 
8292
\newline
 
8293
 
 
8294
\family typewriter
 
8295
\series default
 
8296
aspect
 
8297
\end_layout
 
8298
 
 
8299
\begin_layout Description
 
8300
 
 
8301
\series medium
 
8302
\shape italic
 
8303
declaration:
 
8304
\series default
 
8305
 \InsetSpace ~
 
8306
 
 
8307
\newline
 
8308
pointcut-declaration
 
8309
\newline
 
8310
slice-declaration
 
8311
\newline
 
8312
advice-declaration
 
8313
\end_layout
 
8314
 
 
8315
\begin_layout Description
 
8316
 
 
8317
\series medium
 
8318
\shape italic
 
8319
member-declaration:
 
8320
\series default
 
8321
 \InsetSpace ~
 
8322
 
 
8323
\newline
 
8324
pointcut-declaration
 
8325
\newline
 
8326
slice-declaration
 
8327
\newline
 
8328
advice-declaration
 
8329
\end_layout
 
8330
 
 
8331
\begin_layout Description
 
8332
 
 
8333
\series medium
 
8334
\shape italic
 
8335
pointcut-declaration:
 
8336
\series default
 
8337
 
 
8338
\emph on
 
8339
 
 
8340
\begin_inset LatexCommand \index{pointcut!declaration}
 
8341
 
 
8342
\end_inset
 
8343
 
 
8344
 
 
8345
\emph default
 
8346
\InsetSpace ~
 
8347
 
 
8348
\newline
 
8349
 
 
8350
\family typewriter
 
8351
\shape default
 
8352
pointcut
 
8353
\family default
 
8354
\shape italic
 
8355
 \InsetSpace ~
 
8356
declaration
 
8357
\end_layout
 
8358
 
 
8359
\begin_layout Description
 
8360
 
 
8361
\series medium
 
8362
\shape italic
 
8363
pointcut-expression:
 
8364
\series default
 
8365
 
 
8366
\series medium
 
8367
 
 
8368
\begin_inset LatexCommand \index{pointcut!expression}
 
8369
 
 
8370
\end_inset
 
8371
 
 
8372
 
 
8373
\series default
 
8374
\InsetSpace ~
 
8375
 
 
8376
\newline
 
8377
constant-expression
 
8378
\end_layout
 
8379
 
 
8380
\begin_layout Description
 
8381
 
 
8382
\series medium
 
8383
\shape italic
 
8384
advice-declaration:
 
8385
\series default
 
8386
 
 
8387
\begin_inset LatexCommand \index{advice!declaration}
 
8388
 
 
8389
\end_inset
 
8390
 
 
8391
\InsetSpace ~
 
8392
 
 
8393
\newline
 
8394
 
 
8395
\family typewriter
 
8396
\shape default
 
8397
advice
 
8398
\family default
 
8399
\shape italic
 
8400
 \InsetSpace ~
 
8401
pointcut-expression\InsetSpace ~
 
8402
 
 
8403
\series bold
 
8404
\shape default
 
8405
:
 
8406
\series default
 
8407
\shape italic
 
8408
 \InsetSpace ~
 
8409
order-declaration
 
8410
\newline
 
8411
 
 
8412
\family typewriter
 
8413
\shape default
 
8414
advice
 
8415
\family default
 
8416
\shape italic
 
8417
 \InsetSpace ~
 
8418
pointcut-expression\InsetSpace ~
 
8419
 
 
8420
\series bold
 
8421
\shape default
 
8422
:
 
8423
\series default
 
8424
\shape italic
 
8425
 \InsetSpace ~
 
8426
slice-reference
 
8427
\newline
 
8428
 
 
8429
\family typewriter
 
8430
\shape default
 
8431
advice
 
8432
\family default
 
8433
\shape italic
 
8434
 \InsetSpace ~
 
8435
pointcut-expression\InsetSpace ~
 
8436
 
 
8437
\series bold
 
8438
\shape default
 
8439
:
 
8440
\series default
 
8441
\shape italic
 
8442
 \InsetSpace ~
 
8443
declaration
 
8444
\end_layout
 
8445
 
 
8446
\begin_layout Description
 
8447
 
 
8448
\series medium
 
8449
\shape italic
 
8450
order-declaration:
 
8451
\series default
 
8452
 
 
8453
\begin_inset LatexCommand \index{order!declaration}
 
8454
 
 
8455
\end_inset
 
8456
 
 
8457
\InsetSpace ~
 
8458
 
 
8459
\newline
 
8460
 
 
8461
\family typewriter
 
8462
\shape default
 
8463
order (
 
8464
\family default
 
8465
\shape italic
 
8466
 \InsetSpace ~
 
8467
pointcur-expression-seq\InsetSpace ~
 
8468
 
 
8469
\family typewriter
 
8470
\shape default
 
8471
)
 
8472
\end_layout
 
8473
 
 
8474
\begin_layout Description
 
8475
 
 
8476
\series medium
 
8477
\shape italic
 
8478
slice-reference:
 
8479
\series default
 
8480
 
 
8481
\begin_inset LatexCommand \index{slice!reference}
 
8482
 
 
8483
\end_inset
 
8484
 
 
8485
\InsetSpace ~
 
8486
 
 
8487
\newline
 
8488
 
 
8489
\family typewriter
 
8490
\shape default
 
8491
slice\InsetSpace ~
 
8492
::
 
8493
\family default
 
8494
\shape italic
 
8495
 
 
8496
\begin_inset Formula $_{\textrm{opt}}$
 
8497
\end_inset
 
8498
 
 
8499
\InsetSpace ~
 
8500
nested-name-specifier
 
8501
\begin_inset Formula $_{\textrm{opt}}$
 
8502
\end_inset
 
8503
 
 
8504
 unqualified-id\InsetSpace ~
 
8505
 
 
8506
\family typewriter
 
8507
\emph on
 
8508
;
 
8509
\end_layout
 
8510
 
 
8511
\begin_layout Description
 
8512
 
 
8513
\series medium
 
8514
\shape italic
 
8515
slice-declaration:
 
8516
\series default
 
8517
 
 
8518
\begin_inset LatexCommand \index{slice!declaration}
 
8519
 
 
8520
\end_inset
 
8521
 
 
8522
\InsetSpace ~
 
8523
 
 
8524
\newline
 
8525
 
 
8526
\family typewriter
 
8527
\emph on
 
8528
slice 
 
8529
\family default
 
8530
\series medium
 
8531
\emph default
 
8532
declaration
 
8533
\end_layout
 
8534
 
 
8535
\begin_layout Section
 
8536
\begin_inset LatexCommand \label{sec:Match-Expression-Grammar}
 
8537
 
 
8538
\end_inset
 
8539
 
 
8540
Match Expression Grammar
 
8541
\begin_inset LatexCommand \index{match expression!grammar}
 
8542
 
 
8543
\end_inset
 
8544
 
 
8545
 
 
8546
\begin_inset LatexCommand \index{match expression grammar}
 
8547
 
 
8548
\end_inset
 
8549
 
 
8550
 
 
8551
\end_layout
 
8552
 
 
8553
\begin_layout Standard
 
8554
Match expression in AspectC++ are used to define a type pattern and an optional
 
8555
 object name pattern to select a subset of the known program entities like
 
8556
 functions, attributes, or argument/result types.
 
8557
 The grammer is very similar to the grammer of C++ declarations.
 
8558
 Any rules, which are referenced here but not defined, should be looked
 
8559
 up in the ISO C++ standard.
 
8560
\end_layout
 
8561
 
 
8562
\begin_layout Description
 
8563
 
 
8564
\series medium
 
8565
\shape italic
 
8566
match-expression:
 
8567
\series default
 
8568
\shape default
 
8569
 
 
8570
\series bold
 
8571
\InsetSpace ~
 
8572
 
 
8573
\family typewriter
 
8574
\series default
 
8575
 
 
8576
\newline
 
8577
 
 
8578
\family default
 
8579
\shape italic
 
8580
match-declaration
 
8581
\end_layout
 
8582
 
 
8583
\begin_layout Description
 
8584
 
 
8585
\series medium
 
8586
\emph on
 
8587
match-id:
 
8588
\series default
 
8589
\emph default
 
8590
 \InsetSpace ~
 
8591
 
 
8592
\newline
 
8593
 
 
8594
\family typewriter
 
8595
%
 
8596
\family default
 
8597
 
 
8598
\newline
 
8599
 
 
8600
\emph on
 
8601
nondigit
 
8602
\emph default
 
8603
 
 
8604
\newline
 
8605
 
 
8606
\emph on
 
8607
match-id
 
8608
\emph default
 
8609
 
 
8610
\family typewriter
 
8611
%
 
8612
\family default
 
8613
 
 
8614
\newline
 
8615
 
 
8616
\emph on
 
8617
match-id nondigit
 
8618
\emph default
 
8619
 
 
8620
\newline
 
8621
 
 
8622
\emph on
 
8623
match-id digit
 
8624
\end_layout
 
8625
 
 
8626
\begin_layout Description
 
8627
 
 
8628
\series medium
 
8629
\emph on
 
8630
match-declaration:
 
8631
\series default
 
8632
\emph default
 
8633
 \InsetSpace ~
 
8634
 
 
8635
\newline
 
8636
 
 
8637
\emph on
 
8638
match-decl-specifier-seq
 
8639
\begin_inset Formula $_{\textrm{opt}}$
 
8640
\end_inset
 
8641
 
 
8642
 match-declarator
 
8643
\end_layout
 
8644
 
 
8645
\begin_layout Description
 
8646
 
 
8647
\series medium
 
8648
\emph on
 
8649
match-decl-specifier-seq:
 
8650
\series default
 
8651
\emph default
 
8652
 \InsetSpace ~
 
8653
 
 
8654
\newline
 
8655
 
 
8656
\emph on
 
8657
match-decl-specifier-seq
 
8658
\begin_inset Formula $_{\textrm{opt}}$
 
8659
\end_inset
 
8660
 
 
8661
 match-decl-specifier
 
8662
\end_layout
 
8663
 
 
8664
\begin_layout Description
 
8665
 
 
8666
\series medium
 
8667
\emph on
 
8668
match-decl-specifier:
 
8669
\series default
 
8670
\emph default
 
8671
 \InsetSpace ~
 
8672
 
 
8673
\newline
 
8674
 
 
8675
\emph on
 
8676
nested-match-name-specifier
 
8677
\begin_inset Formula $_{\textrm{opt}}$
 
8678
\end_inset
 
8679
 
 
8680
 match-id
 
8681
\newline
 
8682
cv-qualifier
 
8683
\newline
 
8684
match-function-specifier
 
8685
\newline
 
8686
 
 
8687
\family typewriter
 
8688
\emph default
 
8689
char
 
8690
\newline
 
8691
wchar_t
 
8692
\newline
 
8693
bool
 
8694
\newline
 
8695
short
 
8696
\newline
 
8697
int
 
8698
\newline
 
8699
long
 
8700
\newline
 
8701
signed
 
8702
\newline
 
8703
unsigned
 
8704
\newline
 
8705
float
 
8706
\newline
 
8707
double
 
8708
\newline
 
8709
void
 
8710
\end_layout
 
8711
 
 
8712
\begin_layout Description
 
8713
 
 
8714
\series medium
 
8715
\emph on
 
8716
match-function-specifier:
 
8717
\series default
 
8718
\emph default
 
8719
 \InsetSpace ~
 
8720
 
 
8721
\newline
 
8722
 
 
8723
\family typewriter
 
8724
virtual
 
8725
\end_layout
 
8726
 
 
8727
\begin_layout Description
 
8728
 
 
8729
\series medium
 
8730
\emph on
 
8731
nested-match-name-specifier:
 
8732
\series default
 
8733
\emph default
 
8734
 \InsetSpace ~
 
8735
 
 
8736
\newline
 
8737
 
 
8738
\emph on
 
8739
match-id
 
8740
\family typewriter
 
8741
\emph default
 
8742
\InsetSpace ~
 
8743
::\InsetSpace ~
 
8744
 
 
8745
\family default
 
8746
\emph on
 
8747
nested-match-name-specifier
 
8748
\begin_inset Formula $_{\textrm{opt}}$
 
8749
\end_inset
 
8750
 
 
8751
 
 
8752
\newline
 
8753
 
 
8754
\family typewriter
 
8755
\emph default
 
8756
...\InsetSpace ~
 
8757
::\InsetSpace ~
 
8758
 
 
8759
\family default
 
8760
\emph on
 
8761
nested-match-name-specifier
 
8762
\begin_inset Formula $_{\textrm{opt}}$
 
8763
\end_inset
 
8764
 
 
8765
 
 
8766
\end_layout
 
8767
 
 
8768
\begin_layout Description
 
8769
 
 
8770
\series medium
 
8771
\emph on
 
8772
match-declarator
 
8773
\series default
 
8774
\emph default
 
8775
: \InsetSpace ~
 
8776
 
 
8777
\newline
 
8778
 
 
8779
\emph on
 
8780
direct-match-declarator
 
8781
\newline
 
8782
match-ptr-declarator match-declarator
 
8783
\end_layout
 
8784
 
 
8785
\begin_layout Description
 
8786
 
 
8787
\series medium
 
8788
\emph on
 
8789
abstract-match-declarator
 
8790
\series default
 
8791
\emph default
 
8792
: \InsetSpace ~
 
8793
 
 
8794
\newline
 
8795
 
 
8796
\emph on
 
8797
direct-abstract-match-declarator
 
8798
\newline
 
8799
match-ptr-declarator abstract-match-declarator
 
8800
\end_layout
 
8801
 
 
8802
\begin_layout Description
 
8803
 
 
8804
\series medium
 
8805
\emph on
 
8806
direct-match-declarator:
 
8807
\series default
 
8808
\emph default
 
8809
 \InsetSpace ~
 
8810
 
 
8811
\newline
 
8812
 
 
8813
\emph on
 
8814
match-declarator-id
 
8815
\newline
 
8816
direct-match-declarator 
 
8817
\family typewriter
 
8818
\emph default
 
8819
(
 
8820
\family default
 
8821
\emph on
 
8822
 match-parameter-declaration-clause 
 
8823
\family typewriter
 
8824
\emph default
 
8825
)
 
8826
\family default
 
8827
\emph on
 
8828
 cv-qualifier-seq
 
8829
\begin_inset Formula $_{\textrm{opt}}$
 
8830
\end_inset
 
8831
 
 
8832
 
 
8833
\newline
 
8834
direct-match-declarator 
 
8835
\family typewriter
 
8836
\emph default
 
8837
[
 
8838
\family default
 
8839
\emph on
 
8840
 match-array-size 
 
8841
\family typewriter
 
8842
\emph default
 
8843
]
 
8844
\end_layout
 
8845
 
 
8846
\begin_layout Description
 
8847
 
 
8848
\series medium
 
8849
\emph on
 
8850
direct-abstract-match-declarator:
 
8851
\series default
 
8852
\emph default
 
8853
 \InsetSpace ~
 
8854
 
 
8855
\emph on
 
8856
 
 
8857
\newline
 
8858
direct-abstract-match-declarator 
 
8859
\family typewriter
 
8860
\emph default
 
8861
(
 
8862
\family default
 
8863
\emph on
 
8864
 match-parameter-declaration-clause 
 
8865
\family typewriter
 
8866
\emph default
 
8867
)
 
8868
\family default
 
8869
\emph on
 
8870
 cv-qualifier-seq
 
8871
\begin_inset Formula $_{\textrm{opt}}$
 
8872
\end_inset
 
8873
 
 
8874
 
 
8875
\newline
 
8876
direct-abstract-match-declarator 
 
8877
\family typewriter
 
8878
\emph default
 
8879
[
 
8880
\family default
 
8881
\emph on
 
8882
 match-array-size 
 
8883
\family typewriter
 
8884
\emph default
 
8885
]
 
8886
\end_layout
 
8887
 
 
8888
\begin_layout Description
 
8889
 
 
8890
\series medium
 
8891
\emph on
 
8892
match-array-size:
 
8893
\series default
 
8894
\emph default
 
8895
 \InsetSpace ~
 
8896
 
 
8897
\newline
 
8898
 
 
8899
\family typewriter
 
8900
%
 
8901
\family default
 
8902
 
 
8903
\newline
 
8904
 
 
8905
\emph on
 
8906
decimal-literal
 
8907
\end_layout
 
8908
 
 
8909
\begin_layout Description
 
8910
 
 
8911
\series medium
 
8912
\emph on
 
8913
match-ptr-operator:
 
8914
\series default
 
8915
\emph default
 
8916
 \InsetSpace ~
 
8917
 
 
8918
\newline
 
8919
 
 
8920
\family typewriter
 
8921
*
 
8922
\family default
 
8923
 
 
8924
\emph on
 
8925
cv-qualifier-seq
 
8926
\begin_inset Formula $_{\textrm{opt}}$
 
8927
\end_inset
 
8928
 
 
8929
 
 
8930
\emph default
 
8931
 
 
8932
\newline
 
8933
 
 
8934
\family typewriter
 
8935
&
 
8936
\family default
 
8937
 
 
8938
\newline
 
8939
 
 
8940
\emph on
 
8941
nested-match-name-specifier
 
8942
\emph default
 
8943
 
 
8944
\family typewriter
 
8945
*
 
8946
\family default
 
8947
 
 
8948
\emph on
 
8949
cv-qualifier-seq
 
8950
\begin_inset Formula $_{\textrm{opt}}$
 
8951
\end_inset
 
8952
 
 
8953
 
 
8954
\end_layout
 
8955
 
 
8956
\begin_layout Description
 
8957
 
 
8958
\series medium
 
8959
\emph on
 
8960
match-parameter-declaration-clause:
 
8961
\series default
 
8962
\emph default
 
8963
 \InsetSpace ~
 
8964
 
 
8965
\newline
 
8966
 
 
8967
\family typewriter
 
8968
\emph on
 
8969
...
 
8970
\family default
 
8971
 
 
8972
\newline
 
8973
match-parameter-declaration-list
 
8974
\begin_inset Formula $_{\textrm{opt}}$
 
8975
\end_inset
 
8976
 
 
8977
 
 
8978
\newline
 
8979
match-parameter-declaration-list
 
8980
\family typewriter
 
8981
 , ...
 
8982
\end_layout
 
8983
 
 
8984
\begin_layout Description
 
8985
 
 
8986
\series medium
 
8987
\emph on
 
8988
match-parameter-declaration-list:
 
8989
\series default
 
8990
\emph default
 
8991
 \InsetSpace ~
 
8992
 
 
8993
\newline
 
8994
 
 
8995
\emph on
 
8996
match-parameter-declaration
 
8997
\newline
 
8998
match-parameter-declaration-list
 
8999
\family typewriter
 
9000
 , 
 
9001
\family default
 
9002
match-parameter-declaration
 
9003
\end_layout
 
9004
 
 
9005
\begin_layout Description
 
9006
 
 
9007
\series medium
 
9008
\emph on
 
9009
match-parameter-declaration:
 
9010
\series default
 
9011
\emph default
 
9012
 \InsetSpace ~
 
9013
 
 
9014
\newline
 
9015
 
 
9016
\emph on
 
9017
matct-decl-specifier-seq match-abstract-declarator
 
9018
\begin_inset Formula $_{\textrm{opt}}$
 
9019
\end_inset
 
9020
 
 
9021
 
 
9022
\end_layout
 
9023
 
 
9024
\begin_layout Description
 
9025
 
 
9026
\series medium
 
9027
\emph on
 
9028
match-declarator-id:
 
9029
\series default
 
9030
\emph default
 
9031
 \InsetSpace ~
 
9032
 
 
9033
\newline
 
9034
 
 
9035
\emph on
 
9036
nested-match-name-specifier
 
9037
\begin_inset Formula $_{\textrm{opt}}$
 
9038
\end_inset
 
9039
 
 
9040
 match-id
 
9041
\newline
 
9042
nested-match-name-specifier
 
9043
\begin_inset Formula $_{\textrm{opt}}$
 
9044
\end_inset
 
9045
 
 
9046
 match-operator-function-id
 
9047
\newline
 
9048
nested-match-name-specifier
 
9049
\begin_inset Formula $_{\textrm{opt}}$
 
9050
\end_inset
 
9051
 
 
9052
 match-conversion-function-id
 
9053
\end_layout
 
9054
 
 
9055
\begin_layout Description
 
9056
 
 
9057
\series medium
 
9058
\emph on
 
9059
match-operator-function-id:
 
9060
\series default
 
9061
\emph default
 
9062
 \InsetSpace ~
 
9063
 
 
9064
\newline
 
9065
 
 
9066
\family typewriter
 
9067
operator %
 
9068
\family default
 
9069
 
 
9070
\newline
 
9071
 
 
9072
\family typewriter
 
9073
operator
 
9074
\family default
 
9075
 
 
9076
\emph on
 
9077
match-operator
 
9078
\end_layout
 
9079
 
 
9080
\begin_layout Description
 
9081
 
 
9082
\series medium
 
9083
\emph on
 
9084
match-operator:
 
9085
\series default
 
9086
\emph default
 
9087
 one of
 
9088
\newline
 
9089
 
 
9090
\begin_inset Tabular
 
9091
<lyxtabular version="3" rows="4" columns="13">
 
9092
<features>
 
9093
<column alignment="block" valignment="top" width="0.6cm">
 
9094
<column alignment="block" valignment="top" width="0.6cm">
 
9095
<column alignment="block" valignment="top" width="0.6cm">
 
9096
<column alignment="block" valignment="top" width="0.6cm">
 
9097
<column alignment="block" valignment="top" width="0.6cm">
 
9098
<column alignment="block" valignment="top" width="0.6cm">
 
9099
<column alignment="block" valignment="top" width="0.6cm">
 
9100
<column alignment="block" valignment="top" width="0.6cm">
 
9101
<column alignment="block" valignment="top" width="0.6cm">
 
9102
<column alignment="block" valignment="top" width="0.6cm">
 
9103
<column alignment="block" valignment="top" width="0.6cm">
 
9104
<column alignment="block" valignment="top" width="0.6cm">
 
9105
<column alignment="block" valignment="top" width="0.6cm">
 
9106
<row>
 
9107
<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
 
9108
\begin_inset Text
 
9109
 
 
9110
\begin_layout Standard
 
9111
 
 
9112
\family typewriter
 
9113
new
 
9114
\end_layout
 
9115
 
 
9116
\end_inset
 
9117
</cell>
 
9118
<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
 
9119
\begin_inset Text
 
9120
 
 
9121
\begin_layout Standard
 
9122
 
 
9123
\family typewriter
 
9124
delete
 
9125
\end_layout
 
9126
 
 
9127
\end_inset
 
9128
</cell>
 
9129
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9130
\begin_inset Text
 
9131
 
 
9132
\begin_layout Standard
 
9133
 
 
9134
\end_layout
 
9135
 
 
9136
\end_inset
 
9137
</cell>
 
9138
<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
 
9139
\begin_inset Text
 
9140
 
 
9141
\begin_layout Standard
 
9142
 
 
9143
\family typewriter
 
9144
new[]
 
9145
\end_layout
 
9146
 
 
9147
\end_inset
 
9148
</cell>
 
9149
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9150
\begin_inset Text
 
9151
 
 
9152
\begin_layout Standard
 
9153
 
 
9154
\end_layout
 
9155
 
 
9156
\end_inset
 
9157
</cell>
 
9158
<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
 
9159
\begin_inset Text
 
9160
 
 
9161
\begin_layout Standard
 
9162
 
 
9163
\family typewriter
 
9164
delete[]
 
9165
\end_layout
 
9166
 
 
9167
\end_inset
 
9168
</cell>
 
9169
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9170
\begin_inset Text
 
9171
 
 
9172
\begin_layout Standard
 
9173
 
 
9174
\end_layout
 
9175
 
 
9176
\end_inset
 
9177
</cell>
 
9178
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9179
\begin_inset Text
 
9180
 
 
9181
\begin_layout Standard
 
9182
 
 
9183
\end_layout
 
9184
 
 
9185
\end_inset
 
9186
</cell>
 
9187
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9188
\begin_inset Text
 
9189
 
 
9190
\begin_layout Standard
 
9191
 
 
9192
\end_layout
 
9193
 
 
9194
\end_inset
 
9195
</cell>
 
9196
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9197
\begin_inset Text
 
9198
 
 
9199
\begin_layout Standard
 
9200
 
 
9201
\end_layout
 
9202
 
 
9203
\end_inset
 
9204
</cell>
 
9205
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9206
\begin_inset Text
 
9207
 
 
9208
\begin_layout Standard
 
9209
 
 
9210
\end_layout
 
9211
 
 
9212
\end_inset
 
9213
</cell>
 
9214
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9215
\begin_inset Text
 
9216
 
 
9217
\begin_layout Standard
 
9218
 
 
9219
\end_layout
 
9220
 
 
9221
\end_inset
 
9222
</cell>
 
9223
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
9224
\begin_inset Text
 
9225
 
 
9226
\begin_layout Standard
 
9227
 
 
9228
\end_layout
 
9229
 
 
9230
\end_inset
 
9231
</cell>
 
9232
</row>
 
9233
<row>
 
9234
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9235
\begin_inset Text
 
9236
 
 
9237
\begin_layout Standard
 
9238
 
 
9239
\family typewriter
 
9240
+
 
9241
\end_layout
 
9242
 
 
9243
\end_inset
 
9244
</cell>
 
9245
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9246
\begin_inset Text
 
9247
 
 
9248
\begin_layout Standard
 
9249
 
 
9250
\family typewriter
 
9251
-
 
9252
\end_layout
 
9253
 
 
9254
\end_inset
 
9255
</cell>
 
9256
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9257
\begin_inset Text
 
9258
 
 
9259
\begin_layout Standard
 
9260
 
 
9261
\family typewriter
 
9262
*
 
9263
\end_layout
 
9264
 
 
9265
\end_inset
 
9266
</cell>
 
9267
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9268
\begin_inset Text
 
9269
 
 
9270
\begin_layout Standard
 
9271
 
 
9272
\family typewriter
 
9273
/
 
9274
\end_layout
 
9275
 
 
9276
\end_inset
 
9277
</cell>
 
9278
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9279
\begin_inset Text
 
9280
 
 
9281
\begin_layout Standard
 
9282
 
 
9283
\family typewriter
 
9284
%%
 
9285
\end_layout
 
9286
 
 
9287
\end_inset
 
9288
</cell>
 
9289
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9290
\begin_inset Text
 
9291
 
 
9292
\begin_layout Standard
 
9293
 
 
9294
\family typewriter
 
9295
^
 
9296
\end_layout
 
9297
 
 
9298
\end_inset
 
9299
</cell>
 
9300
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9301
\begin_inset Text
 
9302
 
 
9303
\begin_layout Standard
 
9304
 
 
9305
\family typewriter
 
9306
&
 
9307
\end_layout
 
9308
 
 
9309
\end_inset
 
9310
</cell>
 
9311
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9312
\begin_inset Text
 
9313
 
 
9314
\begin_layout Standard
 
9315
 
 
9316
\family typewriter
 
9317
|
 
9318
\end_layout
 
9319
 
 
9320
\end_inset
 
9321
</cell>
 
9322
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9323
\begin_inset Text
 
9324
 
 
9325
\begin_layout Standard
 
9326
 
 
9327
\family typewriter
 
9328
~
 
9329
\end_layout
 
9330
 
 
9331
\end_inset
 
9332
</cell>
 
9333
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9334
\begin_inset Text
 
9335
 
 
9336
\begin_layout Standard
 
9337
 
 
9338
\family typewriter
 
9339
!
 
9340
\end_layout
 
9341
 
 
9342
\end_inset
 
9343
</cell>
 
9344
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9345
\begin_inset Text
 
9346
 
 
9347
\begin_layout Standard
 
9348
 
 
9349
\family typewriter
 
9350
=
 
9351
\end_layout
 
9352
 
 
9353
\end_inset
 
9354
</cell>
 
9355
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9356
\begin_inset Text
 
9357
 
 
9358
\begin_layout Standard
 
9359
 
 
9360
\family typewriter
 
9361
<
 
9362
\end_layout
 
9363
 
 
9364
\end_inset
 
9365
</cell>
 
9366
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
9367
\begin_inset Text
 
9368
 
 
9369
\begin_layout Standard
 
9370
 
 
9371
\family typewriter
 
9372
>
 
9373
\end_layout
 
9374
 
 
9375
\end_inset
 
9376
</cell>
 
9377
</row>
 
9378
<row>
 
9379
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9380
\begin_inset Text
 
9381
 
 
9382
\begin_layout Standard
 
9383
 
 
9384
\family typewriter
 
9385
+=
 
9386
\end_layout
 
9387
 
 
9388
\end_inset
 
9389
</cell>
 
9390
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9391
\begin_inset Text
 
9392
 
 
9393
\begin_layout Standard
 
9394
 
 
9395
\family typewriter
 
9396
-=
 
9397
\end_layout
 
9398
 
 
9399
\end_inset
 
9400
</cell>
 
9401
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9402
\begin_inset Text
 
9403
 
 
9404
\begin_layout Standard
 
9405
 
 
9406
\family typewriter
 
9407
*=
 
9408
\end_layout
 
9409
 
 
9410
\end_inset
 
9411
</cell>
 
9412
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9413
\begin_inset Text
 
9414
 
 
9415
\begin_layout Standard
 
9416
 
 
9417
\family typewriter
 
9418
/=
 
9419
\end_layout
 
9420
 
 
9421
\end_inset
 
9422
</cell>
 
9423
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9424
\begin_inset Text
 
9425
 
 
9426
\begin_layout Standard
 
9427
 
 
9428
\family typewriter
 
9429
%%=
 
9430
\end_layout
 
9431
 
 
9432
\end_inset
 
9433
</cell>
 
9434
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9435
\begin_inset Text
 
9436
 
 
9437
\begin_layout Standard
 
9438
 
 
9439
\family typewriter
 
9440
^=
 
9441
\end_layout
 
9442
 
 
9443
\end_inset
 
9444
</cell>
 
9445
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9446
\begin_inset Text
 
9447
 
 
9448
\begin_layout Standard
 
9449
 
 
9450
\family typewriter
 
9451
&=
 
9452
\end_layout
 
9453
 
 
9454
\end_inset
 
9455
</cell>
 
9456
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9457
\begin_inset Text
 
9458
 
 
9459
\begin_layout Standard
 
9460
 
 
9461
\family typewriter
 
9462
|=
 
9463
\end_layout
 
9464
 
 
9465
\end_inset
 
9466
</cell>
 
9467
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9468
\begin_inset Text
 
9469
 
 
9470
\begin_layout Standard
 
9471
 
 
9472
\family typewriter
 
9473
<<
 
9474
\end_layout
 
9475
 
 
9476
\end_inset
 
9477
</cell>
 
9478
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9479
\begin_inset Text
 
9480
 
 
9481
\begin_layout Standard
 
9482
 
 
9483
\family typewriter
 
9484
>>
 
9485
\end_layout
 
9486
 
 
9487
\end_inset
 
9488
</cell>
 
9489
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9490
\begin_inset Text
 
9491
 
 
9492
\begin_layout Standard
 
9493
 
 
9494
\family typewriter
 
9495
>>=
 
9496
\end_layout
 
9497
 
 
9498
\end_inset
 
9499
</cell>
 
9500
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9501
\begin_inset Text
 
9502
 
 
9503
\begin_layout Standard
 
9504
 
 
9505
\family typewriter
 
9506
<<=
 
9507
\end_layout
 
9508
 
 
9509
\end_inset
 
9510
</cell>
 
9511
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
9512
\begin_inset Text
 
9513
 
 
9514
\begin_layout Standard
 
9515
 
 
9516
\family typewriter
 
9517
==
 
9518
\end_layout
 
9519
 
 
9520
\end_inset
 
9521
</cell>
 
9522
</row>
 
9523
<row>
 
9524
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9525
\begin_inset Text
 
9526
 
 
9527
\begin_layout Standard
 
9528
 
 
9529
\family typewriter
 
9530
!=
 
9531
\end_layout
 
9532
 
 
9533
\end_inset
 
9534
</cell>
 
9535
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9536
\begin_inset Text
 
9537
 
 
9538
\begin_layout Standard
 
9539
 
 
9540
\family typewriter
 
9541
<=
 
9542
\end_layout
 
9543
 
 
9544
\end_inset
 
9545
</cell>
 
9546
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9547
\begin_inset Text
 
9548
 
 
9549
\begin_layout Standard
 
9550
 
 
9551
\family typewriter
 
9552
>=
 
9553
\end_layout
 
9554
 
 
9555
\end_inset
 
9556
</cell>
 
9557
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9558
\begin_inset Text
 
9559
 
 
9560
\begin_layout Standard
 
9561
 
 
9562
\family typewriter
 
9563
&&
 
9564
\end_layout
 
9565
 
 
9566
\end_inset
 
9567
</cell>
 
9568
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9569
\begin_inset Text
 
9570
 
 
9571
\begin_layout Standard
 
9572
 
 
9573
\family typewriter
 
9574
||
 
9575
\end_layout
 
9576
 
 
9577
\end_inset
 
9578
</cell>
 
9579
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9580
\begin_inset Text
 
9581
 
 
9582
\begin_layout Standard
 
9583
 
 
9584
\family typewriter
 
9585
++
 
9586
\end_layout
 
9587
 
 
9588
\end_inset
 
9589
</cell>
 
9590
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9591
\begin_inset Text
 
9592
 
 
9593
\begin_layout Standard
 
9594
 
 
9595
\family typewriter
 
9596
--
 
9597
\end_layout
 
9598
 
 
9599
\end_inset
 
9600
</cell>
 
9601
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9602
\begin_inset Text
 
9603
 
 
9604
\begin_layout Standard
 
9605
 
 
9606
\family typewriter
 
9607
,
 
9608
\end_layout
 
9609
 
 
9610
\end_inset
 
9611
</cell>
 
9612
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9613
\begin_inset Text
 
9614
 
 
9615
\begin_layout Standard
 
9616
 
 
9617
\family typewriter
 
9618
->*
 
9619
\end_layout
 
9620
 
 
9621
\end_inset
 
9622
</cell>
 
9623
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9624
\begin_inset Text
 
9625
 
 
9626
\begin_layout Standard
 
9627
 
 
9628
\family typewriter
 
9629
->
 
9630
\end_layout
 
9631
 
 
9632
\end_inset
 
9633
</cell>
 
9634
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9635
\begin_inset Text
 
9636
 
 
9637
\begin_layout Standard
 
9638
 
 
9639
\family typewriter
 
9640
()
 
9641
\end_layout
 
9642
 
 
9643
\end_inset
 
9644
</cell>
 
9645
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 
9646
\begin_inset Text
 
9647
 
 
9648
\begin_layout Standard
 
9649
 
 
9650
\family typewriter
 
9651
[]
 
9652
\end_layout
 
9653
 
 
9654
\end_inset
 
9655
</cell>
 
9656
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
 
9657
\begin_inset Text
 
9658
 
 
9659
\begin_layout Standard
 
9660
 
 
9661
\end_layout
 
9662
 
 
9663
\end_inset
 
9664
</cell>
 
9665
</row>
 
9666
</lyxtabular>
 
9667
 
 
9668
\end_inset
 
9669
 
 
9670
 
 
9671
\end_layout
 
9672
 
 
9673
\begin_layout Description
 
9674
 
 
9675
\series medium
 
9676
\emph on
 
9677
match-conversion-function-id:
 
9678
\series default
 
9679
\emph default
 
9680
 \InsetSpace ~
 
9681
 
 
9682
\newline
 
9683
 
 
9684
\family typewriter
 
9685
operator
 
9686
\family default
 
9687
 
 
9688
\emph on
 
9689
match-conversion-type-id
 
9690
\end_layout
 
9691
 
 
9692
\begin_layout Description
 
9693
 
 
9694
\series medium
 
9695
\emph on
 
9696
match-conversion-type-id:
 
9697
\series default
 
9698
\emph default
 
9699
 \InsetSpace ~
 
9700
 
 
9701
\newline
 
9702
 
 
9703
\emph on
 
9704
match-type-specifier-seq match-conversion-declarator
 
9705
\begin_inset Formula $_{\textrm{opt}}$
 
9706
\end_inset
 
9707
 
 
9708
 
 
9709
\end_layout
 
9710
 
 
9711
\begin_layout Description
 
9712
 
 
9713
\series medium
 
9714
\emph on
 
9715
match-conversion-declarator:
 
9716
\series default
 
9717
\emph default
 
9718
 \InsetSpace ~
 
9719
 
 
9720
\newline
 
9721
 
 
9722
\emph on
 
9723
match-ptr-operator match-conversion-declarator
 
9724
\begin_inset Formula $_{\textrm{opt}}$
 
9725
\end_inset
 
9726
 
 
9727
 
 
9728
\end_layout
 
9729
 
 
9730
\begin_layout Standard
 
9731
\begin_inset ERT
 
9732
status collapsed
 
9733
 
 
9734
\begin_layout Standard
 
9735
 
 
9736
 
 
9737
\backslash
 
9738
cleardoublepage
 
9739
\backslash
 
9740
begin{examples}
 
9741
\end_layout
 
9742
 
 
9743
\end_inset
 
9744
 
 
9745
 
 
9746
\end_layout
 
9747
 
 
9748
\begin_layout Standard
 
9749
\noindent
 
9750
match expressions (name pointcuts), 
 
9751
\begin_inset LatexCommand \pageref{exa:match-expressions}
 
9752
 
 
9753
\end_inset
 
9754
 
 
9755
 
 
9756
\end_layout
 
9757
 
 
9758
\begin_layout Standard
 
9759
\noindent
 
9760
pointcut expressions, 
 
9761
\begin_inset LatexCommand \pageref{exa:pointcut-expressions}
 
9762
 
 
9763
\end_inset
 
9764
 
 
9765
 
 
9766
\end_layout
 
9767
 
 
9768
\begin_layout Standard
 
9769
\noindent
 
9770
pointcut declaration, 
 
9771
\begin_inset LatexCommand \pageref{exa:pointcut-declaration}
 
9772
 
 
9773
\end_inset
 
9774
 
 
9775
 
 
9776
\end_layout
 
9777
 
 
9778
\begin_layout Standard
 
9779
\noindent
 
9780
pure virtual pointcut declaration, 
 
9781
\begin_inset LatexCommand \pageref{exa:pure-virtual}
 
9782
 
 
9783
\end_inset
 
9784
 
 
9785
 
 
9786
\end_layout
 
9787
 
 
9788
\begin_layout Standard
 
9789
\noindent
 
9790
class slice declaration, 
 
9791
\begin_inset LatexCommand \pageref{exa:class-slice-declaration}
 
9792
 
 
9793
\end_inset
 
9794
 
 
9795
 
 
9796
\end_layout
 
9797
 
 
9798
\begin_layout Standard
 
9799
\noindent
 
9800
advice declaration, 
 
9801
\begin_inset LatexCommand \pageref{exa:advice-declaration}
 
9802
 
 
9803
\end_inset
 
9804
 
 
9805
 
 
9806
\end_layout
 
9807
 
 
9808
\begin_layout Standard
 
9809
\noindent
 
9810
advice declaration with access to context information, 
 
9811
\begin_inset LatexCommand \pageref{exa:advice-declaration-with}
 
9812
 
 
9813
\end_inset
 
9814
 
 
9815
 
 
9816
\end_layout
 
9817
 
 
9818
\begin_layout Standard
 
9819
\noindent
 
9820
introductions, 
 
9821
\begin_inset LatexCommand \pageref{exa:introductions}
 
9822
 
 
9823
\end_inset
 
9824
 
 
9825
 
 
9826
\end_layout
 
9827
 
 
9828
\begin_layout Standard
 
9829
\noindent
 
9830
base class introduction, 
 
9831
\begin_inset LatexCommand \pageref{exa:base-class-intro}
 
9832
 
 
9833
\end_inset
 
9834
 
 
9835
 
 
9836
\end_layout
 
9837
 
 
9838
\begin_layout Standard
 
9839
\noindent
 
9840
advice ordering, 
 
9841
\begin_inset LatexCommand \pageref{exa:order}
 
9842
 
 
9843
\end_inset
 
9844
 
 
9845
 
 
9846
\end_layout
 
9847
 
 
9848
\begin_layout Standard
 
9849
\noindent
 
9850
aspect declaration, 
 
9851
\begin_inset LatexCommand \pageref{exa:aspect-decl}
 
9852
 
 
9853
\end_inset
 
9854
 
 
9855
 
 
9856
\end_layout
 
9857
 
 
9858
\begin_layout Standard
 
9859
\noindent
 
9860
abstract aspect, 
 
9861
\begin_inset LatexCommand \pageref{exa:abstract-aspect}
 
9862
 
 
9863
\end_inset
 
9864
 
 
9865
 
 
9866
\end_layout
 
9867
 
 
9868
\begin_layout Standard
 
9869
\noindent
 
9870
reused abstract aspect, 
 
9871
\begin_inset LatexCommand \pageref{exa:reused-abstract}
 
9872
 
 
9873
\end_inset
 
9874
 
 
9875
 
 
9876
\end_layout
 
9877
 
 
9878
\begin_layout Standard
 
9879
\noindent
 
9880
aspect instantiation using 
 
9881
\family typewriter
 
9882
aspectof
 
9883
\family default
 
9884
 
9885
\begin_inset LatexCommand \pageref{exa:aspect-aspectof}
 
9886
 
 
9887
\end_inset
 
9888
 
 
9889
 
 
9890
\end_layout
 
9891
 
 
9892
\begin_layout Standard
 
9893
\noindent
 
9894
re-usable trace aspect, 
 
9895
\begin_inset LatexCommand \pageref{exa:re-usable-trace}
 
9896
 
 
9897
\end_inset
 
9898
 
 
9899
 
 
9900
\end_layout
 
9901
 
 
9902
\begin_layout Standard
 
9903
\noindent
 
9904
\begin_inset ERT
 
9905
status collapsed
 
9906
 
 
9907
\begin_layout Standard
 
9908
 
 
9909
 
 
9910
\backslash
 
9911
begin{comment}
 
9912
\end_layout
 
9913
 
 
9914
\end_inset
 
9915
 
 
9916
static type identification using introductions, 
 
9917
\begin_inset LatexCommand \pageref{exa:static-type-id}
 
9918
 
 
9919
\end_inset
 
9920
 
 
9921
 
 
9922
\begin_inset ERT
 
9923
status collapsed
 
9924
 
 
9925
\begin_layout Standard
 
9926
 
 
9927
\end_layout
 
9928
 
 
9929
\begin_layout Standard
 
9930
 
 
9931
\end_layout
 
9932
 
 
9933
\begin_layout Standard
 
9934
 
 
9935
 
 
9936
\backslash
 
9937
end{comment}
 
9938
\end_layout
 
9939
 
 
9940
\begin_layout Standard
 
9941
 
 
9942
\end_layout
 
9943
 
 
9944
\end_inset
 
9945
 
 
9946
 
 
9947
\end_layout
 
9948
 
 
9949
\begin_layout Standard
 
9950
\noindent
 
9951
\begin_inset ERT
 
9952
status collapsed
 
9953
 
 
9954
\begin_layout Standard
 
9955
 
 
9956
 
 
9957
\backslash
 
9958
begin{comment}
 
9959
\end_layout
 
9960
 
 
9961
\end_inset
 
9962
 
 
9963
extended thread counting, 
 
9964
\begin_inset LatexCommand \pageref{exa:extended-thread}
 
9965
 
 
9966
\end_inset
 
9967
 
 
9968
 
 
9969
\begin_inset ERT
 
9970
status collapsed
 
9971
 
 
9972
\begin_layout Standard
 
9973
 
 
9974
\end_layout
 
9975
 
 
9976
\begin_layout Standard
 
9977
 
 
9978
\end_layout
 
9979
 
 
9980
\begin_layout Standard
 
9981
 
 
9982
 
 
9983
\backslash
 
9984
end{comment}
 
9985
\end_layout
 
9986
 
 
9987
\begin_layout Standard
 
9988
 
 
9989
\end_layout
 
9990
 
 
9991
\end_inset
 
9992
 
 
9993
 
 
9994
\end_layout
 
9995
 
 
9996
\begin_layout Standard
 
9997
\noindent
 
9998
type, scope, and name parts of a function match expression, 
 
9999
\begin_inset LatexCommand \pageref{exa:match-expr-parts}
 
10000
 
 
10001
\end_inset
 
10002
 
 
10003
 
 
10004
\end_layout
 
10005
 
 
10006
\begin_layout Standard
 
10007
\noindent
 
10008
simple name patterns, 
 
10009
\begin_inset LatexCommand \pageref{exa:match-name-patterns}
 
10010
 
 
10011
\end_inset
 
10012
 
 
10013
 
 
10014
\end_layout
 
10015
 
 
10016
\begin_layout Standard
 
10017
\noindent
 
10018
operator name patterns, 
 
10019
\begin_inset LatexCommand \pageref{exa:match-operator-name-patterns}
 
10020
 
 
10021
\end_inset
 
10022
 
 
10023
 
 
10024
\end_layout
 
10025
 
 
10026
\begin_layout Standard
 
10027
\noindent
 
10028
conversion function name patterns, 
 
10029
\begin_inset LatexCommand \pageref{exa:match-conversion-function-name-patterns}
 
10030
 
 
10031
\end_inset
 
10032
 
 
10033
 
 
10034
\end_layout
 
10035
 
 
10036
\begin_layout Standard
 
10037
\noindent
 
10038
scope patterns, 
 
10039
\begin_inset LatexCommand \pageref{exa:match-scope-patterns}
 
10040
 
 
10041
\end_inset
 
10042
 
 
10043
 
 
10044
\end_layout
 
10045
 
 
10046
\begin_layout Standard
 
10047
\noindent
 
10048
type patterns with the wildcard character, 
 
10049
\begin_inset LatexCommand \pageref{exa:match-type-patterns-wildcard}
 
10050
 
 
10051
\end_inset
 
10052
 
 
10053
 
 
10054
\end_layout
 
10055
 
 
10056
\begin_layout Standard
 
10057
\noindent
 
10058
type patterns with 
 
10059
\family typewriter
 
10060
const
 
10061
\family default
 
10062
 and 
 
10063
\family typewriter
 
10064
volatile
 
10065
\family default
 
10066
 
10067
\begin_inset LatexCommand \pageref{exa:match-type-patterns-cv}
 
10068
 
 
10069
\end_inset
 
10070
 
 
10071
 
 
10072
\end_layout
 
10073
 
 
10074
\begin_layout Standard
 
10075
\noindent
 
10076
type patterns with 
 
10077
\family typewriter
 
10078
virtual
 
10079
\family default
 
10080
 
10081
\begin_inset LatexCommand \pageref{exa:match-type-patterns-virtual}
 
10082
 
 
10083
\end_inset
 
10084
 
 
10085
 
 
10086
\end_layout
 
10087
 
 
10088
\begin_layout Standard
 
10089
\noindent
 
10090
type matching, 
 
10091
\begin_inset LatexCommand \pageref{exa:type-matching}
 
10092
 
 
10093
\end_inset
 
10094
 
 
10095
 
 
10096
\end_layout
 
10097
 
 
10098
\begin_layout Standard
 
10099
\noindent
 
10100
control flow dependant advice activation, 
 
10101
\begin_inset LatexCommand \pageref{exa:control-flow}
 
10102
 
 
10103
\end_inset
 
10104
 
 
10105
 
 
10106
\end_layout
 
10107
 
 
10108
\begin_layout Standard
 
10109
\noindent
 
10110
matching in scopes, 
 
10111
\begin_inset LatexCommand \pageref{exa:matching-in-scopes}
 
10112
 
 
10113
\end_inset
 
10114
 
 
10115
 
 
10116
\end_layout
 
10117
 
 
10118
\begin_layout Standard
 
10119
\noindent
 
10120
function matching, 
 
10121
\begin_inset LatexCommand \pageref{exa:function-matching}
 
10122
 
 
10123
\end_inset
 
10124
 
 
10125
 
 
10126
\end_layout
 
10127
 
 
10128
\begin_layout Standard
 
10129
\noindent
 
10130
instance counting
 
10131
\begin_inset LatexCommand \label{exa:instance-counting}
 
10132
 
 
10133
\end_inset
 
10134
 
 
10135
 
 
10136
\end_layout
 
10137
 
 
10138
\begin_layout Standard
 
10139
\noindent
 
10140
\begin_inset ERT
 
10141
status collapsed
 
10142
 
 
10143
\begin_layout Standard
 
10144
 
 
10145
 
 
10146
\backslash
 
10147
begin{comment}
 
10148
\end_layout
 
10149
 
 
10150
\end_inset
 
10151
 
 
10152
attribute matching, 
 
10153
\begin_inset LatexCommand \pageref{exa:attribute-matching}
 
10154
 
 
10155
\end_inset
 
10156
 
 
10157
 
 
10158
\begin_inset ERT
 
10159
status collapsed
 
10160
 
 
10161
\begin_layout Standard
 
10162
 
 
10163
\end_layout
 
10164
 
 
10165
\begin_layout Standard
 
10166
 
 
10167
\end_layout
 
10168
 
 
10169
\begin_layout Standard
 
10170
 
 
10171
 
 
10172
\backslash
 
10173
end{comment}
 
10174
\end_layout
 
10175
 
 
10176
\begin_layout Standard
 
10177
 
 
10178
\end_layout
 
10179
 
 
10180
\end_inset
 
10181
 
 
10182
 
 
10183
\end_layout
 
10184
 
 
10185
\begin_layout Standard
 
10186
\noindent
 
10187
context matching, 
 
10188
\begin_inset LatexCommand \pageref{exa:context-matching}
 
10189
 
 
10190
\end_inset
 
10191
 
 
10192
 
 
10193
\end_layout
 
10194
 
 
10195
\begin_layout Standard
 
10196
\noindent
 
10197
combining pointcut expressions, 
 
10198
\begin_inset LatexCommand \pageref{exa:combining-pointcut}
 
10199
 
 
10200
\end_inset
 
10201
 
 
10202
 
 
10203
\end_layout
 
10204
 
 
10205
\begin_layout Standard
 
10206
\noindent
 
10207
advice placement, 
 
10208
\begin_inset LatexCommand \pageref{exa:advice-placement}
 
10209
 
 
10210
\end_inset
 
10211
 
 
10212
 
 
10213
\end_layout
 
10214
 
 
10215
\begin_layout Standard
 
10216
\noindent
 
10217
type usage, 
 
10218
\begin_inset LatexCommand \pageref{exa:type-usage}
 
10219
 
 
10220
\end_inset
 
10221
 
 
10222
 
 
10223
\end_layout
 
10224
 
 
10225
\begin_layout Standard
 
10226
\noindent
 
10227
static function usage, 
 
10228
\begin_inset LatexCommand \pageref{exa:static-function-usage}
 
10229
 
 
10230
\end_inset
 
10231
 
 
10232
 
 
10233
\end_layout
 
10234
 
 
10235
\begin_layout Standard
 
10236
\noindent
 
10237
non-static function usage, 
 
10238
\begin_inset LatexCommand \pageref{exa:non-static-function-usage}
 
10239
 
 
10240
\end_inset
 
10241
 
 
10242
 
 
10243
\end_layout
 
10244
 
 
10245
\begin_layout Standard
 
10246
\begin_inset ERT
 
10247
status collapsed
 
10248
 
 
10249
\begin_layout Standard
 
10250
 
 
10251
 
 
10252
\backslash
 
10253
end{examples}
 
10254
\backslash
 
10255
addcontentsline{toc}{section}{
 
10256
\backslash
 
10257
examplesname}
 
10258
\end_layout
 
10259
 
 
10260
\end_inset
 
10261
 
 
10262
 
 
10263
\end_layout
 
10264
 
 
10265
\begin_layout Standard
 
10266
\begin_inset LatexCommand \printindex{}
 
10267
 
 
10268
\end_inset
 
10269
 
 
10270
 
 
10271
\end_layout
 
10272
 
 
10273
\end_body
 
10274
\end_document