[Ns-bugs] [Bug 1084] MgtProbeRequestHeader::SetSupportedRates: operator= missing?
code at nsnam.ece.gatech.edu
Sun Jul 3 18:25:26 PDT 2011
--- Comment #5 from Dean Armstrong <deanarm at gmail.com> 2011-07-03 21:25:25 EDT ---
Created attachment 1184
First draft of a proposed fix for this bug
I've attempted to address this bug in the attached patch by taking the approach
Mathieu suggested of trying to separate storage of the supported rates from the
Information Element classes.
I think I've addressed Mathieu's (2) and (3) from comment #4 - there is no
longer a circular dependency, nor are there any public data members.
The new SupportedRatesIE and ExtendedSupportedRatesIE classes are friends of
SupportedRates, so if friend classes are bad (Mathieu's item (4); regrettably I
need to be educated on the reasons) then I could extend the SupportedRates
interface so that the requirements of the SupportedRatesIE and
ExtendedSupportedRatesIE classes can be met through the SupportedRates public
API. If this is preferred it isn't a major job.
With regard to Mathieu's item (1), there's still a pointer to a SupportedRates
object being passed in and stored on construction of the SupportedRatesIE and
ExtendedSupportedRatesIE objects. I want to argue that this is okay because
these objects are not being used properly if they are being copied and, in
fact, their lifespan should be very short - they are intended to be created in
order to serialise or deserialise the relevant IE, and destroyed thereafter.
There is, of course, nothing that enforces this usage, and I suppose this
approach may be contentious.
In general, I think the cleanliness of this all is constrained by the fact that
the WifiInformationElement API was not obviously designed to support storage
and (de)serialisation related to IEs being split across multiple classes.
I'd appreciate comment on my patch and on alternate approaches from any and all
who have opinions on the cleanest way to do this (especially you two, Mathieu
Configure bugmail: https://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Ns-bugs