ALib C++ Library
by
Library Version:
2510 R0
Documentation generated by
Loading...
Searching...
No Matches
home
dev
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 \ref mainpage_license "Boost Software 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 \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}.
27
struct
CallerInfo
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.
44
using
CallerInfo
=
lang::CallerInfo
;
45
46
}
// namespace [alib]
47
48
49
ALIB_EXPORT
#define ALIB_EXPORT
Definition
alib.inl:488
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:44
alib::lang::CallerInfo
Definition
callerinfo.inl:28
alib::lang::CallerInfo::File
const char * File
The name of the source file as given by compiler.
Definition
callerinfo.inl:29
alib::lang::CallerInfo::TypeInfo
const std::type_info * TypeInfo
The calling type.
Definition
callerinfo.inl:37
alib::lang::CallerInfo::Line
int Line
The line number within File.
Definition
callerinfo.inl:30
alib::lang::CallerInfo::ThreadID
std::thread::id ThreadID
The ID of the calling thread.
Definition
callerinfo.inl:35
alib::lang::CallerInfo::Func
const char * Func
Definition
callerinfo.inl:31