[Ns-bugs] [Bug 277] star topologies are painful to create

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Fri Aug 8 04:00:57 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=277


gjcarneiro at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gjcarneiro at gmail.com




------- Comment #2 from gjcarneiro at gmail.com  2008-08-08 07:00 -------
(In reply to comment #0)
> This is especially obvious when using the BridgeNetDevice/BridgeHelper.
> 
> I would like to propose adding both methods:
> std::pair<NetDeviceContainer,NetDeviceContainer> 
> CsmaHelper::InstallStar (Ptr<Node> center, const NodeContainer &terminals);
> 
> std::pair<NetDeviceContainer,NetDeviceContainer> 
> PointToPointHelper::InstallStar (Ptr<Node> center, const NodeContainer
> &terminals);
> 
> The biggest issue with this proposal is what should be the return value of
> InstallStar. As an alternative to the above proposal, we could create a
> NetDeviceContainerPair class to mirror our use of std:: containers in the
> helper API.

Personally, I would rather have two separate return values.  And of course the
way to have two output parameters in C++ is to have output reference
parameters...  So:

  void CsmaHelper::InstallStar (Ptr<Node> center, const NodeContainer
&terminals, NetDeviceContainer &outCenterDevices, NetDeviceContainer
&outTerminalDevices);

In Python, with 'direction' parameter annotations this can become:

  csma = ns3.CmsmaHelper()
  centerDevices, outerDevices = csma.InstallStar(center, terminals)


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list