4
struct Y; // this one is private!
13
// this is a member of a private class, thus Y cannot be used in TJP so far
14
void X::Y::fy(Y *arg) {
17
// this function may call fy
24
advice execution ("% ...::f%(...)") : around () {
25
printf ("e1: before %s\n",JoinPoint::signature ());
27
printf ("e1: after %s\n",JoinPoint::signature ());
29
advice execution ("% ...::f%(...)") : around () {
30
printf ("e2: before %s\n",JoinPoint::signature ());
32
printf ("e2: after %s\n",JoinPoint::signature ());
34
// this call advice still does not work!
35
// advice call ("% ...::f%(...)") : around () {
36
// printf ("c1: before %s\n",JoinPoint::signature ());
38
// printf ("c1: after %s\n",JoinPoint::signature ());
40
// advice call ("% ...::f%(...)") : around () {
41
// printf ("c2: before %s\n",JoinPoint::signature ());
42
// tjp->action ().trigger ();
43
// printf ("c2: after %s\n",JoinPoint::signature ());
52
// moegliche Loesung ...
61
// template <int> friend struct TJP;
62
// struct Y; // this one is private!
72
// template <> struct TJP<1> {
74
// typedef X::Y Target;
76
// X::Y *that () { return _that; }
77
// X::Y *target () { return 0; }
78
// static const char *signature () { return "X::Y::fy"; }
79
// void proceed () { _that->old_fy (); }
82
// template <typename JP> void adv (JP *tjp) {
83
// printf ("before %s\n", JP::signature ());
87
// // this is a member of a private class, thus Y cannot be used in TJP so far
89
// TJP<1> tjp = { this };
90
// adv< TJP<1> >(&tjp);
92
// // this is a member of a private class, thus Y cannot be used in TJP so far
93
// void X::Y::old_fy() {
94
// printf ("X::Y::old_fy\n");
97
// // this function may call fy