[Ns-developers] ns-3.4 proposal: Object Name Service
Raj Bhattacharjea
raj.b at gatech.edu
Wed Jan 21 15:05:14 PST 2009
On Wed, Jan 21, 2009 at 2:54 PM, Raj Bhattacharjea <raj.b at gatech.edu> wrote:
> Craig has prepared a branch for an "object name service". The idea
> grew out of the fact that people wanted to be able to refer to nodes
> in their simulation by string names, and then extended from also
> naming NetDevices to finally being able to name all Objects in the
> system.
Good work Craig. My comments follow.
1. I'd propose a name/parameter refactoring change like:
- Names::Add (std::string, Ptr<Object>);
+ Names::NameObject(Ptr<Object>, std::string)
This would follow the verb+object function naming scheme. I propose
that all the "Add" methods are thus renamed and reordered such that
the object being named comes first, followed by its name, followed by
the context if necessary.
2. I propose some syntactic sugar, hiding the above API from the user;
essentially, a new Object base class API like
Object::AssignName(std::string); this makes things less verbose and
leads to changes like:
- Names::Add ("/Names/client", n.Get (0));
- Names::Add ("/Names/server", n.Get (1));
+ n.Get (0)->AssignName("/Names/client");
+ n.Get (1)->AssignName("/Names/server");
Patch attached
--
Raj Bhattacharjea
Georgia Institute of Technology
School of Electrical and Computer Engineering
Ph.D. Candidate
Systems Analyst
404.894.2955
-------------- next part --------------
A non-text attachment was scrubbed...
Name: names.patch
Type: text/x-diff
Size: 8268 bytes
Desc: not available
Url : http://mailman.isi.edu/pipermail/ns-developers/attachments/20090121/2c830ea1/names.bin
More information about the Ns-developers
mailing list