a container of attributes to be used during object's construction and in ns3::Object::Set. More...
#include <attribute-list.h>
Classes | |
struct | Attr |
Public Member Functions | |
AttributeList () | |
AttributeList (const AttributeList &o) | |
AttributeList & | operator= (const AttributeList &o) |
~AttributeList () | |
void | Set (std::string name, const AttributeValue &value) |
bool | SetFailSafe (std::string name, const AttributeValue &value) |
void | SetWithTid (TypeId tid, std::string name, const AttributeValue &value) |
void | Reset (void) |
std::string | SerializeToString (void) const |
bool | DeserializeFromString (std::string value) |
Static Public Member Functions | |
static AttributeList * | GetGlobal (void) |
Private Types | |
typedef std::vector< struct Attr > | Attrs |
typedef Attrs::iterator | Iterator |
typedef Attrs::const_iterator | CIterator |
Private Member Functions | |
bool | DoSet (struct TypeId::AttributeInfo *info, const AttributeValue ¶m) |
void | DoSetOne (Ptr< const AttributeChecker > checker, const AttributeValue ¶m) |
std::string | LookupAttributeFullNameByChecker (Ptr< const AttributeChecker > checker) const |
Private Attributes | |
Attrs | m_attributes |
Friends | |
class | ObjectBase |
a container of attributes to be used during object's construction and in ns3::Object::Set.
Definition at line 37 of file attribute-list.h.
typedef std::vector<struct Attr> ns3::AttributeList::Attrs [private] |
Definition at line 98 of file attribute-list.h.
typedef Attrs::const_iterator ns3::AttributeList::CIterator [private] |
Definition at line 100 of file attribute-list.h.
typedef Attrs::iterator ns3::AttributeList::Iterator [private] |
Definition at line 99 of file attribute-list.h.
ns3::AttributeList::AttributeList | ( | ) |
Definition at line 29 of file attribute-list.cc.
ns3::AttributeList::AttributeList | ( | const AttributeList & | o | ) |
Definition at line 32 of file attribute-list.cc.
References ns3::AttributeList::Attr::checker, m_attributes, and ns3::AttributeList::Attr::value.
ns3::AttributeList::~AttributeList | ( | ) |
Definition at line 55 of file attribute-list.cc.
bool ns3::AttributeList::DeserializeFromString | ( | std::string | value | ) |
Definition at line 204 of file attribute-list.cc.
References ns3::TypeId::AttributeInfo::checker, DoSetOne(), ns3::TypeId::LookupAttributeByFullName(), NS_FATAL_ERROR, and Reset().
bool ns3::AttributeList::DoSet | ( | struct TypeId::AttributeInfo * | info, | |
const AttributeValue & | param | |||
) | [private] |
Definition at line 123 of file attribute-list.cc.
References ns3::TypeId::AttributeInfo::checker, DoSetOne(), and ns3::StringValue::Get().
Referenced by Set(), SetFailSafe(), and SetWithTid().
void ns3::AttributeList::DoSetOne | ( | Ptr< const AttributeChecker > | checker, | |
const AttributeValue & | param | |||
) | [private] |
Definition at line 104 of file attribute-list.cc.
References ns3::AttributeList::Attr::checker, ns3::AttributeValue::Copy(), m_attributes, and ns3::AttributeList::Attr::value.
Referenced by DeserializeFromString(), and DoSet().
AttributeList * ns3::AttributeList::GetGlobal | ( | void | ) | [static] |
The global attribute container can be used to specify a set of attribute values without having to re-specify them for each object when it is created. This container is checked only during object construction and it is always checked last, after any per-object container is checked.
Definition at line 163 of file attribute-list.cc.
References ns3::TimeStepPrecision::Get().
Referenced by ns3::ObjectBase::ConstructSelf(), and ns3::AttributeTest::RunTests().
std::string ns3::AttributeList::LookupAttributeFullNameByChecker | ( | Ptr< const AttributeChecker > | checker | ) | const [private] |
Definition at line 169 of file attribute-list.cc.
References ns3::TypeId::GetAttributeChecker(), ns3::TypeId::GetAttributeFullName(), ns3::TypeId::GetAttributeN(), ns3::TypeId::GetRegistered(), ns3::TypeId::GetRegisteredN(), and NS_FATAL_ERROR.
Referenced by SerializeToString().
AttributeList & ns3::AttributeList::operator= | ( | const AttributeList & | o | ) |
Definition at line 43 of file attribute-list.cc.
References ns3::AttributeList::Attr::checker, m_attributes, Reset(), and ns3::AttributeList::Attr::value.
void ns3::AttributeList::Reset | ( | void | ) |
Clear the content of this instance.
Definition at line 158 of file attribute-list.cc.
References m_attributes.
Referenced by DeserializeFromString(), and operator=().
std::string ns3::AttributeList::SerializeToString | ( | void | ) | const |
Definition at line 188 of file attribute-list.cc.
References LookupAttributeFullNameByChecker(), and m_attributes.
void ns3::AttributeList::Set | ( | std::string | name, | |
const AttributeValue & | value | |||
) |
name | the full name of the attribute to set | |
value | the value to set |
This method checks that a attribute with the requested name exists and that the value specified is an acceptable value of that attribute. If any of these checks fails, the program terminates with a message.
Definition at line 61 of file attribute-list.cc.
References DoSet(), ns3::TypeId::LookupAttributeByFullName(), and NS_FATAL_ERROR.
bool ns3::AttributeList::SetFailSafe | ( | std::string | name, | |
const AttributeValue & | value | |||
) |
name | the full name of the attribute to set | |
value | the value to set |
Definition at line 76 of file attribute-list.cc.
References DoSet(), and ns3::TypeId::LookupAttributeByFullName().
Referenced by ns3::AttributeTest::RunTests().
void ns3::AttributeList::SetWithTid | ( | TypeId | tid, | |
std::string | name, | |||
const AttributeValue & | value | |||
) |
tid | the TypeId associated to this attribute | |
name | the name (not full!) of the attribute | |
value | the value to set |
This method checks that a attribute with the requested name exists and that the value specified is an acceptable value of that attribute. If any of these checks fails, the program terminates with a message.
Definition at line 88 of file attribute-list.cc.
References DoSet(), ns3::TypeId::GetName(), ns3::TypeId::LookupAttributeByName(), and NS_FATAL_ERROR.
Referenced by ns3::CreateObject(), and ns3::UnsafeAttributeList::GetSafe().
friend class ObjectBase [friend] |
Definition at line 93 of file attribute-list.h.
Attrs ns3::AttributeList::m_attributes [private] |
Definition at line 108 of file attribute-list.h.
Referenced by AttributeList(), ns3::ObjectBase::ConstructSelf(), DoSetOne(), operator=(), Reset(), and SerializeToString().