forked from Tessil/hopscotch-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tsl-hopscotch-map.natvis
87 lines (83 loc) · 5.6 KB
/
tsl-hopscotch-map.natvis
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<!-- Written in VC 2017 15.7 but is expected to be compatible with VC 2015 -->
<!-- Visualization that shows the index in the name column and the key-value pair in the value column -->
<Type Name="tsl::hopscotch_map<*>" Priority="Medium">
<AlternativeType Name="tsl::bhopscotch_map<*>"/>
<AlternativeType Name="tsl::bhopscotch_set<*>"/>
<AlternativeType Name="tsl::hopscotch_set<*>"/>
<DisplayString>{{ size={m_ht.m_nb_elements} }}</DisplayString>
<Expand>
<Item Name="[bucket_count]" IncludeView="detailed">m_ht.m_buckets_data._Mypair._Myval2._Mylast - m_ht.m_buckets_data._Mypair._Myval2._Myfirst</Item>
<Item Name="[load_factor]" Condition="m_ht.m_buckets_data._Mypair._Myval2._Myfirst != m_ht.m_buckets_data._Mypair._Myval2._Mylast" IncludeView="detailed">
((float)m_ht.m_nb_elements) / ((float)(m_ht.m_buckets_data._Mypair._Myval2._Mylast - m_ht.m_buckets_data._Mypair._Myval2._Myfirst))
</Item>
<Item Name="[load_factor]" Condition="m_ht.m_buckets_data._Mypair._Myval2._Myfirst == m_ht.m_buckets_data._Mypair._Myval2._Mylast" IncludeView="detailed">
0
</Item>
<Item Name="[max_load_factor]" IncludeView="detailed">m_ht.m_max_load_factor</Item>
<CustomListItems>
<Variable Name="bucket" InitialValue="m_ht.m_buckets"/>
<Loop>
<!-- Bucket is either pointing to a static empty bucket (then m_nb_elements == 0) or to a value in m_ht.m_buckets_data.
Break early if m_nb_elements == 0 to avoid using the static empty bucket. -->
<Break Condition="m_ht.m_nb_elements == 0 || bucket == m_ht.m_buckets_data._Mypair._Myval2._Mylast"/>
<Item Condition="(bucket->m_neighborhood_infos & 1) != 0">*bucket</Item>
<Exec>++bucket</Exec>
</Loop>
</CustomListItems>
<Synthetic Name="overflown elements">
<Expand>
<ExpandedItem>m_ht.m_overflow_elements</ExpandedItem>
</Expand>
</Synthetic>
</Expand>
</Type>
<!-- Visualization that shows the key in the name column and the key-value pair in the value column -->
<Type Name="tsl::hopscotch_map<*>" ExcludeView="ShowElementsByIndex" Priority="MediumHigh">
<AlternativeType Name="tsl::bhopscotch_map<*>"/>
<DisplayString>{{ size={m_ht.m_nb_elements} }}</DisplayString>
<Expand>
<Item Name="[bucket_count]" IncludeView="detailed">m_ht.m_buckets_data._Mypair._Myval2._Mylast - m_ht.m_buckets_data._Mypair._Myval2._Myfirst</Item>
<Item Name="[load_factor]" Condition="m_ht.m_buckets_data._Mypair._Myval2._Myfirst != m_ht.m_buckets_data._Mypair._Myval2._Mylast" IncludeView="detailed">
((float)m_ht.m_nb_elements) / ((float)(m_ht.m_buckets_data._Mypair._Myval2._Mylast - m_ht.m_buckets_data._Mypair._Myval2._Myfirst))
</Item>
<Item Name="[load_factor]" Condition="m_ht.m_buckets_data._Mypair._Myval2._Myfirst == m_ht.m_buckets_data._Mypair._Myval2._Mylast" IncludeView="detailed">
0
</Item>
<Item Name="[max_load_factor]" IncludeView="detailed">m_ht.m_max_load_factor</Item>
<CustomListItems>
<Variable Name="bucket" InitialValue="m_ht.m_buckets"/>
<Loop>
<!-- Bucket is either pointing to a static empty bucket (then m_nb_elements == 0) or to a value in m_ht.m_buckets_data.
Break early if m_nb_elements == 0 to avoid using the static empty bucket. -->
<Break Condition="m_ht.m_nb_elements == 0 || bucket == m_ht.m_buckets_data._Mypair._Myval2._Mylast"/>
<Item Name="[{reinterpret_cast<std::pair<$T1,$T2>*>(&bucket->m_value)->first}]" Condition="(bucket->m_neighborhood_infos & 1) != 0">
*bucket
</Item>
<Exec>++bucket</Exec>
</Loop>
</CustomListItems>
<Synthetic Name="overflown elements">
<Expand>
<ExpandedItem>m_ht.m_overflow_elements</ExpandedItem>
</Expand>
</Synthetic>
</Expand>
</Type>
<Type Name="tsl::detail_hopscotch_hash::hopscotch_hash<*>::hopscotch_iterator<*>">
<DisplayString Condition="m_buckets_iterator._Ptr != m_buckets_end_iterator._Ptr">{m_buckets_iterator}</DisplayString>
<DisplayString Condition="m_buckets_iterator._Ptr == m_buckets_end_iterator._Ptr">{m_overflow_iterator}</DisplayString>
<Expand>
<ExpandedItem Condition="m_buckets_iterator._Ptr != m_buckets_end_iterator._Ptr">m_buckets_iterator</ExpandedItem>
<ExpandedItem Condition="m_buckets_iterator._Ptr == m_buckets_end_iterator._Ptr">m_overflow_iterator</ExpandedItem>
</Expand>
</Type>
<Type Name="tsl::detail_hopscotch_hash::hopscotch_bucket<*>">
<DisplayString Condition="(m_neighborhood_infos & 1) == 0">empty</DisplayString>
<DisplayString Condition="(m_neighborhood_infos & 1) != 0">{*reinterpret_cast<$T1*>(&m_value)}</DisplayString>
<Expand>
<ExpandedItem Condition="(m_neighborhood_infos & 1) != 0">*reinterpret_cast<$T1*>(&m_value)</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>