memgraph/storage/cursor.hpp
Dominik Tomičević 694d3363d6 Merged record accessor
2016-02-12 18:43:56 +01:00

35 lines
619 B
C++

#pragma once
#include "transactions/transaction.hpp"
#include "mvcc/version_list.hpp"
#include "storage/model/properties/property.hpp"
#include "storage/vertex.hpp"
template <class Accessor, class It, class Derived>
class Cursor : public Crtp<Derived>
{
public:
Cursor(Accessor&& accessor, It item, tx::Transaction& t)
: accessor(accessor), item(item), t(t)
{
}
Derived& operator++()
{
++item;
return this->derived();
}
Derived& operator++(int)
{
return operator++();
}
protected:
Accessor accessor;
tx::Transaction& t;
It item;
};