Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "MOR_SampleDofListFactory.hpp"
00008
00009 #include "Teuchos_TestForException.hpp"
00010
00011 #include <stdexcept>
00012
00013 namespace MOR {
00014
00015 SampleDofListFactory::SampleDofListFactory()
00016 {
00017
00018 }
00019
00020 Teuchos::Array<int>
00021 SampleDofListFactory::create(const Teuchos::RCP<Teuchos::ParameterList> ¶ms)
00022 {
00023 const std::string providerId = params->get("Source Type", "");
00024
00025 const ProviderMap::const_iterator it = providers_.find(providerId);
00026 TEUCHOS_TEST_FOR_EXCEPTION(
00027 it == providers_.end(),
00028 std::out_of_range,
00029 "Unknown sample dof provider type: " << providerId);
00030
00031 return (*it->second)(params);
00032 }
00033
00034 void
00035 SampleDofListFactory::extend(const std::string &id, const Teuchos::RCP<DofListProvider> &provider)
00036 {
00037 providers_[id] = provider;
00038 }
00039
00040 }