View | Details | Raw Unified | Return to bug 1717
Collapse All | Expand All

(-)a/src/core/model/object-base.cc (-3 / +19 lines)
 Lines 75-87    Link Here 
75
          struct TypeId::AttributeInformation info = tid.GetAttribute(i);
75
          struct TypeId::AttributeInformation info = tid.GetAttribute(i);
76
          NS_LOG_DEBUG ("try to construct \""<< tid.GetName ()<<"::"<<
76
          NS_LOG_DEBUG ("try to construct \""<< tid.GetName ()<<"::"<<
77
                        info.name <<"\"");
77
                        info.name <<"\"");
78
          // is this attribute stored in this AttributeConstructionList instance ?
79
          Ptr<AttributeValue> value = attributes.Find(info.checker);
80
          // See if this attribute should not be set here in the
81
          // constructor.
78
          if (!(info.flags & TypeId::ATTR_CONSTRUCT))
82
          if (!(info.flags & TypeId::ATTR_CONSTRUCT))
79
            {
83
            {
80
              continue;
84
              // Handle this attribute if it should not be 
85
              // set here.
86
              if (value == 0)
87
                {
88
                  // Skip this attribute if it's not in the
89
                  // AttributeConstructionList.
90
                  continue;
91
                }              
92
              else
93
                {
94
                  // This is an error because this attribute is not
95
                  // settable in its constructor but is present in
96
                  // the AttributeConstructionList.
97
                  NS_FATAL_ERROR ("Attribute name="<<info.name<<" tid="<<tid.GetName () << ": initial value cannot be set using attributes");
98
                }
81
            }
99
            }
82
          bool found = false;
100
          bool found = false;
83
          // is this attribute stored in this AttributeConstructionList instance ?
84
          Ptr<AttributeValue> value = attributes.Find(info.checker);
85
          if (value != 0)
101
          if (value != 0)
86
            {
102
            {
87
              // We have a matching attribute value.
103
              // We have a matching attribute value.

Return to bug 1717