Bug 1960

Summary: Wrong information on index range, about Node::GetDevice
Product: ns-3 Reporter: Julien Vaubourg <julien.vaubourg>
Component: documentationAssignee: Tom Henderson <tomh>
Status: RESOLVED FIXED    
Severity: minor CC: julien.vaubourg, ns-bugs, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: propose patch

Description Julien Vaubourg 2014-08-03 08:13:45 UTC
Doxygen says:

  "The indexes used by the GetDevice method start at one and end at GetNDevices ()"
  => http://www.nsnam.org/docs/release/3.19/doxygen/classns3_1_1_node.html#a5918dfd24ef632efc9a83a5f6561c76e

But with:

  nodes.Get(0)->GetDevice(nodes.Get(0)->GetNDevices())

I obtain:

  assert failed. cond="index < m_devices.size ()", msg="Device index 2 is out of range e.cc, line=136

Therefore the indexes don't end at GetNDevices(), or the documentation is not enough clear.

Cheers,
ju.
Comment 1 Tommaso Pecorella 2014-08-03 09:10:07 UTC
Created attachment 1861 [details]
propose patch

Deleted the [wrong] statement and clarified some other functions
Comment 2 Tom Henderson 2014-08-04 01:49:33 UTC
(In reply to Tommaso Pecorella from comment #1)
> Created attachment 1861 [details]
> propose patch
> 
> Deleted the [wrong] statement and clarified some other functions

Looks good to me.
Comment 3 Tommaso Pecorella 2014-08-04 02:48:49 UTC
changeset:   10853:43b9107a69a3