This repository has been archived by the owner on Nov 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutentebusiness.cpp
53 lines (36 loc) · 1.63 KB
/
utentebusiness.cpp
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
48
49
50
51
52
53
#include "utentebusiness.h"
#include<iostream>
using std::cout;
using std::endl;
UtenteBusiness::UtenteBusiness(string u,string n,string c,const list<string>& ep,const list<string>& l,const list<string>& ts,string d,string m,const map<string,Utente*>& contatti):Utente(u,n,c,ep,l,ts,d,m,contatti){}
UtenteBusiness::UtenteBusiness(string u,const Profilo& p,const Rete& r):Utente(u,p,r){}
UtenteBusiness::~UtenteBusiness(){}
map<string,vector<list<string> > > UtenteBusiness::userSearch(const DB& d, string n, string c) const{
vector<Utente*> ut=d.find(n,c);
map<string,vector<list<string> > > info_map;
vector<list<string> > tmp;
list<string> list_tmp;
for(unsigned int i=0;i<ut.size();i++){
(ut[i])->readProfilo(list_tmp);
tmp.push_back(list_tmp);
list_tmp.erase(list_tmp.begin(),list_tmp.end());
(ut[i])->readInfoList(list_tmp,"Esperienze");
tmp.push_back(list_tmp);
list_tmp.erase(list_tmp.begin(),list_tmp.end());
(ut[i])->readInfoList(list_tmp,"Lingue");
tmp.push_back(list_tmp);
list_tmp.erase(list_tmp.begin(),list_tmp.end());
(ut[i])->readInfoList(list_tmp,"Studi");
tmp.push_back(list_tmp);
map<string,vector<list<string> > >::value_type v((ut[i])->getUsername(),tmp);
info_map.insert(v);
tmp.erase(tmp.begin(),tmp.end()); // azzero tmp
list_tmp.erase(list_tmp.begin(),list_tmp.end()); //azzero list_tmp
}
return info_map;
}
void UtenteBusiness::readProfilo(list<string>& lista)const{
lista.push_back("Business");
lista.push_back(this->getUsername());
this->getProfilo()->readPf(lista);
}