memgraph/storage/model/record.hpp

32 lines
652 B
C++
Raw Normal View History

2015-07-07 22:18:26 +08:00
#ifndef MEMGRAPH_STORAGE_RECORD_HPP
#define MEMGRAPH_STORAGE_RECORD_HPP
#include <mutex>
2015-07-31 18:31:08 +08:00
#include "utils/crtp.hpp"
2015-07-07 22:18:26 +08:00
#include "sync/spinlock.hpp"
2015-07-31 18:31:08 +08:00
#include "sync/lockable.hpp"
#include "storage/model/utils/mvcc.hpp"
2015-07-07 22:18:26 +08:00
2015-07-31 18:31:08 +08:00
template <class Derived>
2015-07-07 22:18:26 +08:00
class Record
2015-07-31 18:31:08 +08:00
: public Crtp<Derived>,
public Mvcc<Derived>,
Lockable<SpinLock>
2015-07-07 22:18:26 +08:00
{
public:
2015-07-31 18:31:08 +08:00
Record(uint64_t id) : id(id) {}
2015-07-07 22:18:26 +08:00
// every node has a unique id. 2^64 = 1.8 x 10^19. that should be enough
// for a looong time :) but keep in mind that some vacuuming would be nice
// to reuse indices for deleted nodes.
uint64_t id;
private:
2015-07-31 18:31:08 +08:00
// TODO add real data here
2015-07-07 22:18:26 +08:00
};
#endif