RecordProxy class + VertexProxy and EdgeProxy. The main purpose of those Proxy objects is to control the process of updating the Index

This commit is contained in:
Marko Budiselic 2015-12-12 19:06:59 +01:00
parent 00e9fb2a63
commit 904553b712
6 changed files with 57 additions and 2 deletions

12
examples/record_proxy.cpp Normal file
View File

@ -0,0 +1,12 @@
#include <iostream>
#include "storage/vertex_proxy.hpp"
using std::cout;
using std::endl;
int main() {
VertexProxy vertex_proxy;
cout << "Record Proxy Examples" << endl;
return 0;
}

View File

@ -4,4 +4,3 @@
#include "mvcc/version_list.hpp"
#include "data_structures/skiplist/skiplist.hpp"
#include "utils/counters/atomic_counter.hpp"

9
storage/edge_proxy.hpp Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#include "record_proxy.hpp"
#include "edges.hpp"
class EdgeProxy : public RecordProxy<Edge, Edges, EdgeProxy>
{
// TODO: implementation
};

27
storage/record_proxy.hpp Normal file
View File

@ -0,0 +1,27 @@
#pragma once
#include "transactions/transaction.hpp"
#include "mvcc/version_list.hpp"
template <class T, class Store, class Derived>
class RecordProxy
{
public:
Derived update(tx::Transaction& transaction) const
{
// TODO: implementation
transaction.commit();
return nullptr;
}
void remove(tx::Transaction& transaction) const
{
// TODO: implementation
transaction.commit();
}
private:
T* record;
Store *store;
mvcc::VersionList<T> *version_list;
};

9
storage/vertex_proxy.hpp Normal file
View File

@ -0,0 +1,9 @@
#pragma once
#include "record_proxy.hpp"
#include "vertices.hpp"
class VertexProxy : public RecordProxy<Vertex, Vertices, VertexProxy>
{
// TODO: implementation
};

View File

@ -78,4 +78,3 @@ private:
SkipList<uint64_t, VertexRecord> vertices;
AtomicCounter<uint64_t> counter;
};