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

45
src/core/string.cc Normal file
View File

@@ -0,0 +1,45 @@
#include "string.h"
namespace ns3 {
String::String ()
: m_value ()
{}
String::String (const char *value)
: m_value (value)
{}
String::String (std::string value)
: m_value (value)
{}
void
String::Set (std::string value)
{
m_value = value;
}
void
String::Set (const char *value)
{
m_value = value;
}
std::string
String::Get (void) const
{
return m_value;
}
std::ostream & operator << (std::ostream &os, const String &value)
{
os << value.Get ();
return os;
}
std::istream &operator >> (std::istream &is, String &value)
{
std::string str;
is >> str;
value = String (str);
return is;
}
VALUE_HELPER_CPP (String);
} // namespace ns3