Line data Source code
1 :
2 : /* Copyright (c) 2010, Stefan Eilemann <eile@eyescale.ch>
3 : * Copyright (c) 2010, Cedric Stalder <cedric.stalder@gmail.com>
4 : *
5 : * This library is free software; you can redistribute it and/or modify it under
6 : * the terms of the GNU Lesser General Public License version 2.1 as published
7 : * by the Free Software Foundation.
8 : *
9 : * This library is distributed in the hope that it will be useful, but WITHOUT
10 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 : * details.
13 : *
14 : * You should have received a copy of the GNU Lesser General Public License
15 : * along with this library; if not, write to the Free Software Foundation, Inc.,
16 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 : */
18 :
19 : #ifndef EQSERVER_CONFIGBACKUPVISITOR_H
20 : #define EQSERVER_CONFIGBACKUPVISITOR_H
21 :
22 : #include "configVisitor.h" // base class
23 :
24 : #include "canvas.h"
25 : #include "compound.h"
26 : #include "layout.h"
27 : #include "observer.h"
28 : #include "segment.h"
29 : #include "view.h"
30 :
31 : namespace eq
32 : {
33 : namespace server
34 : {
35 : namespace
36 : {
37 : /** Backup all data which may be modified by a running application. */
38 : class ConfigBackupVisitor : public ConfigVisitor
39 : {
40 : public:
41 2 : ConfigBackupVisitor() {}
42 2 : virtual ~ConfigBackupVisitor() {}
43 82 : virtual VisitorResult visitPre(Compound* compound)
44 : {
45 82 : compound->backup();
46 82 : return TRAVERSE_CONTINUE;
47 : }
48 2 : virtual VisitorResult visitPre(Config* config)
49 : {
50 2 : config->backup();
51 2 : return TRAVERSE_CONTINUE;
52 : }
53 2 : virtual VisitorResult visit(Observer* observer)
54 : {
55 2 : observer->backup();
56 2 : return TRAVERSE_CONTINUE;
57 : }
58 2 : virtual VisitorResult visitPre(Canvas* canvas)
59 : {
60 2 : canvas->backup();
61 2 : return TRAVERSE_CONTINUE;
62 : }
63 2 : virtual VisitorResult visit(Segment* segment)
64 : {
65 2 : segment->backup();
66 2 : return TRAVERSE_CONTINUE;
67 : }
68 14 : virtual VisitorResult visitPre(Layout* layout)
69 : {
70 14 : layout->backup();
71 14 : return TRAVERSE_CONTINUE;
72 : }
73 14 : virtual VisitorResult visit(View* view)
74 : {
75 14 : view->backup();
76 14 : return TRAVERSE_CONTINUE;
77 : }
78 2 : virtual VisitorResult visitPre(Node* node)
79 : {
80 2 : node->backup();
81 2 : return TRAVERSE_CONTINUE;
82 : }
83 4 : virtual VisitorResult visitPre(Pipe* pipe)
84 : {
85 4 : pipe->backup();
86 4 : return TRAVERSE_CONTINUE;
87 : }
88 4 : virtual VisitorResult visitPre(Window* window)
89 : {
90 4 : window->backup();
91 4 : return TRAVERSE_CONTINUE;
92 : }
93 18 : virtual VisitorResult visit(Channel* channel)
94 : {
95 18 : channel->backup();
96 18 : return TRAVERSE_CONTINUE;
97 : }
98 : };
99 : }
100 : }
101 : }
102 : #endif // EQSERVER_CONSTCONFIGVISITOR_H
|