introduce the ns3::String class, get rid of the string -> Attribute implicit conversion, and get rid of MakeDataRate, port PointToPointNetDevice to Attributes

This commit is contained in:
Mathieu Lacage
2008-02-27 21:41:34 +01:00
parent 1d4187bd0f
commit 0c586271e5
31 changed files with 200 additions and 279 deletions

View File

@@ -175,15 +175,13 @@ uint64_t DataRate::GetBitRate() const
return m_bps;
}
DataRate MakeDataRate (std::string rate)
DataRate::DataRate (std::string rate)
{
uint64_t bps;
bool ok = DoParse (rate, &bps);
bool ok = DoParse (rate, &m_bps);
if (!ok)
{
NS_FATAL_ERROR ("Could not parse rate.");
NS_FATAL_ERROR ("Could not parse rate: "<<rate);
}
return DataRate (bps);
}
std::ostream &operator << (std::ostream &os, const DataRate &rate)

View File

@@ -58,6 +58,7 @@ public:
* non-trivial bitrate availiable.
*/
DataRate (uint64_t bps);
DataRate (std::string rate);
bool operator < (const DataRate& rhs) const;
bool operator <= (const DataRate& rhs) const;
@@ -87,8 +88,6 @@ private:
static uint64_t Parse(const std::string);
};
DataRate MakeDataRate (std::string rate);
std::ostream &operator << (std::ostream &os, const DataRate &rate);
std::istream &operator >> (std::istream &is, DataRate &rate);