forked from bristolcrypto/SPDZ-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSummer.h
47 lines (37 loc) · 929 Bytes
/
Summer.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
// (C) 2017 University of Bristol. See License.txt
/*
* Summer.h
*
*/
#ifndef OFFLINE_SUMMER_H_
#define OFFLINE_SUMMER_H_
#include "Networking/Player.h"
#include "Tools/WaitQueue.h"
#include "Tools/time-func.h"
#include <pthread.h>
#include <vector>
using namespace std;
template<class T>
class Parallel_MAC_Check;
template<class T>
class Summer
{
int sum_players, last_sum_players, next_sum_players;
int base_player;
Parallel_MAC_Check<T>& MC;
Player* send_player;
Player* receive_player;
Timer timer;
public:
vector<T> values;
pthread_t thread;
WaitQueue<int> input_queue, output_queue;
bool stop;
int size;
WaitQueue< vector<T> > share_queue;
Summer(int sum_players, int last_sum_players, int next_sum_players,
Player* send_player, Player* receive_player, Parallel_MAC_Check<T>& MC);
~Summer();
void run();
};
#endif /* OFFLINE_SUMMER_H_ */