Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
mitkQuestionFactory.h
Go to the documentation of this file.
1
/*============================================================================
2
3
The Medical Imaging Interaction Toolkit (MITK)
4
5
Copyright (c) German Cancer Research Center (DKFZ)
6
All rights reserved.
7
8
Use of this source code is governed by a 3-clause BSD license that can be
9
found in the LICENSE file.
10
11
============================================================================*/
12
13
#ifndef mitkQuestionFactory_h
14
#define mitkQuestionFactory_h
15
16
#include <
mitkIQuestionFactory.h
>
17
18
#include <memory>
19
#include <string>
20
#include <unordered_map>
21
22
namespace
mitk::Forms
23
{
30
class
QuestionFactory
:
public
IQuestionFactory
31
{
32
public
:
33
QuestionFactory
();
34
~QuestionFactory
()
override
;
35
40
void
Register
(
Question
* question)
override
;
41
47
Question
*
Create
(
const
std::string& type)
const override
;
48
49
private
:
50
std::unordered_map<std::string, std::unique_ptr<Question>> m_Prototypes;
51
};
52
}
53
54
#endif
mitk::Forms::IQuestionFactory
Register subclasses of Question to create instances of them based on their type string.
Definition:
mitkIQuestionFactory.h:35
mitk::Forms::QuestionFactory
Default implementation of IQuestionFactory using prototype-based creation.
Definition:
mitkQuestionFactory.h:31
mitk::Forms::QuestionFactory::QuestionFactory
QuestionFactory()
mitk::Forms::QuestionFactory::Create
Question * Create(const std::string &type) const override
Create a new question instance by cloning the registered prototype for the given type.
mitk::Forms::QuestionFactory::Register
void Register(Question *question) override
Register a question prototype. Takes ownership of the pointer.
mitk::Forms::QuestionFactory::~QuestionFactory
~QuestionFactory() override
mitk::Forms::Question
Abstract base class for all types of questions used in a Form.
Definition:
mitkQuestion.h:38
mitkIQuestionFactory.h
mitk::Forms
Definition:
mitkCheckboxesQuestion.h:19
src
MITK
Modules
Forms
src
mitkQuestionFactory.h
Generated by
1.9.1