ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
DbgBoxing Struct Reference

Description:

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 before invoking a method.

Note
While some of the methods are written with a non-capital letter (which usually indicates that they are 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.
Availability
This struct is only available if compiler symbol ALIB_DEBUG_BOXING is set.
The following methods are available independent of 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 BaseCamp is included in the ALib Distribution.
See also
Chapter 12.7 Debug Helpers of the Programmer's Manual of module ALib Boxing.

Definition at line 124 of file dbgboxing.hpp.

#include <dbgboxing.hpp>

Collaboration diagram for DbgBoxing:
[legend]

Public Static Field Index:

static ALIB_API std::vector< StringRemovableNamespaces
 See method removeNamespaces. Pre-initialized with "alib::".
 

Public Static Method Index:

static ALIB_API AString DumpAll ()
 
static ALIB_API void DumpCustomFunctionHashMapMetrics (AString &target, bool detailedBucketList)
 
static ALIB_API alib::AString DumpFunctions (const std::vector< std::pair< const std::type_info *, uinteger > > &input, const String &headline=EMPTY_STRING, const String &indent=EMPTY_STRING)
 
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 AString DumpVTables (bool staticVtables, bool includeFunctions=false)
 
static ALIB_API void dumpVTables (AString &target, detail::DbgStringTable< const detail::VTable * > &vtableNames, bool staticVtables, bool includeFunctions)
 
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 AStringremoveNamespaces (AString &string, integer startIndex)
 
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 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)
 
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 Method Index:

 DbgBoxing ()=delete
 Not constructible.
 

Field Details:

◆ RemovableNamespaces

std::vector< alib::String > RemovableNamespaces
static
Initial value:
{
A_CHAR( "alib::boxing::" ),
A_CHAR( "alib::" ),
}
#define A_CHAR(STR)

See method removeNamespaces. Pre-initialized with "alib::".

Definition at line 524 of file dbgboxing.hpp.

Method Details:

◆ DumpAll()

AString DumpAll ( )
static

First, lists all mapped types with static, then those with dynamic vtables. Along with each type, its default function implementations are given.

Availability
This method is included only if module ALib BaseCamp is included in the ALib Distribution.
Returns
A string containing the dump.

Definition at line 432 of file dbgboxing.cpp.

Here is the call graph for this function:

◆ DumpCustomFunctionHashMapMetrics()

void DumpCustomFunctionHashMapMetrics ( AString & target,
bool detailedBucketList )
static

Invokes DbgDumpDistribution on the internal hash table used to register and fetch implementations of custom box-functions.

Availability
This method is included only if module ALib BaseCamp is included in the ALib Distribution and compiler symbol ALIB_DEBUG_CONTAINERS is given.
Parameters
[out]targetThe target string to write to.
detailedBucketListIf true is given, for each bucket a line with its size value and a "size bar" is written.

Definition at line 261 of file vtable.cpp.

Here is the call graph for this function:

◆ DumpFunctions()

AString DumpFunctions ( const std::vector< std::pair< const std::type_info *, uinteger > > & input,
const String & headline = EMPTY_STRING,
const String & indent = EMPTY_STRING )
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 their counter information.

Availability
This method is included only if module ALib BaseCamp is included in the ALib Distribution.
Parameters
inputA list of types.
headlineThe headline to write.
indentSpaces to write before each entry.
Returns
A list of demangled type names.

Definition at line 286 of file dbgboxing.cpp.

Here is the call graph for this function:

◆ dumpFunctions()

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

Helper for (bigger part of) DumpFunctions.

Availability
This method is included only if module ALib BaseCamp is included in the ALib Distribution.
Parameters
inputA list of types and usage numbers.
[out]outputA string to write to.
headlineThe headline to write.
indentSpaces to write before each entry.
tmpStringsA buffer needed for internal use.

Definition at line 307 of file dbgboxing.cpp.

Here is the call graph for this function:

◆ DumpVTables()

AString DumpVTables ( bool staticVtables,
bool includeFunctions = false )
static

Lists all mapped types with either static or dynamic vtables. Along with each type, its default function implementations are given.

Availability
This method is included only if module ALib BaseCamp is included in the ALib Distribution.
Parameters
staticVtablesIf true, only types with static vtables are listed. Otherwise only those with dynamic vtables.
includeFunctionsIf true for each type, the list of specialized functions are listed.
Returns
A string containing the dump.

Definition at line 348 of file dbgboxing.cpp.

Here is the call graph for this function:

◆ dumpVTables()

void dumpVTables ( AString & target,
detail::DbgStringTable< const detail::VTable * > & vtableNames,
bool staticVtables,
bool includeFunctions )
static

Internally used by methods DumpVTables and DumpAll.

Availability
This method is included only if module ALib BaseCamp is included in the ALib Distribution.
Parameters
[out]targetThe target string to write to.
[out]vtableNamesOutput parameter that receives the strings.
staticVtablesIf true, only types with static vtables are listed. Otherwise only those with dynamic vtables.
includeFunctionsIf true, For each vtable the list of specialized function is written.

Definition at line 370 of file dbgboxing.cpp.

Here is the call graph for this function:

◆ getFunctionTypes()

void getFunctionTypes ( const detail::FunctionTable & input,
std::vector< std::pair< const std::type_info *, uinteger > > & output )
static

Collects all function declarator types of the given box-function table.

See also
The result can be conveniently passed to DumpFunctions.
Parameters
inputThe function table to use.
outputThe result vector to fill.

Definition at line 237 of file vtable.cpp.

◆ GetKnownFunctionTypes()

std::vector< std::pair< const std::type_info *, uinteger > > GetKnownFunctionTypes ( )
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.

See also
The result can be conveniently passed to DumpFunctions.
Returns
A vector of pairs of type information structs and usage numbers.

Definition at line 201 of file vtable.cpp.

◆ GetKnownVTables()

std::vector< detail::VTable * > GetKnownVTables ( )
static

Returns all vtable singletons that have been created during program execution so far. One vtable is created for each mapped type used.

See also
The result can be conveniently passed to DumpVTables.
Returns
A vector of pointers to objects of type detail::VTable.

Definition at line 175 of file vtable.cpp.

◆ GetSpecificFunctionTypes() [1/2]

static std::vector< std::pair< const std::type_info *, uinteger > > GetSpecificFunctionTypes ( const Box & box)
inlinestatic

Convenience function: invokes GetSpecificFunctionTypes(const detail::VTable*) with the vtable of the box created or passed with the invocation.

See also
The result can be conveniently passed to DumpFunctions.
Parameters
boxA box that the vtable is used of.
Returns
A vector of type information structs.

Definition at line 207 of file dbgboxing.hpp.

Here is the call graph for this function:

◆ GetSpecificFunctionTypes() [2/2]

static std::vector< std::pair< const std::type_info *, uinteger > > GetSpecificFunctionTypes ( const detail::VTable * vtable)
inlinestatic

Collects all function declarator types, with type-specific implementations. Parameter vtable might for example be retrieved from a box instance with Box::DbgGetVTable.

See also
The result can be conveniently passed to DumpFunctions.
Parameters
vtableThe vtable to get all function implementations for.
Returns
A vector of type information structs.

Definition at line 188 of file dbgboxing.hpp.

Here is the call graph for this function:

◆ removeNamespaces()

AString & removeNamespaces ( AString & string,
integer startIndex )
static

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 before invoking any method.

Parameters
stringThe string to remove the namespace from.
startIndexThe index within the string to start searching for removable namespaces.
Returns
A string containing the requested information.

Definition at line 128 of file dbgboxing.cpp.

◆ TypeInfo() [1/2]

template<typename TBoxable >
static AString TypeInfo ( const Box & box,
const String & headline = A_CHAR("Boxing Information For Boxable Type: "),
const String & indent = A_CHAR("  "                                   ) )
inlinestatic

Collects necessary information from template type TBoxable and invokes typeInfo.
See method TypeInfo.

Availability
This method is included only if module ALib Strings is included in the ALib Distribution.
Template Parameters
TBoxableThe boxable type to investigate in.
Parameters
boxA box containing a "sample" of TBoxable.. If a different box is given this method has undefined behavior
headlineThe headline to write.
indentSpaces to write before each entry.
Returns
A string containing the requested information.

Definition at line 319 of file dbgboxing.hpp.

Here is the call graph for this function:

◆ TypeInfo() [2/2]

template<typename TBoxable >
static AString TypeInfo ( const String & headline = A_CHAR( "Boxing Information For Boxable Type: "),
const String & indent = A_CHAR( "  "                                   ) )
inlinestatic

Returns human-readable information about the type TBoxable in respect to how boxing 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

Note
Does not work for type void*, which is not customizable anyhow (always boxed as void*).
Availability
This method is included only if module ALib Strings is included in the ALib Distribution.
Template Parameters
TBoxableThe boxable type to investigate in.
Parameters
headlineThe headline to write.
indentSpaces to write before each entry.
Returns
A string containing the requested information.

Definition at line 295 of file dbgboxing.hpp.

Here is the call graph for this function:

◆ typeInfo()

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 )
static

See method TypeInfo, which invokes this method using template parameter TBoxable

Availability
This method is included only if module ALib Strings is included in the ALib Distribution.
Parameters
[out]targetThe target string.
vtableThe vtable of the mapped type.
indentEmpty or a string of spaces that are alwys preprended before each entry.
srcIsPointerDenotes if TBoxable is a pointer type.
isValueTypeCustomizedDenotes if the value type of TBoxable is customized.
isPointerTypeCustomizedDenotes if the pointer type of TBoxable is customized.
fitsToPlaceholderDenotes if the value type of TBoxable would fit to placeholder.
copyConstructibleDenotes if the value type of TBoxable is copy constructible.
triviallyDestructibleDenotes if the value type of TBoxable is trivially destructible.
isUnboxableDenotes if TBoxable is unboxable.

Definition at line 168 of file dbgboxing.cpp.

Here is the call graph for this function:

◆ TypeName() [1/2]

static AString TypeName ( const Box & box)
inlinestatic

Convenience function: invokes TypeName(const detail::VTable*) with the vtable of the box created or passed with the invocation.

Availability
This method is included only if module ALib Strings is included in the ALib Distribution.
Parameters
boxThe box to get the mapped type name for.
Returns
A string containing the requested information.

Definition at line 244 of file dbgboxing.hpp.

Here is the call graph for this function:

◆ TypeName() [2/2]

static AString TypeName ( const detail::VTable * vtable)
inlinestatic

Writes the (demangled) mapped type that the given vtable represents.

Availability
This method is included only if module ALib Strings is included in the ALib Distribution.
Parameters
vtableThe vtable to get the mapped type name for.
Returns
A string containing the requested information.

Definition at line 226 of file dbgboxing.hpp.

Here is the call graph for this function:

◆ typeName()

void typeName ( const detail::VTable * vtable,
AString & result )
static

Implementation of TypeName.

Availability
This method is included only if module ALib Strings is included in the ALib Distribution.
Parameters
vtableThe vtable.
[out]resultThe target string to write the type information to.

Definition at line 145 of file dbgboxing.cpp.

Here is the call graph for this function:

The documentation for this struct was generated from the following files: