-
Notifications
You must be signed in to change notification settings - Fork 0
/
VertexProxy.h
67 lines (51 loc) · 1.63 KB
/
VertexProxy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* UpdateFunctionDelegator, as a visitor pattern backbone, has some abstract
* methods. However, graphlab instantiates its vertices, which means
* that vertex class cannot be abstract, so UpdateFunctionDelegator cannot be a
* vertex class. As a remedy, VertexProxy's role is that of a non-abstract
* mediator between graphlab and UpdateFunctionDelegator.
*
* File: VertexProxy.h
* Author: ivek
*
* Created on January 9, 2012, 4:05 PM
*/
#ifndef VERTEXPROXY_H
#define VERTEXPROXY_H
#include "UpdateFunctionDelegator.h"
#include "graphlab.hpp"
#include <graphlab/serialization/serialization_includes.hpp>
class VertexProxy {
public:
/* Pointers to shared variables */
static gl::glshared_const<unsigned int>* M;
static gl::glshared_const<unsigned int>* K;
static gl::glshared_const<unsigned int>* N;
VertexProxy(){
};
VertexProxy(const VertexProxy& orig) {
this->essence = orig.essence->clone();
}
~VertexProxy(){
};
UpdateFunctionDelegator* getDelegator() {
return essence;
}
const UpdateFunctionDelegator* const getDelegator() const {
return essence;
}
static void initSharedData(
gl::glshared_const<unsigned int>* m,
gl::glshared_const<unsigned int>* n,
gl::glshared_const<unsigned int>* k) {
M=m;
N=n;
K=k;
}
/* Serialization - only keep the wrapper, */
void save(graphlab::oarchive& oarc) const {};
void load(graphlab::iarchive& iarc) {};
protected:
UpdateFunctionDelegator* essence;
};
#endif /* VERTEXPROXY_H */