void FallbackRepository::getView(const std::string& path, std::vector<IConfigurationRepositoryPtr>& views) const { std::vector<IConfigurationRepositoryPtr> baseTmp; base_->getView(path, baseTmp); if (baseTmp.empty()) { ConfigurationRepository empty; empty.provision(getPath(), boost::property_tree::ptree()); baseTmp.push_back(empty.getView(path)); } std::vector<IConfigurationRepositoryPtr> fallbackTmp; if (fallback_) { fallback_->getView(path, fallbackTmp); } std::vector<IConfigurationRepositoryPtr> tmp; for (const auto& b : baseTmp) { auto view = boost::make_shared<FallbackRepository>(b); for (const auto& f : fallbackTmp) { view->setFallback(f); } tmp.push_back(view); } std::swap(views, tmp); }
IConfigurationRepositoryPtr FallbackRepository::getView(const std::string &path) const { auto view = boost::make_shared<FallbackRepository>(base_->getView(path)); if (fallback_) { view->setFallback(fallback_->getView(path)); } return view; }
ResourceManager::ResourceManager() { setFallback(new ForceRendererOptions); setFallback(new ObjectRendererOptions); setFallback(new ShapeRendererOptions); }