Bug 129 - class Tcp inappropriately exports default values as part of its public API
: class Tcp inappropriately exports default values as part of its public API
Status: RESOLVED FIXED
: ns-3
internet-stack
: pre-release
: All All
: P3 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-01-25 19:07 EDT by
Modified: 2008-07-01 13:32 EDT (History)


Attachments
untested patch to fix this API (8.13 KB, patch)
2008-02-15 02:30 EDT, Tom Henderson
Details | Diff
patch tested against all tcp examples (9.58 KB, patch)
2008-02-15 10:10 EDT, Tom Henderson
Details | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-01-25 19:07:47 EDT
Suggestion by Mathieu:


> in tcp.h:
> 
> class Tcp
> {
> public:
>   Tcp (void);
>   Ptr<Socket> CreateSocket (...);
> 
>   void SetDefaultSeqSize (uint32_t seqSize);
>   ...
> protected:
>   // make it available only to subclasses
>   uint32_t GetDefaultSeqSize (void);
>   ...
> private:
>   // hide the member.
>   uint32_t m_defaultSeqSize;
> };
> 
> in tcp.cc:
> 
> static NumericDefaultValue<uint32_t> g_defaultSegSize = ...;
> 
> Tcp::Tcp (void)
>   : m_defaultSeqSize (g_defaultSeqSize)
> {}
> 
> void 
> Tcp::SetDefaultSeqSize (uint32_t seqSize)
> {
>   m_defaultSeqSize = seqSize;
> }
> uint32_t 
> Tcp::GetDefaultSeqSize (void)
> {
>   return m_defaultSeqSize;
> }


I support this in principle, but the above suggestion needs a little massaging:
 TcpSocket is not a subclass of Tcp
------- Comment #1 From 2008-02-11 00:12:51 EDT -------
Move the getters fromm protected to public.  OK to commit?
------- Comment #2 From 2008-02-15 02:30:33 EDT -------
Created an attachment (id=110) [details]
untested patch to fix this API
------- Comment #3 From 2008-02-15 10:10:05 EDT -------
Created an attachment (id=111) [details]
patch tested against all tcp examples
------- Comment #4 From 2008-04-02 15:14:08 EDT -------
The ns-3-param merge fixed this.