1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
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 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Benjamin Grauer |
---|
13 | co-programmer: ... |
---|
14 | */ |
---|
15 | |
---|
16 | /*! |
---|
17 | * @file load_param_xml.h |
---|
18 | * A Class and macro-functions, that makes our lives easy to load-in parameters from XML |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _LOAD_PARAM_XML_H |
---|
22 | #define _LOAD_PARAM_XML_H |
---|
23 | |
---|
24 | #include "load_param.h" |
---|
25 | #include "executor/executor_xml.h" |
---|
26 | |
---|
27 | #define LoadParamXML(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \ |
---|
28 | XmlLoadParam(ROOT, PARAMETER_NAME, OBJECT, new ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), false) |
---|
29 | |
---|
30 | #define LoadParamXML_CYCLE(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \ |
---|
31 | XmlLoadParam(ROOT, PARAMETER_NAME, OBJECT, new ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), true) |
---|
32 | |
---|
33 | class XmlLoadParam : public LoadParamBase |
---|
34 | { |
---|
35 | public: |
---|
36 | XmlLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, Executor<const TiXmlElement*>* executor, bool inLoadCycle = false); |
---|
37 | virtual ~XmlLoadParam(); |
---|
38 | |
---|
39 | XmlLoadParam& describe(const std::string& descriptionText) { LoadParamBase::describe(descriptionText); return *this; }; |
---|
40 | |
---|
41 | private: |
---|
42 | Executor<const TiXmlElement*>* executor; |
---|
43 | }; |
---|
44 | |
---|
45 | #endif /* _LOAD_PARAM_XML_H */ |
---|