Bug 2991

Summary: ObjectFactory >> operator for recursive string description
Product: ns-3 Reporter: SEANY CAROLINY OLIVEIRA SILVA <seany>
Component: coreAssignee: Peter Barnes <pdbarnes>
Status: NEW ---    
Severity: normal CC: ns-bugs
Priority: P3    
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://www.nsnam.org/bugzilla/show_bug.cgi?id=2586
Attachments: fix

Description SEANY CAROLINY OLIVEIRA SILVA 2018-09-17 19:14:15 EDT
Created attachment 3183 [details]


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]