#include <dbgboxing.hpp>
Provides low- and high-level debug methods for ALib Boxing.
This type is not constructible, as all method are static.
To shorten custom type names, custom namespaces might be added to static vector RemovableNamespaces prior to invoking a method.
protected
or private
), those are still declared public
. These methods are "inner" methods used by the similar named capitalized methods. Their use is recommended, when writing custom "composite" debug-functions, as the various output parameters might be reused with subsequent invocations.This struct is only available if compilation symbol ALIB_DEBUG_BOXING is set.
The following methods are available independent from the ALib Distribution.
The following methods become available if module ALib Strings is included in the ALib Distribution:
All other methods become available if module ALib Text is included in the ALib Distribution.
Definition at line 131 of file dbgboxing.hpp.
Public Static Fields | |
static ALIB_API std::vector< String > | RemovableNamespaces |
Public Static Methods | |
static ALIB_API AString | DumpAll () |
static ALIB_API void | DumpCustomFunctionHashMapMetrics (AString &target, bool detailedBucketList) |
static ALIB_API void | dumpFunctions (const std::vector< std::pair< const std::type_info *, uinteger >> &input, AString &output, const String &headline, const String &indent, detail::DbgStringTable< uinteger > &tmpStrings) |
static ALIB_API aworx::AString | DumpFunctions (const std::vector< std::pair< const std::type_info *, uinteger >> &input, const String &headline=EmptyString(), const String &indent=EmptyString()) |
static ALIB_API void | dumpVTables (AString &target, detail::DbgStringTable< const detail::VTable * > &vtableNames, bool staticVtables, bool includeFunctions) |
static ALIB_API AString | DumpVTables (bool staticVtables, bool includeFunctions=false) |
static ALIB_API void | getFunctionTypes (const detail::FunctionTable &input, std::vector< std::pair< const std::type_info *, uinteger >> &output) |
static ALIB_API std::vector< std::pair< const std::type_info *, uinteger > > | GetKnownFunctionTypes () |
static ALIB_API std::vector< detail::VTable * > | GetKnownVTables () |
static std::vector< std::pair< const std::type_info *, uinteger > > | GetSpecificFunctionTypes (const Box &box) |
static std::vector< std::pair< const std::type_info *, uinteger > > | GetSpecificFunctionTypes (const detail::VTable *vtable) |
static ALIB_API AString & | removeNamespaces (AString &string, integer startIndex) |
static ALIB_API void | typeInfo (AString &target, const detail::VTable *vtable, const String &indent, bool srcIsPointer, bool isValueTypeCustomized, bool isPointerTypeCustomized, bool fitsToPlaceholder, bool copyConstructible, bool triviallyDestructible, bool isUnboxable) |
template<typename TBoxable > | |
static AString | TypeInfo (const Box &box, const String &headline=A_CHAR("Boxing Information For Boxable Type: "), const String &indent=A_CHAR(" ")) |
template<typename TBoxable > | |
static AString | TypeInfo (const String &headline=A_CHAR("Boxing Information For Boxable Type: "), const String &indent=A_CHAR(" ")) |
static AString | TypeName (const Box &box) |
static AString | TypeName (const detail::VTable *vtable) |
static ALIB_API void | typeName (const detail::VTable *vtable, AString &result) |
Public Methods | |
DbgBoxing ()=delete | |
|
delete |
Not constructible
|
static |
First, lists all mapped types with static, then those with dynamic vtables. Along with each type, its default function implementations are given.
This method is included only if module ALib Text is included in the ALib Distribution.
Definition at line 452 of file dbgboxing.cpp.
|
static |
Invokes DbgDumpDistribution on the internal hash table used to register and fetch implementations of custom box-functions.
This method is included only if module ALib Text is included in the ALib Distribution and compilation symbol ALIB_DEBUG_MONOMEM is given.
[out] | target | The target string to write to. |
detailedBucketList | If true is given, for each bucket a line with its size value and a "size bar" is written. |
Definition at line 277 of file vtable.cpp.
|
static |
Helper for (bigger part of) DumpFunctions.
This method is included only if module ALib Text is included in the ALib Distribution.
input | A list of types and usage numbers. | |
[out] | output | A string to write to. |
headline | The headline to write. | |
indent | Spaces to write prior to each entry. | |
tmpStrings | A buffer needed for internal use. |
Definition at line 323 of file dbgboxing.cpp.
|
static |
Takes a vector of pairs of std::type_info
pointers and a usage counter, and returns an AString with a sorted list of type names including counter information.
This method is included only if module ALib Text is included in the ALib Distribution.
input | A list of types. |
headline | The headline to write. |
indent | Spaces to write prior to each entry. |
Definition at line 303 of file dbgboxing.cpp.
|
static |
Internally used by overloaded DumpVTables methods.
This method is included only if module ALib Text is included in the ALib Distribution.
[out] | target | The target string to write to. |
[out] | vtableNames | Output parameter that receives the strings. |
staticVtables | If true , only types with static vtables are listed. Otherwise only those with dynamic vtables. | |
includeFunctions | If true , For each vtable the list of specialized function is written. |
Definition at line 386 of file dbgboxing.cpp.
|
static |
Lists all mapped types with either static or dynamic vtables. Along with each type, its default function implementations are given.
This method is included only if module ALib Text is included in the ALib Distribution.
staticVtables | If true , only types with static vtables are listed. Otherwise only those with dynamic vtables. |
includeFunctions | If true for each type, the list of specialized functions are listed. |
Definition at line 365 of file dbgboxing.cpp.
|
static |
Collects all function declarator types of the given box-function table.
input | The function table to use. |
output | The result vector to fill. |
Definition at line 253 of file vtable.cpp.
|
static |
Returns a vector of std::type_info
objects, representing all function types that either a default or a type specific implementation has been registered for.
A second value in the vector provides the number of invocations of a default implementation. If such is not available, this number is set to std::numeric_limits<uinteger>::max()
.
The list includes the built-in function types.
Definition at line 217 of file vtable.cpp.
|
static |
Returns all vtable singletons that have been created during program execution so far. One vtable is created for each mapped type used.
Definition at line 191 of file vtable.cpp.
|
inlinestatic |
Convenience function: invokes GetSpecificFunctionTypes(const detail::VTable*) with the vtable of the box created or passed with the invocation.
box | A box that the vtable is used of. |
Definition at line 214 of file dbgboxing.hpp.
|
inlinestatic |
Collects all function declarator types, with type-specific implementations. Parameter vtable might for example be retrieved from a box instance with Box::DbgGetVTable.
vtable | The vtable to get all function implementations for. |
Definition at line 195 of file dbgboxing.hpp.
Removes namespaces in the given string. The function is used with all methods that create string values containing type names. Note that custom namespaces might be added to static field RemovableNamespaces prior to invoking any method.
string | The string to remove the namespace from. |
startIndex | The index within the string to start searching for removable namespaces. |
Definition at line 145 of file dbgboxing.cpp.
|
static |
See method TypeInfo, which invokes this method using template parameter TBoxable
This method is included only if module ALib Strings is included in the ALib Distribution.
[out] | target | The target string. |
vtable | The vtable of the mapped type. | |
indent | Empty or a string of spaces that are alwys preprended prior to each entry. | |
srcIsPointer | Denotes if TBoxable is a pointer type. | |
isValueTypeCustomized | Denotes if the value type of TBoxable is customized. | |
isPointerTypeCustomized | Denotes if the pointer type of TBoxable is customized. | |
fitsToPlaceholder | Denotes if the value type of TBoxable would fit to placeholder. | |
copyConstructible | Denotes if the value type of TBoxable is copy constructible. | |
triviallyDestructible | Denotes if the value type of TBoxable is trivially destructible. | |
isUnboxable | Denotes if TBoxable is unboxable. |
Definition at line 185 of file dbgboxing.cpp.
|
inlinestatic |
Collects necessary information from template type TBoxable and invokes typeInfo.
See method TypeInfo.
This method is included only if module ALib Strings is included in the ALib Distribution.
TBoxable | The boxable type to investigate in. |
box | A box containing a "sample" of TBoxable.. If a different box is given this method has undefined behavior |
headline | The headline to write. |
indent | Spaces to write prior to each entry. |
Definition at line 327 of file dbgboxing.hpp.
|
inlinestatic |
Returns human readable information about the type TBoxable in respect to how boxing of objects of this type is performed.
The implementation of this method creates a default value of TBoxable, boxes this and returns the result of TypeInfo(const Box&,const String&,const String&). Hence, for types that are not default constructible, inner function TypeInfo has to be used with an accordingly boxed "sample" of type TBoxable
void*
, which is not customizable anyhow (always boxed as void*
).This method is included only if module ALib Strings is included in the ALib Distribution.
TBoxable | The boxable type to investigate in. |
headline | The headline to write. |
indent | Spaces to write prior to each entry. |
Definition at line 303 of file dbgboxing.hpp.
Convenience function: invokes TypeName(const detail::VTable*) with the vtable of the box created or passed with the invocation.
This method is included only if module ALib Strings is included in the ALib Distribution.
box | The box to get the mapped type name for. |
Definition at line 251 of file dbgboxing.hpp.
|
inlinestatic |
Writes the (demangled) mapped type that the given vtable represents.
This method is included only if module ALib Strings is included in the ALib Distribution.
vtable | The vtable to get the mapped type name for. |
Definition at line 233 of file dbgboxing.hpp.
|
static |
Implementation of TypeName.
This method is included only if module ALib Strings is included in the ALib Distribution.
vtable | The vtable. | |
[out] | result | The target string to write the type information to. |
Definition at line 162 of file dbgboxing.cpp.
|
static |
See method removeNamespaces. Pre-initialized with "aworx::lib::".
Definition at line 530 of file dbgboxing.hpp.