mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 18:13:57 +02:00
Cleanup
This commit is contained in:
parent
f7bd15f1a8
commit
8d5cbfe8fe
9 changed files with 50 additions and 99 deletions
|
@ -6,15 +6,16 @@ namespace ns3 {
|
|||
|
||||
std::ostream &operator << (std::ostream &os, const LeoLatLong &l)
|
||||
{
|
||||
os << l.latitude << ":" << l.longitude;
|
||||
os << l.label << "," << l.latitude << "," << l.longitude;
|
||||
return os;
|
||||
}
|
||||
|
||||
std::istream &operator >> (std::istream &is, LeoLatLong &l)
|
||||
{
|
||||
char c1;
|
||||
is >> l.latitude >> c1 >> l.longitude;
|
||||
if (c1 != ':')
|
||||
char c1, c2;
|
||||
is >> l.label >> c1 >> l.latitude >> c2 >> l.longitude;
|
||||
if (c1 != ',' ||
|
||||
c2 != ',')
|
||||
{
|
||||
is.setstate (std::ios_base::failbit);
|
||||
}
|
||||
|
@ -23,6 +24,7 @@ std::istream &operator >> (std::istream &is, LeoLatLong &l)
|
|||
|
||||
LeoLatLong::LeoLatLong () : latitude (0), longitude (0) {}
|
||||
LeoLatLong::LeoLatLong (double la, double lo) : latitude (la), longitude (lo) {}
|
||||
LeoLatLong::LeoLatLong (std::string label, double la, double lo) : latitude (la), longitude (lo) {}
|
||||
LeoLatLong::~LeoLatLong () {}
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue