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
 
641 werner 20
#ifndef MODULES_H
21
#define MODULES_H
22
 
646 werner 23
class DisturbanceInterface; // forward
24
class SetupResourceUnitInterface; // forward
25
class WaterInterface; // forward
1044 werner 26
class TreeDeathInterface; // forward
646 werner 27
class ResourceUnit; // forward
1044 werner 28
class Tree; // forward
646 werner 29
class WaterCycleData; // forward
793 werner 30
class QJSEngine; // forward
641 werner 31
/** The Modules class is the container for iLand modules (e.g. Fire, Wind, ...).
32
    It handles loading and invoking the functionality defined in the modules.
33
*/
34
class Modules
35
{
36
public:
37
    Modules();
649 werner 38
 
674 werner 39
    /// general setup
646 werner 40
    void setup();
652 werner 41
    /// get interface by name (or 0 if not present)
42
    DisturbanceInterface *module(const QString &module_name);
649 werner 43
 
646 werner 44
    bool hasSetupResourceUnits() { return !mSetupRUs.isEmpty(); }
45
    // setup of resource unit specific parameters
46
    void setupResourceUnit(const ResourceUnit* ru);
47
 
48
    // functions
649 werner 49
    void yearBegin(); ///< executes yearly initialization code for each module
50
    void run(); ///< execute the modules
646 werner 51
    // water
52
    void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data);
1044 werner 53
 
54
    // tree death
55
    void treeDeath(const Tree *tree, int removal_type);
641 werner 56
private:
57
    void init();
58
    QList<DisturbanceInterface*> mInterfaces; ///< the list stores only the active modules
646 werner 59
    QList<SetupResourceUnitInterface*> mSetupRUs;
60
    QList<WaterInterface*> mWater;
1044 werner 61
    QList<TreeDeathInterface*> mTreeDeath;
641 werner 62
};
63
 
64
#endif // MODULES_H