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:
parent
00e9fb2a63
commit
904553b712
12
examples/record_proxy.cpp
Normal file
12
examples/record_proxy.cpp
Normal 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;
|
||||
}
|
@ -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
9
storage/edge_proxy.hpp
Normal 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
27
storage/record_proxy.hpp
Normal 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
9
storage/vertex_proxy.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "record_proxy.hpp"
|
||||
#include "vertices.hpp"
|
||||
|
||||
class VertexProxy : public RecordProxy<Vertex, Vertices, VertexProxy>
|
||||
{
|
||||
// TODO: implementation
|
||||
};
|
@ -78,4 +78,3 @@ private:
|
||||
SkipList<uint64_t, VertexRecord> vertices;
|
||||
AtomicCounter<uint64_t> counter;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user