-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReducer.cpp
More file actions
41 lines (36 loc) · 750 Bytes
/
Reducer.cpp
File metadata and controls
41 lines (36 loc) · 750 Bytes
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
#ifndef REDUCER_CPP_
#define REDUCER_CPP_
#include "Reducer.h"
template <class T, typename S>
Reducer<T,S>::Reducer (Partition<T,S> * p_partition)
{
partition = p_partition;
}
template <class T, typename S>
void Reducer<T,S>::execute ()
{
printf ("Launching Reducer Sort Engine...\n");
partition->sort();
printf ("Reducer Sort Engine Terminated...\n");
}
template <class T, typename S>
void Reducer<T,S>::start (Reducer<T,S> * me)
{
me->execute();
}
template <class T, typename S>
void Reducer<T,S>::setThread(std::thread * p_th)
{
th = p_th;
}
template <class T, typename S>
void Reducer<T,S>::waitForRunToFinish()
{
th->join();
}
template <class T, typename S>
Reducer<T,S>::~Reducer ()
{
delete(th);
}
#endif