#ifndef SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_PERFETTO_SQL_ENGINE_H_
#define SRC_TRACE_PROCESSOR_PERFETTO_SQL_ENGINE_PERFETTO_SQL_ENGINE_H_
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/flat_hash_map.h"
#include "perfetto/ext/base/status_or.h"
#include "perfetto/trace_processor/basic_types.h"
#include "src/trace_processor/containers/string_pool.h"
#include "src/trace_processor/db/runtime_table.h"
#include "src/trace_processor/db/table.h"
#include "src/trace_processor/perfetto_sql/engine/function_util.h"
#include "src/trace_processor/perfetto_sql/engine/perfetto_sql_parser.h"
#include "src/trace_processor/perfetto_sql/engine/perfetto_sql_preprocessor.h"
#include "src/trace_processor/perfetto_sql/engine/runtime_table_function.h"
#include "src/trace_processor/perfetto_sql/intrinsics/functions/sql_function.h"
#include "src/trace_processor/perfetto_sql/intrinsics/table_functions/static_table_function.h"
#include "src/trace_processor/sqlite/bindings/sqlite_result.h"
#include "src/trace_processor/sqlite/bindings/sqlite_window_function.h"
#include "src/trace_processor/sqlite/db_sqlite_table.h"
#include "src/trace_processor/sqlite/sql_source.h"
#include "src/trace_processor/sqlite/sqlite_engine.h"
#include "src/trace_processor/sqlite/sqlite_utils.h"
#include "src/trace_processor/util/sql_argument.h"
#include "src/trace_processor/util/sql_modules.h"
namespace perfetto::trace_processor {
class PerfettoSqlEngine { … };
namespace perfetto_sql_internal {
template <typename Function>
struct ScopedCleanup { … };
template <typename Function>
void WrapSqlFunction(sqlite3_context* ctx, int argc, sqlite3_value** argv) { … }
}
template <typename Function>
base::Status PerfettoSqlEngine::RegisterStaticFunction(
const char* name,
int argc,
typename Function::Context* ctx,
bool deterministic) { … }
template <typename Function>
base::Status PerfettoSqlEngine::RegisterSqliteFunction(
typename Function::UserDataContext* ctx,
bool deterministic) { … }
template <typename Function>
base::Status PerfettoSqlEngine::RegisterSqliteFunction(
std::unique_ptr<typename Function::UserDataContext> ctx,
bool deterministic) { … }
template <typename Function>
base::Status PerfettoSqlEngine::RegisterSqliteAggregateFunction(
typename Function::UserDataContext* ctx,
bool deterministic) { … }
template <typename Function>
base::Status PerfettoSqlEngine::RegisterSqliteWindowFunction(
const char* name,
int argc,
typename Function::Context* ctx,
bool deterministic) { … }
template <typename Function>
base::Status PerfettoSqlEngine::RegisterStaticFunction(
const char* name,
int argc,
std::unique_ptr<typename Function::Context> ctx,
bool deterministic) { … }
template <typename Function>
base::Status PerfettoSqlEngine::RegisterFunctionWithSqlite(
const char* name,
int argc,
std::unique_ptr<typename Function::Context> ctx,
bool deterministic) { … }
}
#endif