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:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user