Bugzilla – Bug 129
class Tcp inappropriately exports default values as part of its public API
Last modified: 2008-07-01 13:32:22 UTC
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
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.