#include "commonObjects.h" #include "appEngine.h" #include "xmlObjectLoader.h" #include "xmlScriptParser.h" CommonObjects::~CommonObjects() { rowSets.clear(); datasources.clear(); } RowSetPtr CommonObjects::getSource(const std::string & name) const { RowSets::index::type::const_iterator i = rowSets.get().find(name); if (i != rowSets.get().end()) { return *i; } throw CommonObjects::DataSourceNotFound(name); } CommonObjects::DataSources::index::type::const_iterator CommonObjects::loadDataSource(const std::string & name) const { XmlScriptParser xml(ApplicationEngine::getCurrent()->env()->getDatasourceRoot(), name, true); LoaderBase loader(true); loader.supportedStorers.insert(Storer::into(&datasources)); loader.collectAll(xml.get_document()->get_root_node(), false); DataSources::index::type::const_iterator i = datasources.get().find(name); if (i == datasources.get().end()) { throw DataSourceNotFound(name); } return i; }