8namespace swift::misc::network
14 if (maxNumber > 0) this->
truncate(maxNumber - 1);
88 Q_ASSERT_X(nwReply, Q_FUNC_INFO,
"missing reply");
91 return (ok &&
id >= 0) ? this->
markAsReceived(
id, success) :
false;
116 qint64 min = std::numeric_limits<qint64>::max();
117 for (
const CUrlLog &rl : *
this)
132 for (
const CUrlLog &rl : *
this)
141 if (c == 0)
return 0;
147 static const QString s(
"Entries: %1, pending: %2, errors: %3, min: %4ms avg: %5ms max: %6ms");
148 if (this->
isEmpty())
return QStringLiteral(
"No data");
auto findFirstByOrDefault(Predicate p, const Value &def) const
bool contains(const T &object) const
size_type size() const
Returns number of elements in the sequence.
CSequence findBy(Predicate p) const
void truncate(size_type maxSize)
void push_front(const CUrlLog &value)
CONTAINER findBeforeNowMinusOffset(qint64 msOffset) const
List of objects before now - offset.
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
Information about accessing one URL over the network.
static const char * propertyNameId()
Property name used for request.
qint64 getResponseTimeMs() const
Response time.
void setSuccess(bool s)
Set success.
bool isSuccess() const
Success?
bool isPending() const
Pending.
void setResponseTimestampToNow()
Set response time and response timestamp.
int getId() const
Unique id.
int sizePending() const
Pending calls.
bool markAsReceived(int id, bool success)
Mark as received.
CUrlLogList findPending() const
Find pending log entries.
bool hasCompleted() const
Any completed calls.
CSequence()=default
Default constructor.
bool containsId(int id) const
Contains the id?
int sizeErrors() const
Erroneous calls.
CUrlLogList findOutdatedPending(int outdatedOffsetMs) const
Find outdated pending log entries.
bool hasPending() const
Any pending calls.
QString getSummary() const
Summary.
int addPendingUrl(const CUrl &url, int maxNumber=10)
Add a pending URL.
qint64 getMaxResponseTime() const
Maximum response time.
qint64 getAverageResponseTime() const
Average response time.
CUrlLogList()=default
Default constructor.
CUrlLogList findErrors() const
Find log entries with errors (not pending).
CUrlLog findByIdOrDefault(int id) const
Find by id.
qint64 getMinResponseTime() const
Minimum response time.
QVariant property(const char *name) const const
bool setProperty(const char *name, QVariant &&value)
QString arg(Args &&... args) const const
QVariant fromValue(T &&value)
int toInt(bool *ok) const const
#define SWIFT_DEFINE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template definition of mixins for a CSequence subclass.