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()
This method needs to be called with bootstrapping a software. It mainly registers default and type-specific implementations of the built-in box-functions. In addition, in debug-compilations, static vtables are registered.
The standard bootstrap code of ALib will perform this. Only if fileset Modules is not included in the ALib Distribution, this function has to be invoked "manually".
Multiple invocations of this method are ignored.
- See also
- For information about using this method, consult chapter 3.6 Bootstrapping Small Modules of the ALib Programmer's Manual.
Definition at line 732 of file boxing.cpp.
◆ BootstrapRegister()
void aworx::lib::boxing::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 Memory 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( aworx::lib::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 154 of file boxing.hpp.
◆ BootstrapRegisterDefault()
void aworx::lib::boxing::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 Memory 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( aworx::lib::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 190 of file boxing.hpp.