-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCandidateFinder.h
35 lines (30 loc) · 949 Bytes
/
CandidateFinder.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
#pragma once
#include <Candidate.h>
#include "CandidateSettings.h"
#include <cstdint>
#include <chrono>
#include <thread>
#include <mutex>
#include <vector>
#include <set>
#include <algorithm>
enum class FinderState { analyzing, ready, cancellationRequested, cancelled };
struct candidateSort final {
bool operator()(Candidate a, Candidate b) const { return a.score > b.score; }
};
class CandidateFinder {
public:
CandidateFinder(CandidateSettings settings, unsigned char* dataToAnalyze,
uint64_t dataLength);
~CandidateFinder();
FinderState finderState;
std::mutex finderStateMutex;
float analysisProgress;
std::mutex analysisProgressMutex;
CandidateSettings candidateSettings;
unsigned char* dataToAnalyze;
uint64_t dataLength;
std::vector<std::vector<float>> correlationCoefficientsForLines;
std::set<Candidate, candidateSort> candidates;
std::mutex candidatesMutex;
};