memgraph/transactions/transaction.hpp

29 lines
480 B
C++
Raw Normal View History

#pragma once
#include <cstdlib>
2015-07-31 18:36:41 +08:00
#include <cstdint>
#include <vector>
#include "mvcc/id.hpp"
#include "snapshot.hpp"
2015-10-04 15:47:15 +08:00
namespace tx
{
2015-07-31 18:36:41 +08:00
struct Transaction
{
Transaction(const Id& id, Snapshot<Id> snapshot)
: id(id), cid(1), snapshot(std::move(snapshot)) {}
// index of this transaction
Id id;
2015-07-07 22:18:26 +08:00
// index of the current command in the current transaction;
uint8_t cid;
// a snapshot of currently active transactions
Snapshot<Id> snapshot;
};
2015-10-04 15:47:15 +08:00
}