-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProcessedFiles.h
33 lines (29 loc) · 1.03 KB
/
ProcessedFiles.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
#ifndef PROCESSEDFILES_H
#define PROCESSEDFILES_H
#include <mutex>
#include <vector>
#include <string>
#include "Lock.h"
#define CYCLIC 1
#define INSTR 2
#define GOOD 3
//------------------------------------------------------------------------------
class ProcessedFilesProtected {
private:
std::mutex m;
/* Vector con los resultados de cada ejecuccion de los hilos. */
std::vector<std::string> results;
public:
/* Constructor */
ProcessedFilesProtected();
/* Destructor */
~ProcessedFilesProtected();
/* Recibe un numero segun cual fue el resultado(constantes CYCLIC,
INSTR, GOOD) y el nombre del archivo que obtuvo ese resultado.
Guarda en el vector de resultados un string con el nombre del archivo
y la frase que se deba imprimir segun cual sea el resultado.*/
void addResult(int threadResult, std::string& fileName);
/* Devuelve el vector con los resultados. */
std::vector<std::string> getResult();
};
#endif