Bug 2991 - ObjectFactory >> operator for recursive string description
ObjectFactory >> operator for recursive string description
Status: NEW
Product: ns-3
Classification: Unclassified
Component: core
unspecified
All All
: P3 normal
Assigned To: Peter Barnes
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-17 19:14 EDT by SEANY CAROLINY OLIVEIRA SILVA
Modified: 2018-09-20 03:13 EDT (History)
1 user (show)

See Also:


Attachments
fix (1.23 KB, patch)
2018-09-17 19:14 EDT, SEANY CAROLINY OLIVEIRA SILVA
Details | Diff
TestCase (2.14 KB, application/gzip)
2018-09-17 19:17 EDT, SEANY CAROLINY OLIVEIRA SILVA
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SEANY CAROLINY OLIVEIRA SILVA 2018-09-17 19:14:15 EDT
Created attachment 3183 [details]
fix

Hi,

We found a bug at the ObjectFactory class >> operator when parsing strings used when specifying attributes. When one class has a attribute describing another class (pointers or object factories), we may face a error.

At first, we had to change the way the code looks for the closing bracket “]”. When we have a recursive class description, we must look for the last “]” in the string. Then, when looking for the “|” character as the delimiter between different pairs of attribute name and values, we can’t just look for the next “|”, as this may belong to separate attributes of the inner class. So we use the concept of level when parsing the string, increasing the level when entering a recursive description. So we can now look for the next “|” in level 0.

You can find attached a patch which fix the error and a simulation scenario for tests.
Comment 1 SEANY CAROLINY OLIVEIRA SILVA 2018-09-17 19:17:06 EDT
Created attachment 3184 [details]
TestCase