-
Notifications
You must be signed in to change notification settings - Fork 36
/
tsl-sparse-map.natvis
73 lines (68 loc) · 3.97 KB
/
tsl-sparse-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
<?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::sparse_map<*>" Priority="Medium">
<AlternativeType Name="tsl::sparse_set<*>"/>
<DisplayString>{{ size={m_ht.m_nb_elements} }}</DisplayString>
<Expand>
<Item Name="[bucket_count]" IncludeView="detailed">m_ht.m_bucket_count</Item>
<Item Name="[load_factor]" Condition="m_ht.m_bucket_count != 0" IncludeView="detailed">((float)m_ht.m_nb_elements) / ((float)m_ht.m_bucket_count)</Item>
<Item Name="[load_factor]" Condition="m_ht.m_bucket_count == 0" 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_sparse_buckets"/>
<Variable Name="element" InitialValue="bucket->m_values"/>
<Variable Name="num_elements" InitialValue="bucket->m_nb_elements"/>
<Size>m_ht.m_nb_elements</Size>
<Loop>
<Loop>
<Break Condition="num_elements == 0"/>
<Item>*element</Item>
<Exec>++element</Exec>
<Exec>--num_elements</Exec>
</Loop>
<Break Condition="bucket->m_last_array"/>
<Exec>++bucket</Exec>
<Exec>element = bucket->m_values</Exec>
<Exec>num_elements = bucket->m_nb_elements</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
<!-- Visualization that shows the key in the name column and the key-value pair in the value column -->
<Type Name="tsl::sparse_map<*>" ExcludeView="ShowElementsByIndex" Priority="MediumHigh">
<DisplayString>{{ size={m_ht.m_nb_elements} }}</DisplayString>
<Expand>
<Item Name="[bucket_count]" IncludeView="detailed">m_ht.m_bucket_count</Item>
<Item Name="[load_factor]" Condition="m_ht.m_bucket_count != 0" IncludeView="detailed">((float)m_ht.m_nb_elements) / ((float)m_ht.m_bucket_count)</Item>
<Item Name="[load_factor]" Condition="m_ht.m_bucket_count == 0" 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_sparse_buckets"/>
<Variable Name="element" InitialValue="bucket->m_values"/>
<Variable Name="num_elements" InitialValue="bucket->m_nb_elements"/>
<Size>m_ht.m_nb_elements</Size>
<Loop>
<Loop>
<Break Condition="num_elements == 0"/>
<Item Name="[{element->first}]">*element</Item>
<Exec>++element</Exec>
<Exec>--num_elements</Exec>
</Loop>
<Break Condition="bucket->m_last_array"/>
<Exec>++bucket</Exec>
<Exec>element = bucket->m_values</Exec>
<Exec>num_elements = bucket->m_nb_elements</Exec>
</Loop>
</CustomListItems>
</Expand>
</Type>
<Type Name="tsl::detail_sparse_hash::sparse_hash<*>::sparse_iterator<*>">
<DisplayString Condition="m_sparse_array_it != 0">{*m_sparse_array_it}</DisplayString>
<DisplayString Condition="m_sparse_array_it == 0">end</DisplayString>
<Expand>
<ExpandedItem Condition="m_sparse_array_it != 0">*m_sparse_array_it</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>