summaryrefslogtreecommitdiffstats
path: root/src/Config.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <wjp@usecode.org>2015-02-27 11:46:29 +0100
committerWillem Jan Palenstijn <wjp@usecode.org>2015-02-27 11:46:29 +0100
commit03a9dd972ada50eedb83386910cecf02fe8d0e35 (patch)
treef764bff6a8109d42445bdd1db622fd739baf5d4a /src/Config.cpp
parent9e2bb413a937aefe57f4fcf343413543ae57258a (diff)
parent169e912d2633cda7ffc234e78afba1b096e122ea (diff)
downloadastra-03a9dd972ada50eedb83386910cecf02fe8d0e35.tar.gz
astra-03a9dd972ada50eedb83386910cecf02fe8d0e35.tar.bz2
astra-03a9dd972ada50eedb83386910cecf02fe8d0e35.tar.xz
astra-03a9dd972ada50eedb83386910cecf02fe8d0e35.zip
Merge pull request #20 from wvaarle/matlab-get-geometry
'get_geometry' functions in the matlab layer
Diffstat (limited to 'src/Config.cpp')
-rw-r--r--src/Config.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index 3a3cb53..653935e 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -54,12 +54,24 @@ Config::Config(XMLNode* _self)
self = _self;
}
+//-----------------------------------------------------------------------------
Config::~Config()
{
delete self;
self = 0;
}
+//-----------------------------------------------------------------------------
+void Config::initialize(std::string rootname)
+{
+ if (self == 0) {
+ XMLDocument* doc = XMLDocument::createDocument(rootname);
+ self = doc->getRootNode();
+ }
+}
+
+
+//-----------------------------------------------------------------------------
template <class T>
ConfigStackCheck<T>::ConfigStackCheck(const char *_name, T* _obj, const Config& _cfg)
: object(_obj), cfg(&_cfg), name(_name)