memgraph/transactions/transaction.hpp

31 lines
545 B
C++
Raw Normal View History

#ifndef MEMGRAPH_MVCC_TRANSACTION_HPP
#define MEMGRAPH_MVCC_TRANSACTION_HPP
#include <cstdlib>
2015-07-31 18:36:41 +08:00
#include <cstdint>
#include <vector>
#include "snapshot.hpp"
2015-10-04 15:47:15 +08:00
namespace tx
{
2015-07-31 18:36:41 +08:00
struct Transaction
{
Transaction(uint64_t id, Snapshot<uint64_t> snapshot)
: id(id), cid(1), snapshot(std::move(snapshot)) {}
// index of this transaction
2015-07-31 18:36:41 +08:00
uint64_t 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<uint64_t> snapshot;
};
2015-10-04 15:47:15 +08:00
}
#endif