Default implementation of IQuestionFactory using prototype-based creation.
More...
#include <mitkQuestionFactory.h>
Default implementation of IQuestionFactory using prototype-based creation.
Stores question prototypes keyed by their type string and creates new instances by cloning the matching prototype.
Definition at line 30 of file mitkQuestionFactory.h.
◆ QuestionFactory()
| mitk::Forms::QuestionFactory::QuestionFactory |
( |
| ) |
|
◆ ~QuestionFactory()
| mitk::Forms::QuestionFactory::~QuestionFactory |
( |
| ) |
|
|
override |
◆ Create()
| Question* mitk::Forms::QuestionFactory::Create |
( |
const std::string & |
type | ) |
const |
|
overridevirtual |
Create a new question instance by cloning the registered prototype for the given type.
- Parameters
-
| type | The question type string. |
- Returns
- A new Question instance, or nullptr if no prototype is registered for this type.
Implements mitk::Forms::IQuestionFactory.
◆ Register()
| void mitk::Forms::QuestionFactory::Register |
( |
Question * |
question | ) |
|
|
overridevirtual |
Register a question prototype. Takes ownership of the pointer.
- Parameters
-
| question | The prototype question to register. Its type string is used as the key. |
Implements mitk::Forms::IQuestionFactory.
The documentation for this class was generated from the following file: