mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
52 lines
953 B
Plaintext
52 lines
953 B
Plaintext
// 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}}
|