[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 14:59:07 PDT 2008


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





------- Comment #3 from mathieu.lacage at sophia.inria.fr  2008-08-08 17:59 -------
(In reply to comment #2)

> > 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)


naively, I would have thought that this could be obtained in python with the
std::pair<> version. At worst, you could write a simple C++ wrapper which
converts the std::pair return value to a pair of arguments and is wrapped
itself to InstallStar in python. I understand that this is annoying for the
automatic wrapper generation but using input arguments in the c++ version would
force users to unconditionally create variables to hold the result while they
can conceivably ignore the return value of InstallStar when they don't need it.


-- 
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