iLand
plugin_interface.h
Go to the documentation of this file.
1/********************************************************************************************
2** iLand - an individual based forest landscape and disturbance model
3** http://iland-model.org
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
20#ifndef PLUGIN_INTERFACE_H
21#define PLUGIN_INTERFACE_H
22
23#include <QtPlugin>
24
31class QJSEngine; // forward
32class ResourceUnit; // forward
33
35{
36public:
38
39 // general information / properties
40 virtual QString name()=0;
41 virtual QString version()=0;
42 virtual QString description()=0;
43
44 // setup
45 virtual void setup()=0;
46 virtual void yearBegin()=0;
47 virtual void run()=0;
48 virtual void setupScripting(QJSEngine *engine)=0;
49};
50
52{
53public:
57 virtual void setupResourceUnit(const ResourceUnit *ru)=0;
58
59};
60
64class WaterCycleData; // forward
65class ResourceUnit; // forward
67{
68public:
69 virtual ~WaterInterface() {}
70
71 virtual void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data)=0;
72};
73
77class Tree; // forward
78//class Tree::TreeRemovalType;
80{
81public:
83 virtual void treeDeath(const Tree *tree, const int removal_type)=0;
84};
85
86Q_DECLARE_INTERFACE(DisturbanceInterface, "at.ac.boku.iland.DisturbanceInterface/1.0")
87
88Q_DECLARE_INTERFACE(WaterInterface, "at.ac.boku.iland.WaterInterface/1.0")
89
90Q_DECLARE_INTERFACE(SetupResourceUnitInterface, "at.ac.boku.iland.SetupResourceUnitInterface/1.0")
91
92Q_DECLARE_INTERFACE(TreeDeathInterface, "at.ac.boku.iland.TreeDeathInterface/1.0")
93
94#endif // PLUGIN_INTERFACE_H
Definition: plugin_interface.h:35
virtual void yearBegin()=0
function executes at the beginning of a year (e.g., cleanup)
virtual QString name()=0
a unique name of the plugin
virtual QString description()=0
some additional description. This info is shown in the GUI and is printed to the log file.
virtual void setupScripting(QJSEngine *engine)=0
allow module specific javascript functions/classes
virtual void setup()=0
setup after general iLand model frame is created.
virtual ~DisturbanceInterface()
Definition: plugin_interface.h:37
virtual QString version()=0
a version identification
virtual void run()=0
main function that once a year (after growth)
ResourceUnit is the spatial unit that encapsulates a forest stand and links to several environmental ...
Definition: resourceunit.h:49
Definition: plugin_interface.h:52
virtual ~SetupResourceUnitInterface()
Definition: plugin_interface.h:54
virtual void setupResourceUnit(const ResourceUnit *ru)=0
setup of parameters specific for resource unit.
Definition: plugin_interface.h:80
virtual void treeDeath(const Tree *tree, const int removal_type)=0
virtual ~TreeDeathInterface()
Definition: plugin_interface.h:82
A tree is the basic simulation entity of iLand and represents a single tree.
Definition: tree.h:44
WaterCycleData is a data transfer container for water-related details.
Definition: watercycle.h:191
Definition: plugin_interface.h:67
virtual void calculateWater(const ResourceUnit *resource_unit, const WaterCycleData *water_data)=0
virtual ~WaterInterface()
Definition: plugin_interface.h:69