ilang  1.1.4
ILAng: A Modeling and Verification Platform for SoCs
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros
container_shortcut.h
Go to the documentation of this file.
1 
4 #ifndef ILANG_UTIL_CONTAINER_SHORTCUT_H__
5 #define ILANG_UTIL_CONTAINER_SHORTCUT_H__
6 
7 #include <algorithm>
8 #include <set>
9 #include <string>
10 
11 #define UNION(a, b, r) \
12  (std::set_union((a).begin(), (a).end(), (b).begin(), (b).end(), \
13  std::inserter((r), (r).end())))
14 #define INTERSECT(a, b, r) \
15  (std::set_intersection((a).begin(), (a).end(), (b).begin(), (b).end(), \
16  std::inserter((r), (r).end())))
17 #define DIFFERENCE(a, b, r) \
18  (std::set_difference((a).begin(), (a).end(), (b).begin(), (b).end(), \
19  std::inserter((r), (r).end())))
20 #define SYMDIFF(a, b, r) \
21  (std::set_symmetric_difference((a).begin(), (a).end(), (b).begin(), \
22  (b).end(), std::inserter((r), (r).end())))
23 
24 #define IN(e, s) ((s).find(e) != (s).end())
25 #define IN_p(e, s) ((s)->find(e) != (s)->end())
26 
27 #define S_IN(sub, s) ((s).find(sub) != (s).npos)
28 
29 #endif // ILANG_UTIL_CONTAINER_SHORTCUT_H__