File: Test.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-- 1,129 bytes parent folder | download | duplicates (4)
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
#include <iostream>

namespace acc {
  attribute myNoreturn();
  attribute aha(typename X, template<typename, int> class A);
  attribute myAttr(int i, void (*param)(int));
  attribute myNNAttr(typename X, X& b);
  attribute wholeFunc(int a);
  attribute hi(int a, const char* B);
}

aspect funcModifierClass {
  advice construction ("[[acc::aha(int, List)]]") : before() {
    std::cout << "ClassAttributed" << std::endl;
  }
};

aspect funcModifierClassFail {
  advice construction ("[[acc::aha(char, List)]]") : before() {
    std::cout << "ClassAttributed failed" << std::endl;
  }
};

aspect funcModifierFail {
  advice execution (/*"% %(...)"*/"[[acc::myNNAttr(Core, co2)]]" &&  "[[acc::hi( 3, \"al\" \"oa\" )]]" && "[[acc::aha(char, List)]]") && within("[[acc::aha(int, List)]]") : before() {
    std::cout << "FunctionAttributed faied" << std::endl;
  }
};

aspect funcModifier {
  advice execution (/*"% %(...)"*/"[[acc::myNNAttr(Core, co)]]" &&  "[[acc::hi( 3, \"al\" \"oa\" )]]" && "[[acc::aha(char, List)]]") && within("[[acc::aha(int, List)]]") : before() {
    std::cout << "FunctionAttributed" << std::endl;
  }
};