ALib C++ Framework
by
Library Version:
2511 R0
Documentation generated by
Loading...
Searching...
No Matches
A-Worx
ALib
src
alib
lang
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
//==================================================================================================
8
ALIB_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".
28
struct
CallerInfo
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.
45
using
CallerInfo
=
lang::CallerInfo
;
46
47
}
// namespace [alib]
ALIB_EXPORT
#define ALIB_EXPORT
Definition
alib.inl:562
alib::lang
Definition
allocation.inl:8
alib
Definition
ALib.Boxing.StdFunctors.H:18
alib::CallerInfo
lang::CallerInfo CallerInfo
Type alias in namespace alib.
Definition
callerinfo.inl:45
alib::lang::CallerInfo
Definition
callerinfo.inl:29
alib::lang::CallerInfo::File
const char * File
The name of the source file as given by compiler.
Definition
callerinfo.inl:30
alib::lang::CallerInfo::TypeInfo
const std::type_info * TypeInfo
The calling type.
Definition
callerinfo.inl:38
alib::lang::CallerInfo::Line
int Line
The line number within #".File".
Definition
callerinfo.inl:31
alib::lang::CallerInfo::ThreadID
std::thread::id ThreadID
The ID of the calling thread.
Definition
callerinfo.inl:36
alib::lang::CallerInfo::Func
const char * Func
Definition
callerinfo.inl:32