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:
45
src/core/string.cc
Normal file
45
src/core/string.cc
Normal 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
|
||||
Reference in New Issue
Block a user