Reusable singleton, factory, and locking helpers.
More...
◆ GMP_DISABLE_CONSTRUCTION
| #define GMP_DISABLE_CONSTRUCTION |
( |
|
Class | ) |
|
This macro grants gmp::singleton<Class> friendship and makes the default constructor private, which is a common pattern for CRTP singleton types.
- Parameters
-
| Class | The singleton-derived class type. |
- Example
};
CRTP-based singleton helper with optional dead-reference recovery.
#define GMP_DISABLE_CONSTRUCTION(Class)
Prevent direct public construction of a singleton-derived type.
Definition at line 181 of file singleton.hpp.
◆ GMP_FACTORY_REGISTER
| #define GMP_FACTORY_REGISTER |
( |
|
AbstractProduct, |
|
|
|
ConstructorArgs, |
|
|
|
... |
|
) |
| |
This macro creates static registration objects for gmp::object_factory<AbstractProduct, ...>. It supports both single constructor-argument forms and tuple forms, and it also supports explicit (key, type) registration pairs.
- Parameters
-
| AbstractProduct | The abstract product base type managed by the factory. |
| ConstructorArgs | Either a single constructor argument type or a tuple of types. |
| ... | Concrete product registrations. Each item can be:
- a concrete type name, using that type name as the registration key
- a tuple
(key, ConcreteType) for an explicit string key
|
- Example
#define GMP_FACTORY_REGISTER(AbstractProduct, ConstructorArgs,...)
Register one or more concrete product types with an object factory.
Definition at line 184 of file object_factory.hpp.
◆ GMP_FACTORY_REGISTER_NO_ARGS
| #define GMP_FACTORY_REGISTER_NO_ARGS |
( |
|
AbstractProduct, |
|
|
|
ConcreteProduct |
|
) |
| |
◆ GMP_FACTORY_REGISTER_WITH_ARGS
| #define GMP_FACTORY_REGISTER_WITH_ARGS |
( |
|
AbstractProduct, |
|
|
|
ConstructorArgs, |
|
|
|
ConcreteProduct |
|
) |
| |
◆ destroyed_
◆ pInstance_