This is the reference documentation of sub-namespace boxing
of the ALib C++ Library , which holds types of library module ALib Boxing .
Extensive documentation for this module is provided with ALib Module Boxing - Programmer's Manual.
◆ Bootstrap()
◆ BootstrapRegister()
template<typename TFDecl , typename TMapping >
void BootstrapRegister |
( |
typename TFDecl::Signature | function | ) |
|
|
inline |
Registers box-function function of type TFDecl for boxes of mapped type TMapping .
- Attention
- Function registration and function invocation are not protected against racing conditions of multi-threaded access. For this reason, it is advised to invoke this function exclusively while bootstrapping a software, when no threads are started, yet. Registrations can be made prior to bootstrapping ALib , respectively during or after phase BootstrapPhases::PrepareResources .
-
If for any reason registration is performed after bootstrapping ALib and module ALib Monomem is included in the ALib Distribution , and this function is invoked after ALib was bootstrapped, then prior to an invocation of this method, mutex GlobalAllocatorLock has to be acquired. This can be done with:
ALIB_LOCK_WITH( alib::monomem::GlobalAllocatorLock )
-
Note that even when this lock is set, still multi-threaded access to registration and/or box-function invocations is not allowed.
- Template Parameters
-
- Parameters
-
function | Pointer to the function implementation. |
Definition at line 120 of file boxing.hpp.
◆ BootstrapRegisterDefault()
template<typename TFDecl >
void BootstrapRegisterDefault |
( |
typename TFDecl::Signature | function | ) |
|
|
inline |
Registers a default implementation of a box-function, which is invoked if no type-specific implementation is registered for a mapped type.
- Attention
- Function registration and function invocation are not protected against racing conditions of multi-threaded access. For this reason, it is advised to invoke this function exclusively while bootstrapping a software, when no threads are started, yet. Registrations can be made prior to bootstrapping ALib , respectively during or after phase BootstrapPhases::PrepareResources .
-
If for any reason registration is performed after bootstrapping ALib and module ALib Monomem is included in the ALib Distribution , and this function is invoked after ALib was bootstrapped, then prior to an invocation of this method, mutex GlobalAllocatorLock has to be acquired. This can be done with:
ALIB_LOCK_WITH( alib::monomem::GlobalAllocatorLock )
-
Note that even when this lock is set, still multi-threaded access to registration and/or box-function invocations is not allowed.
- Template Parameters
-
- Parameters
-
function | Pointer to the function's default implementation. |
Definition at line 156 of file boxing.hpp.