-
Notifications
You must be signed in to change notification settings - Fork 9
/
bpt_args_list.hpp
47 lines (34 loc) · 974 Bytes
/
bpt_args_list.hpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef BPT_ARG_LIST_HPP
#define BPT_ARG_LIST_HPP
#include <boost/noncopyable.hpp>
#include <pin.H>
namespace bpt {
struct args_list : boost::noncopyable {
explicit args_list();
~args_list();
args_list& operator()(IARG_TYPE);
template <typename T>
args_list& operator()(IARG_TYPE, T);
template <typename T1, typename T2>
args_list& operator()(IARG_TYPE, T1, IARG_TYPE, T2);
IARGLIST value();
UINT32 size();
private:
IARGLIST list_;
UINT32 size_;
};
template <typename T>
args_list& args_list::operator()(IARG_TYPE typ, T val) {
IARGLIST_AddArguments(list_, typ, val, IARG_END);
++size_;
return *this;
}
template <typename T1, typename T2>
args_list& args_list::operator()(IARG_TYPE typ1, T1 val1,
IARG_TYPE typ2, T2 val2) {
IARGLIST_AddArguments(list_, typ1, val1, typ2, val2, IARG_END);
size_ += 2;
return *this;
}
} //namespace bpt
#endif //BPT_ARG_LIST_HPP