|
Lines 251-263
Object::AggregateObject (Ptr<Object> o)
|
Link Here
|
|---|
|
| 251 |
NS_ASSERT (CheckLoose ()); |
251 |
NS_ASSERT (CheckLoose ()); |
| 252 |
NS_ASSERT (o->CheckLoose ()); |
252 |
NS_ASSERT (o->CheckLoose ()); |
| 253 |
|
253 |
|
| 254 |
if (DoGetObject (o->GetInstanceTypeId ())) |
|
|
| 255 |
{ |
| 256 |
NS_FATAL_ERROR ("Object::AggregateObject(): " |
| 257 |
"Multiple aggregation of objects of type " << |
| 258 |
o->GetInstanceTypeId ().GetName ()); |
| 259 |
} |
| 260 |
|
| 261 |
Object *other = PeekPointer (o); |
254 |
Object *other = PeekPointer (o); |
| 262 |
// first create the new aggregate buffer. |
255 |
// first create the new aggregate buffer. |
| 263 |
uint32_t total = m_aggregates->n + other->m_aggregates->n; |
256 |
uint32_t total = m_aggregates->n + other->m_aggregates->n; |
|
Lines 274-279
Object::AggregateObject (Ptr<Object> o)
|
Link Here
|
|---|
|
| 274 |
for (uint32_t i = 0; i < other->m_aggregates->n; i++) |
267 |
for (uint32_t i = 0; i < other->m_aggregates->n; i++) |
| 275 |
{ |
268 |
{ |
| 276 |
aggregates->buffer[m_aggregates->n+i] = other->m_aggregates->buffer[i]; |
269 |
aggregates->buffer[m_aggregates->n+i] = other->m_aggregates->buffer[i]; |
|
|
270 |
if (DoGetObject (other->m_aggregates->buffer[i]->GetInstanceTypeId ())) |
| 271 |
{ |
| 272 |
NS_FATAL_ERROR ("Object::AggregateObject(): " |
| 273 |
"Multiple aggregation of objects of type " << |
| 274 |
other->m_aggregates->buffer[i]->GetInstanceTypeId ()); |
| 275 |
} |
| 277 |
UpdateSortedArray (aggregates, m_aggregates->n + i); |
276 |
UpdateSortedArray (aggregates, m_aggregates->n + i); |
| 278 |
} |
277 |
} |
| 279 |
|
278 |
|
| 280 |
- |
|
|