Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | |||
671 | werner | 2 | /******************************************************************************************** |
3 | ** iLand - an individual based forest landscape and disturbance model |
||
4 | ** http://iland.boku.ac.at |
||
5 | ** Copyright (C) 2009- Werner Rammer, Rupert Seidl |
||
6 | ** |
||
7 | ** This program is free software: you can redistribute it and/or modify |
||
8 | ** it under the terms of the GNU General Public License as published by |
||
9 | ** the Free Software Foundation, either version 3 of the License, or |
||
10 | ** (at your option) any later version. |
||
11 | ** |
||
12 | ** This program is distributed in the hope that it will be useful, |
||
13 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
15 | ** GNU General Public License for more details. |
||
16 | ** |
||
17 | ** You should have received a copy of the GNU General Public License |
||
18 | ** along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
19 | ********************************************************************************************/ |
||
20 | |||
173 | werner | 21 | #ifndef OUTPUTMANAGER_H |
22 | #define OUTPUTMANAGER_H |
||
23 | #include "output.h" |
||
24 | |||
25 | class OutputManager |
||
26 | { |
||
27 | public: |
||
28 | OutputManager(); ///< create all outputs |
||
29 | ~OutputManager(); |
||
665 | werner | 30 | void addOutput(Output *output); ///< add a (newly created) output category. freeing of memory is done by outputmanager |
1054 | werner | 31 | void removeOutput(const QString &tableName); ///< remove (if available) the output with the name 'tableName', free the memory |
181 | werner | 32 | void setup(); ///< setup of the outputs + switch on/off (from project file) |
176 | werner | 33 | Output *find(const QString& tableName); ///< search for output and return pointer, NULL otherwise |
34 | bool execute(const QString& tableName); ///< execute output with a given name. returns true if executed. |
||
222 | werner | 35 | void save(); ///< save transactions of all outputs |
232 | werner | 36 | void close(); ///< close all outputs |
254 | werner | 37 | QString wikiFormat(); ///< wiki-format of all outputs |
173 | werner | 38 | private: |
39 | QList<Output*> mOutputs; ///< list of outputs in system |
||
231 | werner | 40 | // transactions |
41 | void startTransaction(); ///< start database transaction (if output database is open, i.e. >0 DB outputs are active) |
||
42 | void endTransaction(); ///< ends database transaction |
||
43 | bool mTransactionOpen; ///< for database outputs: if true, currently a transaction is open |
||
173 | werner | 44 | }; |
45 | |||
46 | #endif // OUTPUTMANAGER_H |