mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-10 18:43:54 -06:00
`til::linear_flat_set` is a primitive hash map with linear probing. The implementation is slightly complicated due to the use of templates. I've strongly considered just writing multiple copies of this class, by hand since the code is indeed fairly trivial but ended up deciding against it, because this templated approach makes testing easier. This class is in the order of 10x faster than `std::unordered_map`.
126 lines
5.3 KiB
XML
126 lines
5.3 KiB
XML
|
||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||
<!-- See https://docs.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2017#BKMK_Syntax_reference for documentation -->
|
||
<Type Name="TextColor">
|
||
<DisplayString Condition="_meta==ColorType::IsIndex256">{{Index256:{_index}}}</DisplayString>
|
||
<DisplayString Condition="_meta==ColorType::IsIndex16">{{Index16:{_index}}}</DisplayString>
|
||
<DisplayString Condition="_meta==ColorType::IsDefault">{{Default}}</DisplayString>
|
||
<DisplayString Condition="_meta==ColorType::IsRgb">{{RGB:{_red},{_green},{_blue}}}</DisplayString>
|
||
<Expand></Expand>
|
||
</Type>
|
||
|
||
<Type Name="TextAttribute">
|
||
<!-- You can't do too much trickiness inside the DisplayString format
|
||
string, so we'd have to add entries for each flag if we really
|
||
wanted them to show up like that. -->
|
||
<DisplayString>{{FG: {_foreground}, BG: {_background}, Legacy: {_wAttrLegacy}, {_extendedAttrs}}</DisplayString>
|
||
<Expand>
|
||
<Item Name="Legacy">_wAttrLegacy</Item>
|
||
<Item Name="FG">_foreground</Item>
|
||
<Item Name="BG">_background</Item>
|
||
<Item Name="Extended">_extendedAttrs</Item>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="Microsoft::Console::Types::Viewport">
|
||
<!-- Can't call functions in here -->
|
||
<DisplayString>{{LT({_sr.left}, {_sr.top}) RB({_sr.right}, {_sr.bottom}) [{_sr.right-_sr.left+1} x { _sr.bottom-_sr.top+1}]}}</DisplayString>
|
||
<Expand>
|
||
<ExpandedItem>_sr</ExpandedItem>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="_COORD">
|
||
<DisplayString>{{{X},{Y}}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="_SMALL_RECT">
|
||
<DisplayString>{{LT({Left}, {Top}) RB({Right}, {Bottom}) In:[{Right-Left+1} x {Bottom-Top+1}] Ex:[{Right-Left} x {Bottom-Top}]}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="ROW">
|
||
<DisplayString>{_chars.data(),[_charOffsets[_columnCount]]}</DisplayString>
|
||
<StringView>_chars.data(),[_charOffsets[_columnCount]]</StringView>
|
||
<Expand>
|
||
<Item Name="_chars">_chars.data(),[_charOffsets[_columnCount]]</Item>
|
||
<Item Name="_charOffsets">_charOffsets.data(),[_charOffsets.size()]</Item>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="std::unique_ptr<TextBuffer,std::default_delete<TextBuffer>>">
|
||
<Expand>
|
||
<ExpandedItem>_Mypair._Myval2</ExpandedItem>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="KeyEvent">
|
||
<DisplayString Condition="_keyDown">{{↓ wch:{_charData} mod:{_activeModifierKeys} repeat:{_repeatCount} vk:{_virtualKeyCode} vsc:{_virtualScanCode}}</DisplayString>
|
||
<DisplayString Condition="!_keyDown">{{↑ wch:{_charData} mod:{_activeModifierKeys} repeat:{_repeatCount} vk:{_virtualKeyCode} vsc:{_virtualScanCode}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="til::size">
|
||
<DisplayString>{{W: {_width,d} x H: {_height,d} -> A: {_width * _height, d}}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="til::point">
|
||
<DisplayString>{{X: {_x,d}, Y: {_y,d}}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="til::rect">
|
||
<DisplayString>{{L: {_topLeft._x}, T: {_topLeft._y}, R: {_bottomRight._x} B: {_bottomRight._y} [W: {_bottomRight._x - _topLeft._x} x H: {_bottomRight._y - _topLeft._y} -> A: {(_bottomRight._x - _topLeft._x) * (_bottomRight._y - _topLeft._y)}]}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="til::color">
|
||
<DisplayString>{{RGB: {(int)r,d}, {(int)g,d}, {(int)b,d}; α: {(int)a,d}}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="til::rle<*>">
|
||
<DisplayString>{{Size: {_total_length,d}}}</DisplayString>
|
||
<Expand>
|
||
<Item Name="[size]">_total_length</Item>
|
||
<ExpandedItem>_runs</ExpandedItem>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="til::details::rle_const_iterator<*>">
|
||
<DisplayString>{{run of {_it->first,d} for {_it->second,d} at {_usage,d}}}</DisplayString>
|
||
</Type>
|
||
|
||
<Type Name="til::small_vector<*>">
|
||
<DisplayString>{{ size={_size} }}</DisplayString>
|
||
<Expand>
|
||
<Item Name="[capacity]" ExcludeView="simple">_capacity</Item>
|
||
<Item Name="[size]" ExcludeView="simple">_size</Item>
|
||
<ArrayItems>
|
||
<Size>_size</Size>
|
||
<ValuePointer>_data</ValuePointer>
|
||
</ArrayItems>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="til::small_vector_iterator<*>">
|
||
<AlternativeType Name="til::small_vector_const_iterator<*>" />
|
||
<SmartPointer Usage="Indexable">_ptr,na</SmartPointer>
|
||
<Expand>
|
||
<Item Name="[ptr]">_ptr</Item>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="til::generational<*>">
|
||
<DisplayString>{{ gen={_generation._value}, {_value} }}</DisplayString>
|
||
<Expand>
|
||
<ExpandedItem>_value</ExpandedItem>
|
||
</Expand>
|
||
</Type>
|
||
|
||
<Type Name="til::linear_flat_set<*,*>">
|
||
<DisplayString>{{ size={_load / $T2} }}</DisplayString>
|
||
<Expand>
|
||
<ArrayItems>
|
||
<Size>_capacity</Size>
|
||
<ValuePointer>_map._Mypair._Myval2</ValuePointer>
|
||
</ArrayItems>
|
||
</Expand>
|
||
</Type>
|
||
</AutoVisualizer>
|