|
Bugzilla – Full Text Bug Listing |
| Summary: | Ipv4Address API cleanup | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
| Component: | network | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | the proposed API changes and source code alignment | ||
|
Description
Tom Henderson
2008-03-17 08:58:50 UTC
Created attachment 115 [details]
the proposed API changes and source code alignment
(In reply to comment #0) > This patch proposes to remove the "HostOrder" postfix of the name of getters > and setters in Ipv4Address. Instead, all Getters and Setters are host order; > if we introduce network order getters and setters, we could perhaps qualify > those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently > there are no such methods). I think that the long method name is actually nice and descriptive so, I find it weird to make the method names less descriptive. (In reply to comment #2) > (In reply to comment #0) > > This patch proposes to remove the "HostOrder" postfix of the name of getters > > and setters in Ipv4Address. Instead, all Getters and Setters are host order; > > if we introduce network order getters and setters, we could perhaps qualify > > those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently > > there are no such methods). > > I think that the long method name is actually nice and descriptive so, I find > it weird to make the method names less descriptive. > Yes, it is more descriptive, but longer to type, and e.g. the constructor assumes host order without such a qualifier. All of the getters and setters are host order; we have network byte order methods but they are called Serialize and Deserialize and operate on a byte array. I could live with GetHostOrder and SetHostOrder if we removed redundant Set() methods already there, and removed the warnings around their usage, but it seems simpler to me to just say Set() and Get(). > > > This patch proposes to remove the "HostOrder" postfix of the name of getters
> > > and setters in Ipv4Address. Instead, all Getters and Setters are host order;
> > > if we introduce network order getters and setters, we could perhaps qualify
> > > those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently
> > > there are no such methods).
> >
> > I think that the long method name is actually nice and descriptive so, I find
> > it weird to make the method names less descriptive.
> >
>
> Yes, it is more descriptive, but longer to type, and e.g. the constructor
> assumes host order without such a qualifier. All of the getters and setters
> are host order; we have network byte order methods but they are called
> Serialize and Deserialize and operate on a byte array.
ok. That is a good point.
[ping] what is the status of this bug ? Do you still want to apply this ? [pong] I lost track of that one but yes, I still think it is valid. changeset 1763f7ac8e80 |