Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
mitk::Forms::IQuestionFactory Class Referenceabstract

Register subclasses of Question to create instances of them based on their type string. More...

#include <mitkIQuestionFactory.h>

Inheritance diagram for mitk::Forms::IQuestionFactory:

Public Member Functions

virtual ~IQuestionFactory ()
 
virtual void Register (Question *question)=0
 Register a Question subclass for the instance creation based on its type string. More...
 
virtual QuestionCreate (const std::string &type) const =0
 Create an instance of a Question subclass based on its type string. More...
 

Static Public Member Functions

static IQuestionFactoryGetInstance ()
 Obtain a pointer to the single instance of this service. More...
 

Detailed Description

Register subclasses of Question to create instances of them based on their type string.

This is a service interface. Obtain a pointer to its single instance via GetInstance().

Each Question subclass must be registered by calling Register(), which is typically done in the module activator class. After Question subclasses are registered, instances of them can be created with Create() based on their type string. This mechanism is primarily used for the deserialization of questions.

Definition at line 34 of file mitkIQuestionFactory.h.

Constructor & Destructor Documentation

◆ ~IQuestionFactory()

virtual mitk::Forms::IQuestionFactory::~IQuestionFactory ( )
virtual

Member Function Documentation

◆ Create()

virtual Question* mitk::Forms::IQuestionFactory::Create ( const std::string &  type) const
pure virtual

Create an instance of a Question subclass based on its type string.

See also
Question::GetType(), Question::CreateAnother()

Implemented in mitk::Forms::QuestionFactory.

◆ GetInstance()

static IQuestionFactory* mitk::Forms::IQuestionFactory::GetInstance ( )
static

Obtain a pointer to the single instance of this service.

◆ Register()

virtual void mitk::Forms::IQuestionFactory::Register ( Question question)
pure virtual

Register a Question subclass for the instance creation based on its type string.

The service takes over ownership of the passed Question pointer.

See also
Question::GetType()

Implemented in mitk::Forms::QuestionFactory.


The documentation for this class was generated from the following file: