[Ns-developers] Bug 215 (Name List)
Mathieu Lacage
mathieu.lacage at sophia.inria.fr
Tue Jan 20 02:43:13 PST 2009
hi craig,
comments below,
On Tue, 2009-01-20 at 01:17 -0800, craigdo at ee.washington.edu wrote:
> // Add some human readable names for the devices we'll be interested in.
> // We add the names to the name space "under" the nodes we created above.
> // This has the effect of making "/Names/client/eth0" and
> "/Names/server/eth0"
> // Note that the first parameter must reference a previously named object,
> // and we have, in fact, already named objects "/Names/client" and
> // "/Names/server"
> //
> Names::Name ("/Names/client", "eth0", d.Get (0));
> Names::Name ("/Names/server", "eth0", d.Get (1));
The name of the method 'Name' on class 'Names' strikes me as utterly
confusing. How about simply 'Set' or 'Add' (I prefer the latter):
Names::Add ("/Names/client", "eth0", d.Get (0));
I think that it would also be nice to have the simpler non-hierarchical
version which is the version I thought we had originally discussed on
the list:
Names::Add ("ap", d.Get (0));
> You can look up named objects, of course. Here I install the server app on
> the node defined by its name and ditto for the client.
>
> ApplicationContainer apps = server.Install (Names::Find<Node>
> ("/Names/server"));
> apps = client.Install (Names::Find<Node> ("/Names/client"));
I would much rather prefer to see:
apps = client.Install ("/Names/client");
which means a couple of extra overloads in ApplicationContainer but,
well, it seems like a small price to pay for the convenience.
(note that this does not mean that there should not be a Find<> method,
it just means that it would be nice to not have to use it in this case)
regards,
Mathieu
>
>
More information about the Ns-developers
mailing list