File: Derived.ah

package info (click to toggle)
aspectc%2B%2B 1%3A2.3%2Bgit20221129-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 17,988 kB
  • sloc: cpp: 109,125; ansic: 7,644; sh: 2,262; makefile: 1,312; pascal: 634; python: 402; xml: 349
file content (34 lines) | stat: -rw-r--r-- 885 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef __Derived_ah__
#define __Derived_ah__

#include <stdio.h>

#include "Base.ah"
#include "C.h"

aspect Derived : public Base {
    // make the base aspect introduce something into "C"
    pointcut target_class () = "C";
    pointcut virtual late_target_class_copy () = 0;

    advice execution (target_class ()) : before () {
	printf ("before %s\n", JoinPoint::signature ());
    }
    // advice execution (late_target_class_copy ()) : after () {
    // 	printf ("after %s\n", JoinPoint::signature ());
    // }
};

struct Confusion {
    pointcut target_class() = "DoesNotExists";
};

aspect Derived2 : public Confusion, public Derived {
    // make the base aspect introduce something into "C"
    pointcut late_target_class_copy () = "C";
    // advice late_target_class_copy() : slice struct {
    //   void func() { _something = 42; }
    // };
};

#endif // __Derived_ah__