qxLib
Classes | Macros
reflection_creator.h File Reference

Contains reflection creator functionality. More...

#include <qx/containers/string/string_view.h>
#include <qx/macros/common.h>
#include <qx/rtti/class_identificator.h>
#include <functional>
#include <map>
#include <memory>

Go to the source code of this file.

Classes

class  qx::reflection_creator< base_class_t, smart_ptr_t, args_t >
 Reflection creator. More...
 

Macros

#define QX_REGISTER_UNIQUE_CREATOR(...)
 Macro for base class. Use YourClass::Creator::create_object. More...
 
#define QX_REGISTER_UNIQUE_CONSTRUCTOR(...)
 Macro for all classes inherited from base class. More...
 
#define QX_REGISTER_SHARED_CREATOR(...)
 Macro for base class. Use YourClass::Creator::create_object. More...
 
#define QX_REGISTER_SHARED_CONSTRUCTOR(...)
 Macro for all classes inherited from base class. More...
 

Detailed Description

Contains reflection creator functionality.

The creator allows you to create instances of the class using its name or ID

Author
Khrapov
Date
9.09.2021

Definition in file reflection_creator.h.

Macro Definition Documentation

◆ QX_REGISTER_SHARED_CONSTRUCTOR

#define QX_REGISTER_SHARED_CONSTRUCTOR (   ...)
Value:
private: \
static inline volatile bool QX_LINE_NAME(s_bRegistered) = Creator::_register_class( \
qx::details::create_shared<CreatorRoot, this_class_type, __VA_ARGS__>, \
get_class_id_static(), \
get_class_name_static())
#define QX_LINE_NAME(prefix)
Do magic! Creates a unique name using the line number.
Definition: common.h:35

Macro for all classes inherited from base class.

std::shared_ptr version

Parameters
...- constructor args types

Definition at line 165 of file reflection_creator.h.

◆ QX_REGISTER_SHARED_CREATOR

#define QX_REGISTER_SHARED_CREATOR (   ...)
Value:
protected: \
using CreatorRoot = this_class_type; \
Reflection creator.

Macro for base class. Use YourClass::Creator::create_object.

std::shared_ptr version

Parameters
...- constructor args types

Definition at line 154 of file reflection_creator.h.

◆ QX_REGISTER_UNIQUE_CONSTRUCTOR

#define QX_REGISTER_UNIQUE_CONSTRUCTOR (   ...)
Value:
private: \
static inline volatile bool QX_LINE_NAME(s_bRegistered) = Creator::_register_class( \
qx::details::create_unique<CreatorRoot, this_class_type, __VA_ARGS__>, \
get_class_id_static(), \
get_class_name_static())

Macro for all classes inherited from base class.

std::unique_ptr version

Parameters
...- constructor args types

Definition at line 141 of file reflection_creator.h.

◆ QX_REGISTER_UNIQUE_CREATOR

#define QX_REGISTER_UNIQUE_CREATOR (   ...)
Value:
using CreatorRoot = this_class_type; \

Macro for base class. Use YourClass::Creator::create_object.

std::unique_ptr version

Parameters
...- constructor args types

Definition at line 131 of file reflection_creator.h.