Create command line options for orbit trace

This commit is contained in:
Tim Schubert 2020-08-23 19:37:40 +02:00
parent f214b48dbf
commit b7f459e36a
10 changed files with 266 additions and 97 deletions

29
model/leo-orbit.cc Normal file
View file

@ -0,0 +1,29 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
#include "leo-orbit.h"
namespace ns3 {
std::ostream &operator << (std::ostream &os, const LeoOrbit &orbit)
{
os << orbit.alt << ":" << orbit.inc << ":" << orbit.planes << ":" << orbit.sats;
return os;
}
std::istream &operator >> (std::istream &is, LeoOrbit &orbit)
{
char c1, c2, c3;
is >> orbit.alt >> c1 >> orbit.inc >> c2 >> orbit.planes >> c3 >> orbit.sats;
if (c1 != ':' ||
c2 != ':' ||
c3 != ':')
{
is.setstate (std::ios_base::failbit);
}
return is;
}
LeoOrbit::LeoOrbit () : alt (0), inc (0), planes (0), sats (0) {}
LeoOrbit::~LeoOrbit () {}
};