Line data Source code
1 :
2 : /* Copyright (c) 2010-2011, Stefan Eilemann <eile@eyescale.ch>
3 : * 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_CONFIGRESTOREVISITOR_H
20 : #define EQSERVER_CONFIGRESTOREVISITOR_H
21 :
22 : #include "configVisitor.h" // base class
23 :
24 : namespace eq
25 : {
26 : namespace server
27 : {
28 : namespace
29 : {
30 : /** Restore all data which may have been modified by an application. */
31 : class ConfigRestoreVisitor : public ConfigVisitor
32 : {
33 : public:
34 0 : ConfigRestoreVisitor() {}
35 0 : virtual ~ConfigRestoreVisitor() {}
36 0 : virtual VisitorResult visitPre(Compound* compound)
37 : {
38 0 : compound->restore();
39 0 : return TRAVERSE_CONTINUE;
40 : }
41 0 : virtual VisitorResult visitPre(Config* config) { return _restore(config); }
42 0 : virtual VisitorResult visit(Observer* observer)
43 : {
44 0 : return _restore(observer);
45 : }
46 0 : virtual VisitorResult visitPre(Canvas* canvas) { return _restore(canvas); }
47 0 : virtual VisitorResult visit(Segment* segment) { return _restore(segment); }
48 0 : virtual VisitorResult visitPre(Layout* layout) { return _restore(layout); }
49 0 : virtual VisitorResult visit(View* view) { return _restore(view); }
50 0 : virtual VisitorResult visitPre(Node* node) { return _restore(node); }
51 0 : virtual VisitorResult visitPre(Pipe* pipe) { return _restore(pipe); }
52 0 : virtual VisitorResult visitPre(Window* window) { return _restore(window); }
53 0 : virtual VisitorResult visit(Channel* channel) { return _restore(channel); }
54 : private:
55 0 : VisitorResult _restore(fabric::Object* object)
56 : {
57 0 : object->restore();
58 0 : return TRAVERSE_CONTINUE;
59 : }
60 : };
61 : }
62 : }
63 : }
64 : #endif // EQSERVER_CONSTCONFIGVISITOR_H
|