109 os << i->name <<
"=" << i->value->SerializeToString (i->checker);
122 std::string::size_type lbracket, rbracket;
123 lbracket = v.find (
"[");
124 rbracket = v.find (
"]");
125 if (lbracket == std::string::npos && rbracket == std::string::npos)
130 if (lbracket == std::string::npos || rbracket == std::string::npos)
134 NS_ASSERT (lbracket != std::string::npos);
135 NS_ASSERT (rbracket != std::string::npos);
136 std::string tid = v.substr (0, lbracket);
137 std::string parameters = v.substr (lbracket+1,rbracket-(lbracket+1));
139 std::string::size_type cur;
141 while (cur != parameters.size ())
143 std::string::size_type equal = parameters.find (
"=", cur);
144 if (equal == std::string::npos)
146 is.setstate (std::ios_base::failbit);
151 std::string name = parameters.substr (cur, equal-cur);
155 is.setstate (std::ios_base::failbit);
160 std::string::size_type next = parameters.find (
"|", cur);
162 if (next == std::string::npos)
164 value = parameters.substr (equal+1, parameters.size () - (equal+1));
165 cur = parameters.size ();
169 value = parameters.substr (equal+1, next - (equal+1));
176 is.setstate (std::ios_base::failbit);
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
TypeId GetTypeId(void) const
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
NS_LOG_COMPONENT_DEFINE("GrantedTimeWindowMpiInterface")
AttributeConstructionList m_parameters
Hold a value for an Attribute.
#define NS_ASSERT(condition)
CIterator End(void) const
void SetTypeId(TypeId tid)
implement the ns-3 type and attribute system
#define NS_FATAL_ERROR(msg)
fatal error handling
Callback< ObjectBase * > GetConstructor(void) const
void SetTypeId(TypeId tid)
Ptr< Object > Create(void) const
CIterator Begin(void) const
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
virtual Ptr< AttributeValue > Copy(void) const =0
bool LookupAttributeByName(std::string name, struct AttributeInformation *info) const
std::string GetName(void) const
void Set(std::string name, const AttributeValue &value)
std::list< struct Item >::const_iterator CIterator
instantiate subclasses of ns3::Object.
virtual bool DeserializeFromString(std::string value, Ptr< const AttributeChecker > checker)=0
void Construct(const AttributeConstructionList &attributes)
a base class which provides memory management and object aggregation
ATTRIBUTE_HELPER_CPP(ObjectFactory)
void Add(std::string name, Ptr< const AttributeChecker > checker, Ptr< AttributeValue > value)
a unique identifier for an interface.
static TypeId LookupByName(std::string name)