MyGUI: MyGUI::FactoryManager Class Reference

MyGUI 3.4.3

Public Types | Public Member Functions | Static Public Member Functions
MyGUI::FactoryManager Class Reference

`#include <MyGUI_FactoryManager.h>`

## Public Types
using | Delegate = delegates::Delegate<IObject*&>

## Public Member Functions
| FactoryManager (const FactoryManager &)=delete
FactoryManager & | operator= (const FactoryManager &)=delete
| FactoryManager ()
void | initialise ()
void | shutdown ()
void | registerFactory (std::string_view _category, std::string_view _type, Delegate::IDelegate *_delegate)
void | unregisterFactory (std::string_view _category, std::string_view _type)
void | unregisterFactory (std::string_view _category)
bool | isFactoryExist (std::string_view _category, std::string_view _type)
template<typename Type>
void | registerFactory (std::string_view _category)
template<typename Type>
void | registerFactory (std::string_view _category, std::string_view _type)
template<typename Type>
void | unregisterFactory (std::string_view _category)
IObject * | createObject (std::string_view _category, std::string_view _type)
template<typename Type>
Type * | createObject (std::string_view _category)
void | destroyObject (IObject *_object)

## Static Public Member Functions
static FactoryManager & | getInstance ()
static FactoryManager * | getInstancePtr ()
static std::string_view | getClassTypeName ()

## Detailed Description

Definition at line 18 of file MyGUI_FactoryManager.h.

## Member Typedef Documentation

## ◆ Delegate

using MyGUI::FactoryManager::Delegate = delegates::Delegate<IObject*&>

Definition at line 28 of file MyGUI_FactoryManager.h.

## Constructor & Destructor Documentation

## ◆ FactoryManager() [1/2]

MyGUI::FactoryManager::FactoryManager | ( | const FactoryManager & |  | ) |
| delete

## ◆ FactoryManager() [2/2]

MyGUI::FactoryManager::FactoryManager | ( |  | ) |

Definition at line 16 of file MyGUI_FactoryManager.cpp.

## Member Function Documentation

## ◆ createObject() [1/2]

template<typename Type>

Type * MyGUI::FactoryManager::createObject | ( | std::string_view | _category | ) |
| inline

Create object with given _category and _type. Return nullptr if there's no registered factory.

Definition at line 64 of file MyGUI_FactoryManager.h.

## ◆ createObject() [2/2]

IObject * MyGUI::FactoryManager::createObject | ( | std::string_view | _category,
|  | std::string_view | _type )

Create object with given _category and _type. Return nullptr if there's no registered factory.

Definition at line 80 of file MyGUI_FactoryManager.cpp.

## ◆ destroyObject()

void MyGUI::FactoryManager::destroyObject | ( | IObject * | _object | ) |

Destroy object

Definition at line 104 of file MyGUI_FactoryManager.cpp.

## ◆ getClassTypeName()

std::string_view MyGUI::FactoryManager::getClassTypeName | ( |  | ) |
| static

## ◆ getInstance()

FactoryManager & MyGUI::FactoryManager::getInstance | ( |  | ) |
| static

## ◆ getInstancePtr()

FactoryManager * MyGUI::FactoryManager::getInstancePtr | ( |  | ) |
| static

## ◆ initialise()

void MyGUI::FactoryManager::initialise | ( |  | ) |

Definition at line 21 of file MyGUI_FactoryManager.cpp.

## ◆ isFactoryExist()

bool MyGUI::FactoryManager::isFactoryExist | ( | std::string_view | _category,
|  | std::string_view | _type )

Is factory for specified _category and _type exist.

Definition at line 126 of file MyGUI_FactoryManager.cpp.

## ◆ operator=()

FactoryManager & MyGUI::FactoryManager::operator= | ( | const FactoryManager & |  | ) |
| delete

## ◆ registerFactory() [1/3]

template<typename Type>

void MyGUI::FactoryManager::registerFactory | ( | std::string_view | _category | ) |
| inline

Register factory for specified _category.

Definition at line 41 of file MyGUI_FactoryManager.h.

## ◆ registerFactory() [2/3]

template<typename Type>

void MyGUI::FactoryManager::registerFactory | ( | std::string_view | _category,
|  | std::string_view | _type )
| inline

Register factory for specified _category and _type.

Definition at line 48 of file MyGUI_FactoryManager.h.

## ◆ registerFactory() [3/3]

void MyGUI::FactoryManager::registerFactory | ( | std::string_view | _category,
|  | std::string_view | _type,
|  | Delegate::IDelegate * | _delegate )

Register delegate function that creates object for specified _category and _type.

Definition at line 39 of file MyGUI_FactoryManager.cpp.

## ◆ shutdown()

void MyGUI::FactoryManager::shutdown | ( |  | ) |

Definition at line 30 of file MyGUI_FactoryManager.cpp.

## ◆ unregisterFactory() [1/3]

template<typename Type>

void MyGUI::FactoryManager::unregisterFactory | ( | std::string_view | _category | ) |
| inline

Unegister factory for specified _category.

Definition at line 55 of file MyGUI_FactoryManager.h.

## ◆ unregisterFactory() [2/3]

void MyGUI::FactoryManager::unregisterFactory | ( | std::string_view | _category | ) |

Unregister all delegate functions that creates object for specified _category.

Definition at line 70 of file MyGUI_FactoryManager.cpp.

## ◆ unregisterFactory() [3/3]

void MyGUI::FactoryManager::unregisterFactory | ( | std::string_view | _category,
|  | std::string_view | _type )

Unregister delegate function that creates object for specified _category and _type.

Definition at line 54 of file MyGUI_FactoryManager.cpp.

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

- MyGUI_FactoryManager.h
- MyGUI_FactoryManager.cpp