2015-09-13 17:34:17 +08:00
|
|
|
#ifndef MEMGRAPH_MVCC_TRANSACTION_HPP
|
|
|
|
#define MEMGRAPH_MVCC_TRANSACTION_HPP
|
2015-07-04 17:51:33 +08:00
|
|
|
|
|
|
|
#include <cstdlib>
|
2015-07-31 18:36:41 +08:00
|
|
|
#include <cstdint>
|
2015-07-04 17:51:33 +08:00
|
|
|
#include <vector>
|
|
|
|
|
2015-10-08 06:58:29 +08:00
|
|
|
#include "snapshot.hpp"
|
|
|
|
|
2015-10-04 15:47:15 +08:00
|
|
|
namespace tx
|
|
|
|
{
|
2015-07-31 18:36:41 +08:00
|
|
|
|
2015-07-04 17:51:33 +08:00
|
|
|
struct Transaction
|
|
|
|
{
|
2015-10-08 06:58:29 +08:00
|
|
|
Transaction(uint64_t id, Snapshot<uint64_t> snapshot)
|
|
|
|
: id(id), cid(1), snapshot(std::move(snapshot)) {}
|
2015-07-04 17:51:33 +08:00
|
|
|
|
|
|
|
// index of this transaction
|
2015-07-31 18:36:41 +08:00
|
|
|
uint64_t id;
|
2015-07-04 17:51:33 +08:00
|
|
|
|
2015-07-07 22:18:26 +08:00
|
|
|
// index of the current command in the current transaction;
|
|
|
|
uint8_t cid;
|
|
|
|
|
2015-10-08 06:58:29 +08:00
|
|
|
// a snapshot of currently active transactions
|
|
|
|
Snapshot<uint64_t> snapshot;
|
2015-07-04 17:51:33 +08:00
|
|
|
};
|
|
|
|
|
2015-10-04 15:47:15 +08:00
|
|
|
}
|
|
|
|
|
2015-07-04 17:51:33 +08:00
|
|
|
#endif
|