2020-02-09 13:28:03 +01:00
|
|
|
|
/*
|
|
|
|
|
Fernando M<EFBFBD>ndez
|
|
|
|
|
https://fernmend.ddns.net
|
|
|
|
|
C++ | Clases y memoria din<EFBFBD>mica.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-08 20:32:39 +01:00
|
|
|
|
#ifndef _LISTA
|
|
|
|
|
#define _LISTA
|
|
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <conio.h>
|
|
|
|
|
#include "persona.h"
|
|
|
|
|
|
2020-02-09 13:28:03 +01:00
|
|
|
|
class ListaPersonas{
|
|
|
|
|
public:
|
|
|
|
|
//Constructoras:
|
|
|
|
|
ListaPersonas();
|
|
|
|
|
ListaPersonas(int);
|
2020-02-08 20:32:39 +01:00
|
|
|
|
|
2020-02-09 13:28:03 +01:00
|
|
|
|
//M<>todos p<>blicos:
|
|
|
|
|
void liberar(); //Libera la memoria din<69>mica.
|
|
|
|
|
void agregar(); //A<>ade objectos de la clase Persona a la lista.
|
|
|
|
|
void mostrar(); //Muestra la lista de personas.
|
2020-02-08 20:32:39 +01:00
|
|
|
|
|
2020-02-09 13:28:03 +01:00
|
|
|
|
private:
|
|
|
|
|
//Atributos:
|
|
|
|
|
Persona** _persona;
|
|
|
|
|
int _capacidad, _contador;
|
2020-02-08 20:32:39 +01:00
|
|
|
|
|
2020-02-09 13:28:03 +01:00
|
|
|
|
//M<>todos privados:
|
|
|
|
|
void ampliar(); //Amplia la lista en caso de que se alcance la m<>xima capacidad.
|
|
|
|
|
bool salir(); //Lee una tecla. Si es "ESC", devuleve true (false en caso contratio).
|
|
|
|
|
|
|
|
|
|
};
|
2020-02-08 20:32:39 +01:00
|
|
|
|
|
2020-02-09 13:28:03 +01:00
|
|
|
|
#endif // !_LISTA
|