diff --git a/src/grpc/qgrpcoperation.cpp b/src/grpc/qgrpcoperation.cpp index 8f443733..51a663d5 100644 --- a/src/grpc/qgrpcoperation.cpp +++ b/src/grpc/qgrpcoperation.cpp @@ -104,7 +104,7 @@ QGrpcOperation::~QGrpcOperation() = default; \internal Getter of the data received from the channel. */ -QByteArray QGrpcOperation::data() const +QByteArray QGrpcOperation::data() const noexcept { return d_func()->data; } @@ -136,7 +136,7 @@ void QGrpcOperation::read(QProtobufMessage *message) const Getter of the metadata received from the channel. For the HTTP2 channels it usually contains the HTTP headers received from the server. */ -QGrpcMetadata QGrpcOperation::metadata() const +QGrpcMetadata QGrpcOperation::metadata() const noexcept { return d_func()->channelOperation->serverMetadata(); } @@ -144,7 +144,7 @@ QGrpcMetadata QGrpcOperation::metadata() const /*! Getter of the method that this operation was intialized with. */ -QLatin1StringView QGrpcOperation::method() const +QLatin1StringView QGrpcOperation::method() const noexcept { return d_func()->channelOperation->method(); } @@ -153,7 +153,7 @@ QLatin1StringView QGrpcOperation::method() const \internal Returns a pointer to the assigned channel-side QGrpcChannelOperation. */ -const QGrpcChannelOperation *QGrpcOperation::channelOperation() const +const QGrpcChannelOperation *QGrpcOperation::channelOperation() const noexcept { return d_func()->channelOperation.get(); } @@ -162,7 +162,7 @@ const QGrpcChannelOperation *QGrpcOperation::channelOperation() const \internal Getter of the serializer that QGrpcOperation was constructed with. */ -std::shared_ptr QGrpcOperation::serializer() const +std::shared_ptr QGrpcOperation::serializer() const noexcept { return d_func()->channelOperation->serializer(); } @@ -185,7 +185,7 @@ void QGrpcOperation::cancel() Returns true when QGrpcOperation finished its workflow, meaning it was finished, canceled, or error occurred, otherwise returns false. */ -bool QGrpcOperation::isFinished() const +bool QGrpcOperation::isFinished() const noexcept { return d_func()->isFinished.loadRelaxed(); } diff --git a/src/grpc/qgrpcoperation.h b/src/grpc/qgrpcoperation.h index 0ffbf4eb..d9cc9f66 100644 --- a/src/grpc/qgrpcoperation.h +++ b/src/grpc/qgrpcoperation.h @@ -36,11 +36,11 @@ public: void read(QProtobufMessage *message) const; - QGrpcMetadata metadata() const; - QLatin1StringView method() const; + [[nodiscard]] QGrpcMetadata metadata() const noexcept; + [[nodiscard]] QLatin1StringView method() const noexcept; void cancel(); - bool isFinished() const; + [[nodiscard]] bool isFinished() const noexcept; Q_SIGNALS: void finished(); @@ -49,14 +49,14 @@ Q_SIGNALS: protected: explicit QGrpcOperation(std::shared_ptr channelOperation); - const QGrpcChannelOperation *channelOperation() const; - std::shared_ptr serializer() const; + [[nodiscard]] const QGrpcChannelOperation *channelOperation() const noexcept; + [[nodiscard]] std::shared_ptr serializer() const noexcept; private: Q_DISABLE_COPY_MOVE(QGrpcOperation) - QByteArray data() const; - QGrpcStatus deserializationError() const; + [[nodiscard]] QByteArray data() const noexcept; + [[nodiscard]] QGrpcStatus deserializationError() const; Q_DECLARE_PRIVATE(QGrpcOperation) };