Функции помечены как inline

This commit is contained in:
Andrei Astafev 2020-04-23 14:05:17 +03:00
parent 45fa0f4f73
commit d244c67cba
5 changed files with 20 additions and 20 deletions

View File

@ -11,32 +11,32 @@ namespace myx {
namespace redis {
Client::Client( QObject* parent ) :
MYXLIB_INLINE Client::Client( QObject* parent ) :
QObject( parent ),
d ( new ClientPrivate( this ) )
{
}
void Client::connectToHost( const QString& hostName, quint16 port )
MYXLIB_INLINE void Client::connectToHost( const QString& hostName, quint16 port )
{
d->m_socket.connectToHost( hostName, port );
}
void Client::disconnectFromHost()
MYXLIB_INLINE void Client::disconnectFromHost()
{
d->m_socket.disconnectFromHost();
}
bool Client::isConnected() const
MYXLIB_INLINE bool Client::isConnected() const
{
return( d->m_socket.state() == QAbstractSocket::ConnectedState );
}
Request* Client::sendCommand( const QByteArray& command )
MYXLIB_INLINE Request* Client::sendCommand( const QByteArray& command )
{
d->m_socket.write( command + "\r\n" );
@ -46,13 +46,13 @@ Request* Client::sendCommand( const QByteArray& command )
}
bool Client::waitForConnected( int msecs )
MYXLIB_INLINE bool Client::waitForConnected( int msecs )
{
return( d->m_socket.waitForConnected( msecs ) );
}
bool Client::waitForDisconnected( int msecs )
MYXLIB_INLINE bool Client::waitForDisconnected( int msecs )
{
return( d->m_socket.waitForDisconnected( msecs ) );
}

View File

@ -11,7 +11,7 @@ namespace myx {
namespace redis {
Lexer::Lexer( QIODevice* device, QObject* parent ) :
MYXLIB_INLINE Lexer::Lexer( QIODevice* device, QObject* parent ) :
QObject ( parent ),
m_device( device ),
m_state ( kDoingNothing ),
@ -22,7 +22,7 @@ Lexer::Lexer( QIODevice* device, QObject* parent ) :
}
void Lexer::readData()
MYXLIB_INLINE void Lexer::readData()
{
m_buffer.append( m_device->readAll() );
@ -54,7 +54,7 @@ void Lexer::readData()
} // Lexer::readData
bool Lexer::readCharacter()
MYXLIB_INLINE bool Lexer::readCharacter()
{
if ( m_buffer.isEmpty() )
{
@ -80,7 +80,7 @@ bool Lexer::readCharacter()
} // Lexer::readCharacter
bool Lexer::readUnsafeString()
MYXLIB_INLINE bool Lexer::readUnsafeString()
{
m_crlf = m_buffer.indexOf( "\r\n", m_crlf );
if ( m_crlf == -1 )
@ -107,7 +107,7 @@ bool Lexer::readUnsafeString()
} // Lexer::readUnsafeString
bool Lexer::readSafeString()
MYXLIB_INLINE bool Lexer::readSafeString()
{
if ( m_buffer.size() - m_length < 2 )
{

View File

@ -11,7 +11,7 @@ namespace myx {
namespace redis {
Parser::Parser( Lexer* lexer, QObject* parent ) :
MYXLIB_INLINE Parser::Parser( Lexer* lexer, QObject* parent ) :
QObject( parent )
{
connect( lexer, &Lexer::character, this, &Parser::readCharacter );
@ -20,7 +20,7 @@ Parser::Parser( Lexer* lexer, QObject* parent ) :
}
void Parser::readCharacter( const char c )
MYXLIB_INLINE void Parser::readCharacter( const char c )
{
switch ( c )
{
@ -40,7 +40,7 @@ void Parser::readCharacter( const char c )
}
void Parser::readUnsafeString( const QString& value )
MYXLIB_INLINE void Parser::readUnsafeString( const QString& value )
{
if ( tos().m_reply.type() == Reply::kMultiBulk )
{
@ -55,14 +55,14 @@ void Parser::readUnsafeString( const QString& value )
}
void Parser::readSafeString( const QByteArray& value )
MYXLIB_INLINE void Parser::readSafeString( const QByteArray& value )
{
tos().m_reply.value() = value;
descend();
}
void Parser::descend()
MYXLIB_INLINE void Parser::descend()
{
while ( true )
{

View File

@ -106,6 +106,6 @@ private:
} // namespace myx
Q_DECLARE_METATYPE( myx::redis::Reply )
Q_DECLARE_METATYPE( myx::redis::Reply ) // NOLINT
#endif // ifndef MYX_REDIS_REPLY_HPP_

View File

@ -15,7 +15,7 @@ namespace myx {
namespace redis {
Request::Request( QObject* parent ) :
MYXLIB_INLINE Request::Request( QObject* parent ) :
QObject( parent ),
d ( new Loop )
{
@ -23,7 +23,7 @@ Request::Request( QObject* parent ) :
}
bool Request::waitForReply( int msecs )
MYXLIB_INLINE bool Request::waitForReply( int msecs )
{
QTimer timer;
timer.setInterval( msecs );