Reflection creator.
More...
#include <reflection_creator.h>
|
static smart_ptr_t< base_class_t > | create_object (class_identificator id, args_t &&... args) |
| Create object based on class id. More...
|
|
static smart_ptr_t< base_class_t > | create_object (string_view svClassName, args_t &&... args) |
| Create object based on class name. More...
|
|
static bool | _register_class (factory factory, class_identificator id, string_view svClassName) |
| Register class so it can be constructed by creator. More...
|
|
template<class base_class_t, template< class > class smart_ptr_t, class... args_t>
class qx::reflection_creator< base_class_t, smart_ptr_t, args_t >
Reflection creator.
Performs registration of classes inherited from base_class_t and creates their instances by their ID and name. Allocates memory.
- Template Parameters
-
base_class_t | - base class type |
smart_ptr_t | - smart pointer class type |
args_t | - args for type creation |
- Author
- Khrapov
- Date
- 7.09.2021
Definition at line 40 of file reflection_creator.h.
◆ _register_class()
template<class base_class_t , template< class > class smart_ptr_t, class... args_t>
static bool qx::reflection_creator< base_class_t, smart_ptr_t, args_t >::_register_class |
( |
factory |
factory, |
|
|
class_identificator |
id, |
|
|
string_view |
svClassName |
|
) |
| |
|
inlinestatic |
Register class so it can be constructed by creator.
- Parameters
-
factory | - class factory |
id | - class id |
svClassName | - class name |
- Return values
-
Definition at line 83 of file reflection_creator.h.
◆ create_object() [1/2]
template<class base_class_t , template< class > class smart_ptr_t, class... args_t>
static smart_ptr_t<base_class_t> qx::reflection_creator< base_class_t, smart_ptr_t, args_t >::create_object |
( |
class_identificator |
id, |
|
|
args_t &&... |
args |
|
) |
| |
|
inlinestatic |
Create object based on class id.
- Parameters
-
id | - class id |
args | - template parameter pack |
- Return values
-
- | class instance or nullptr if can't find factory or can't create |
Definition at line 52 of file reflection_creator.h.
◆ create_object() [2/2]
template<class base_class_t , template< class > class smart_ptr_t, class... args_t>
static smart_ptr_t<base_class_t> qx::reflection_creator< base_class_t, smart_ptr_t, args_t >::create_object |
( |
string_view |
svClassName, |
|
|
args_t &&... |
args |
|
) |
| |
|
inlinestatic |
Create object based on class name.
- Parameters
-
svClassName | - class name |
args | - template parameter pack |
- Return values
-
- | class instance or nullptr if can't find factory or can't create |
Definition at line 66 of file reflection_creator.h.
The documentation for this class was generated from the following file: