ALib C++ Framework
by
Library Version: 2511 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
callerinfo.inl
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of module \alib_lang of the \aliblong.
4///
5/// \emoji :copyright: 2013-2025 A-Worx GmbH, Germany.
6/// Published under #"mainpage_license".
7//==================================================================================================
8ALIB_EXPORT namespace alib { namespace lang {
9
10/// A simple struct that holds source code location information.
11/// Usually, this is information about a caller of a function, used with debug-compilations.
12/// Module \alib_alox might be explicitly compiled to include such caller information also in
13/// release-versions of software.
14///
15///
16/// @see
17/// - Chapter #"alib_manual_appendix_callerinfo" of the General Programmer's Manual.
18/// - Macros #"ALIB_CALLER", #"ALIB_CALLER_PRUNED", #"ALIB_COMMA_CALLER_PRUNED" and
19/// #"ALIB_CALLER_NULLED".
20/// - Instances of this type are appendable to class \b AString in a default way.
21/// This is implemented with functor
22/// #"AppendableTraits<lang::CallerInfo, TChar, TAllocator>".
23///
24/// - Class #"FMTCallerInfo" defines a format specification to customize
25/// the output.
26/// As always, #"FMTCallerInfo;that syntax" is directly available in
27/// placeholder fields of class #"FormatterPythonStyle".
29{
30 const char* File{nullptr}; ///< The name of the source file as given by compiler.
31 int Line{0}; ///< The line number within #".File".
32 const char* Func{nullptr}; ///< The function name of the source location. Nulled if
33 ///< the location is not inside a function or method.
34 ///
35 #if ALIB_EXT_LIB_THREADS_AVAILABLE
36 std::thread::id ThreadID; ///< The ID of the calling thread.
37 #endif
38 const std::type_info* TypeInfo{nullptr}; ///< The calling type.
39};
40
41
42} // namespace alib[::lang]
43
44/// Type alias in namespace \b alib.
46
47} // namespace [alib]
#define ALIB_EXPORT
Definition alib.inl:562
lang::CallerInfo CallerInfo
Type alias in namespace alib.
const char * File
The name of the source file as given by compiler.
const std::type_info * TypeInfo
The calling type.
int Line
The line number within #".File".
std::thread::id ThreadID
The ID of the calling thread.