forked from data61/MP-SPDZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Access.h
48 lines (38 loc) · 762 Bytes
/
Access.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
/*
* Access.h
*
*/
#ifndef GC_ACCESS_H_
#define GC_ACCESS_H_
#include "Clear.h"
namespace GC
{
template <class T>
class ReadAccess
{
public:
T& dest;
const Clear address;
const int length;
ReadAccess(T& dest, Clear address, int length, size_t& complexity) :
dest(dest), address(address), length(length)
{
complexity += length;
}
};
template <class T>
class WriteAccess
{
public:
const T& source;
const Clear address;
WriteAccess(Clear address, const T& source) :
source(source), address(address) {}
};
struct ClearWriteAccess
{
const Clear address, value;
ClearWriteAccess(Clear address, Clear value) : address(address), value(value) {}
};
} /* namespace GC */
#endif /* GC_ACCESS_H_ */