tidy&format(all): all files formatted and relevant warnings resolved
C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
This commit is contained in:
@@ -7,38 +7,39 @@
|
||||
namespace ZShell::internal {
|
||||
|
||||
class CircularBuffer : public QObject {
|
||||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
|
||||
Q_PROPERTY(int capacity READ capacity WRITE setCapacity NOTIFY capacityChanged)
|
||||
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
||||
Q_PROPERTY(QList<qreal> values READ values NOTIFY valuesChanged)
|
||||
Q_PROPERTY(qreal maximum READ maximum NOTIFY valuesChanged)
|
||||
Q_PROPERTY(
|
||||
int capacity READ capacity WRITE setCapacity NOTIFY capacityChanged)
|
||||
Q_PROPERTY(int count READ count NOTIFY countChanged)
|
||||
Q_PROPERTY(QList<qreal> values READ values NOTIFY valuesChanged)
|
||||
Q_PROPERTY(qreal maximum READ maximum NOTIFY valuesChanged)
|
||||
|
||||
public:
|
||||
explicit CircularBuffer(QObject* parent = nullptr);
|
||||
public:
|
||||
explicit CircularBuffer(QObject* parent = nullptr);
|
||||
|
||||
[[nodiscard]] int capacity() const;
|
||||
void setCapacity(int capacity);
|
||||
[[nodiscard]] int capacity() const;
|
||||
void setCapacity(int capacity);
|
||||
|
||||
[[nodiscard]] int count() const;
|
||||
[[nodiscard]] QList<qreal> values() const;
|
||||
[[nodiscard]] qreal maximum() const;
|
||||
[[nodiscard]] int count() const;
|
||||
[[nodiscard]] QList<qreal> values() const;
|
||||
[[nodiscard]] qreal maximum() const;
|
||||
|
||||
Q_INVOKABLE void push(qreal value);
|
||||
Q_INVOKABLE void clear();
|
||||
Q_INVOKABLE [[nodiscard]] qreal at(int index) const;
|
||||
Q_INVOKABLE void push(qreal value);
|
||||
Q_INVOKABLE void clear();
|
||||
Q_INVOKABLE [[nodiscard]] qreal at(int index) const;
|
||||
|
||||
signals:
|
||||
void capacityChanged();
|
||||
void countChanged();
|
||||
void valuesChanged();
|
||||
signals:
|
||||
void capacityChanged();
|
||||
void countChanged();
|
||||
void valuesChanged();
|
||||
|
||||
private:
|
||||
QVector<qreal> m_data;
|
||||
int m_head = 0;
|
||||
int m_count = 0;
|
||||
int m_capacity = 0;
|
||||
private:
|
||||
QVector<qreal> m_data;
|
||||
int m_head = 0;
|
||||
int m_count = 0;
|
||||
int m_capacity = 0;
|
||||
};
|
||||
|
||||
} // namespace ZShell::internal
|
||||
|
||||
Reference in New Issue
Block a user