Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Receptor1.hpp"
- #include <iostream>
- #include <sstream>
- using namespace std;
- Receptor::Receptor():transmisiones(), msgs_recibidos()
- {}
- Receptor::Receptor(const Receptor& rc){
- transmisiones = rc.transmisiones;
- msgs_recibidos = rc.msgs_recibidos;
- }
- Receptor::~Receptor(){
- transmisiones.~ListaPaquetes();
- msgs_recibidos.~vector();
- }
- void Receptor::clear(){
- transmisiones.clear();
- msgs_recibidos.clear();
- }
- void Receptor::add_pack(const Paquete& pq){
- transmisiones.add_pack(pq);
- }
- string Receptor::extraer_msgs(){
- string idaux;
- ostringstream os;
- while(transmisiones.esta_vacia()!=true){
- idaux = transmisiones.primer_id();
- os << transmisiones.recuperar_mensaje(idaux);
- }
- return os.str();
- }
- string Receptor::str() const{
- int dim = msgs_recibidos.size();
- ostringstream os;
- os << endl << "PAQUETES" << endl << endl << transmisiones.str() << endl << "MSGS" << endl;
- if(dim>0){
- for(unsigned i = 0; i<dim; i++){
- os << msgs_recibidos.at(i) << endl;
- }
- }
- return os.str();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement