diff options
| author | Cristian Cadar <c.cadar@imperial.ac.uk> | 2023-12-14 22:15:57 +0000 |
|---|---|---|
| committer | MartinNowack <2443641+MartinNowack@users.noreply.github.com> | 2024-01-12 12:00:35 +0000 |
| commit | 2c8b74cc858793c94e5476b5765e93ee23738702 (patch) | |
| tree | 8d4005084ef0ae0f2d7eb72333855e15526ace25 /lib/Core/ExecutionTreeWriter.h | |
| parent | 5ca8f5a020cca251a0d5d08bc855bf945735c1af (diff) | |
| download | klee-2c8b74cc858793c94e5476b5765e93ee23738702.tar.gz | |
Rename files from PTree to ExecutionTree (and similar)
Diffstat (limited to 'lib/Core/ExecutionTreeWriter.h')
| -rw-r--r-- | lib/Core/ExecutionTreeWriter.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/Core/ExecutionTreeWriter.h b/lib/Core/ExecutionTreeWriter.h new file mode 100644 index 00000000..12709116 --- /dev/null +++ b/lib/Core/ExecutionTreeWriter.h @@ -0,0 +1,46 @@ +//===-- PTreeWriter.h -------------------------------------------*- C++ -*-===// +// +// The KLEE Symbolic Virtual Machine +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#pragma once + +#include <sqlite3.h> + +#include <cstdint> +#include <string> + +namespace klee { +class AnnotatedPTreeNode; + +/// @brief Writes process tree nodes into an SQLite database +class PTreeWriter { + friend class PersistentPTree; + + ::sqlite3 *db{nullptr}; + ::sqlite3_stmt *insertStmt{nullptr}; + ::sqlite3_stmt *transactionBeginStmt{nullptr}; + ::sqlite3_stmt *transactionCommitStmt{nullptr}; + std::uint32_t batch{0}; + bool flushed{true}; + + /// Writes nodes in batches + void batchCommit(bool force = false); + +public: + explicit PTreeWriter(const std::string &dbPath); + ~PTreeWriter(); + PTreeWriter(const PTreeWriter &other) = delete; + PTreeWriter(PTreeWriter &&other) noexcept = delete; + PTreeWriter &operator=(const PTreeWriter &other) = delete; + PTreeWriter &operator=(PTreeWriter &&other) noexcept = delete; + + /// Write new node into database + void write(const AnnotatedPTreeNode &node); +}; + +} // namespace klee |
