-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndexeDeque.h
41 lines (35 loc) · 888 Bytes
/
IndexeDeque.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
#ifndef INDEXEDEQUE_H_INCLUDED
#define INDEXEDEQUE_H_INCLUDED
#include "Indexe.h"
#include <deque>
#include <vector>
#include "Stat.h"
class IndexeDeque:public Indexe{
public:
deque<Stat> Data;
void addStats(vector<Stat> data) ;
vector<Stat> getStats(string word) ;
vector<Stat> getAllStats();
};
void IndexeDeque::addStats(vector<Stat> data){
for (Stat stat:data){
Data.push_back(stat);
}
}
vector<Stat> IndexeDeque::getStats(string word){
vector<Stat> resultat;
for (auto it = Data.cbegin();it!=Data.end();++it){
if(it->mot == word){
resultat.push_back(*it);
}
}
return resultat;
}
vector<Stat> IndexeDeque::getAllStats(){
vector<Stat> resultat;
for (auto it = Data.cbegin();it!=Data.end();++it){
resultat.push_back(*it);
}
return resultat;
}
#endif // INDEXEDEQUE_H_INCLUDED