ns3::AttributeList Class Reference
[Attribute]

a container of attributes to be used during object's construction and in ns3::Object::Set. More...

#include <attribute-list.h>

List of all members.

Classes

struct  Attr

Public Member Functions

 AttributeList ()
 AttributeList (const AttributeList &o)
AttributeListoperator= (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 AttributeListGetGlobal (void)

Private Types

typedef std::vector< struct AttrAttrs
typedef Attrs::iterator Iterator
typedef Attrs::const_iterator CIterator

Private Member Functions

bool DoSet (struct TypeId::AttributeInfo *info, const AttributeValue &param)
void DoSetOne (Ptr< const AttributeChecker > checker, const AttributeValue &param)
std::string LookupAttributeFullNameByChecker (Ptr< const AttributeChecker > checker) const

Private Attributes

Attrs m_attributes

Friends

class ObjectBase

Detailed Description

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.


Member Typedef Documentation

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.


Constructor & Destructor Documentation

ns3::AttributeList::AttributeList (  ) 

Definition at line 29 of file attribute-list.cc.

ns3::AttributeList::AttributeList ( const AttributeList o  ) 
ns3::AttributeList::~AttributeList (  ) 

Definition at line 55 of file attribute-list.cc.


Member Function Documentation

bool ns3::AttributeList::DeserializeFromString ( std::string  value  ) 
bool ns3::AttributeList::DoSet ( struct TypeId::AttributeInfo info,
const AttributeValue param 
) [private]
void ns3::AttributeList::DoSetOne ( Ptr< const AttributeChecker checker,
const AttributeValue param 
) [private]
AttributeList * ns3::AttributeList::GetGlobal ( void   )  [static]
Returns:
the global attribute container

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]
AttributeList & ns3::AttributeList::operator= ( const AttributeList o  ) 
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 
)
Parameters:
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 
)
Parameters:
name the full name of the attribute to set
value the value to set
Returns:
true if the requested attribute exists and could be stored, false otherwise.

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 
)
Parameters:
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().


Friends And Related Function Documentation

friend class ObjectBase [friend]

Definition at line 93 of file attribute-list.h.


Member Data Documentation


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:10:09 2009 for NS-3 by  doxygen 1.6.3