10 bool srcIsUnboxableStringType,
11 bool isValueTypeCustomized,
12 bool isPointerTypeCustomized,
13 bool fitsToPlaceholder,
14 bool copyConstructible,
15 bool triviallyDestructible,
26 target << indent <<
"Mapped Type: ";
typeName(vtable, target ); target <<
" (Enumeration)" <<
NEW_LINE;
27 target << indent <<
"Customized: Not customizable (always boxed as enum value type)" <<
NEW_LINE;
31 bool arrayBoxing = vtable->
IsArray();
32 bool srcIsValue = !srcIsPointer;
34 target << indent <<
"Mapped Type: ";
typeName(vtable, target ); target <<
NEW_LINE;
36 target <<indent <<
"Customized T: " << isValueTypeCustomized <<
NEW_LINE;
37 target <<indent <<
"Customized T*: " << isPointerTypeCustomized <<
NEW_LINE;
38 target <<indent <<
"Is Unboxable: "
40 ? ( srcIsValue && valueBoxing && isValueTypeCustomized
41 ?
"Yes (By customization)"
43 : srcIsValue && valueBoxing && !isValueTypeCustomized
44 ?
"Yes (Value fits in placeholder and is copy-constructible)"
46 : srcIsPointer && pointerBoxing && isPointerTypeCustomized
47 ?
"Yes (By customization)"
49 : srcIsPointer && pointerBoxing && !isPointerTypeCustomized && (!copyConstructible || !triviallyDestructible)
50 ?
"Yes (Value would not be copy-constructible or trivially destructible)"
52 : srcIsPointer && pointerBoxing && !isPointerTypeCustomized && !fitsToPlaceholder
53 ?
"Yes (Value would not fit to placeholder)"
55 : srcIsValue && arrayBoxing && isValueTypeCustomized
56 ?
"Yes (Custom unboxing from array type)"
58 : srcIsValue && arrayBoxing && isPointerTypeCustomized
59 ?
"Yes (Unboxing from array type, customized with pointer type)"
61 : srcIsPointer && arrayBoxing && isPointerTypeCustomized
62 ?
"Yes (Custom unboxing from array type)"
64 : srcIsPointer && arrayBoxing && isValueTypeCustomized
65 ?
"Yes (Unboxing from array type, customized with value type)"
67 : srcIsUnboxableStringType
68 ?
"Yes (Unboxing from character array type)"
70 :
"INTERNAL ERROR IN DBG METHDO: CASE NOT MATCHED (E1)"
73 srcIsValue && isValueTypeCustomized
74 ?
"Forbidden (By customization)"
76 : srcIsValue && pointerBoxing && isPointerTypeCustomized
77 ?
"Not as value (Pointer type is customized)"
79 : srcIsValue && pointerBoxing && !isPointerTypeCustomized && (!copyConstructible || !triviallyDestructible)
80 ?
"Not as value (Not copy-constructible or trivially destructible)"
82 : srcIsValue && pointerBoxing && !isPointerTypeCustomized && !fitsToPlaceholder
83 ?
"Not as value (Does not fit to placeholder)"
85 : srcIsPointer && isPointerTypeCustomized
86 ?
"Forbidden (By customization)"
88 : srcIsPointer && valueBoxing && isValueTypeCustomized
89 ?
"Not as pointer (Value type is customized)"
91 : srcIsPointer && valueBoxing && !isValueTypeCustomized
92 ?
"Not as pointer (Value fits in placeholder and is copy-constructible and trivially destructible)"
95 ?
"Arrays cannot be unboxed"
98 ?
"No (String type is not marked for implicit construction from character array type)"
100 :
"INTERNAL ERROR IN DBG METHOd: CASE NOT MATCHED (E2)"
106 ?
"STATIC VTABLE NOT REGISTERED"
108 ?
"Dynamic Singleton"
109 :
"Static Singleton (Specialized VTableOptimizationTraits)"
116 "An internal error occurred while describing type. Description follows:\n"
120 "An warning occurred while describing type. Description follows:\n"
125 String256 headline; headline <<
'\n' << indent <<
"Associated Specialized Functions:";
126 String256 indent2; indent2 << indent << indent;
127 dumpFunctions( functions, target, headline, indent2, tmpStrings );
145 for(
int theSakeOfAutoTabs= 0 ; theSakeOfAutoTabs < 2 ; ++theSakeOfAutoTabs ) {
147 dumpFunctions( input, result, headline, indent, tmpStrings );
153void dumpFunctions(
const std::vector<std::pair<const std::type_info*,uinteger>>& input,
160 for(
auto& type : input )
163 std::sort( tmpStrings.begin(), tmpStrings.end(),
164 [] (std::tuple<String, uinteger>& a,
165 std::tuple<String, uinteger>& b )
167 return std::get<0>(a).template CompareTo<CHK, lang::Case::Ignore>( std::get<0>(b) ) < 0;
175 auto& args= formatter.Reset();
176 args.Add( indent,
"{} {!ATab5}{:>2})\n",
nullptr,
'(',
nullptr );
177 for(
auto& nameAndUse : tmpStrings ) {
178 args[2]= std::get<0>(nameAndUse);
179 args[4]= std::get<1>(nameAndUse) != (std::numeric_limits<uinteger>::max)()
180 ?
Box( std::get<1>(nameAndUse) )
181 :
Box(
"No default implementation" );
182 formatter.FormatArgs( output, args );
196 for(
int theSakeOfAutoTabs= 0 ; theSakeOfAutoTabs < 2 ; ++theSakeOfAutoTabs ) {
200 dumpVTables( result, vtableNames, staticVtables , includeFunctions );
210 bool includeFunctions ) {
212 result << ( staticVtables ?
A_CHAR(
"Mapped types with static VTables")
213 :
A_CHAR(
"Mapped types with dynamic VTables") );
214 if( includeFunctions )
215 result <<
A_CHAR(
" and their associated specialized functions");
223 for(
int i= 0 ; i < 2; ++i )
224 for(
auto& it : ( i == 0 ? DbgKnownVTables : DbgKnownVTablesArray) ) {
235 temp <<
" ATTENTION: Unregistered customized VTable!!! This is an Error";
237 vtableNames.
Add( temp, it.second );
241 std::sort( vtableNames.begin(), vtableNames.end(),
246 Substring lhs= std::get<0>(a); lhs.TrimStart().ConsumeToken(
' '); lhs.TrimStart();
247 Substring rhs= std::get<0>(b); rhs.TrimStart().ConsumeToken(
' '); rhs.TrimStart();
248 return lhs.CompareTo<CHK, lang::Case::Ignore>( rhs ) < 0;
254 std::vector<std::pair<const std::type_info*,uinteger>> tempFunctions;
255 for(
auto& vtable: vtableNames ) {
256 result << std::get<0>(vtable) <<
NEW_LINE;
257 if( includeFunctions ) {
272 for(
int theSakeOfAutoTabs= 0 ; theSakeOfAutoTabs < 2 ; ++theSakeOfAutoTabs ) {
282 (result <<
"Known Function Declarators And Usage Of Default Implementation:"
286 #if ALIB_DEBUG_CONTAINERS
287 (result <<
NEW_LINE <<
"Metrics Of Custom Function Implementation HashMap: "
297#if ALIB_DEBUG_CONTAINERS
#define ALIB_ASSERT_WARNING(cond, domain,...)
#define ALIB_LOCK_RECURSIVE_WITH(lock)
#define ALIB_ASSERT_ERROR(cond, domain,...)
void Reset(Snapshot snapshot=Snapshot())
integer IndexOf(TChar needle, integer startIdx=0) const
constexpr bool IsNotEmpty() const
void typeInfo(AString &target, const detail::VTable *vtable, const String &indent, bool srcIsPointer, bool srcIsStringType, bool srcIsUnboxableStringType, bool isValueTypeCustomized, bool isPointerTypeCustomized, bool fitsToPlaceholder, bool copyConstructible, bool triviallyDestructible, bool isUnboxable)
std::vector< std::pair< const std::type_info *, uinteger > > GetKnownFunctionTypes()
AString & RemoveNamespaces(AString &string, integer startIndex)
void dumpFunctions(const std::vector< std::pair< const std::type_info *, uinteger > > &input, AString &output, const String &headline, const String &indent, DbgStringTable< uinteger > &tmpStrings)
AString DumpFunctions(const std::vector< std::pair< const std::type_info *, uinteger > > &input, const String &headline, const String &indent)
void getFunctionTypes(const detail::FunctionTable &input, std::vector< std::pair< const std::type_info *, uinteger > > &output)
std::vector< std::pair< const std::type_info *, uinteger > > GetSpecificFunctionTypes(const detail::VTable *vtable)
void dumpVTables(AString &result, DbgStringTable< const detail::VTable * > &vtableNames, bool staticVtables, bool includeFunctions)
AString DumpVTables(bool staticVtables, bool includeFunctions)
void DumpCustomFunctionHashMapMetrics(AString &target, bool detailedBucketList)
void typeName(const detail::VTable *vtable, AString &result)
AString DbgDumpDistribution(const THashtable &hashtable, bool detailedBucketList)
@ Left
Chooses left alignment.
format::Formatter Formatter
Type alias in namespace #"%alib".
constexpr String NULL_STRING
A nulled string of the default character type.
monomem::TLocalAllocator< 8 > LocalAllocator8K
Type alias in namespace #"%alib". Allocates 8kB of stack memory.
LocalString< 64 > String64
Type alias name for #"TLocalString;TLocalString<character,64>".
constexpr CString NEW_LINE
A zero-terminated string containing the new-line character sequence.
boxing::Box Box
Type alias in namespace #"%alib".
strings::TField< character > Field
Type alias in namespace #"%alib".
strings::TString< character > String
Type alias in namespace #"%alib".
LocalString< 1024 > String1K
Type alias name for #"TLocalString;TLocalString<character,1024>".
LocalString< 256 > String256
Type alias name for #"TLocalString;TLocalString<character,256>".
strings::TAString< character, lang::HeapAllocator > AString
Type alias in namespace #"%alib".
LocalString< 512 > String512
Type alias name for #"TLocalString;TLocalString<character,512>".
std::tuple< String, TAssociatedTypes... > ElementType
Shortcut to the std::tuple-type that instantiations of this template class store.
String & Add(const String &src, TArgs &&... args)
The custom function hash.
DbgFactoryType DbgProduction
Debug information.
const MappingType Mapping
@ Static
A static VTable is in place.
@ Unregistered
Not registered, yet.