Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
GoldenScientist authored Aug 14, 2019
0 parents commit cc3af01
Show file tree
Hide file tree
Showing 10 changed files with 836 additions and 0 deletions.
50 changes: 50 additions & 0 deletions Arc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* @file main.cpp
* @brief Programme principale
*
* Ce programme EST UN LOGICIEL LIBRE. Vous pouvez le redistribuer.
*/

/**
* Au dessus Doxygen-style documentation, qui facilite
* la generation des doc doxygen.
*/

#ifndef ARC_H_
#define ARC_H_

using namespace std;

typedef struct Arc {
char debut { };
int longueur { };
char fin { };
Arc();
Arc(char, int, char);
} Arc;

Arc::Arc() {
}

Arc::Arc(char d, int l, char f) :
debut(d), longueur(l), fin(f) {
}

ostream& operator<<(ostream& strm, Arc const& obj) {
return strm << obj.debut << " --[" << obj.longueur << "]--> " << obj.fin;
}

/**
* Definir une structure pour determiner si un arc est plus grad
* qu'un autre arc. Cette structure serve du troisieme argument
* pour le map des arc (veuillez voir dans "Graph_or.h").
*/
struct ArcComparer {
bool operator()(const Arc& first, const Arc& second) const {
if (first.debut == second.debut)
return first.fin < second.fin;
return first.debut < second.debut;
}
};

#endif /* ARC_H_ */
Loading

0 comments on commit cc3af01

Please sign in to comment.