renamed bytesQueued() to queued()

This commit is contained in:
Emiel Bruijntjes 2018-04-01 22:34:15 +02:00
parent 0eb14c9756
commit b26058f3e2
7 changed files with 33 additions and 21 deletions

View File

@ -122,12 +122,6 @@ public:
*/
int fileno() const;
/**
* The number of outgoing bytes queued on this connection.
* @return size_t
*/
size_t bytesQueued() const;
/**
* Process the TCP connection
*
@ -161,7 +155,7 @@ public:
}
/**
* The max frame size
* The max frame size. Useful if you set up a buffer to parse incoming data: it does not have to exceed this size.
* @return uint32_t
*/
uint32_t maxFrame() const
@ -170,7 +164,7 @@ public:
}
/**
* The number of bytes that can best be passed to the next call to the parse() method
* The number of bytes that can best be passed to the next call to the parse() method.
* @return uint32_t
*/
uint32_t expected() const
@ -179,7 +173,7 @@ public:
}
/**
* Return the amount of channels this connection has
* Return the number of channels this connection has.
* @return std::size_t
*/
std::size_t channels() const
@ -187,6 +181,12 @@ public:
// return the amount of channels this connection has
return _connection.channels();
}
/**
* The number of outgoing bytes queued on this connection.
* @return std::size_t
*/
std::size_t queued() const;
/**
* Send a heartbeat

View File

@ -337,11 +337,11 @@ public:
virtual int fileno() const override { return _socket; }
/**
* The number of outgoing bytes queued on this connection.
* @return size_t
* Number of bytes in the outgoing buffer
* @return std::size_t
*/
virtual size_t bytesQueued() const { return _out.size(); }
virtual std::size_t queued() const override { return _out.size(); }
/**
* Process the filedescriptor in the object
* @param monitor Object that can be used to find out if connection object is still alive

View File

@ -171,6 +171,12 @@ public:
* @return int
*/
virtual int fileno() const override { return _socket; }
/**
* Number of bytes in the outgoing buffer
* @return std::size_t
*/
virtual std::size_t queued() const override { return _out.size(); }
/**
* Process the filedescriptor in the object

View File

@ -159,10 +159,10 @@ public:
virtual int fileno() const override { return _socket; }
/**
* The number of outgoing bytes queued on this connection.
* @return size_t
* Number of bytes in the outgoing buffer
* @return std::size_t
*/
virtual size_t bytesQueued() const { return _out.size(); }
virtual std::size_t queued() const override { return _out.size(); }
/**
* Process the filedescriptor in the object

View File

@ -45,11 +45,11 @@ int TcpConnection::fileno() const
/**
* The number of outgoing bytes queued on this connection.
* @return size_t
* @return std::size_t
*/
size_t TcpConnection::bytesQueued() const
std::size_t TcpConnection::queued() const
{
return _state->bytesQueued();
return _state->queued();
}
/**

View File

@ -184,6 +184,12 @@ public:
_thread.join();
}
/**
* Number of bytes in the outgoing buffer
* @return std::size_t
*/
virtual std::size_t queued() const override { return _buffer.size(); }
/**
* Proceed to the next state
* @return TcpState *

View File

@ -4,7 +4,7 @@
* Base class / interface of the various states of the TCP connection
*
* @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
* @copyright 2015 - 2016 Copernica BV
* @copyright 2015 - 2018 Copernica BV
*/
/**
@ -67,7 +67,7 @@ public:
* The number of outgoing bytes queued on this connection.
* @return size_t
*/
virtual size_t bytesQueued() const { return 0; }
virtual std::size_t queued() const { return 0; }
/**
* Process the filedescriptor in the object