Private virtual functions are now protected, so that sub-classes can call them if necessary (and they appear in the API doc :)

This commit is contained in:
Laurent Gomila 2012-04-04 22:33:53 +02:00
parent 1a8488bd7b
commit 8c776f33c1
10 changed files with 67 additions and 59 deletions

View file

@ -208,30 +208,11 @@ public:
Packet& operator <<(const std::wstring& data);
Packet& operator <<(const String& data);
private :
protected:
friend class TcpSocket;
friend class UdpSocket;
////////////////////////////////////////////////////////////
/// Disallow comparisons between packets
///
////////////////////////////////////////////////////////////
bool operator ==(const Packet& right) const;
bool operator !=(const Packet& right) const;
////////////////////////////////////////////////////////////
/// \brief Check if the packet can extract a given number of bytes
///
/// This function updates accordingly the state of the packet.
///
/// \param size Size to check
///
/// \return True if \a size bytes can be read from the packet
///
////////////////////////////////////////////////////////////
bool checkSize(std::size_t size);
////////////////////////////////////////////////////////////
/// \brief Called before the packet is sent over the network
///
@ -271,6 +252,27 @@ private :
////////////////////////////////////////////////////////////
virtual void onReceive(const void* data, std::size_t size);
private :
////////////////////////////////////////////////////////////
/// Disallow comparisons between packets
///
////////////////////////////////////////////////////////////
bool operator ==(const Packet& right) const;
bool operator !=(const Packet& right) const;
////////////////////////////////////////////////////////////
/// \brief Check if the packet can extract a given number of bytes
///
/// This function updates accordingly the state of the packet.
///
/// \param size Size to check
///
/// \return True if \a size bytes can be read from the packet
///
////////////////////////////////////////////////////////////
bool checkSize(std::size_t size);
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////