swift
Loading...
Searching...
No Matches
urlloglist.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2017 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_MISC_NETWORK_URLLOGLIST_H
7#define SWIFT_MISC_NETWORK_URLLOGLIST_H
8
9#include <QNetworkReply>
10
11#include "misc/collection.h"
12#include "misc/network/urllog.h"
13#include "misc/sequence.h"
16
17SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::network, CUrlLog, CUrlLogList)
18
19namespace swift::misc::network
20{
23 public CSequence<CUrlLog>,
24 public ITimestampObjectList<CUrlLog, CUrlLogList>,
25 public mixin::MetaType<CUrlLogList>
26 {
27 public:
30
32 CUrlLogList() = default;
33
35 CUrlLogList(const CSequence &other);
36
38 int addPendingUrl(const CUrl &url, int maxNumber = 10);
39
41 int addPendingUrl(const CUrl &url, QNetworkReply *nwReply, int maxNumber = 10);
42
45
47 CUrlLogList findOutdatedPending(int outdatedOffsetMs) const;
48
50 CUrlLogList findErrors() const;
51
53 int sizePending() const;
54
56 bool hasPending() const;
57
59 bool hasCompleted() const;
60
62 int sizeErrors() const;
63
65 CUrlLog findByIdOrDefault(int id) const;
66
68 bool markAsReceived(int id, bool success);
69
71 bool markAsReceived(const QNetworkReply *nwReply, bool success);
72
74 bool containsId(int id) const;
75
77 qint64 getMaxResponseTime() const;
78
80 qint64 getMinResponseTime() const;
81
83 qint64 getAverageResponseTime() const;
84
86 QString getSummary() const;
87 };
88} // namespace swift::misc::network
89
90Q_DECLARE_METATYPE(swift::misc::network::CUrlLogList)
92
93#endif // SWIFT_MISC_NETWORK_URLLOGLIST_H
Generic ordered container with value semantics.
Definition collection.h:113
CSequence()=default
Default constructor.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
Value object encapsulating information of a location, kind of simplified CValueObject compliant versi...
Definition url.h:27
Information about accessing one URL over the network.
Definition urllog.h:24
Value object encapsulating a list of voice rooms.
Definition urlloglist.h:26
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.
#define SWIFT_MISC_DECLARE_USING_MIXIN_METATYPE(DERIVED)
When a derived class and a base class both inherit from mixin::MetaType, the derived class uses this ...
#define SWIFT_DECLARE_SEQUENCE_MIXINS(Namespace, T, List)
Explicit template declaration of mixins for a CSequence subclass to be placed near the top of the hea...
Definition sequence.h:62
#define SWIFT_MISC_EXPORT
Export a class or function from the library.