|
Bugzilla – Full Text Bug Listing |
| Summary: | class Tcp inappropriately exports default values as part of its public API | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Tom Henderson <tomh> |
| Component: | internet | Assignee: | ns-bugs <ns-bugs> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
untested patch to fix this API
patch tested against all tcp examples |
||
Move the getters fromm protected to public. OK to commit? Created attachment 110 [details]
untested patch to fix this API
Created attachment 111 [details]
patch tested against all tcp examples
The ns-3-param merge fixed this. |
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