Crossfire Server, Trunk
CREFilterDefinitionManager.cpp
Go to the documentation of this file.
2 #include "CREFilterDefinition.h"
3 #include <QDataStream>
4 
6 {
7 }
8 
10 {
11  copy(other);
12 }
13 
15 {
16  qDeleteAll(myFilters);
17 }
18 
20 {
21  qDeleteAll(myFilters);
22  myFilters.clear();
23  for (int f = 0; f < other.filters().size(); f++)
24  {
25  myFilters.append(new CREFilterDefinition(*other.filters()[f]));
26  }
27 }
28 
29 QList<CREFilterDefinition*>& CREFilterDefinitionManager::filters()
30 {
31  return myFilters;
32 }
33 
34 const QList<CREFilterDefinition*>& CREFilterDefinitionManager::filters() const
35 {
36  return myFilters;
37 }
38 
39 QDataStream &operator<<(QDataStream &out, const CREFilterDefinitionManager &manager)
40 {
41  out << manager.filters().size();
42  for (int f = 0; f < manager.filters().size(); f++)
43  out << (*manager.filters()[f]);
44  return out;
45 }
46 
47 QDataStream &operator>>(QDataStream &in, CREFilterDefinitionManager &manager)
48 {
49  int size;
50  in >> size;
51  while (size > 0)
52  {
54  in >> (*filter);
55  manager.filters().append(filter);
56  size--;
57  }
58  return in;
59 }
CREFilterDefinitionManager
Definition: CREFilterDefinitionManager.h:9
filter
Definition: filter.py:1
CREFilterDefinition.h
operator>>
QDataStream & operator>>(QDataStream &in, CREFilterDefinitionManager &manager)
Definition: CREFilterDefinitionManager.cpp:47
CREFilterDefinitionManager::~CREFilterDefinitionManager
virtual ~CREFilterDefinitionManager()
Definition: CREFilterDefinitionManager.cpp:14
CREFilterDefinitionManager::CREFilterDefinitionManager
CREFilterDefinitionManager()
Definition: CREFilterDefinitionManager.cpp:5
make_face_from_files.out
out
Definition: make_face_from_files.py:74
CREFilterDefinitionManager.h
CREFilterDefinitionManager::copy
void copy(const CREFilterDefinitionManager &other)
Definition: CREFilterDefinitionManager.cpp:19
operator<<
QDataStream & operator<<(QDataStream &out, const CREFilterDefinitionManager &manager)
Definition: CREFilterDefinitionManager.cpp:39
CREFilterDefinition
Definition: CREFilterDefinition.h:7
CREFilterDefinitionManager::myFilters
QList< CREFilterDefinition * > myFilters
Definition: CREFilterDefinitionManager.h:24
manager
static AssetsManager * manager
Definition: assets.cpp:63
CREFilterDefinitionManager::filters
QList< CREFilterDefinition * > & filters()
Definition: CREFilterDefinitionManager.cpp:29