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