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 10 : ConfigBackupVisitor() {}
42 10 : virtual ~ConfigBackupVisitor() {}
43 266 : virtual VisitorResult visitPre( Compound* compound )
44 : {
45 266 : compound->backup();
46 266 : return TRAVERSE_CONTINUE;
47 : }
48 10 : virtual VisitorResult visitPre( Config* config )
49 : {
50 10 : config->backup();
51 10 : return TRAVERSE_CONTINUE;
52 : }
53 10 : virtual VisitorResult visit( Observer* observer )
54 : {
55 10 : observer->backup();
56 10 : return TRAVERSE_CONTINUE;
57 : }
58 10 : virtual VisitorResult visitPre( Canvas* canvas )
59 : {
60 10 : canvas->backup();
61 10 : return TRAVERSE_CONTINUE;
62 : }
63 10 : virtual VisitorResult visit( Segment* segment )
64 : {
65 10 : segment->backup();
66 10 : return TRAVERSE_CONTINUE;
67 : }
68 63 : virtual VisitorResult visitPre( Layout* layout )
69 : {
70 63 : layout->backup();
71 63 : return TRAVERSE_CONTINUE;
72 : }
73 63 : virtual VisitorResult visit( View* view )
74 : {
75 63 : view->backup();
76 63 : return TRAVERSE_CONTINUE;
77 : }
78 15 : virtual VisitorResult visitPre( Node* node )
79 : {
80 15 : node->backup();
81 15 : return TRAVERSE_CONTINUE;
82 : }
83 23 : virtual VisitorResult visitPre( Pipe* pipe )
84 : {
85 23 : pipe->backup();
86 23 : return TRAVERSE_CONTINUE;
87 : }
88 23 : virtual VisitorResult visitPre( Window* window )
89 : {
90 23 : window->backup();
91 23 : return TRAVERSE_CONTINUE;
92 : }
93 86 : virtual VisitorResult visit( Channel* channel )
94 : {
95 86 : channel->backup();
96 86 : return TRAVERSE_CONTINUE;
97 : }
98 : };
99 : }
100 : }
101 : }
102 : #endif // EQSERVER_CONSTCONFIGVISITOR_H
|