parent
d2ed94c3ed
commit
cea2ad2d50
@ -0,0 +1,40 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include "Contact3.hpp"
|
||||||
|
#include <list>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
using namespace reseau2;
|
||||||
|
|
||||||
|
list<const Personne*> ListeContact::getValue() {
|
||||||
|
return personnes;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ListeContact::ajtContact(const Personne& p) {
|
||||||
|
personnes.push_back(&p);
|
||||||
|
}
|
||||||
|
|
||||||
|
LiaisonPersonne::LiaisonPersonne(const Personne *envoyeur, const Personne *destinataire) : envoyeur(envoyeur), destinataire(destinataire) {}
|
||||||
|
|
||||||
|
const Personne* LiaisonPersonne::getEnvoyeur() const {
|
||||||
|
return envoyeur;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Personne* LiaisonPersonne::getDestinataire() const {
|
||||||
|
return destinataire;
|
||||||
|
}
|
||||||
|
|
||||||
|
Conteneur::Conteneur(Personne *pers) : pers(pers) {}
|
||||||
|
|
||||||
|
std::list<const Personne*> Conteneur::getValue() {
|
||||||
|
cout << "test";
|
||||||
|
std::list<const Personne*> liste;
|
||||||
|
for (const LiaisonPersonne& liaisonPersonne : personnes) {
|
||||||
|
liste.push_back(liaisonPersonne.getDestinataire());
|
||||||
|
}
|
||||||
|
return liste;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Conteneur::ajtContact(const Personne& p) {
|
||||||
|
personnes.emplace_back(pers, &p);
|
||||||
|
}
|
Loading…
Reference in new issue