swift
Loading...
Searching...
No Matches
dbinfolist.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2016 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_DB_DBINFOLIST_H
7#define SWIFT_MISC_DB_DBINFOLIST_H
8
9#include <initializer_list>
10
11#include "misc/collection.h"
13#include "misc/db/dbinfo.h"
15#include "misc/sequence.h"
17
18SWIFT_DECLARE_SEQUENCE_MIXINS(swift::misc::db, CDbInfo, CDbInfoList)
19
20namespace swift::misc::db
21{
24 public CSequence<CDbInfo>,
25 public swift::misc::db::IDatastoreObjectList<CDbInfo, CDbInfoList, int>,
26 public swift::misc::mixin::MetaType<CDbInfoList>
27 {
28 public:
31
33 CDbInfoList() = default;
34
36 CDbInfoList(const CSequence<CDbInfo> &other);
37
39 CDbInfo findFirstByEntityOrDefault(swift::misc::network::CEntityFlags::Entity entity) const;
40
42 static CDbInfoList fromDatabaseJson(const QJsonArray &array);
43 };
44} // namespace swift::misc::db
45
46Q_DECLARE_METATYPE(swift::misc::db::CDbInfoList)
48
49#endif // SWIFT_MISC_DB_DBINFOLIST_H
Generic ordered container with value semantics.
Definition collection.h:113
CSequence()=default
Default constructor.
Info about the latest models.
Definition dbinfo.h:22
Value object encapsulating a list of info objects.
Definition dbinfolist.h:27
CSequence()=default
Default constructor.
CDbInfoList()=default
Default constructor.
static CDbInfoList fromDatabaseJson(const QJsonArray &array)
From our database JSON format.
CDbInfo findFirstByEntityOrDefault(swift::misc::network::CEntityFlags::Entity entity) const
Find by entity.
List of objects read from database. Such objects should implement.
CRTP class template from which a derived class can inherit common methods dealing with the metatype o...
#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.