summaryrefslogtreecommitdiffstats
path: root/src/Config.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-09-16 12:01:02 +0200
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2015-09-16 12:01:02 +0200
commit55cbaa5df6f91594b7cd69754e04c186c7c88c97 (patch)
treeb1456253660a7762df6868d1452a6d9480e25b19 /src/Config.cpp
parent7584ffbd6748bcca8c3f7ed2dc961be01f2fcfdc (diff)
parent026aa46c5db24ddd687cec0fa6e056a2ee3790c5 (diff)
downloadastra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.gz
astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.bz2
astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.tar.xz
astra-55cbaa5df6f91594b7cd69754e04c186c7c88c97.zip
Merge branch 'master' into volgeom3d
Conflicts: src/CudaBackProjectionAlgorithm3D.cpp
Diffstat (limited to 'src/Config.cpp')
-rw-r--r--src/Config.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Config.cpp b/src/Config.cpp
index d860638..395080b 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -45,31 +45,33 @@ using namespace std;
//-----------------------------------------------------------------------------
// default constructor
-Config::Config()
+Config::Config() : self()
{
- self = 0;
+ _doc = 0;
}
//-----------------------------------------------------------------------------
// not so default constructor
-Config::Config(XMLNode* _self)
+Config::Config(XMLNode _self)
{
self = _self;
+ _doc = 0;
}
//-----------------------------------------------------------------------------
Config::~Config()
{
- delete self;
- self = 0;
+ delete _doc;
+ _doc = 0;
}
//-----------------------------------------------------------------------------
void Config::initialize(std::string rootname)
{
- if (self == 0) {
+ if (!self) {
XMLDocument* doc = XMLDocument::createDocument(rootname);
self = doc->getRootNode();
+ _doc = doc;
}
}
@@ -124,13 +126,13 @@ bool ConfigStackCheck<T>::stopParsing()
std::string errors;
- std::list<XMLNode*> nodes = cfg->self->getNodes();
- for (std::list<XMLNode*>::iterator i = nodes.begin(); i != nodes.end(); ++i)
+ std::list<XMLNode> nodes = cfg->self.getNodes();
+ for (std::list<XMLNode>::iterator i = nodes.begin(); i != nodes.end(); ++i)
{
- std::string nodeName = (*i)->getName();
+ std::string nodeName = i->getName();
if (nodeName == "Option") {
- nodeName = (*i)->getAttribute("key", "");
+ nodeName = i->getAttribute("key", "");
if (object->configCheckData->parsedOptions.find(nodeName) == object->configCheckData->parsedOptions.end()) {
if (!errors.empty()) errors += ", ";
errors += nodeName;
@@ -142,8 +144,6 @@ bool ConfigStackCheck<T>::stopParsing()
}
}
}
- for (std::list<XMLNode*>::iterator i = nodes.begin(); i != nodes.end(); ++i)
- delete (*i);
nodes.clear();
if (!errors.empty()) {