-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathtrap_traps_h.mustache
More file actions
51 lines (40 loc) · 953 Bytes
/
trap_traps_h.mustache
File metadata and controls
51 lines (40 loc) · 953 Bytes
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
48
49
50
51
// generated by {{generator}} from {{source}}
// clang-format off
#pragma once
#include <iostream>
#include <string>
#include <binlog/binlog.hpp>
#include "{{trap_library_dir}}/TrapLabel.h"
#include "{{trap_library_dir}}/TrapTagTraits.h"
#include "{{gen_dir}}/TrapTags.h"
namespace codeql {
{{#traps}}
// {{table_name}}
struct {{name}}Trap {
static constexpr const char* NAME = "{{name}}Trap";
{{#fields}}
{{type}} {{field_name}}{};
{{/fields}}
template <typename F>
void forEachLabel(F f) {
{{>cpp_for_each_label_body}}
}
template <typename F>
void forEachLabel(F f) const {
{{>cpp_for_each_label_body}}
}
};
std::ostream &operator<<(std::ostream &out, const {{name}}Trap &e);
{{#id}}
namespace detail {
template<>
struct ToBindingTrapFunctor<{{type}}> {
using type = {{name}}Trap;
};
}
{{/id}}
{{/traps}}
}
{{#traps}}
BINLOG_ADAPT_STRUCT(codeql::{{name}}Trap{{#fields}}, {{field_name}}{{/fields}});
{{/traps}}