Skip to content

Commit

Permalink
Clang tidy warning fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fanda Vacek committed Jan 29, 2024
1 parent 24b97d8 commit 097fea6
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion libshvchainpack/include/shv/chainpack/rpcdriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SHVCHAINPACK_DECL_EXPORT RpcDriver
protected:
virtual bool isOpen() = 0;

virtual void writeFrameData(std::string &&frame_data) = 0;
virtual void writeFrameData(const std::string &frame_data) = 0;
/// call it when new data arrived
virtual void onFrameDataRead(std::string &&frame_data);

Expand Down
2 changes: 1 addition & 1 deletion libshvchainpack/include/shv/chainpack/socketrpcdriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SHVCHAINPACK_DECL_EXPORT SocketRpcDriver : public RpcDriver
void sendNotify(std::string &&method, const RpcValue &result);
protected:
bool isOpen() override;
void writeFrameData(std::string &&frame_data) override;
void writeFrameData(const std::string &frame_data) override;

virtual void idleTaskOnSelectTimeout();
private:
Expand Down
4 changes: 2 additions & 2 deletions libshvchainpack/src/chainpack/rpcdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void RpcDriver::sendRpcMessage(const RpcMessage &msg)
logRpcRawMsg() << SND_LOG_ARROW << msg.toPrettyString();
auto frame_data = msg.toChainPack();
logRpcData() << "SEND data:" << Utils::toHex(frame_data, 0, 250);
writeFrameData(std::move(frame_data));
writeFrameData(frame_data);
}

void RpcDriver::sendRpcFrame(RpcFrame &&frame)
Expand All @@ -42,7 +42,7 @@ void RpcDriver::sendRpcFrame(RpcFrame &&frame)
<< Utils::toHex(frame.data, 0, 250);
auto frame_data = frame.toChainPack();
logRpcData() << "SEND data:" << Utils::toHex(frame_data, 0, 250);
writeFrameData(std::move(frame_data));
writeFrameData(frame_data);
}

void RpcDriver::onFrameDataRead(std::string &&frame_data)
Expand Down
2 changes: 1 addition & 1 deletion libshvchainpack/src/chainpack/socketrpcdriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void SocketRpcDriver::idleTaskOnSelectTimeout()
{
}

void SocketRpcDriver::writeFrameData(std::string &&frame_data)
void SocketRpcDriver::writeFrameData(const std::string &frame_data)
{
if(!isOpen()) {
nInfo() << "Write to closed socket";
Expand Down
2 changes: 1 addition & 1 deletion libshviotqt/include/shv/iotqt/rpc/localsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SHVIOTQT_DECL_EXPORT LocalSocket : public Socket
~LocalSocket() override;

std::string readFrameData() override;
void writeFrameData(std::string &&frame_data) override;
void writeFrameData(const std::string &frame_data) override;

void connectToHost(const QUrl &url) override;
void close() override;
Expand Down
2 changes: 1 addition & 1 deletion libshviotqt/include/shv/iotqt/rpc/serialportsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class SHVIOTQT_DECL_EXPORT SerialPortSocket : public Socket
SerialPortSocket(QSerialPort *port, QObject *parent = nullptr);

std::string readFrameData() override;
void writeFrameData(std::string &&frame_data) override;
void writeFrameData(const std::string &frame_data) override;

void setReceiveTimeout(int millis);

Expand Down
4 changes: 2 additions & 2 deletions libshviotqt/include/shv/iotqt/rpc/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class SHVIOTQT_DECL_EXPORT Socket : public QObject
virtual quint16 peerPort() const = 0;

virtual std::string readFrameData() = 0;
virtual void writeFrameData(std::string &&frame_data) = 0;
virtual void writeFrameData(const std::string &frame_data) = 0;

virtual void ignoreSslErrors() = 0;

Expand All @@ -115,7 +115,7 @@ class SHVIOTQT_DECL_EXPORT TcpSocket : public Socket
TcpSocket(QTcpSocket *socket, QObject *parent = nullptr);

std::string readFrameData() override;
void writeFrameData(std::string &&frame_data) override;
void writeFrameData(const std::string &frame_data) override;

void connectToHost(const QUrl &url) override;
void close() override;
Expand Down
2 changes: 1 addition & 1 deletion libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class SHVIOTQT_DECL_EXPORT SocketRpcConnection : public QObject, public shv::cha
protected:
// RpcDriver interface
bool isOpen() Q_DECL_OVERRIDE;
void writeFrameData(std::string &&frame_data) override;
void writeFrameData(const std::string &frame_data) override;

Socket* socket();
void onReadyRead();
Expand Down
2 changes: 1 addition & 1 deletion libshviotqt/include/shv/iotqt/rpc/websocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SHVIOTQT_DECL_EXPORT WebSocket : public Socket
WebSocket(QWebSocket *socket, QObject *parent = nullptr);

std::string readFrameData() override;
void writeFrameData(std::string &&frame_data) override;
void writeFrameData(const std::string &frame_data) override;

void connectToHost(const QUrl &url) override;
void close() override;
Expand Down
4 changes: 2 additions & 2 deletions libshviotqt/src/rpc/localsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ std::string LocalSocket::readFrameData()
return m_frameReader->getFrame();
}

void LocalSocket::writeFrameData(std::string &&frame_data)
void LocalSocket::writeFrameData(const std::string &frame_data)
{
m_frameWriter->addFrame(std::move(frame_data));
m_frameWriter->addFrame(frame_data);
flushWriteBuffer();
}

Expand Down
4 changes: 2 additions & 2 deletions libshviotqt/src/rpc/serialportsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ std::string SerialPortSocket::readFrameData()
return m_frameReader.getFrame();
}

void SerialPortSocket::writeFrameData(std::string &&frame_data)
void SerialPortSocket::writeFrameData(const std::string &frame_data)
{
m_frameWriter.addFrame(std::move(frame_data));
m_frameWriter.addFrame(frame_data);
flushWriteBuffer();
}

Expand Down
4 changes: 2 additions & 2 deletions libshviotqt/src/rpc/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ std::string TcpSocket::readFrameData()
return m_frameReader.getFrame();
}

void TcpSocket::writeFrameData(std::string &&frame_data)
void TcpSocket::writeFrameData(const std::string &frame_data)
{
m_frameWriter.addFrame(std::move(frame_data));
m_frameWriter.addFrame(frame_data);
flushWriteBuffer();
}

Expand Down
4 changes: 2 additions & 2 deletions libshviotqt/src/rpc/socketrpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ bool SocketRpcConnection::isOpen()
return isSocketConnected();
}

void SocketRpcConnection::writeFrameData(std::string &&frame_data)
void SocketRpcConnection::writeFrameData(const std::string &frame_data)
{
socket()->writeFrameData(std::move(frame_data));
socket()->writeFrameData(frame_data);
}

void SocketRpcConnection::sendRpcMessage(const shv::chainpack::RpcMessage &rpc_msg)
Expand Down
4 changes: 2 additions & 2 deletions libshviotqt/src/rpc/websocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ std::string WebSocket::readFrameData()
return m_frameReader.getFrame();
}

void WebSocket::writeFrameData(std::string &&frame_data)
void WebSocket::writeFrameData(const std::string &frame_data)
{
m_frameWriter.addFrame(std::move(frame_data));
m_frameWriter.addFrame(frame_data);
flushWriteBuffer();
}

Expand Down

0 comments on commit 097fea6

Please sign in to comment.