parent
0f669b0812
commit
2491615bb7
@ -0,0 +1,56 @@
|
|||||||
|
# ---> C
|
||||||
|
# Prerequisites
|
||||||
|
*.d
|
||||||
|
|
||||||
|
# Object files
|
||||||
|
*.o
|
||||||
|
*.ko
|
||||||
|
*.obj
|
||||||
|
*.elf
|
||||||
|
|
||||||
|
# Linker output
|
||||||
|
*.ilk
|
||||||
|
*.map
|
||||||
|
*.exp
|
||||||
|
|
||||||
|
# Precompiled Headers
|
||||||
|
*.gch
|
||||||
|
*.pch
|
||||||
|
|
||||||
|
# Libraries
|
||||||
|
*.lib
|
||||||
|
*.a
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
|
|
||||||
|
# Shared objects (inc. Windows DLLs)
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Executables
|
||||||
|
*.exe
|
||||||
|
*.out
|
||||||
|
*.app
|
||||||
|
*.i*86
|
||||||
|
*.x86_64
|
||||||
|
*.hex
|
||||||
|
|
||||||
|
# Debug files
|
||||||
|
*.dSYM/
|
||||||
|
*.su
|
||||||
|
*.idb
|
||||||
|
*.pdb
|
||||||
|
|
||||||
|
# Kernel Module Compile Results
|
||||||
|
*.mod*
|
||||||
|
*.cmd
|
||||||
|
.tmp_versions/
|
||||||
|
modules.order
|
||||||
|
Module.symvers
|
||||||
|
Mkfile.old
|
||||||
|
dkms.conf
|
||||||
|
|
||||||
|
#Mac
|
||||||
|
.DS_Store
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"iosfwd": "cpp"
|
"iosfwd": "cpp"
|
||||||
}
|
},
|
||||||
|
"files.autoSave": "afterDelay"
|
||||||
}
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,29 @@
|
|||||||
|
#ifndef PASSAGER_HPP
|
||||||
|
#define PASSAGER_HPP
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Wagon;
|
||||||
|
|
||||||
|
class Passager {
|
||||||
|
private :
|
||||||
|
|
||||||
|
std::string nom;
|
||||||
|
std::string prenom;
|
||||||
|
|
||||||
|
Wagon *wagonActuel;
|
||||||
|
|
||||||
|
public :
|
||||||
|
|
||||||
|
Passager(std::string nom, std::string prenom);
|
||||||
|
|
||||||
|
Wagon getWagonActuel() const;
|
||||||
|
|
||||||
|
friend std::ostream &operator<<(std::ostream &s, const Passager &p);
|
||||||
|
|
||||||
|
|
||||||
|
~Passager();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // PASSAGER_HPP
|
@ -0,0 +1,32 @@
|
|||||||
|
#include "wagon.hpp"
|
||||||
|
#include "passager.hpp"
|
||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
Wagon::Wagon(int numero)
|
||||||
|
:numero{numero}, lesPassagers{}
|
||||||
|
{}
|
||||||
|
|
||||||
|
int Wagon::ajouter(Passager& lePassager) {
|
||||||
|
if(lesPassagers.size() >= capacite) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
lesPassagers.push_back(&lePassager);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// int Wagon::enlever(const Passager& lePassager) {
|
||||||
|
// list<Passager*>::iterator it = find(lesPassagers.begin(), lesPassagers.end(), &lePassager);
|
||||||
|
// if(it == lesPassagers.end()) return 0;
|
||||||
|
// lesPassagers.remove(it);
|
||||||
|
// return 1;
|
||||||
|
// }
|
||||||
|
|
||||||
|
ostream &operator<<(ostream &s, const Wagon &w) {
|
||||||
|
s << "Wagon n° " << w.numero << " : " << w.lesPassagers.size() << " passager(s)." << endl;
|
||||||
|
s << "Reste " << w.capacite - w.lesPassagers.size() << " places(s)." << endl;
|
||||||
|
s << "Liste des passagers :\n" << w.lesPassagers << endl;
|
||||||
|
return s;
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"__bit_reference": "cpp",
|
||||||
|
"__config": "cpp",
|
||||||
|
"__debug": "cpp",
|
||||||
|
"__errc": "cpp",
|
||||||
|
"__functional_base": "cpp",
|
||||||
|
"__hash_table": "cpp",
|
||||||
|
"__locale": "cpp",
|
||||||
|
"__mutex_base": "cpp",
|
||||||
|
"__node_handle": "cpp",
|
||||||
|
"__nullptr": "cpp",
|
||||||
|
"__split_buffer": "cpp",
|
||||||
|
"__string": "cpp",
|
||||||
|
"__threading_support": "cpp",
|
||||||
|
"__tuple": "cpp",
|
||||||
|
"algorithm": "cpp",
|
||||||
|
"array": "cpp",
|
||||||
|
"atomic": "cpp",
|
||||||
|
"bit": "cpp",
|
||||||
|
"bitset": "cpp",
|
||||||
|
"cctype": "cpp",
|
||||||
|
"chrono": "cpp",
|
||||||
|
"clocale": "cpp",
|
||||||
|
"cmath": "cpp",
|
||||||
|
"complex": "cpp",
|
||||||
|
"cstdarg": "cpp",
|
||||||
|
"cstddef": "cpp",
|
||||||
|
"cstdint": "cpp",
|
||||||
|
"cstdio": "cpp",
|
||||||
|
"cstdlib": "cpp",
|
||||||
|
"cstring": "cpp",
|
||||||
|
"ctime": "cpp",
|
||||||
|
"cwchar": "cpp",
|
||||||
|
"cwctype": "cpp",
|
||||||
|
"exception": "cpp",
|
||||||
|
"functional": "cpp",
|
||||||
|
"initializer_list": "cpp",
|
||||||
|
"iomanip": "cpp",
|
||||||
|
"ios": "cpp",
|
||||||
|
"iosfwd": "cpp",
|
||||||
|
"iostream": "cpp",
|
||||||
|
"istream": "cpp",
|
||||||
|
"iterator": "cpp",
|
||||||
|
"limits": "cpp",
|
||||||
|
"list": "cpp",
|
||||||
|
"locale": "cpp",
|
||||||
|
"memory": "cpp",
|
||||||
|
"mutex": "cpp",
|
||||||
|
"new": "cpp",
|
||||||
|
"optional": "cpp",
|
||||||
|
"ostream": "cpp",
|
||||||
|
"ratio": "cpp",
|
||||||
|
"sstream": "cpp",
|
||||||
|
"stdexcept": "cpp",
|
||||||
|
"streambuf": "cpp",
|
||||||
|
"string": "cpp",
|
||||||
|
"string_view": "cpp",
|
||||||
|
"system_error": "cpp",
|
||||||
|
"tuple": "cpp",
|
||||||
|
"type_traits": "cpp",
|
||||||
|
"typeinfo": "cpp",
|
||||||
|
"unordered_map": "cpp",
|
||||||
|
"utility": "cpp",
|
||||||
|
"vector": "cpp"
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKlT+iyUK+kT/4SnKNLMtpWysE+AW/47jLSVApbEYP14crYJdPC6CeBKum9CPTqiG4s1caVUUuwCXIEdawrgSHg3SvyzwC8lHE7hQMj5tZ7dFVQy7N+k+8s3uW/lZ8JadOHmQOXcRQ4wDKlZcuihQQZpNBZgPvkCXY2CJGRLcpUTfLIXYR9T+4bXXcOXx+yv1Pql4AbJJGdrIAsYDxjZmsapprz46Mi/zmOw8aj7X+0cVsZra9/eEqd2nHOvh1lBR0fgNMgXEU4J0EKJtVYMpTtxmlHIvZRhhq5v8yG9H1dQTocDsFnjf6c3I7FZ2+qw8jG/DeofDuI7m/HIBd8DZel5xwWJD/94dSUcvlsMH/UIwIA0ej5Aet7PmIAef9mtUhuvqY9cq5KI/Q9EY3HX1gjzjAo8isx/vukWTEd2lxAiFj44nAkH5Yk5XSGcZqrjFMWGLet0to5+tm6+0DKZpAWkBgvuiBN3ytPjOhomhDHBiIufkq2HzfNAzhGIjVCMU= ia@IA
|
|
Loading…
Reference in new issue