swift
Loading...
Searching...
No Matches
serverlist.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2013 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_SERVERLIST_H
7#define SWIFT_MISC_NETWORK_SERVERLIST_H
8
9#include <QMetaType>
10#include <QString>
11
12#include "misc/collection.h"
13#include "misc/network/server.h"
14#include "misc/sequence.h"
16
17SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::network, CServer, CServerList)
18
19namespace swift::misc::network
20{
22 class SWIFT_MISC_EXPORT CServerList : public CSequence<CServer>, public mixin::MetaType<CServerList>
23 {
24 public:
27
29 CServerList() = default;
30
32 CServerList(const CSequence<CServer> &other);
33
35 bool containsName(const QString &name) const;
36
38 bool removeByName(const QString &name);
39
41 void removeUsers();
42
44 bool containsAddressPort(const CServer &server);
45
47 void addIfAddressNotExists(const CServer &server);
48
50 void addIfAddressNotExists(const CServerList &servers);
51
53 void setFsdSetup(const CFsdSetup &setup);
54 };
55} // namespace swift::misc::network
56
57Q_DECLARE_METATYPE(swift::misc::network::CServerList)
59
60#endif // SWIFT_MISC_NETWORK_SERVERLIST_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 for a FSD setup.
Definition fsdsetup.h:24
Value object encapsulating information of a FSD server.
Definition server.h:28
Value object encapsulating a list of servers.
Definition serverlist.h:23
CSequence()=default
Default constructor.
CServerList()=default
Default constructor.
void setFsdSetup(const CFsdSetup &setup)
Set FSD setup for all entries.
bool containsName(const QString &name) const
Contains name.
bool containsAddressPort(const CServer &server)
Contains server with same address/port.
bool removeByName(const QString &name)
Remove by name.
void removeUsers()
Remove passwords.
void addIfAddressNotExists(const CServer &server)
Add if address not already exists.
#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.