ALib C++ Library
Library Version: 2510 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 \ref mainpage_license "Boost Software 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 \ref alib_manual_appendix_callerinfo of the General Programmer's Manual.
18/// - Macros \ref ALIB_CALLER, \ref ALIB_CALLER_PRUNED, \ref ALIB_COMMA_CALLER_PRUNED and
19/// \ref 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/// \alib{strings::APPENDABLES;AppendableTraits<lang::CallerInfo,TChar,TAllocator>}.
23/// - Class \alib{format;FMTCallerInfo} defines a format specification to customize
24/// the output.
25/// As always, \alib{format;FMTCallerInfo;that syntax} is directly available in
26/// placeholder fields of class \alib{format;FormatterPythonStyle}.
28{
29 const char* File{nullptr}; ///< The name of the source file as given by compiler.
30 int Line{0}; ///< The line number within #File.
31 const char* Func{nullptr}; ///< The function name of the source location. Nulled if
32 ///< the location is not inside a function or method.
33 ///
34 #if ALIB_EXT_LIB_THREADS_AVAILABLE
35 std::thread::id ThreadID; ///< The ID of the calling thread.
36 #endif
37 const std::type_info* TypeInfo{nullptr}; ///< The calling type.
38};
39
40
41} // namespace alib[::lang]
42
43/// Type alias in namespace \b alib.
45
46} // namespace [alib]
47
48
49
#define ALIB_EXPORT
Definition alib.inl:488
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.