TypeId::GetAttributeListN -> TypeId::GetAttributeN

This commit is contained in:
Mathieu Lacage
2008-03-21 13:41:16 -07:00
parent 048ffbe7d3
commit 18c92e855d
7 changed files with 16 additions and 16 deletions

View File

@@ -308,14 +308,14 @@ Packet::Print (std::ostream &os) const
Chunk *chunk = dynamic_cast<Chunk *> (instance);
NS_ASSERT (chunk != 0);
chunk->Deserialize (item.current);
for (uint32_t j = 0; j < item.tid.GetAttributeListN (); j++)
for (uint32_t j = 0; j < item.tid.GetAttributeN (); j++)
{
std::string attrName = item.tid.GetAttributeName (j);
std::string value;
bool ok = chunk->GetAttribute (attrName, value);
NS_ASSERT (ok);
os << attrName << "=" << value;
if ((j + 1) < item.tid.GetAttributeListN ())
if ((j + 1) < item.tid.GetAttributeN ())
{
os << ",";
}

View File

@@ -171,7 +171,7 @@ AttributeList::LookupAttributeFullNameByChecker (Ptr<const AttributeChecker> che
for (uint32_t i = 0; i < TypeId::GetRegisteredN (); i++)
{
TypeId tid = TypeId::GetRegistered (i);
for (uint32_t j = 0; j < tid.GetAttributeListN (); j++)
for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
{
if (checker == tid.GetAttributeChecker (j))
{

View File

@@ -124,7 +124,7 @@ CommandLine::PrintAttributes (std::string type) const
{
NS_FATAL_ERROR ("Unknown type="<<type<<" in --PrintAttributes");
}
for (uint32_t i = 0; i < tid.GetAttributeListN (); ++i)
for (uint32_t i = 0; i < tid.GetAttributeN (); ++i)
{
std::cout << " --"<<tid.GetAttributeFullName (i)<<"=[";
Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (i);

View File

@@ -36,8 +36,8 @@ ObjectBase::ConstructSelf (const AttributeList &attributes)
TypeId tid = GetInstanceTypeId ();
do {
// loop over all attributes in object type
NS_LOG_DEBUG ("construct tid="<<tid.GetName ()<<", params="<<tid.GetAttributeListN ());
for (uint32_t i = 0; i < tid.GetAttributeListN (); i++)
NS_LOG_DEBUG ("construct tid="<<tid.GetName ()<<", params="<<tid.GetAttributeN ());
for (uint32_t i = 0; i < tid.GetAttributeN (); i++)
{
Ptr<const AttributeAccessor> paramSpec = tid.GetAttributeAccessor (i);
Attribute initial = tid.GetAttributeInitialValue (i);

View File

@@ -54,7 +54,7 @@ public:
ns3::Attribute initialValue,
ns3::Ptr<const ns3::AttributeAccessor> spec,
ns3::Ptr<const ns3::AttributeChecker> checker);
uint32_t GetAttributeListN (uint16_t uid) const;
uint32_t GetAttributeN (uint16_t uid) const;
std::string GetAttributeName (uint16_t uid, uint32_t i) const;
std::string GetAttributeHelp (uint16_t uid, uint32_t i) const;
uint32_t GetAttributeFlags (uint16_t uid, uint32_t i) const;
@@ -263,7 +263,7 @@ IidManager::AddAttribute (uint16_t uid,
uint32_t
IidManager::GetAttributeListN (uint16_t uid) const
IidManager::GetAttributeN (uint16_t uid) const
{
struct IidInformation *information = LookupInformation (uid);
return information->attributes.size ();
@@ -438,7 +438,7 @@ TypeId::LookupAttributeByName (std::string name, struct TypeId::AttributeInfo *i
TypeId nextTid = *this;
do {
tid = nextTid;
for (uint32_t i = 0; i < tid.GetAttributeListN (); i++)
for (uint32_t i = 0; i < tid.GetAttributeN (); i++)
{
std::string paramName = tid.GetAttributeName (i);
if (paramName == name)
@@ -548,9 +548,9 @@ TypeId::MustHideFromDocumentation (void) const
}
uint32_t
TypeId::GetAttributeListN (void) const
TypeId::GetAttributeN (void) const
{
uint32_t n = Singleton<IidManager>::Get ()->GetAttributeListN (m_tid);
uint32_t n = Singleton<IidManager>::Get ()->GetAttributeN (m_tid);
return n;
}
std::string

View File

@@ -139,7 +139,7 @@ public:
/**
* \returns the number of attributes associated to this TypeId
*/
uint32_t GetAttributeListN (void) const;
uint32_t GetAttributeN (void) const;
/**
* \param i index into attribute array
* \returns the name associated to the attribute whose

View File

@@ -7,7 +7,7 @@ void
PrintAttributes (TypeId tid, std::ostream &os)
{
os << "<ul>"<<std::endl;
for (uint32_t j = 0; j < tid.GetAttributeListN (); j++)
for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
{
os << "<li><b>" << tid.GetAttributeName (j) << "</b>: "
<< tid.GetAttributeHelp (j) << std::endl;
@@ -52,7 +52,7 @@ int main (int argc, char *argv[])
}
std::cout << "\\fn static TypeId " << tid.GetName () << "::GetTypeId (void)" << std::endl;
std::cout << "\\brief This method returns the TypeId associated to \\ref " << tid.GetName () << std::endl << std::endl;
if (tid.GetAttributeListN () == 0)
if (tid.GetAttributeN () == 0)
{
std::cout << "No Attributes defined for this type." << std::endl;
}
@@ -65,7 +65,7 @@ int main (int argc, char *argv[])
TypeId tmp = tid.GetParent ();
while (tmp.GetParent () != tmp)
{
if (tmp.GetAttributeListN () != 0)
if (tmp.GetAttributeN () != 0)
{
hasAttributesInParent = true;
}
@@ -77,7 +77,7 @@ int main (int argc, char *argv[])
tmp = tid.GetParent ();
while (tmp.GetParent () != tmp)
{
if (tmp.GetAttributeListN () != 0)
if (tmp.GetAttributeN () != 0)
{
std::cout << tmp.GetName () << std::endl;
PrintAttributes (tmp, std::cout);