edits
[cdsspec-compiler.git] / notes / definition.cc
1 #include <iostream>
2 #include <vector>
3 #include <string>
4 #include <iterator>
5
6 using namespace std;
7
8 typedef struct MethodCall {
9         string interfaceName; // The interface label name
10         void *value; // The pointer that points to the struct that have the return
11                                  // value and the arguments
12         void *localState; // The pointer that points to the struct that represents
13                                           // the (local) state
14         vector<MethodCall*> *prev; // Method calls that are hb right before me
15         vector<MethodCall*> *next; // Method calls that are hb right after me
16         vector<MethodCall*> *concurrent; // Method calls that are concurrent with me
17 } MethodCall;
18
19 typedef MethodCall *Method;
20 typedef vector<Method> *MethodSet;
21
22 #define NewSet new vector<Method>
23
24 /**
25         The set here is a vector<MethodCall*>* type, or the MethodSet type. And the
26         item would become the MethodCall* type, or the Method type
27 */
28 #define ForEach(item, set) \
29         for (int i = 0, Method item = (set)->size() > 0 ? (*(set))[0] : NULL; \
30                 i < (set)->size(); i++, 
31
32 int main() {
33         return 0;
34 }