Subversion Repositories public iLand

Rev

Rev 1221 | Details | Compare with Previous | Last modification | View Log | RSS feed

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