Remove [[nodiscard]] (#108)

This commit is contained in:
Ken Van Hoeylandt 2024-12-05 23:25:31 +01:00 committed by GitHub
parent 422bc01fdb
commit c6f1cd6098
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 40 additions and 40 deletions

View File

@ -66,22 +66,22 @@ public:
~AppInstance() override = default; ~AppInstance() override = default;
void setState(State state); void setState(State state);
[[nodiscard]] State getState() const; State getState() const;
[[nodiscard]] const AppManifest& getManifest() const override; const AppManifest& getManifest() const override;
[[nodiscard]] Flags getFlags() const override; Flags getFlags() const override;
void setFlags(Flags flags); void setFlags(Flags flags);
Flags& mutableFlags() { return flags; } // TODO: locking mechanism Flags& mutableFlags() { return flags; } // TODO: locking mechanism
[[nodiscard]] std::shared_ptr<void> _Nullable getData() const override; std::shared_ptr<void> _Nullable getData() const override;
void setData(std::shared_ptr<void> data) override; void setData(std::shared_ptr<void> data) override;
[[nodiscard]] std::shared_ptr<const Bundle> getParameters() const override; std::shared_ptr<const Bundle> getParameters() const override;
void setResult(Result result) override; void setResult(Result result) override;
void setResult(Result result, std::shared_ptr<const Bundle> bundle) override; void setResult(Result result, std::shared_ptr<const Bundle> bundle) override;
[[nodiscard]] bool hasResult() const override; bool hasResult() const override;
std::unique_ptr<ResultHolder>& getResult() { return resultHolder; } std::unique_ptr<ResultHolder>& getResult() { return resultHolder; }
}; };

View File

@ -25,14 +25,14 @@ protected:
public: public:
[[nodiscard]] virtual const AppManifest& getManifest() const = 0; virtual const AppManifest& getManifest() const = 0;
[[nodiscard]] virtual std::shared_ptr<void> _Nullable getData() const = 0; virtual std::shared_ptr<void> _Nullable getData() const = 0;
virtual void setData(std::shared_ptr<void> data) = 0; virtual void setData(std::shared_ptr<void> data) = 0;
[[nodiscard]] virtual std::shared_ptr<const Bundle> getParameters() const = 0; virtual std::shared_ptr<const Bundle> getParameters() const = 0;
[[nodiscard]] virtual Flags getFlags() const = 0; virtual Flags getFlags() const = 0;
virtual void setResult(Result result) = 0; virtual void setResult(Result result) = 0;
virtual void setResult(Result result, std::shared_ptr<const Bundle> bundle)= 0; virtual void setResult(Result result, std::shared_ptr<const Bundle> bundle)= 0;
[[nodiscard]] virtual bool hasResult() const = 0; virtual bool hasResult() const = 0;
}; };
} }

View File

@ -54,7 +54,7 @@ public:
* @return true if trigger level can be be updated (new trigger level was less than or equal to the stream buffer's length). * @return true if trigger level can be be updated (new trigger level was less than or equal to the stream buffer's length).
* @return false if trigger level can't be be updated (new trigger level was greater than the stream buffer's length). * @return false if trigger level can't be be updated (new trigger level was greater than the stream buffer's length).
*/ */
[[nodiscard]] bool setTriggerLevel(size_t triggerLevel) const; bool setTriggerLevel(size_t triggerLevel) const;
/** /**
* @brief Sends bytes to a stream buffer. The bytes are copied into the stream buffer. * @brief Sends bytes to a stream buffer. The bytes are copied into the stream buffer.
@ -69,7 +69,7 @@ public:
* Ignored if called from ISR. * Ignored if called from ISR.
* @return The number of bytes actually written to the stream buffer. * @return The number of bytes actually written to the stream buffer.
*/ */
[[nodiscard]] size_t send( size_t send(
const void* data, const void* data,
size_t length, size_t length,
uint32_t timeout uint32_t timeout
@ -89,7 +89,7 @@ public:
* Ignored if called from ISR. * Ignored if called from ISR.
* @return The number of bytes read from the stream buffer, if any. * @return The number of bytes read from the stream buffer, if any.
*/ */
[[nodiscard]] size_t receive( size_t receive(
void* data, void* data,
size_t length, size_t length,
uint32_t timeout uint32_t timeout
@ -103,7 +103,7 @@ public:
* @return The number of bytes that can be read from the stream buffer before * @return The number of bytes that can be read from the stream buffer before
* the stream buffer would be empty. * the stream buffer would be empty.
*/ */
[[nodiscard]] size_t getAvailableReadBytes() const; size_t getAvailableReadBytes() const;
/** /**
* @brief Queries a stream buffer to see how much free space it contains, which is * @brief Queries a stream buffer to see how much free space it contains, which is
@ -113,7 +113,7 @@ public:
* @return The number of bytes that can be written to the stream buffer before * @return The number of bytes that can be written to the stream buffer before
* the stream buffer would be full. * the stream buffer would be full.
*/ */
[[nodiscard]] size_t getAvailableWriteBytes() const; size_t getAvailableWriteBytes() const;
/** /**
* @brief Queries a stream buffer to see if it is full. * @brief Queries a stream buffer to see if it is full.
@ -121,7 +121,7 @@ public:
* @return true if the stream buffer is full. * @return true if the stream buffer is full.
* @return false if the stream buffer is not full. * @return false if the stream buffer is not full.
*/ */
[[nodiscard]] bool isFull() const; bool isFull() const;
/** /**
* @brief Queries a stream buffer to see if it is empty. * @brief Queries a stream buffer to see if it is empty.
@ -130,7 +130,7 @@ public:
* @return true if the stream buffer is empty. * @return true if the stream buffer is empty.
* @return false if the stream buffer is not empty. * @return false if the stream buffer is not empty.
*/ */
[[nodiscard]] bool isEmpty() const; bool isEmpty() const;
/** /**
* @brief Resets a stream buffer to its initial, empty, state. Any data that was * @brief Resets a stream buffer to its initial, empty, state. Any data that was
@ -141,7 +141,7 @@ public:
* @return TtStatusError if there was a task blocked waiting to send to or read * @return TtStatusError if there was a task blocked waiting to send to or read
* from the stream buffer then the stream buffer is not reset. * from the stream buffer then the stream buffer is not reset.
*/ */
[[nodiscard]] TtStatus reset() const; TtStatus reset() const;
}; };

View File

@ -154,7 +154,7 @@ public:
* *
* @return thread state from ThreadState * @return thread state from ThreadState
*/ */
[[nodiscard]] State getState() const; State getState() const;
/** Start Thread /** Start Thread
* *

View File

@ -17,8 +17,8 @@ public:
explicit ServiceInstance(const service::ServiceManifest& manifest); explicit ServiceInstance(const service::ServiceManifest& manifest);
~ServiceInstance() override = default; ~ServiceInstance() override = default;
[[nodiscard]] const service::ServiceManifest& getManifest() const override; const service::ServiceManifest& getManifest() const override;
[[nodiscard]] void* getData() const override; void* getData() const override;
void setData(void* newData) override; void setData(void* newData) override;
}; };

View File

@ -8,22 +8,22 @@ class Touch;
class Display { class Display {
public: public:
[[nodiscard]] virtual bool start() = 0; virtual bool start() = 0;
[[nodiscard]] virtual bool stop() = 0; virtual bool stop() = 0;
[[nodiscard]] virtual void setPowerOn(bool turnOn) = 0; virtual void setPowerOn(bool turnOn) = 0;
[[nodiscard]] virtual bool isPoweredOn() const = 0; virtual bool isPoweredOn() const = 0;
[[nodiscard]] virtual bool supportsPowerControl() const = 0; virtual bool supportsPowerControl() const = 0;
[[nodiscard]] virtual Touch* _Nullable createTouch() = 0; virtual Touch* _Nullable createTouch() = 0;
/** Set a value in the range [0, 255] */ /** Set a value in the range [0, 255] */
virtual void setBacklightDuty(uint8_t backlightDuty) = 0; virtual void setBacklightDuty(uint8_t backlightDuty) = 0;
[[nodiscard]] virtual uint8_t getBacklightDuty() const = 0; virtual uint8_t getBacklightDuty() const = 0;
[[nodiscard]] virtual bool supportsBacklightDuty() const = 0; virtual bool supportsBacklightDuty() const = 0;
/** After start() returns true, this should return a valid pointer until stop() is called and returns true */ /** After start() returns true, this should return a valid pointer until stop() is called and returns true */
[[nodiscard]] virtual lv_display_t* _Nullable getLvglDisplay() const = 0; virtual lv_display_t* _Nullable getLvglDisplay() const = 0;
}; };
} }

View File

@ -8,11 +8,11 @@ class Display;
class Keyboard { class Keyboard {
public: public:
[[nodiscard]] virtual bool start(lv_display_t* display) = 0; virtual bool start(lv_display_t* display) = 0;
[[nodiscard]] virtual bool stop() = 0; virtual bool stop() = 0;
[[nodiscard]] virtual bool isAttached() const = 0; virtual bool isAttached() const = 0;
[[nodiscard]] virtual lv_indev_t* _Nullable getLvglIndev() = 0; virtual lv_indev_t* _Nullable getLvglIndev() = 0;
}; };
} }

View File

@ -9,10 +9,10 @@ class Display;
class Touch { class Touch {
public: public:
[[nodiscard]] virtual bool start(lv_display_t* display) = 0; virtual bool start(lv_display_t* display) = 0;
[[nodiscard]] virtual bool stop() = 0; virtual bool stop() = 0;
[[nodiscard]] virtual lv_indev_t* _Nullable getLvglIndev() = 0; virtual lv_indev_t* _Nullable getLvglIndev() = 0;
}; };
} }

View File

@ -13,8 +13,8 @@ protected:
public: public:
[[nodiscard]] virtual const service::ServiceManifest& getManifest() const = 0; virtual const service::ServiceManifest& getManifest() const = 0;
[[nodiscard]] virtual void* getData() const = 0; virtual void* getData() const = 0;
virtual void setData(void* newData) = 0; virtual void setData(void* newData) = 0;
}; };