Crossfire Server, Trunk
CREReportDefinitionManager.cpp
Go to the documentation of this file.
1
/*
2
* Crossfire -- cooperative multi-player graphical RPG and adventure game
3
*
4
* Copyright (c) 2022 the Crossfire Development Team
5
*
6
* Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
7
* welcome to redistribute it under certain conditions. For details, please
8
* see COPYING and LICENSE.
9
*
10
* The authors can be reached via e-mail at <crossfire@metalforge.org>.
11
*/
12
13
#include "
CREReportDefinitionManager.h
"
14
#include "
CREReportDefinition.h
"
15
#include <QDataStream>
16
17
CREReportDefinitionManager::CREReportDefinitionManager
()
18
{
19
}
20
21
CREReportDefinitionManager::CREReportDefinitionManager
(
const
CREReportDefinitionManager
& other) : QObject()
22
{
23
copy
(other);
24
}
25
26
CREReportDefinitionManager::~CREReportDefinitionManager
()
27
{
28
qDeleteAll(
myReports
);
29
}
30
31
void
CREReportDefinitionManager::copy
(
const
CREReportDefinitionManager
& other)
32
{
33
qDeleteAll(
myReports
);
34
myReports
.clear();
35
for
(
int
f = 0; f < other.
reports
().size(); f++)
36
{
37
Q_ASSERT(other.
reports
()[f]);
38
myReports
.append(
new
CREReportDefinition
(*other.
reports
()[f]));
39
}
40
}
41
42
QList<CREReportDefinition*>&
CREReportDefinitionManager::reports
()
43
{
44
return
myReports
;
45
}
46
47
const
QList<CREReportDefinition*>&
CREReportDefinitionManager::reports
()
const
48
{
49
return
myReports
;
50
}
51
52
QDataStream &
operator<<
(QDataStream &
out
,
const
CREReportDefinitionManager
&
manager
)
53
{
54
out
<<
manager
.reports().size();
55
for
(
int
f = 0; f <
manager
.reports().size(); f++)
56
out
<< (*
manager
.reports()[f]);
57
return
out
;
58
}
59
60
QDataStream &
operator>>
(QDataStream &in,
CREReportDefinitionManager
&
manager
)
61
{
62
int
size;
63
in >> size;
64
while
(size > 0)
65
{
66
CREReportDefinition
*
report
=
new
CREReportDefinition
();
67
in >> (*report);
68
manager
.reports().append(
report
);
69
size--;
70
}
71
return
in;
72
}
CREReportDefinitionManager
Definition:
CREReportDefinitionManager.h:21
CREReportDefinitionManager.h
CREReportDefinition
Definition:
CREReportDefinition.h:19
operator<<
QDataStream & operator<<(QDataStream &out, const CREReportDefinitionManager &manager)
Definition:
CREReportDefinitionManager.cpp:52
CREReportDefinition.h
operator>>
QDataStream & operator>>(QDataStream &in, CREReportDefinitionManager &manager)
Definition:
CREReportDefinitionManager.cpp:60
CREReportDefinitionManager::reports
QList< CREReportDefinition * > & reports()
Definition:
CREReportDefinitionManager.cpp:42
CREReportDefinitionManager::myReports
QList< CREReportDefinition * > myReports
Definition:
CREReportDefinitionManager.h:36
make_face_from_files.out
out
Definition:
make_face_from_files.py:81
report
Definition:
report.py:1
CREReportDefinitionManager::CREReportDefinitionManager
CREReportDefinitionManager()
Definition:
CREReportDefinitionManager.cpp:17
manager
static AssetsManager * manager
Definition:
assets.cpp:60
CREReportDefinitionManager::copy
void copy(const CREReportDefinitionManager &other)
Definition:
CREReportDefinitionManager.cpp:31
CREReportDefinitionManager::~CREReportDefinitionManager
virtual ~CREReportDefinitionManager()
Definition:
CREReportDefinitionManager.cpp:26
crossfire-crossfire-server
utils
cre
CREReportDefinitionManager.cpp
Generated by
1.8.17