Elements 6.3.1
A C++ base framework for the Euclid Software.
Loading...
Searching...
No Matches
ThisModule.tpp
Go to the documentation of this file.
1
21// IWYU pragma: private, include "ElementsKernel/ThisModule.h"
22
23#ifndef ELEMENTSKERNEL_ELEMENTSKERNEL_THIS_MODULE_IMPL_
24#error "This file should not be included directly! Use ElementsKernel/ThisModule.h instead"
25#else
26
27#include "ElementsKernel/FuncPtrCast.h" // for FuncPtrCast
28#include "ElementsKernel/ModuleInfo.h" // for ModuleInfo
29
30namespace Elements {
31namespace System {
32
33inline const ModuleInfo& getThisModuleInfo() {
34 static ModuleInfo this_module;
35 if (this_module.isEmpty()) {
36 this_module = ModuleInfo(FuncPtrCast<void*>(getThisModuleInfo));
37 }
38
39 return this_module;
40}
41
42} // namespace System
43} // namespace Elements
44
45#endif // ELEMENTSKERNEL_ELEMENTSKERNEL_THIS_MODULE_IMPL_
defines a Small helper function that allows the cast from void * to function pointer
OS specific details to access at run-time the module configuration of the process.
constexpr DESTPTR FuncPtrCast(SRC *const src_p) noexcept
Cast from void * to function pointer.
static const ModuleInfo & getThisModuleInfo()
function to retrieve the current module