added support for branches and explicit transaction commit

This commit is contained in:
krangelov
2021-09-08 14:09:23 +02:00
parent 2e846cdf59
commit bcc33af36b
9 changed files with 233 additions and 91 deletions

View File

@@ -83,23 +83,11 @@ public:
return current_db->free_internal(o.as_object());
}
template<class A>
static ref<A> get_root() {
return current_db->get_root_internal();
}
template<class A>
static void set_root(ref<A> root) {
current_db->set_root_internal(root.offset);
}
template<class A>
static ref<A> safe_object2ref(object o) {
if (!current_db->is_valid_object(o, sizeof(A)))
throw pgf_error("Invalid database object");
return o;
}
static PGF_INTERNAL_DECL ref<PgfPGF> get_revision(PgfText *name);
static PGF_INTERNAL_DECL void set_revision(ref<PgfPGF> pgf);
static PGF_INTERNAL_DECL ref<PgfPGF> revision2pgf(PgfRevision revision);
static PGF_INTERNAL_DECL void link_transient_revision(ref<PgfPGF> pgf);
static PGF_INTERNAL_DECL void unlink_transient_revision(ref<PgfPGF> pgf);
PGF_INTERNAL_DECL static void sync();
@@ -112,8 +100,6 @@ private:
PGF_INTERNAL_DECL object get_root_internal();
PGF_INTERNAL_DECL void set_root_internal(object root_offset);
PGF_INTERNAL_DECL bool is_valid_object(object o, size_t bytes);
PGF_INTERNAL_DECL unsigned char* relocate(unsigned char* ptr);
friend class DB_scope;