#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass article
\begin_preamble
%--------------------------------------------------------------------
% PDF related
%--------------------------------------------------------------------
\newif\ifpdf 
\ifx\pdfoutput\undefined 
  \pdffalse                     % we are not running PDFLaTeX 
\else 
  \pdfoutput=1                % we are running PDFLaTeX 
  \pdftrue 
\fi

%--------------------------------------------------------------------
% setup hyperref
%--------------------------------------------------------------------
\ifpdf
  \usepackage{hyperref}  
  \hypersetup{% 
    %
    %% general document information
    pdftitle          = {AspectC++ Language Reference}, 
    pdfsubject     = {Dokumentation}, 
    pdfkeywords  = {AOP, AspectC++, pure-systems}, 
    pdfauthor      = {\textcopyright\ pure-systems GmbH and Olaf Spinczyk}, 
    pdfcreator     = {\LaTeX\ with package \flqq hyperref\frqq},
    pdfproducer  = {pdfTeX-0.\the\pdftexversion\pdftexrevision},
    %
    %% document style
    colorlinks=true,                  % colored link
    urlcolor=blue,                    % blue URL links
    bookmarks=true,                % generate bookmarks
    bookmarksnumbered=true,  % generate section numbers
    pdfpagemode=None           % don't open bookmarks
  } 
  
  %% set document creation date to 10.7.2003 00:00
  \pdfinfo {/CreationDate (D:20030710000000)}
\fi

%--------------------------------------------------------------------
% create hyperrefs depending on the use of pdflatex
%--------------------------------------------------------------------
\newcommand\depref[2]{%
  \ifpdf
    \href{#1}{#2}
  \else  
    {#2}
  \fi
}

%--------------------------------------------------------------------
% setup pure-systems style
%--------------------------------------------------------------------
\usepackage{floatflt}
\usepackage{../styles/pure-systems}
\doctype{Documentation:}
\credit{
  \noindent\small{(c) 2002-2003 Olaf Spinczyk and pure-systems GmbH\\All rights reserved.}}
\pslogo{
  \resizebox{6cm}{!}{\includegraphics{../images/ps-logo}}}
\otherlogo{
  \resizebox{4cm}{!}{\includegraphics{../images/ac++logo}}}
\sloppy
\remark{
  \small{(c) 2002-2003 Olaf Spinczyk$^1$ and pure-systems GmbH$^2$\\~\\
$^1$\depref{mailto:os@aspectc.org}{os@aspectc.org}\\
\depref{http://www.aspectc.org}{www.aspectc.org}\\~\\
$^2$\depref{mailto:aspectc@pure-systems.com}{aspectc@pure-systems.com}\\
\depref{http://www.pure-systems.com}{www.pure-systems.com}\\
Agnetenstr. 14\\
39106 Magdeburg\\
Germany
}}
\version{1.1, \today}

%--------------------------------------------------------------------
% place footnotes at the bottom of the page
%--------------------------------------------------------------------
\renewcommand\footnoterule{%
  \vfill
  \kern-3\p@
  \hrule\@width.3\columnwidth
  \kern2.6\p@}

%--------------------------------------------------------------------
% leave less than one and a half space between lines
%--------------------------------------------------------------------
\setstretch{1.15}

%--------------------------------------------------------------------
% 'list of examples' environment
%--------------------------------------------------------------------
\newcommand\examplesname{List of Examples}
\newenvironment{examples} 
  {\section*{\examplesname}% 
   \@mkboth{\MakeUppercase\examplesname}% 
                 {\MakeUppercase\examplesname}% 
   \thispagestyle{plain}
   \parindent\z@ \parskip\z@ \@plus .3\p@\relax} %
  {\clearpage}

%--------------------------------------------------------------------
% environment 'comment' 
%--------------------------------------------------------------------
\usepackage{comment}

%--------------------------------------------------------------------
% add 'Index' to table of contents 
%--------------------------------------------------------------------
\let\old@theindex\theindex
\def\theindex{
  \old@theindex
  \addcontentsline{toc}{section}{\indexname}}
\end_preamble
\language english
\inputencoding auto
\fontscheme pslatex
\graphics default
\paperfontsize 12
\spacing onehalf 
\papersize Default
\paperpackage a4
\use_geometry 0
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\quotes_times 2
\papercolumns 1
\papersides 2
\paperpagestyle default

\layout Title


\emph on 
AspectC++ Language Reference
\layout Author

Matthias Urban
\size largest 

\newline 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
vspace{8mm}
\end_inset 

and Olaf Spinczyk
\layout Standard


\begin_inset LatexCommand \tableofcontents{}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
clearpage
\end_inset 


\layout Section

About
\layout Standard

This document is intended to be used as a reference book for the AspectC++
 language elements.
 It describes in-depth the use and meaning of each element providing examples.
 For experienced users the contents of this document is summarized in the
\emph on 
 
\emph default 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
depref{http://www.aspectc.com/ac++quickref.pdf}{
\backslash 
emph{AspectC++ Quick Reference}}
\backslash 
hspace{-4pt}
\end_inset 

.
 A step-by-step introduction how to program with AspectC++ is given in the
 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
depref{http://www.aspectc.com/doc.html}{
\backslash 
emph{AspectC++ Programming Guide}}
\backslash 
hspace{-4pt}
\end_inset 

.
 Detailed information about the AspectC++ compiler 
\series bold 
ac++
\series default 

\begin_inset LatexCommand \index{ac++@\texttt{ac++}}

\end_inset 

 can be looked up in the 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
depref{http://www.aspectc.com/ac++compilerman.pdf}{
\backslash 
emph{AC++ Compiler Manual}}
\backslash 
hspace{-4pt}
\end_inset 

.
 
\layout Standard

AspectC++ is an aspect-oriented extension to the C++ language
\begin_inset Foot
collapsed true

\layout Standard

defined in the ISO/IEC 14882:1998(E) standard
\end_inset 

.
 It is similar to AspectJ
\begin_inset Foot
collapsed true

\layout Standard


\family typewriter 

\begin_inset ERT
status Open

\layout Standard

\backslash 
depref{http://www.aspectj.org}{
\backslash 
texttt{www.aspectj.org}}
\end_inset 


\end_inset 

 but, due to the nature of C++, in some points completely different.
 The first part of this document introduces the basic concepts of the AspectC++
 language.
 The in-depth description of each language element is subject of the second
 part.
\layout Section

Basic Concepts
\layout Subsection

Pointcuts
\begin_inset LatexCommand \index{pointcut|(}

\end_inset 


\layout Standard

Aspects in AspectC++ implement crosscutting concerns
\begin_inset LatexCommand \index{crosscutting concern}

\end_inset 

 in a modular way.
 With this in mind the most important element of the AspectC++ language
 is the pointcut.
 Pointcuts describe a set of join points
\begin_inset LatexCommand \index{join point}

\end_inset 

 by determining on which condition an aspect shall take effect.
 Thereby each join point can either refer to a function, an attribute, a
 type, a variable, or a point from which a join point is accessed so that
 this condition can be for instance the event of reaching a designated code
 position
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

 or the allocation of a variable with a certain value
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 

.
 Depending on the kind of pointcuts, they are evaluated at compile time
 or at runtime.
\layout Subsubsection

Match Expressions
\begin_inset LatexCommand \index{match expression|(}

\end_inset 


\begin_inset LatexCommand \index{search pattern!match expression|(}

\end_inset 


\layout Standard

There are two types of pointcuts in AspectC++: code pointcuts and name pointcuts.
 Name pointcuts
\begin_inset LatexCommand \index{name pointcut}

\end_inset 


\begin_inset LatexCommand \index{pointcut!name}

\end_inset 

 describe an intersection through the set of names known in a program.
 In detail these names can be the names of types, attributes, functions,
 variables, and namespaces.
 One way to describe name pointcuts are the so-called match expressions,
 i.e.\SpecialChar ~
string constants containing a search pattern
\begin_inset LatexCommand \index{search pattern}

\end_inset 


\begin_inset LatexCommand \index{match expression!search pattern}

\end_inset 

.
 In such a search pattern the special character 
\begin_inset Quotes eld
\end_inset 

%
\begin_inset Quotes erd
\end_inset 

 is interpreted as a wildcard for names or parts of a signature.
 The special character sequence 
\begin_inset Quotes eld
\end_inset 

...
\begin_inset Quotes erd
\end_inset 

 matches any number of parameters in a function signature.
\layout Subsubsection*

Example: match expressions (name pointcuts)
\begin_inset LatexCommand \label{exa:match-expressions}

\end_inset 


\layout Description


\family typewriter 
\series medium 
"int"
\family default 
\series default 
 \SpecialChar ~

\newline 
matches the C++ built-in scalar type 
\family typewriter 
int
\layout Description


\family typewriter 
\series medium 
"%List"
\family default 
\series default 
 \SpecialChar ~

\newline 
matches any class, struct or union whose name ends with 
\begin_inset Quotes eld
\end_inset 

List
\begin_inset Quotes erd
\end_inset 


\layout Description


\family typewriter 
\series medium 
"% 
\series default 
printf(...)"
\family default 
 \SpecialChar ~

\newline 
matches the function 
\family typewriter 
printf
\family default 
 having any number of parameters and returning any type
\layout Standard

The signatures given in match expressions are internally separated into
 result type, entity name
\begin_inset Foot
collapsed true

\layout Standard

if present
\end_inset 

, and arguments
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
footnotemark[
\backslash 
value{footnote}]
\end_inset 

.
 This makes it possible to match even complex C++ signatures.
 The signature 
\family typewriter 
"void (*fct())(int)"
\family default 
 describing a function taking no argument and returning a pointer to a function
 taking a single argument of type 
\family typewriter 
int
\family default 
 can be for instance successfully matched by the match expression
\begin_inset LatexCommand \index{match expression|)}

\end_inset 


\begin_inset LatexCommand \index{search pattern!match expression|)}

\end_inset 

 
\family typewriter 
"% fct()"
\family default 
.
 
\layout Subsubsection

Pointcut Expressions
\begin_inset LatexCommand \index{pointcut!expression|(}

\end_inset 


\layout Standard

The other type of pointcuts, the code pointcuts
\begin_inset LatexCommand \index{code pointcut}

\end_inset 


\begin_inset LatexCommand \index{pointcut!code}

\end_inset 

, describe an intersection through the set of the points in the control
 flow
\begin_inset LatexCommand \index{control flow}

\end_inset 

 of a program.
 A code pointcut can refer to a call or execution point of a function
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

 but also to write and read points of attributes and variables
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 

.
 They can only be created with the help of name pointcuts because all join
 points supported by AspectC++ require at least one name to be defined.
 This is done by calling predefined pointcut functions
\begin_inset LatexCommand \index{pointcut function}

\end_inset 


\begin_inset LatexCommand \index{pointcut!function}

\end_inset 

 in a pointcut expression that expect a pointcut as argument.
 Such a pointcut function is for instance 
\series bold 
within
\series default 
(
\emph on 
pointcut
\emph default 
), which filters all join points that are within the functions or classes
 in the given pointcut.
\layout Standard

Name and code pointcuts can be combined in pointcut expressions by using
 the algebraic operators 
\begin_inset Quotes eld
\end_inset 

&&
\begin_inset Quotes erd
\end_inset 

, 
\begin_inset Quotes eld
\end_inset 

||
\begin_inset Quotes erd
\end_inset 

, and 
\begin_inset Quotes eld
\end_inset 

!
\begin_inset Quotes erd
\end_inset 

.
\layout Subsubsection*

Example: pointcut expressions
\begin_inset LatexCommand \label{exa:pointcut-expressions}

\end_inset 


\layout Description


\family typewriter 
\series medium 
"%List"\SpecialChar ~
&&\SpecialChar ~
!derived("Queue")
\family default 
\series default 
 \SpecialChar ~

\newline 
describes the set of classes with names that end with 
\begin_inset Quotes eld
\end_inset 

List
\begin_inset Quotes erd
\end_inset 

 and that are not derived from the class 
\family typewriter 
Queue
\layout Description


\family typewriter 
\series medium 
call("void 
\series default 
draw()
\series medium 
")\SpecialChar ~

\series default 
&&\SpecialChar ~
within
\series medium 
("
\series default 
Shape
\series medium 
")
\family default 
\series default 
 \SpecialChar ~

\newline 
describes the set of calls to the function 
\family typewriter 
draw
\family default 
 that are within methods of the class 
\family typewriter 
Shape
\family default 

\begin_inset LatexCommand \index{pointcut!expression|)}

\end_inset 


\layout Subsubsection

Types of Join Points
\begin_inset LatexCommand \index{join point|(}

\end_inset 


\layout Standard

According to the two types of pointcuts supported by AspectC++ there are
 also two types of join points.
 Based on a short code fragment the differences and relations between these
 two types of join points shall be clarified.
\layout LyX-Code

class Shape;
\newline 
void draw(Shape&);
\newline 

\newline 
namespace Circle {
\newline 
  typedef int PRECISION;
\newline 
  
\newline 
  class S_Circle : public Shape {
\newline 
    PRECISION m_radius;
\newline 
  public:
\newline 
    ...
\layout LyX-Code

    void radius(PRECISION r) { m_radius=r; }
\newline 
  };
\newline 
  
\newline 
  void draw(PRECISION r) {
\layout LyX-Code

    S_Circle circle;
\layout LyX-Code

    circle.radius(r);
\layout LyX-Code

    draw(circle);
\newline 
  }
\newline 
}
\newline 

\newline 
int main() {
\newline 
  Circle::draw(10);
\newline 
  return 0;
\newline 
}
\layout Standard

Code join points
\begin_inset LatexCommand \index{code join point}

\end_inset 


\begin_inset LatexCommand \index{join point!code}

\end_inset 

 are used to form code pointcuts and name join points (i.e.\SpecialChar ~
names) are used
 to form name pointcuts.
 Figure 
\begin_inset LatexCommand \vref{fig:join-points}

\end_inset 

 shows some join points of the code fragment and how they correlate.
 
\layout Standard


\begin_inset Float figure
wide false
collapsed true

\layout Standard
\align center 

\begin_inset Graphics
	filename ../images/JoinPointModel.eps
	scale 65

\end_inset 


\layout Caption


\begin_inset LatexCommand \label{fig:join-points}

\end_inset 

join points and their relations
\end_inset 


\layout Standard

Every 
\series bold 
execution
\series default 

\begin_inset LatexCommand \index{execution join point}

\end_inset 


\begin_inset LatexCommand \index{join point!execution}

\end_inset 

 join point is associated with the name of an executable function.
 Pure virtual functions
\begin_inset LatexCommand \index{pure virtual!functions}

\end_inset 

 are not executable.
 Thus, advice code for execution join points would never be triggered for
 this kind of function.
 However, the call of such a function, i.e.\SpecialChar ~
a 
\series bold 
call
\series default 
 join point with this function as target, is absolutely possible.
\layout Standard

Every 
\series bold 
call
\series default 

\begin_inset LatexCommand \index{call join point}

\end_inset 


\begin_inset LatexCommand \index{join point!call}

\end_inset 

 join point is associated with two names: the name of the source and the
 target function of a function call.
 As there can be multiple function calls within the same function, each
 function name can be associated with a list of 
\series bold 
call
\series default 
 join points
\begin_inset LatexCommand \index{join point|)}

\end_inset 

.
 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

The same holds for 
\series bold 
set
\series default 

\begin_inset LatexCommand \index{set join point}

\end_inset 


\begin_inset LatexCommand \index{join point!set}

\end_inset 

 and 
\series bold 
get
\series default 

\begin_inset LatexCommand \index{get join point}

\end_inset 


\begin_inset LatexCommand \index{join point!get}

\end_inset 

 join points, which represent write resp.\SpecialChar ~
read operations on attributes or
 global variables.
 Each of these join points is associated with the name of the function that
 contains the join point and the name of the accessed attribute or global
 variable.
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Subsubsection

Pointcut declarations
\series bold 

\begin_inset LatexCommand \index{pointcut!declaration|(}

\end_inset 


\layout Standard

AspectC++ provides the possibility to name pointcut
\begin_inset LatexCommand \index{name pointcut}

\end_inset 


\begin_inset LatexCommand \index{pointcut!name}

\end_inset 

 expressions with the help of pointcut declarations.
 This makes it possible to reuse pointcut expressions in different parts
 of a program.
 They are allowed where C++ declarations are allowed.
 Thereby the usual C++ name lookup and inheritance rules are also applicable
 for pointcut declarations.
\layout Standard

A pointcut declaration is introduced by the keyword 
\family typewriter 
pointcut
\family default 
.
 
\layout Subsubsection*

Example: pointcut declaration
\begin_inset LatexCommand \label{exa:pointcut-declaration}

\end_inset 


\layout Description


\family typewriter 
\series medium 
pointcut
\series default 
\SpecialChar ~

\series medium 
lists()\SpecialChar ~
=
\series default 
\SpecialChar ~

\series medium 
derived("List");
\family default 
\series default 
 \SpecialChar ~

\newline 

\family typewriter 
lists
\family default 
 can now be used everywhere in a program where a pointcut expression can
 be used to refer to 
\family typewriter 
derived("List")
\layout Standard

Furthermore pointcut declarations can be used to define pure virtual pointcuts
\begin_inset LatexCommand \index{pure virtual!pointcut}

\end_inset 


\begin_inset LatexCommand \index{pointcut!pure virtual}

\end_inset 

.
 This enables the possibility of having re-usable abstract aspects
\begin_inset LatexCommand \index{aspect}

\end_inset 


\begin_inset LatexCommand \index{abstract aspect}

\end_inset 


\begin_inset LatexCommand \index{aspect!abstract}

\end_inset 

 that are discussed in section 
\begin_inset LatexCommand \ref{sub:Aspects}

\end_inset 

.
 The syntax of pure virtual pointcut declarations is the same as for usual
 pointcut declarations except the keyword 
\family typewriter 
virtual
\family default 
 following 
\family typewriter 
pointcut
\family default 
 and that the pointcut expression is 
\begin_inset Quotes eld
\end_inset 

0
\begin_inset Quotes erd
\end_inset 

.
\layout Subsubsection*

Example: pure virtual pointcut declaration
\begin_inset LatexCommand \label{exa:pure-virtual}

\end_inset 


\layout Description


\family typewriter 
\series medium 
pointcut
\series default 
\SpecialChar ~

\series medium 
virtual\SpecialChar ~
methods()\SpecialChar ~
=
\series default 
\SpecialChar ~

\series medium 
0;
\family default 
\series default 
 \SpecialChar ~

\newline 

\family typewriter 
methods
\family default 
 is a pure virtual pointcut that has to be redefined in a derived aspect
 to refer to the actual pointcut
\begin_inset LatexCommand \index{pointcut|)}

\end_inset 

 expression
\series bold 

\begin_inset LatexCommand \index{pointcut!declaration|)}

\end_inset 


\layout Subsection

Advice Code
\begin_inset LatexCommand \index{advice|(}

\end_inset 


\begin_inset LatexCommand \index{advice!code|(}

\end_inset 


\layout Standard

To a code join point
\begin_inset LatexCommand \index{code join point}

\end_inset 


\begin_inset LatexCommand \index{join point!code}

\end_inset 

 so-called advice code can be bound.
 Advice code can be understood as an action
\begin_inset LatexCommand \index{action}

\end_inset 


\begin_inset LatexCommand \index{runtime support!action}

\end_inset 

 activated by an aspect when a corresponding code join point in a program
 is reached.
 The activation of the advice code can happen before
\begin_inset LatexCommand \index{before}

\end_inset 


\begin_inset LatexCommand \index{advice!before}

\end_inset 

, after
\begin_inset LatexCommand \index{after}

\end_inset 


\begin_inset LatexCommand \index{advice!after}

\end_inset 

, or before and after the code join point is reached.
 The AspectC++ language element to specify advice code is the advice declaration
\begin_inset LatexCommand \index{advice!declaration}

\end_inset 

.
 It is introduced by the keyword 
\family typewriter 
advice
\family default 
 followed by a pointcut expression defining where and under which conditions
 the advice code shall be activated.
 
\layout Subsubsection*

Example: advice declaration
\begin_inset LatexCommand \label{exa:advice-declaration}

\end_inset 


\layout LyX-Code

advice execution("void login(...)") : before() {
\newline 
  cout << "Logging in." << endl;
\newline 
}
\layout Standard

The code fragment 
\family typewriter 
:before()
\family default 
 following the pointcut expression determines that the advice code shall
 be activated directly 
\series bold 
before
\series default 

\begin_inset LatexCommand \index{before}

\end_inset 


\begin_inset LatexCommand \index{advice!before}

\end_inset 

 the code join point is reached.
 It is also possible here to use 
\family typewriter 
:after()
\family default 
 which means 
\series bold 
after
\series default 

\begin_inset LatexCommand \index{after}

\end_inset 


\begin_inset LatexCommand \index{advice!after}

\end_inset 

 reaching the code join point respectively 
\family typewriter 
:around()
\family default 
 which means that the advice code shall be executed instead of the code
 described by the code join point.
 In an 
\series bold 
around
\series default 

\begin_inset LatexCommand \index{around}

\end_inset 


\begin_inset LatexCommand \index{advice!around}

\end_inset 

 advice the advice code can explicitly trigger the execution of the program
 code at the join point so that advice code can be executed 
\series bold 
before
\series default 
 and 
\series bold 
after
\series default 
 the join point.
 There are no special access rights of advice code regarding to program
 code at a join point.
\layout Standard

Beside the pure description of join points pointcuts can also bind variables
 to context
\begin_inset LatexCommand \index{context variables}

\end_inset 

 information of a join point.
 Thus for instance the actual argument values of a function call can be
 made accessible to the advice code.
\layout Subsubsection*

Example: advice declaration with access to context information
\begin_inset LatexCommand \label{exa:advice-declaration-with}

\end_inset 


\layout LyX-Code

pointcut new_user(const char *name) = 
\newline 
  execution("void login(...)") && args(name); 
\newline 

\newline 
advice new_user(name) : before(const char *name) { 
\newline 
  cout << "User " << name << " is logging in." << endl; 
\newline 
}
\layout Standard

In the example above at first the pointcut 
\family typewriter 
new_user
\family default 
 is defined including a context variable
\begin_inset LatexCommand \index{context variables}

\end_inset 

 
\family typewriter 
name
\family default 
 that is bound to it.
 This means that a value of type 
\family typewriter 
const char*
\family default 
 is supplied every time the join point described by the pointcut 
\family typewriter 
new_user
\family default 
 is reached.
 The pointcut function 
\family typewriter 
args
\family default 
 used in the pointcut expression delivers all join points in the program
 where an argument of type 
\family typewriter 
const char*
\family default 
 is used.
 Therefore 
\family typewriter 
args(name)
\family default 
 in touch with the 
\series bold 
execution
\series default 

\begin_inset LatexCommand \index{execution join point}

\end_inset 


\begin_inset LatexCommand \index{join point!execution}

\end_inset 

 join point binds 
\family typewriter 
name
\family default 
 to the first and only parameter of the function 
\family typewriter 
login
\family default 
.
 
\layout Standard

The advice declaration in the example above following the pointcut declaration
 binds the execution of advice code to the event when a join point described
 in 
\family typewriter 
new_user
\family default 
 is reached.
 The context variable
\begin_inset LatexCommand \index{context variables}

\end_inset 

 that holds the actual value of the parameter of the reached join point
 has to be declared as a formal parameter of 
\family typewriter 
before
\family default 
, 
\family typewriter 
after
\family default 
, or 
\family typewriter 
around
\family default 
.
 This parameter can be used in the advice code like an oridinary function
 parameter.
\layout Standard

Beside the pointcut function 
\family typewriter 
args
\family default 

\begin_inset LatexCommand \index{args@\texttt{args()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!args@\texttt{args()}}

\end_inset 

 the binding of context variables is performed by 
\family typewriter 
that
\family default 

\begin_inset LatexCommand \index{that@\texttt{that()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!that@\texttt{that()}}

\end_inset 

,
\family typewriter 
 target
\family default 

\begin_inset LatexCommand \index{target@\texttt{target()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!target@\texttt{target()}}

\end_inset 

, and 
\family typewriter 
result
\family default 

\begin_inset LatexCommand \index{result@\texttt{result()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!base@\texttt{base()}}

\end_inset 

.
 At the same time these pointcut functions act as filters corresponding
 to the type of the context variable.
 For instance 
\family typewriter 
args
\family default 
 in the example above filters all join points having an argument of type
 
\family typewriter 
const char*
\family default 
.
\begin_inset LatexCommand \index{advice!code|)}

\end_inset 


\layout Subsubsection

Introductions
\begin_inset LatexCommand \index{introduction|(}

\end_inset 


\begin_inset LatexCommand \index{advice!introduction|(}

\end_inset 


\layout Standard

The second type of advice supported by AspectC++ are the introductions.
 Introductions are used to extend program code and data structures in particular.
 The following example extends two classes each by an attribute and a method.
\layout Subsubsection*

Example: introductions
\begin_inset LatexCommand \label{exa:introductions}

\end_inset 


\layout LyX-Code

pointcut shapes() = "Circle" || "Polygon";
\newline 

\newline 
advice shapes() : bool m_shaded;
\newline 
advice shapes() : void shaded(bool state) {
\newline 
  m_shaded = state;
\newline 
}
\layout Standard

Like an ordinary advice declaration an introduction is introduced by the
 keyword 
\family typewriter 
advice
\family default 
.
 If the following pointcut is a name pointcut
\begin_inset LatexCommand \index{name pointcut}

\end_inset 


\begin_inset LatexCommand \index{pointcut!name}

\end_inset 

 the C++ declaration following the token 
\begin_inset Quotes eld
\end_inset 

:
\begin_inset Quotes erd
\end_inset 

 is introduced in the classes and namespaces described by the pointcut.
 Introduced code can then be used in normal program code like any other
 function, attribute, etc.
 Advice code in introductions has full access rights
\begin_inset LatexCommand \index{introduction!access rights}

\end_inset 

 regarding to program code at a join point, i.e.\SpecialChar ~
a method introduced in a class
 has access even to private members of that class.
\layout Standard

A special kind of introduction is the base class introduction
\begin_inset LatexCommand \index{base class introduction}

\end_inset 


\begin_inset LatexCommand \index{introduction!base class}

\end_inset 

.
 It is used to extend the base class list of one or more classes, e.g.\SpecialChar ~
to let
 classes provide a special abstract interface.
 In the first line of the following example it is made sure that every class
 with a name that ends with 
\begin_inset Quotes eld
\end_inset 

Object
\begin_inset Quotes erd
\end_inset 

 is derived from a class 
\family typewriter 
MemoryPool
\family default 
.
 This class may implement an own memory management by overloading the 
\family typewriter 
new
\family default 
 and 
\family typewriter 
delete
\family default 
 operators.
 Classes that inherit from 
\family typewriter 
MemoryPool
\family default 
 must redefine the pure virtual method 
\family typewriter 
release
\family default 
 that is part of the implemented memory management.
 This is done in the second line for all classes in the pointcut
\begin_inset LatexCommand \index{advice|)}

\end_inset 


\begin_inset LatexCommand \index{introduction|)}

\end_inset 


\begin_inset LatexCommand \index{advice!introduction|)}

\end_inset 

.
\layout Subsubsection*

Example: base class introduction
\begin_inset LatexCommand \label{exa:base-class-intro}

\end_inset 


\layout LyX-Code

advice "%Object" : baseclass(MemoryPool)
\begin_inset LatexCommand \index{baseclass}

\end_inset 


\begin_inset LatexCommand \index{advice!baseclass}

\end_inset 

;
\newline 
advice "%Object" : virtual void release() { ...
 }
\layout Subsubsection

Advice Ordering
\begin_inset LatexCommand \index{ordering|(}

\end_inset 


\layout Standard

If more than one advice affects the same join point it might be necessary
 to define an order of advice execution if there is a dependency between
 the advice codes (
\begin_inset Quotes eld
\end_inset 

aspect interaction
\begin_inset Quotes erd
\end_inset 


\begin_inset LatexCommand \index{aspect interaction}

\end_inset 

).
 The following example shows how the precedence of advice code can be defined
 in AspectC++.
\layout Subsubsection*

Example: advice ordering
\begin_inset LatexCommand \label{exa:order}

\end_inset 


\layout LyX-Code

advice execution("void send(...)") : order("Encrypt", "Log")
\begin_inset LatexCommand \index{order}

\end_inset 


\begin_inset LatexCommand \index{advice!order}

\end_inset 

;
\layout Standard

If advice of both aspects (see 
\begin_inset LatexCommand \ref{sub:Aspects}

\end_inset 

) 
\family typewriter 
Encrypt
\family default 
 and 
\family typewriter 
Log
\family default 
 should be run when the function 
\family typewriter 
send(...)
\family default 
 is executed this order declaration defines that the advice of 
\family typewriter 
Encrypt
\family default 
 has a higher precedence.
 More details on advice ordering and precedence 
\begin_inset LatexCommand \index{precedence}

\end_inset 

 can be found in section 
\begin_inset LatexCommand \vref{sec:ordering}

\end_inset 

.
\layout Subsection

Aspects
\begin_inset LatexCommand \label{sub:Aspects}

\end_inset 


\begin_inset LatexCommand \index{aspect|(}

\end_inset 


\layout Standard

The aspect is the language element of AspectC++ to collect introductions
 and advice code implementing a common crosscutting concern
\begin_inset LatexCommand \index{crosscutting concern}

\end_inset 

 in a modular way.
 This put aspects in a position to manage common state information.
 They are formulated by means of aspect declarations
\begin_inset LatexCommand \index{aspect!declaration}

\end_inset 

 as a extension to the class concept of C++.
 The basic structure of an aspect declaration is exactly the same as an
 usual C++ class definition, except for the keyword 
\family typewriter 
aspect
\family default 
 instead of 
\family typewriter 
class
\family default 
, 
\family typewriter 
struct
\family default 
 or 
\family typewriter 
union
\family default 
.
 According to that, aspects can have attributes and methods and can inherit
 from classes and even other aspects.
\layout Subsubsection*

Example: aspect declaration
\begin_inset LatexCommand \label{exa:aspect-decl}

\end_inset 


\layout LyX-Code

aspect Counter { 
\newline 
  static int m_count;
\newline 
  Counting() : m_count(0) {}
\newline 
  
\newline 
  pointcut counted() = "Circle" || "Polygon";
\newline 
  
\newline 
  advice counted() : class Helper {
\newline 
    Helper() { Counter::m_count++; }
\newline 
  } m_counter;
\newline 
  
\newline 
  advice execution("% main(...)") : after() {
\newline 
    cout << "Final count: " << m_count << " objects" << endl;
\newline 
  }
\newline 
};
\layout Standard

In this example the count of object instantiations for a set of classes
 is determined.
 Therefore an attribute is introduced into the classes described by the
 pointcut incrementing a global counter on construction time.
 By applying advice code for the function 
\family typewriter 
main
\family default 
 the final count of object instantiations is displayed when the program
 terminates.
 
\layout Standard

This example can also be rewritten as an abstract aspect
\begin_inset LatexCommand \index{abstract aspect}

\end_inset 


\begin_inset LatexCommand \index{aspect!abstract}

\end_inset 

 that can for instance be archived in an aspect library for the purpose
 of reuse.
 It only require to reimplement the pointcut declaration to be pure virtual
\begin_inset LatexCommand \index{pure virtual!pointcut}

\end_inset 

.
\layout Subsubsection*

Example: abstract aspect
\begin_inset LatexCommand \label{exa:abstract-aspect}

\end_inset 


\layout LyX-Code

aspect Counter { 
\newline 
  static int m_count;
\newline 
  Counting() : m_count(0) {}
\newline 
  
\newline 
  pointcut virtual counted() = 0;
\newline 
  ...
\newline 
};
\layout Standard

It is now possible to inherit from 
\family typewriter 
Counter
\family default 
 to reuse its functionality by reimplementing 
\family typewriter 
counted
\family default 
 to refer to the actual pointcut expression.
\layout Subsubsection*

Example: reused abstract aspect
\begin_inset LatexCommand \label{exa:reused-abstract}

\end_inset 


\layout LyX-Code

aspect MyCounter : public Counter { 
\newline 
  pointcut counted() = derived("Shape");
\newline 
};
\layout Subsubsection

Aspect Instantiation
\begin_inset LatexCommand \index{aspect!instantiation|(}

\end_inset 


\layout Standard

By default aspects in AspectC++ are automatically instantiated as global
 objects.
 The idea behind it is that aspects can also provide global program properties
 and therefore have to be always accessible.
 However in some special cases it may be desired to change this behavior,
 e.g.\SpecialChar ~
in the context of operating systems when an aspect shall be instantiated
 per process or per thread.
 
\layout Standard

The default instantiation scheme can be changed by defining the static method
 
\family typewriter 
aspectof
\family default 

\begin_inset LatexCommand \index{aspectof@\texttt{aspectof()}}

\end_inset 

 resp.\SpecialChar ~

\family typewriter 
aspectOf
\family default 

\begin_inset LatexCommand \index{aspectOf@\texttt{aspectOf()}}

\end_inset 

 that is otherwise generated for an aspect.
 This method is intended to be always able to return an instance of the
 appropriate aspect.
\layout Subsubsection*

Example: aspect instantiation using 
\family typewriter 
aspectof
\begin_inset LatexCommand \label{exa:aspect-aspectof}

\end_inset 


\layout LyX-Code

aspect ThreadCounter : public Counter {
\newline 
  pointcut counted() = "Thread";
\newline 
  
\newline 
  advice counted() : ThreadCounter m_instance;
\newline 
  
\newline 
  static ThreadCounter *aspectof() {
\newline 
    return tjp->target()->m_instance;
\newline 
  }
\newline 
};
\layout Standard

The introduction of 
\family typewriter 
m_instance
\family default 
 into 
\family typewriter 
Thread
\family default 
 guarantees that every thread object has an instance of the aspect.
 By calling 
\family typewriter 
aspectof
\family default 
 it is possible to get this instance at any join point which is essential
 for accessing advice code and members of the aspect.
 For this purpose code in 
\family typewriter 
aspectof
\family default 
 has full access to the actual join point in a way described in the next
 section.
\begin_inset LatexCommand \index{aspect|)}

\end_inset 


\begin_inset LatexCommand \index{aspect!instantiation|)}

\end_inset 


\layout Subsection

Runtime Support
\begin_inset LatexCommand \index{runtime support|(}

\end_inset 


\layout Subsubsection

Support for Advice Code
\begin_inset LatexCommand \index{runtime support!for advice code|(}

\end_inset 


\begin_inset LatexCommand \index{advice!runtime support|(}

\end_inset 


\layout Standard

For many aspects access to context variables
\begin_inset LatexCommand \index{context variables}

\end_inset 

 may not be sufficient to get enough information about the join point where
 advice code was activated.
 For instance a control flow
\begin_inset LatexCommand \index{control flow}

\end_inset 

 aspect for a complete logging of function calls in a program would need
 information about function arguments and its types on runtime to be able
 to produce a type-compatible output.
 
\layout Standard

In AspectC++ this information is provided by the members of the class 
\family typewriter 
JoinPoint
\family default 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}}

\end_inset 


\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}}

\end_inset 

 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

available both in advice code and introductions 
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 

(see table below).
 
\layout Standard


\begin_inset  Tabular
<lyxtabular version="3" rows="21" columns="2">
<features islongtable="true">
<column alignment="center" valignment="top" leftline="true" width="0cm">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0cm">
<row topline="true">
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard


\series bold 
types:
\end_inset 
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
Result
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

result type
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
That
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

object type
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
Target
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

target type
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::Type
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

encoded type of an object
\end_inset 
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::JPType
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

join point types
\end_inset 
</cell>
</row>
<row topline="true">
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard


\series bold 
static methods:
\end_inset 
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
int args()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

number of arguments
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::Type type()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

typ of the function or attribute
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::Type argtype(int)
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

types of the arguments
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
const char *signature()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

signature of the function or attribute
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
unsigned id()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

identification of the join point
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::Type resulttype()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

result type
\end_inset 
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::JPType jptype()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

type of join point
\end_inset 
</cell>
</row>
<row topline="true">
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard


\series bold 
non-static methods:
\end_inset 
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
void *arg(int)
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

actual argument
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
Result *result()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

result value
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
That *that()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

object refered to by 
\family typewriter 
\size small 
this
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
Target *target()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

target object of a call
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
void proceed()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

execute join point code
\end_inset 
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::Action &action()
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
Action
\family default 
 structure
\end_inset 
</cell>
</row>
</lyxtabular>

\end_inset 


\layout Standard
\align center 
Table 1: API of class 
\family typewriter 
JoinPoint
\family default 
 available in advice code
\layout Standard

Types and static methods of the 
\family typewriter 
JoinPoint
\family default 
 API deliver information that is the same for every advice code activation.
 The non-static methods deliver information that differ from one activation
 to another.
 These methods are accessed by the object 
\family typewriter 
tjp
\family default 

\begin_inset LatexCommand \index{tjp@\texttt{tjp}}

\end_inset 


\begin_inset LatexCommand \index{runtime support!thisJoinPoint@\texttt{thisJoinPoint}}

\end_inset 

 resp.\SpecialChar ~

\family typewriter 
thisJoinPoint
\family default 

\begin_inset LatexCommand \index{thisJoinPoint@\texttt{thisJoinPoint}}

\end_inset 


\begin_inset LatexCommand \index{runtime support!thisJoinPoint@\texttt{thisJoinPoint}}

\end_inset 

 which is of type 
\family typewriter 
JoinPoint
\family default 
 and is always available in advice code
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

 and introductions
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 

, too.
\layout Standard

The following example illustrates how to implement a re-usable control flow
\begin_inset LatexCommand \index{control flow}

\end_inset 

 aspect using the 
\family typewriter 
JoinPoint
\family default 
 API.
 
\layout Subsubsection*

Example: re-usable trace aspect
\begin_inset LatexCommand \label{exa:re-usable-trace}

\end_inset 


\layout LyX-Code

aspect Trace {
\newline 
  pointcut virtual methods() = 0;
\newline 
  
\newline 
  advice execution(methods()) : around() {
\newline 
    cout << "before " << JoinPoint::signature() << "(";
\layout LyX-Code

    for (unsigned i = 0; i < JoinPoint::args(); i++)
\newline 
      printvalue(tjp->arg(i), JoinPoint::argtype(i));
\newline 
    cout << ")" << endl;
\newline 
    tjp->proceed()
\series bold 
;
\newline 

\series default 
    cout << "after" << endl;
\newline 
  } 
\newline 
};
\layout Standard

This aspect weaves tracing code into every function specified by the virtual
 pointcut
\begin_inset LatexCommand \index{pure virtual!pointcut}

\end_inset 

 redefined in a derived aspect.
 The helper function 
\family typewriter 
printvalue
\family default 
 is responsible for the formated output of the arguments given at the function
 call.
 After calling 
\family typewriter 
printvalue
\family default 
 for every argument the program code of the actual join point is executed
 by calling 
\family typewriter 
proceed
\family default 

\begin_inset LatexCommand \index{proceed@\texttt{proceed()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!proceed()@\texttt{proceed()}}

\end_inset 

 on the 
\family typewriter 
JoinPoint
\family default 
 object.
 The functionality of 
\family typewriter 
proceed
\family default 
 is achieved by making use of the so-called actions.
\layout Subsubsection

Actions
\begin_inset LatexCommand \index{action|(}

\end_inset 


\begin_inset LatexCommand \index{runtime support!action|(}

\end_inset 


\layout Standard

In AspectC++ an action is the statement sequence that would follow a reached
 join point in a running program if advice code would not have been activated.
 Thus 
\family typewriter 
tjp->proceed()
\family default 

\begin_inset LatexCommand \index{proceed@\texttt{proceed()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!proceed()@\texttt{proceed()}}

\end_inset 

 triggers the execution of the program code of a join point.
 This can be the call or execution of a function
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

 as well as the writing or reading of attributes or variables
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 

.
 The actions concept is realized in the 
\family typewriter 
AC::Action
\family default 
 structure.
 In fact, 
\family typewriter 
proceed
\family default 
 is implemented as 
\family typewriter 
action().trigger()
\family default 

\begin_inset LatexCommand \index{trigger@\texttt{trigger()}}

\end_inset 


\begin_inset LatexCommand \index{action!trigger@\texttt{trigger()}}

\end_inset 

 so that 
\family typewriter 
tjp->proceed()
\family default 
 may also be replaced by 
\family typewriter 
tjp->action().trigger()
\family default 
.
 Thereby the method 
\family typewriter 
action()
\family default 

\begin_inset LatexCommand \index{action@\texttt{action()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!action@\texttt{action()}}

\end_inset 

 of the 
\family typewriter 
JoinPoint
\family default 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}}

\end_inset 


\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}}

\end_inset 

 API returns the actual action object for a join point.
\begin_inset LatexCommand \index{runtime support!for advice code|)}

\end_inset 


\begin_inset LatexCommand \index{advice!runtime support|)}

\end_inset 


\begin_inset LatexCommand \index{action|)}

\end_inset 


\begin_inset LatexCommand \index{runtime support!action|)}

\end_inset 


\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 


\layout Subsubsection

Support for Introductions
\begin_inset LatexCommand \index{runtime support!for introductions|(}

\end_inset 


\begin_inset LatexCommand \index{introduction!runtime support|(}

\end_inset 


\layout Standard

The 
\family typewriter 
JoinPoint
\family default 
 API available in code introduced by an introduction is listed in the following
 table.
\layout Standard


\begin_inset Float table
placement H
wide false
collapsed true

\layout Standard
\align center 

\begin_inset  Tabular
<lyxtabular version="3" rows="6" columns="2">
<features>
<column alignment="center" valignment="top" leftline="true" width="0pt">
<column alignment="center" valignment="top" leftline="true" rightline="true" width="0cm">
<row topline="true">
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard


\series bold 
static methods:
\end_inset 
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
const char *signature()
\end_inset 
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

signature of the function or attribute
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
unsigned id()
\end_inset 
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

identification of the join point
\end_inset 
</cell>
</row>
<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
AC::JPType jptype()
\end_inset 
</cell>
<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

type of join point
\end_inset 
</cell>
</row>
<row topline="true">
<cell multicolumn="1" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard


\series bold 
types:
\end_inset 
</cell>
<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

\end_inset 
</cell>
</row>
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text

\layout Standard


\family typewriter 
Aspect
\end_inset 
</cell>
<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
\begin_inset Text

\layout Standard

type of the aspect
\end_inset 
</cell>
</row>
</lyxtabular>

\end_inset 


\layout Caption


\family typewriter 
JoinPoint
\family default 
 API for introductions
\end_inset 


\layout Standard

In difference to the API available for advice code the API for introduction
 only provides static information about a join point.
 A nice demonstration of this API is shown in the following example.
\layout Subsubsection*

Example: static type identification using introductions
\begin_inset LatexCommand \label{exa:static-type-id}

\end_inset 


\layout LyX-Code

aspect TypeInfo {
\newline 
  pointcut virtual typed() = 0;
\newline 
  
\newline 
  advice typed() : static unsigned type_id() {
\newline 
    return JoinPoint::id();
\newline 
  }
\newline 
  
\newline 
  advice typed() : virtual unsigned type() { 
\newline 
    return type_id(); 
\newline 
  }
\newline 
};
\layout Standard

The first introduction of this aspect introduces a static method 
\family typewriter 
type_id
\family default 
 into a set of classes returning an unique integer value.
 By introducing a second non-static but virtual method type into these classes
 also returning the unique integer value a type identification can be realized
 like this:
\layout LyX-Code

if (obj->type() == AClass::type_id())
\newline 
  ...
\newline 
else if (obj->type() == AnotherClass::type_id())
\newline 
  ...
\layout Standard

This implements a nice alternative to the C++ RTTI mechanism especially
 when the RTTI support of a compiler is switched off.
 
\layout Standard

Code of introductions have to use the type 
\family typewriter 
Aspect
\family default 

\begin_inset LatexCommand \index{Aspect@\texttt{Aspect}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Aspect@\texttt{Aspect}}

\end_inset 

 to get access to the methods and attributes of an aspect, e.g.\SpecialChar ~
by calling
 
\family typewriter 
Aspect::aspectof()
\family default 
.
 Because the static function 
\family typewriter 
aspectof
\family default 

\begin_inset LatexCommand \index{aspectof@\texttt{aspectof()}}

\end_inset 

 is always generated for an aspect, except when it is already explicitly
 defined, 
\family typewriter 
aspectof
\family default 
 always returns the actual aspect instance.
 By courtesy of this technique the example 
\begin_inset LatexCommand \vpageref{exa:aspect-decl}

\end_inset 

 can be changed to provide not only the count of all threads but to provide
 a count for every thread.
\layout Subsubsection*

Example: 
\begin_inset LatexCommand \label{exa:extended-thread}

\end_inset 

extended thread counting
\begin_inset LatexCommand \index{runtime support|)}

\end_inset 


\begin_inset LatexCommand \index{runtime support!for introductions|)}

\end_inset 


\begin_inset LatexCommand \index{introduction!runtime support|)}

\end_inset 


\layout LyX-Code

aspect Counter { 
\newline 
  int m_count;
\newline 
  ...
\newline 
  advice counted() : class Helper {
\newline 
    Helper() { Aspect::aspectof()->m_count++; }
\newline 
  } m_counter;
\newline 
  ...
\newline 
};
\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Section

Match Expressions
\begin_inset LatexCommand \index{match expression|(}

\end_inset 


\begin_inset LatexCommand \index{search pattern!match expression|(}

\end_inset 


\layout Standard

This section provides sample match expressions for matching types, attributes,
 and functions.
\layout Subsection

Type Matching
\layout Description


\family typewriter 
\series medium 
"unsigned 
\series default 
long"
\family default 
 \SpecialChar ~

\newline 
matches the C++ built-in scalar type 
\family typewriter 
unsigned long int
\layout Description


\family typewriter 
\series medium 
"%\SpecialChar ~
*"
\family default 
\series default 
 \SpecialChar ~

\newline 
matches pointers to any class or named C++ data type
\layout Subsection

Namespace and Class Matching
\layout Description


\family typewriter 
\series medium 
"Chain"
\family default 
\series default 
 \SpecialChar ~

\newline 
matches the class, struct, or union 
\family typewriter 
Chain
\layout Description


\family typewriter 
\series medium 
"Memory%"
\family default 
\series default 
 \SpecialChar ~

\newline 
matches any class, struct or union whose name starts with 
\begin_inset Quotes eld
\end_inset 

Memory
\begin_inset Quotes erd
\end_inset 


\layout Subsection

Attribute Matching
\layout Description


\family typewriter 
\series medium 
"Chain
\series default 
* Chain::next"
\family default 
 \SpecialChar ~

\newline 
matches the attribute 
\family typewriter 
next
\family default 
 of class 
\family typewriter 
Chain
\family default 
 having type 
\family typewriter 
Chain*
\family default 
 (pointer to 
\family typewriter 
Chain
\family default 
)
\layout Description


\family typewriter 
\series medium 
"% 
\series default 
Chain::%"
\family default 
 \SpecialChar ~

\newline 
matches any attribute of class 
\family typewriter 
Chain
\layout Subsection

Function Matching
\layout Description


\family typewriter 
\series medium 
"void 
\series default 
reset()"
\family default 
 \SpecialChar ~

\newline 
matches the function 
\family typewriter 
reset
\family default 
 having no parameters and returning 
\family typewriter 
void
\layout Description


\family typewriter 
\series medium 
"% 
\series default 
printf(...)"
\family default 
 \SpecialChar ~

\newline 
matches the function 
\family typewriter 
printf
\family default 
 having any number of parameters and returns any type
\layout Description


\family typewriter 
\series medium 
"void 
\series default 
%(int,%)"
\family default 
 \SpecialChar ~

\newline 
matches any function having exactly two parameters (from which the first
 one must be 
\family typewriter 
int
\family default 
) and returning 
\family typewriter 
void
\family default 

\begin_inset LatexCommand \index{match expression|)}

\end_inset 


\begin_inset LatexCommand \index{search pattern!match expression|)}

\end_inset 


\layout Section

Predefined Pointcut Functions
\begin_inset LatexCommand \label{sec:Predefined}

\end_inset 


\begin_inset LatexCommand \index{pointcut function|(}

\end_inset 


\begin_inset LatexCommand \index{pointcut!function|(}

\end_inset 


\layout Standard

On the following pages a complete list of the pointcut functions supported
 by AspectC++ is presented.
 For every pointcut function it is indicated which type of pointcut is expected
 as argument(s) and of which type the result pointcut is.
 Thereby 
\begin_inset Quotes eld
\end_inset 

N
\begin_inset Quotes erd
\end_inset 

 stands for name pointcut and 
\begin_inset Quotes eld
\end_inset 

C
\begin_inset Quotes erd
\end_inset 

 for code pointcut.
 The optionally given index is an assurance about the type of join point(s)
 described by the result pointcut
\begin_inset Foot
collapsed true

\layout Standard

C, C
\begin_inset Formula $_{\textrm{C}}$
\end_inset 

, C
\begin_inset Formula $_{\textrm{E}}$
\end_inset 

, C
\begin_inset Formula $_{\textrm{S}}$
\end_inset 

, C
\begin_inset Formula $_{\textrm{G}}$
\end_inset 

: Code (any, only 
\emph on 
\bar under 
C
\bar default 
all
\emph default 
, only 
\emph on 
\bar under 
E
\bar default 
xecution
\emph default 
, only 
\emph on 
\bar under 
S
\bar default 
et
\emph default 
, only 
\emph on 
\bar under 
G
\bar default 
et
\emph default 
); N, N
\begin_inset Formula $_{N}$
\end_inset 

, N
\begin_inset Formula $_{C}$
\end_inset 

, N
\begin_inset Formula $_{F}$
\end_inset 

, N
\begin_inset Formula $_{T}$
\end_inset 

: Names (any, only 
\emph on 
\bar under 
N
\bar default 
amespace
\emph default 
, only 
\emph on 
\bar under 
C
\bar default 
lass
\emph default 
, only 
\emph on 
\bar under 
F
\bar default 
unction
\emph default 
, only 
\emph on 
\bar under 
T
\bar default 
ype
\emph default 
)
\end_inset 

.
 
\layout Subsection

Types
\layout Description

base
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{base@\texttt{base()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!base@\texttt{base()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

N
\begin_inset Formula $_{C,F}$
\end_inset 


\newline 
returns all base classes 
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

resp.\SpecialChar ~
redefined functions 
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 

of classes in the pointcut
\layout Description

derived
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{derived@\texttt{derived()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!derived@\texttt{derived()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

N
\begin_inset Formula $_{C,F}$
\end_inset 


\newline 
returns all classes in the pointcut and all classes derived from them
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

 resp.\SpecialChar ~
all redefined functions of derived classes
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Subsubsection*

Example: type matching
\begin_inset LatexCommand \label{exa:type-matching}

\end_inset 


\layout Standard

A software may contain the following class hierarchy.
 
\layout LyX-Code

class Shape { ...
 };
\newline 
class Point : public Shape { ...
 };
\newline 
...
\newline 
class Rectangle : public Line, public Rotatable { ...
 };
\layout Standard

With the following aspect a special feature is added to a designated set
 of classes of this class hierarchy.
\layout LyX-Code

aspect Scale {
\newline 
  pointcut scalable() = 
\newline 
    (base("Rectangle") && derived("Point")) || "Rectangle";
\newline 
  
\newline 
  advice "Point" : baseclass("Scalable");
\newline 
  advice scalable() : void scale(int value) { ...
 }
\newline 
};
\layout Standard

The pointcut describes the classes 
\family typewriter 
Point
\family default 
 and 
\family typewriter 
Rectangle
\family default 
 and all classes derived from 
\family typewriter 
Point
\family default 
 that are direct or indirect base classes of 
\family typewriter 
Rectangle
\family default 
.
 With the first advice 
\family typewriter 
Point
\family default 
 gets a new base class.
 The second advice adds a corresponding method to all classes in the pointcut.
\layout Subsection

Control Flow
\begin_inset LatexCommand \index{control flow|(}

\end_inset 


\layout Description

cflow
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{cflow@\texttt{cflow()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!cflow@\texttt{cflow()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
captures join points occuring in the dynamic execution context of join points
 in the pointcut
\layout Subsubsection*

Example: function call matching
\begin_inset LatexCommand \label{exa:function-call-matching}

\end_inset 


\layout Standard

The following example demonstrates the use of the 
\series bold 
cflow
\series default 
 pointcut function.
\layout LyX-Code

class Constant { 
\newline 
  int m_value;
\newline 
public:
\newline 
  Constant(int v) : m_value(v) {}
\newline 
  
\newline 
  operator int() { return m_value; }
\newline 
  int get_value() { return m_value; }
\newline 
};
\newline 

\newline 
int main() {
\newline 
  Constant year(2003);
\newline 
  ...
\newline 
  int y = year.get_value();
\newline 
  ...
\newline 
  return 0;
\newline 
}
\layout Standard

The function 
\family typewriter 
get_value
\family default 
 may be deprecated and a warning shall be displayed if it is still used
 in the program.
 A corresponding aspect using the 
\series bold 
cflow
\series default 
 pointcut function is shown below.
\layout LyX-Code

aspect Deprecated {
\newline 
  pointcut functions() = call("% Constant::get_value()") && 
\newline 
                         cflow(execution ("% main(...)"));
\newline 
  
\newline 
  advice functions() : before() {
\newline 
    cout << "Warning: Use of get_value() is deprecated." << endl; 
\newline 
  }
\newline 
};
\layout Standard

The pointcut describes all the calls to the function 
\family typewriter 
get_value
\family default 
 that come from the function 
\family typewriter 
main
\family default 
 and any function called in 
\family typewriter 
main
\family default 
 and any function called in a function called in 
\family typewriter 
main
\family default 
 and so on.
 The advice provides the warning message for every join point in the pointcut.
 The message is displayed before 
\family typewriter 
get_value
\family default 
 is called.
\begin_inset LatexCommand \index{control flow|)}

\end_inset 


\layout Subsection

Scope
\layout Description

within
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{within@\texttt{within()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!within@\texttt{within()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
filters all join points that are within the functions or classes in the
 pointcut
\layout Subsubsection*

Example: matching in scopes
\begin_inset LatexCommand \label{exa:matching-in-scopes}

\end_inset 


\layout LyX-Code

aspect Logger {
\newline 
  pointcut calls() = 
\newline 
    call("void transmit()") && within("Transmitter");
\newline 
  
\newline 
  advice calls() : around() {
\newline 
    cout << "transmitting ...
 " << flush;
\newline 
    tjp->proceed();
\newline 
    cout << "finished." << endl;
\newline 
  }
\newline 
};
\layout Standard

This aspect inserts code logging all calls to 
\family typewriter 
transmit
\family default 
 that are within the methods of class 
\family typewriter 
Transmitter
\family default 
.
 
\layout Subsection

Functions
\layout Description

call
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{call@\texttt{call()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!call@\texttt{call()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\begin_inset Formula $_{C}$
\end_inset 


\newline 
Provides all join points where a named entity in the pointcut is called.
 The pointcut may contain function names or class names.
 In the case of a class name all calls to methods of that class are provided.
\layout Description

execution
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{execution@\texttt{execution()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!execution@\texttt{execution()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\begin_inset Formula $_{E}$
\end_inset 


\newline 
provides all join points referring to the implementation of a named entity
 in the pointcut.
 The pointcut may contain function names or class names.
 In the case of a class name all implementations of methods of that class
 are provided.
\layout Subsubsection*

Example: function matching
\begin_inset LatexCommand \label{exa:function-matching}

\end_inset 


\layout Standard

The following aspect weaves debugging code into a program that checks whether
 a method is called on a null pointer and whether the argument of the call
 is null.
\layout LyX-Code

aspect Debug {
\newline 
  pointcut fct() = "% MemPool::dealloc(void*)";
\newline 
  pointcut exec() = execution(fct());
\newline 
  pointcut calls() = call(fct());
\newline 
  
\newline 
  advice exec() && args(ptr) : before(void *ptr) {
\newline 
    assert(ptr && "argument is NULL");
\newline 
  }
\newline 
  advice calls() : before() {
\newline 
    assert(tjp->target() && "'this' is NULL");
\newline 
  }
\newline 
};
\layout Standard

The first advice provides code to check the argument of the function 
\family typewriter 
dealloc
\family default 
 before the function is executed.
 A check whether 
\family typewriter 
dealloc
\family default 
 is called on a null object is provided by the second advice.
 This is realized by checking the target of the call.
\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 


\layout Subsection

Attributes
\layout Standard

The 
\series bold 
set
\series default 
 and 
\series bold 
get
\series default 
 pointcut functions are not yet implemented in the AspectC++ compiler 
\series bold 
ac++
\begin_inset LatexCommand \index{ac++@\texttt{ac++}}

\end_inset 


\series default 
.
\layout Description

set
\series medium 
(
\emph on 
pointcut
\emph default 
) 
\series default 

\begin_inset LatexCommand \index{set@\texttt{set()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!set@\texttt{set()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\begin_inset Formula $_{S}$
\end_inset 


\newline 
selects all join points where the value of an attribute or global variable
 is modified
\layout Description

get
\series medium 
(
\emph on 
pointcut
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{get@\texttt{get()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!get@\texttt{get()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\begin_inset Formula $_{G}$
\end_inset 


\newline 
selects all join points where the value of an attribute or global variable
 is read
\layout Subsubsection*

Example: attribute matching
\begin_inset LatexCommand \label{exa:attribute-matching}

\end_inset 


\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Subsection

Context
\layout Description

that
\series medium 
(
\emph on 
type\SpecialChar ~
pattern
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{that@\texttt{that()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!that@\texttt{that()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
returns all join points where the current C++ 
\family typewriter 
this
\family default 
 pointer refers to an object which is an instance of a type that is compatible
 to the type described by the type pattern
\layout Description

target
\series medium 
(
\emph on 
type\SpecialChar ~
pattern
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{target@\texttt{target()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!target@\texttt{target()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
returns all join points where the target object of a call is an instance
 of a type
\emph on 
 
\emph default 
that is compatible to the type described by the type pattern
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 


\layout Description

result
\series medium 
(
\emph on 
type\SpecialChar ~
pattern
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{result@\texttt{result()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!base@\texttt{base()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
returns all join points where the result object of a call is an instance
 of a type that is compatible to the type described by the type pattern
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Description

args
\series medium 
(
\emph on 
type\SpecialChar ~
pattern
\emph default 
,\SpecialChar ~
...)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{args@\texttt{args()}}

\end_inset 


\begin_inset LatexCommand \index{pointcut function!args@\texttt{args()}}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

(N,...)
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
receives a list of type patterns and filters all methods or attributes with
 a matching signature
\layout Standard

Instead of the type pattern it is also possible here to deliver the name
 of a variable to which the context information is bound.
 In this case the type of the variable is used for the type matching.
\layout Subsubsection*

Example: context matching
\begin_inset LatexCommand \label{exa:context-matching}

\end_inset 


\layout Subsection

Algebraic Operators
\layout Description


\series medium 
\emph on 
pointcut
\series default 
\emph default 
\SpecialChar ~
&&
\series medium 
\emph on 
\SpecialChar ~
pointcut
\family typewriter 
\series default 
\emph default 
 
\family default 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

(N,N)
\begin_inset Formula $\rightarrow$
\end_inset 

N, (C,C)
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
intersection of the join points in the pointcuts
\layout Description


\series medium 
\emph on 
pointcut
\series default 
\emph default 
\SpecialChar ~
||
\series medium 
\emph on 
\SpecialChar ~
pointcut
\family typewriter 
\series default 
\emph default 
 
\family default 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

(N,N)
\begin_inset Formula $\rightarrow$
\end_inset 

N, (C,C)
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
union of the join points in the pointcuts
\layout Description

!
\series medium 
\emph on 
\SpecialChar ~
pointcut
\family typewriter 
\series default 
\emph default 
 
\family default 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
hfill 
\end_inset 

N
\begin_inset Formula $\rightarrow$
\end_inset 

N, C
\begin_inset Formula $\rightarrow$
\end_inset 

C
\newline 
exclusion of the join points in the pointcut
\layout Subsubsection*

Example: 
\begin_inset LatexCommand \label{exa:combining-pointcut}

\end_inset 

combining pointcut expressions
\begin_inset LatexCommand \index{pointcut function|)}

\end_inset 


\begin_inset LatexCommand \index{pointcut!function|)}

\end_inset 


\layout Section

Advice Declarations
\begin_inset LatexCommand \index{advice!declaration|(}

\end_inset 


\layout Standard

This section provides a summary of the AspectC++ placement functions allowed
 in advice declarations.
\layout Description

before
\series medium 
(...)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{before}

\end_inset 


\begin_inset LatexCommand \index{advice!before}

\end_inset 

\SpecialChar ~

\newline 
the advice code is executed before the join points in the pointcut
\layout Description

after
\series medium 
(...)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{after}

\end_inset 


\begin_inset LatexCommand \index{advice!after}

\end_inset 

\SpecialChar ~

\newline 
the advice code is executed after the join points in the pointcut
\layout Description

around
\series medium 
(...)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{around}

\end_inset 


\begin_inset LatexCommand \index{advice!around}

\end_inset 

\SpecialChar ~

\newline 
the advice code is executed in place of the join points in the pointcut
\layout Description

baseclass
\series medium 
(
\emph on 
classname
\emph default 
)
\family typewriter 
\series default 
 
\family default 

\begin_inset LatexCommand \index{baseclass}

\end_inset 


\begin_inset LatexCommand \index{advice!baseclass}

\end_inset 

\SpecialChar ~

\newline 
a new base class is introduced to the classes in the pointcut 
\layout Subsubsection*

Example: 
\begin_inset LatexCommand \label{exa:advice-placement}

\end_inset 

advice placement
\begin_inset LatexCommand \index{advice!declaration|)}

\end_inset 


\layout Section


\family typewriter 
JoinPoint
\family default 
 API
\family typewriter 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}|(}

\end_inset 


\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}|(}

\end_inset 


\layout Standard

The following sections provide a complete description of the 
\family typewriter 
JoinPoint
\family default 
 API.
 
\layout Subsection

Types
\layout Description


\family typewriter 
\series medium 
Result
\series default 
 
\family default 

\begin_inset LatexCommand \index{Result@\texttt{Result}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Result@\texttt{Result}}

\end_inset 

\SpecialChar ~

\newline 
result type of a function
\layout Description


\family typewriter 
\series medium 
That
\series default 
 
\family default 

\begin_inset LatexCommand \index{That@\texttt{That}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!That@\texttt{That}}

\end_inset 

\SpecialChar ~

\newline 
object type (object initiating a call)
\layout Description


\family typewriter 
\series medium 
Target
\series default 
 
\family default 

\begin_inset LatexCommand \index{Target@\texttt{Target}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Target@\texttt{Target}}

\end_inset 

\SpecialChar ~

\newline 
target object type (target object of a call)
\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 


\layout Description


\family typewriter 
\series medium 
Aspect
\family default 
\series default 
 
\begin_inset LatexCommand \index{Aspect@\texttt{Aspect}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!Aspect@\texttt{Aspect}}

\end_inset 

\SpecialChar ~

\newline 
type of the aspect (only available in introductions)
\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Subsubsection*

Example: type usage
\begin_inset LatexCommand \label{exa:type-usage}

\end_inset 


\layout Subsection

Functions
\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
AC::Type
\emph on 
\SpecialChar ~

\emph default 
type()
\series default 
 
\family default 

\begin_inset LatexCommand \index{type@\texttt{type()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!type@\texttt{type()}}

\end_inset 

\SpecialChar ~

\newline 
returns the encoded type for the join point conforming with the C++ ABI
 V3 specification
\begin_inset Foot
collapsed true

\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
depref{http://www.codesourcery.com/cxx-abi/abi.html
\backslash 
#mangling}{
\backslash 
texttt{www.codesourcery.com/cxx-abi/abi.html
\backslash 
#mangling}}
\end_inset 


\end_inset 


\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
int
\emph on 
\SpecialChar ~

\emph default 
args()
\series default 
 
\family default 

\begin_inset LatexCommand \index{args@\texttt{args()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!args@\texttt{args()}}

\end_inset 

\SpecialChar ~

\newline 
returns the number of arguments of a function for call and execution join
 points
\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
AC::Type
\emph on 
\SpecialChar ~

\emph default 
argtype(int
\series default 
\SpecialChar ~

\series medium 
number)
\series default 
 
\family default 

\begin_inset LatexCommand \index{argtype@\texttt{argtype()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!argtype@\texttt{argtype()}}

\end_inset 

\SpecialChar ~

\newline 
returns the encoded type of an argument conforming with the C++ ABI V3 specifica
tion
\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
const\SpecialChar ~
char
\series default 
\emph on 
\SpecialChar ~

\series medium 
\emph default 
*signature()
\series default 
 
\family default 

\begin_inset LatexCommand \index{signature@\texttt{signature()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!signature@\texttt{signature()}}

\end_inset 

\SpecialChar ~

\newline 
gives a textual description of the join point (function name, class name,
 ...)
\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
unsigned\SpecialChar ~
int
\series default 
\emph on 
\SpecialChar ~

\series medium 
\emph default 
id()
\series default 
 
\family default 

\begin_inset LatexCommand \index{id@\texttt{id()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!id@\texttt{id()}}

\end_inset 

\SpecialChar ~

\newline 
returns a unique numeric identifier for this join point
\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
AC::Type
\emph on 
\SpecialChar ~

\emph default 
resulttype()
\series default 
 
\family default 

\begin_inset LatexCommand \index{resulttype@\texttt{resulttype()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!resulttype@\texttt{resulttype()}}

\end_inset 

\SpecialChar ~

\newline 
returns the encoded type of the result type conforming with the C++ ABI
 V3 specification
\layout Description


\family typewriter 
\series medium 
static\SpecialChar ~
AC::JPType
\emph on 
\SpecialChar ~

\emph default 
jptype()
\series default 
 
\family default 

\begin_inset LatexCommand \index{jptype@\texttt{jptype()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!jptype@\texttt{jptype()}}

\end_inset 

\SpecialChar ~

\newline 
returns a unique identifier describing the type of the join point
\layout Subsubsection*

Example: static function usage
\begin_inset LatexCommand \label{exa:static-function-usage}

\end_inset 


\layout Description


\family typewriter 
\series medium 
void\SpecialChar ~
*arg(int
\series default 
\SpecialChar ~

\series medium 
number)
\family default 
\series default 
 
\begin_inset LatexCommand \index{arg@\texttt{arg()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!arg@\texttt{arg()}}

\end_inset 

\SpecialChar ~

\newline 
returns a pointer to the memory position holding the argument value with
 index 
\family typewriter 
number
\layout Description


\family typewriter 
\series medium 
Result
\emph on 
\SpecialChar ~

\emph default 
*result()
\family default 
\series default 
 
\family typewriter 

\begin_inset LatexCommand \index{result@\texttt{result()}}

\end_inset 


\family default 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!result@\texttt{result()}}

\end_inset 

\SpecialChar ~

\newline 
returns a pointer to the memory location designated for the result value
 or 0 if the function has no result value
\layout Description


\family typewriter 
\series medium 
That\SpecialChar ~
*that()
\family default 
\series default 
 
\family typewriter 

\begin_inset LatexCommand \index{that@\texttt{that()}}

\end_inset 


\family default 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!that@\texttt{that()}}

\end_inset 

\SpecialChar ~

\newline 
returns a pointer to the object initiating a call or 0 if it is a static
 method or a global function
\layout Description


\family typewriter 
\series medium 
Target\SpecialChar ~
*target()
\family default 
\series default 
 
\family typewriter 

\begin_inset LatexCommand \index{target@\texttt{target()}}

\end_inset 


\family default 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!target@\texttt{target()}}

\end_inset 

\SpecialChar ~

\newline 
returns a pointer to the object that is the target of a call or 0 if it
 is a static method or a global function
\layout Description


\family typewriter 
\series medium 
void\SpecialChar ~
proceed()
\family default 
\series default 
 
\begin_inset LatexCommand \index{proceed@\texttt{proceed()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!proceed()@\texttt{proceed()}}

\end_inset 

\SpecialChar ~

\newline 
executes the original join point code in an around advice by calling 
\family typewriter 
action().trigger()
\layout Description


\family typewriter 
\series medium 
AC::Action\SpecialChar ~
&action()
\family default 
\series default 
 
\begin_inset LatexCommand \index{action@\texttt{action()}}

\end_inset 


\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}!action@\texttt{action()}}

\end_inset 

\SpecialChar ~

\newline 
returns the runtime action object containing the execution environment to
 execute the original functionality encapsulated by an around advice
\layout Subsubsection*

Example: 
\begin_inset LatexCommand \label{exa:non-static-function-usage}

\end_inset 

non-static function usage
\family typewriter 

\begin_inset LatexCommand \index{JoinPoint@\texttt{JoinPoint}|)}

\end_inset 


\begin_inset LatexCommand \index{runtime support!JoinPoint@\texttt{JoinPoint}|)}

\end_inset 


\layout Section


\begin_inset LatexCommand \label{sec:ordering}

\end_inset 

Advice Ordering
\begin_inset LatexCommand \index{advice!ordering|(}

\end_inset 


\layout Subsection


\begin_inset LatexCommand \label{sub:aspect-precedence}

\end_inset 

Aspect Precedence
\begin_inset LatexCommand \index{precedence!of aspects|(}

\end_inset 


\layout Standard

AspectC++ provides a very flexible mechanism to define aspect precedence.
 The precedence is used to determine the execution order of advice code
 if more than one aspect affect the same join point.
 The precedence in AspectC++ is an attribute of a join point.
 This means that the precedence relationship between two aspects might vary
 in different parts of the system.
 The compiler checks the following conditions to determine the precendence
 of aspects:
\layout Description

order\SpecialChar ~
declaration: if the programmer provides an order declaration, which
 defines the precedence relationship between two aspects for a join point,
 the compiler will obey this definition or abort with a compile-time error
 if there is a cycle in the precedence graph.
 Order declarations have the following syntax:
\family typewriter 
\series bold 

\newline 
advice
\family default 
\series default 
 
\emph on 
pointcut-expr
\emph default 
 : 
\family typewriter 
\series bold 
order
\family default 
\series default 
 
\family typewriter 
\series bold 
(
\family default 
\series default 
 
\emph on 
high
\family typewriter 
\series bold 
\emph default 
,
\family default 
\series default 
 ...
\emph on 
low
\emph default 
 
\family typewriter 
\series bold 
)
\newline 

\family default 
\series default 
The argument list of 
\family typewriter 
order
\family default 
 has to contain at least two elements.
 Each element is a pointcut expression, which describes a set of aspects.
 Each aspect in a certain set has a higher precedence than all aspects,
 which are part of a set following later in the list (on the right hand
 side).
 For example '
\family typewriter 
("A1"||"A2","A3"||"A4")
\family default 
' means that 
\family typewriter 
A1
\family default 
 has precedence over 
\family typewriter 
A3
\family default 
 and 
\family typewriter 
A4
\family default 
 and that 
\family typewriter 
A2
\family default 
 has precedence over 
\family typewriter 
A3
\family default 
 and 
\family typewriter 
A4
\family default 
.
 This order directive does 
\emph on 
not
\emph default 
 define the relation between 
\family typewriter 
A1
\family default 
 and 
\family typewriter 
A2
\family default 
 or 
\family typewriter 
A3
\family default 
 and 
\family typewriter 
A4
\family default 
.
 Of course, the pointcut expressions in the argument list of 
\family typewriter 
order
\family default 
 may contain named pointcuts and even pure virtual pointcuts.
\layout Description

inheritance\SpecialChar ~
relation: if there is no order declaration given and one aspect
 has a base aspect the derived aspect has a higher precedence than the base
 aspect.
\layout Subsection


\begin_inset LatexCommand \label{sub:advice-precedence}

\end_inset 

Advice Precedence
\begin_inset LatexCommand \index{precedence!of advice|(}

\end_inset 


\layout Standard

The precedence of advice is determined with a very simple scheme:
\layout Itemize

if two advice declarations belong to different aspects and there is a precedence
 relation between these aspects (see section 
\begin_inset LatexCommand \vref{sub:aspect-precedence}

\end_inset 

) the same relation will be assumed for the advice.
\layout Itemize

if two advice declarations belong to the same aspect the one that is declared
 first has the higher precedence.
\layout Subsection

Effects of Advice Precedence
\begin_inset LatexCommand \index{precedence!effects|(}

\end_inset 


\layout Standard

Only advice predecence has an effect on the generated code.
 The effect depends on the kind of join point, which is affected by two
 advice declarations.
\layout Subsubsection*

Class Join Points
\layout Standard

Advice on class join points can extend the attribute list or base class
 list.
 If advice has a higher precedence than another it will be handled first.
 For example, an introduced new base class of advice with a high precedence
 will appear in the base class list on the left side of a base class, which
 was inserted by advice with lower precedence.
 This means that the execution order of the constructors of introduced base
 classes can be influenced, for instance, by order declarations.
\layout Standard

The order of introduced attributes also has an impact on the constructor/destruc
tor execution order as well as the object layout.
\layout Subsubsection*

Code Join Points
\layout Standard

Advice on code join points can be 
\family typewriter 
before
\family default 
, 
\family typewriter 
after
\family default 
, or 
\family typewriter 
around
\family default 
 advice.
 For 
\family typewriter 
before
\family default 
 and 
\family typewriter 
around
\family default 
 advice a higher precedence means that the corresponding advice code will
 be run first.
 For 
\family typewriter 
after
\family default 
 advice a higher precedence means that the advice code will be run later.
\layout Standard

If 
\family typewriter 
around
\family default 
 advice code does not call 
\family typewriter 
tjp->proceed()
\family default 
 or 
\family typewriter 
trigger()
\family default 
 on the action object no advice code with lower precedence will be run.
 The execution of advice with higher precedence is not affected by 
\family typewriter 
around
\family default 
 advice with lower precedence.
\layout Standard

For example, consider an aspect that defines advice
\begin_inset Foot
collapsed true

\layout Standard

BE is 
\family typewriter 
before
\family default 
 advice, AF 
\family typewriter 
after
\family default 
 advice, and AR 
\family typewriter 
around
\family default 
 advice
\end_inset 

 in the following order: BE1, AF1, AF2, AR1, BE2, AR2, AF3.
 As described in section 
\begin_inset LatexCommand \vref{sub:advice-precedence}

\end_inset 

 the declaration order also defines the precedence: BE1 has the highest
 and AF3 the lowest.
 The result is the following advice code execution sequence:
\layout Enumerate

BE1 (highest precedence)
\layout Enumerate

AR1 (the indented advice will only be executed if 
\family typewriter 
proceed()
\family default 
 is called!)
\begin_deeper 
\layout Enumerate

BE2 (before AR2, buts depends on AR1)
\layout Enumerate

AR2 (the indented code will only be executed if 
\family typewriter 
proceed()
\family default 
 is called!)
\begin_deeper 
\layout Enumerate

original code under the join point
\layout Enumerate

AF3
\end_deeper 
\end_deeper 
\layout Enumerate

AF2 (does not depend on AR1 and AR2, because of higher precedence)
\layout Enumerate

AF1 (run after AF2, because it has a higher precedence)
\layout Section
\start_of_appendix 
Grammar
\begin_inset LatexCommand \index{grammar}

\end_inset 


\layout Standard

The AspectC++ syntax is an extension to the C++ syntax.
 It adds three new keywords to the C++ language: 
\family typewriter 
aspect
\family default 
, 
\family typewriter 
advice
\family default 
, and 
\family typewriter 
pointcut
\family default 
.
 Additionally it extends the C++ language by advice and pointcut declarations.
 In contrast to pointcut declarations, advice declarations may only occur
 in aspect declarations.
 
\layout Description


\series medium 
\shape italic 
class-key:
\series default 
\shape default 
 
\series bold 
\SpecialChar ~

\newline 

\family typewriter 
\series default 
aspect
\layout Description


\series medium 
\shape italic 
declaration:
\series default 
 \SpecialChar ~

\newline 
pointcut-declaration
\newline 
advice-declaration
\layout Description


\series medium 
\shape italic 
member-declaration:
\series default 
 \SpecialChar ~

\newline 
pointcut-declaration
\newline 
advice-declaration
\layout Description


\series medium 
\shape italic 
pointcut-declaration:
\series default 
 
\emph on 

\begin_inset LatexCommand \index{pointcut!declaration}

\end_inset 


\emph default 
\SpecialChar ~

\newline 

\family typewriter 
\shape default 
pointcut
\family default 
\shape italic 
 \SpecialChar ~
declaration
\layout Description


\series medium 
\shape italic 
pointcut-expression:
\series default 
 
\series medium 

\begin_inset LatexCommand \index{pointcut!expression}

\end_inset 


\series default 
\SpecialChar ~

\newline 
constant-expression
\layout Description


\series medium 
\shape italic 
advice-declaration:
\series default 
 
\begin_inset LatexCommand \index{advice!declaration}

\end_inset 

\SpecialChar ~

\newline 

\family typewriter 
\shape default 
advice
\family default 
\shape italic 
 \SpecialChar ~
pointcut-expression\SpecialChar ~
 
\series bold 
\shape default 
:
\series default 
\shape italic 
 \SpecialChar ~
order-declaration
\newline 

\family typewriter 
\shape default 
advice
\family default 
\shape italic 
 \SpecialChar ~
pointcut-expression\SpecialChar ~
 
\series bold 
\shape default 
:
\series default 
\shape italic 
 \SpecialChar ~
declaration
\layout Description


\series medium 
\shape italic 
order-declaration:
\series default 
 
\begin_inset LatexCommand \index{order!declaration}

\end_inset 

\SpecialChar ~

\newline 

\family typewriter 
\shape default 
order (
\family default 
\shape italic 
 \SpecialChar ~
pointcur-expression-seq\SpecialChar ~

\family typewriter 
\shape default 
)
\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
cleardoublepage
\backslash 
begin{examples}
\end_inset 


\layout Standard
\noindent 
match expressions (name pointcuts), 
\begin_inset LatexCommand \pageref{exa:match-expressions}

\end_inset 


\layout Standard
\noindent 
pointcut expressions, 
\begin_inset LatexCommand \pageref{exa:pointcut-expressions}

\end_inset 


\layout Standard
\noindent 
pointcut declaration, 
\begin_inset LatexCommand \pageref{exa:pointcut-declaration}

\end_inset 


\layout Standard
\noindent 
pure virtual pointcut declaration, 
\begin_inset LatexCommand \pageref{exa:pure-virtual}

\end_inset 


\layout Standard
\noindent 
advice declaration, 
\begin_inset LatexCommand \pageref{exa:advice-declaration}

\end_inset 


\layout Standard
\noindent 
advice declaration with access to context information, 
\begin_inset LatexCommand \pageref{exa:advice-declaration-with}

\end_inset 


\layout Standard
\noindent 
introductions, 
\begin_inset LatexCommand \pageref{exa:introductions}

\end_inset 


\layout Standard
\noindent 
base class introduction, 
\begin_inset LatexCommand \pageref{exa:base-class-intro}

\end_inset 


\layout Standard
\noindent 
advice ordering, 
\begin_inset LatexCommand \pageref{exa:order}

\end_inset 


\layout Standard
\noindent 
aspect declaration, 
\begin_inset LatexCommand \pageref{exa:aspect-decl}

\end_inset 


\layout Standard
\noindent 
abstract aspect, 
\begin_inset LatexCommand \pageref{exa:abstract-aspect}

\end_inset 


\layout Standard
\noindent 
reused abstract aspect, 
\begin_inset LatexCommand \pageref{exa:reused-abstract}

\end_inset 


\layout Standard
\noindent 
aspect instantiation using 
\family typewriter 
aspectof
\family default 
, 
\begin_inset LatexCommand \pageref{exa:aspect-aspectof}

\end_inset 


\layout Standard
\noindent 
re-usable trace aspect, 
\begin_inset LatexCommand \pageref{exa:re-usable-trace}

\end_inset 


\layout Standard
\noindent 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

static type identification using introductions, 
\begin_inset LatexCommand \pageref{exa:static-type-id}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Standard
\noindent 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

extended thread counting, 
\begin_inset LatexCommand \pageref{exa:extended-thread}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Standard
\noindent 
type matching, 
\begin_inset LatexCommand \pageref{exa:type-matching}

\end_inset 


\layout Standard
\noindent 
function call matching, 
\begin_inset LatexCommand \pageref{exa:function-call-matching}

\end_inset 


\layout Standard
\noindent 
matching in scopes, 
\begin_inset LatexCommand \pageref{exa:matching-in-scopes}

\end_inset 


\layout Standard
\noindent 
function matching, 
\begin_inset LatexCommand \pageref{exa:function-matching}

\end_inset 


\layout Standard
\noindent 

\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
begin{comment}
\end_inset 

attribute matching, 
\begin_inset LatexCommand \pageref{exa:attribute-matching}

\end_inset 


\begin_inset ERT
status Collapsed

\layout Standard

\layout Standard

\backslash 
end{comment}
\newline 

\end_inset 


\layout Standard
\noindent 
context matching, 
\begin_inset LatexCommand \pageref{exa:context-matching}

\end_inset 


\layout Standard
\noindent 
combining pointcut expressions, 
\begin_inset LatexCommand \pageref{exa:combining-pointcut}

\end_inset 


\layout Standard
\noindent 
advice placement, 
\begin_inset LatexCommand \pageref{exa:advice-placement}

\end_inset 


\layout Standard
\noindent 
type usage, 
\begin_inset LatexCommand \pageref{exa:type-usage}

\end_inset 


\layout Standard
\noindent 
static function usage, 
\begin_inset LatexCommand \pageref{exa:static-function-usage}

\end_inset 


\layout Standard
\noindent 
non-static function usage, 
\begin_inset LatexCommand \pageref{exa:non-static-function-usage}

\end_inset 


\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
end{examples}
\backslash 
addcontentsline{toc}{section}{
\backslash 
examplesname}
\end_inset 


\layout Standard


\begin_inset LatexCommand \printindex{}

\end_inset 


\the_end
