| 24 | } |
| 25 | |
| 26 | void QuestionFactory::Register(Question* question) |
| 27 | { |
| 28 | auto type = question->GetType(); |
| 29 | |
| 30 | if (m_Prototypes.find(type) != m_Prototypes.end()) |
| 31 | mitkThrow() << "A prototype is already registered for questions of type \"" << type << "\"!"; |
| 32 | |
| 33 | m_Prototypes[type].reset(question); |
| 34 | } |
| 35 | |
| 36 | Question* QuestionFactory::Create(const std::string& type) const |
| 37 | { |
no test coverage detected