src/config-store/model/attribute-default-iterator.cc
changeset 7393 8c3dfe0be54d
parent 6941 9d2c79c992d7
child 7423 4655567a1cb2
--- a/src/config-store/model/attribute-default-iterator.cc	Wed Aug 03 09:42:10 2011 -0400
+++ b/src/config-store/model/attribute-default-iterator.cc	Wed Aug 03 10:04:56 2011 -0400
@@ -43,43 +43,40 @@
       bool calledStart = false;
       for (uint32_t j = 0; j < tid.GetAttributeN (); j++)
         {
-          uint32_t flags = tid.GetAttributeFlags (j);
-          if (!(flags & TypeId::ATTR_CONSTRUCT))
+          struct TypeId::AttributeInformation info = tid.GetAttribute (j);
+          if (!(info.flags & TypeId::ATTR_CONSTRUCT))
             {
               // we can't construct the attribute, so, there is no
               // initial value for the attribute
               continue;
             }
-          Ptr<const AttributeAccessor> accessor = tid.GetAttributeAccessor (j);
           //No accessor, go to next attribute
-          if (accessor == 0)
+          if (info.accessor == 0)
             {
               continue;
             }
-          if (!accessor->HasSetter ())
+          if (!info.accessor->HasSetter ())
             {
               //skip this attribute it doesn't have an setter
               continue;
             }
-          Ptr<const AttributeChecker> checker = tid.GetAttributeChecker (j);
-          if (checker == 0)
+          if (info.checker == 0)
             {
               //skip, it doesn't have a checker
               continue;
             }
-          Ptr<const AttributeValue> value = tid.GetAttributeInitialValue (j);
-          if (value == 0)
+          if (info.initialValue == 0)
             {
               //No value, check next attribute
               continue;
             }
-          Ptr<const ObjectVectorValue> vector = DynamicCast<const ObjectVectorValue> (value);
+          Ptr<const ObjectVectorValue> vector = DynamicCast<const ObjectVectorValue> (info.initialValue);
           if (vector != 0)
             {
               //a vector value, won't take it
               continue;
             }
-          Ptr<const PointerValue> pointer = DynamicCast<const PointerValue> (value);
+          Ptr<const PointerValue> pointer = DynamicCast<const PointerValue> (info.initialValue);
           if (pointer != 0)
             {
               //pointer value, won't take it
@@ -88,9 +85,9 @@
           //We take only values, no pointers or vectors
           if (!calledStart)
             {
-              StartVisitTypeId (tid.GetName ());
+              StartVisitTypeId (info.name);
             }
-          VisitAttribute (tid, tid.GetAttributeName (j), value->SerializeToString (checker), j);
+          VisitAttribute (tid, info.name, info.initialValue->SerializeToString (info.checker), j);
           calledStart = true;
         }
       if (calledStart)