Skip to content
Snippets Groups Projects
Commit fcfe6d36 authored by Andreas Blakli's avatar Andreas Blakli
Browse files

La til kommentarer i stoppested.h.

parent ce690516
Branches
No related tags found
No related merge requests found
...@@ -9,41 +9,50 @@ ...@@ -9,41 +9,50 @@
#include "hjelpeFunksjoner.h" #include "hjelpeFunksjoner.h"
#include "konstanter.h" #include "konstanter.h"
#include "lesData3.h" #include "lesData3.h"
//#include "stoppesteder.h"
/**
* Stoppested klasse.
*
* Har datamedlemmene:
* navn - String med navnet på stoppestedet
* indexNaboStoppene - Liste over nabostoppene sine indekser.
* antallMinutterTilNaboStopp - Liste over tiden mellom nabostoppene.
*/
class Stoppested { class Stoppested {
private: private:
HjelpeFunksjoner hjelp; HjelpeFunksjoner hjelp;
// Navnet på stoppestedet
std::string navn; std::string navn;
// Liste over nabostoppene sine indekser
std::vector<int> indexNaboStoppene; std::vector<int> indexNaboStoppene;
// Liste over tiden mellom nabostoppene
std::vector<int> antallMinutterTilNaboStopp; std::vector<int> antallMinutterTilNaboStopp;
public: public:
Stoppested(); Stoppested();
Stoppested(const std::string & navn, const bool & leggeTilTid); Stoppested(const std::string& navn, const bool& leggeTilTid);
Stoppested(const int & index, const std::string & navn); Stoppested(const int& index, const std::string& navn);
~Stoppested(); ~Stoppested();
// void ny();
void skrivData(); void skrivData();
void skrivNavn(); void skrivNavn();
void lesData(); void lesData();
std::string hentNavn(); std::string hentNavn();
void skrivDataMedNaboer(std::vector<Stoppested*> alleStoppesteder); void skrivDataMedNaboer(std::vector<Stoppested*> alleStoppesteder);
int hentTidNaboStopp(); int hentTidNaboStopp();
int hentNaboStoppIndex(const bool & siste); int hentNaboStoppIndex(const bool& siste);
void leggTilNaboStopp(const int & index, const int & minutter); void leggTilNaboStopp(const int& index, const int& minutter);
void lesTid(); void lesTid();
void leggTilIndex(const int & index); void leggTilIndex(const int& index);
void leggTilTid(const int & minutter); void leggTilTid(const int& minutter);
void slettVectorer(); void slettVectorer();
int hentIndex(); int hentIndex();
void fjernForsteNabo(); void fjernForsteNabo();
void fjernSisteNabo(); void fjernSisteNabo();
void leggTilNaboFremst(const int & index, const int & tid); void leggTilNaboFremst(const int& index, const int& tid);
void leggTilNaboBakerst(const int & index, const int & tid); void leggTilNaboBakerst(const int& index, const int& tid);
int hentAntallStoppestedVector(); int hentAntallStoppestedVector();
int hentTidForsteNabo(); int hentTidForsteNabo();
void lesFraFil(std::ifstream& inn); void lesFraFil(std::ifstream& inn);
void skrivTilFil(std::ofstream & ut); void skrivTilFil(std::ofstream& ut);
}; };
#endif //__STOPPESTED_H #endif //__STOPPESTED_H
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment