Combining enum, struct, and callback in one method; refactoring method body generatio...
[iot2.git] / config / iotpolicy / testclasspolicy_advanced.pol
1 public interface TestClassInterface {
2
3         public Enum handleEnum(Enum en);
4         public Enum[] handleEnumArray(Enum en[]);
5         public List<Enum> handleEnumList(List<Enum> en);
6         public Enum handleEnumComplex(Enum en, int i, char c);
7         public Enum[] handleEnumComplex2(Enum en[], int in, char c);
8
9         public Struct handleStruct(Struct str);
10         public Struct[] handleStructArray(Struct str[]);
11         public List<Struct> handleStructList(List<Struct> str);
12         public Struct handleStructComplex(int in, char c, Struct str);
13         public List<Struct> handleStructComplex2(int in, char c, Struct str[]);
14
15         public Enum[] handleEnumStruct(Enum en[], List<Struct> str, char c);
16
17         public void registerCallback(CallBackInterface _cb);
18         public void registerCallbackArray(CallBackInterface _cb[]);
19         public void registerCallbackList(List<CallBackInterface> _cb);
20         public void registerCallbackComplex(int in, List<CallBackInterface> _cb, double db);
21         public int callBack();
22
23         public Enum[] handleAll(Enum en[], List<Struct> str, char c, List<CallBackInterface> _cb);
24
25         capability EnumsStructs {
26                 description = "All the set methods";
27
28                 method = "handleEnum(Enum en)";
29                 method = "handleEnumArray(Enum en[])";
30                 method = "handleEnumList(List<Enum> en)";
31                 method = "handleEnumComplex(Enum en, int i, char c)";
32                 method = "handleEnumComplex2(Enum en[], int in, char c)";
33
34                 method = "handleStruct(Struct str)";
35                 method = "handleStructArray(Struct str[])";
36                 method = "handleStructList(List<Struct> str)";
37                 method = "handleStructComplex(int in, char c, Struct str)";
38                 method = "handleStructComplex2(int in, char c, Struct str[])";
39
40                 method = "handleEnumStruct(Enum en[], List<Struct> str, char c)";
41                 method = "handleAll(Enum en[], List<Struct> str, char c, List<CallBackInterface> _cb)";
42         }
43
44         capability Callbacks {
45                 description = "All the set-and-get methods";
46
47                 method = "registerCallback(CallBackInterface _cb)";
48                 method = "registerCallbackArray(CallBackInterface _cb[])";
49                 method = "registerCallbackList(List<CallBackInterface> _cb)";
50                 method = "registerCallbackComplex(int in, List<CallBackInterface> _cb, double db)";
51                 method = "callBack()";
52         }
53
54         enum Enum {
55
56                 APPLE,
57                 ORANGE,
58                 GRAPE
59         }
60
61         struct Struct {
62
63                 string  name;
64                 float   value;
65                 int     year;
66         }
67 }
68
69