mirror of
https://github.com/boostorg/bloom.git
synced 2026-01-19 04:02:11 +00:00
added boost_bloom.natvis (#6)
* added boost_bloom.natvis * removed ExcludeView attributes * added capacity as an item plus a view to the array * fixed allocator type * used Synthetic for [array]
This commit is contained in:
@@ -236,3 +236,12 @@ Note that `array()` is a span over `unsigned char`+++s+++ whereas
|
||||
capacities are measured in bits, so `array.size()` is
|
||||
`capacity() / CHAR_BIT`.
|
||||
|
||||
== Debugging
|
||||
|
||||
=== Visual Studio Natvis
|
||||
|
||||
Add the link:../../extra/boost_bloom.natvis[`boost_bloom.natvis`^] visualizer
|
||||
to your project to allow for user-friendly inspection of `boost::bloom::filter`+++s+++.
|
||||
|
||||
image::natvis.png[align=center, title="View of a `boost::bloom::filter` with `boost_bloom.natvis`."]
|
||||
|
||||
|
||||
BIN
doc/img/natvis.png
Normal file
BIN
doc/img/natvis.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
48
extra/boost_bloom.natvis
Normal file
48
extra/boost_bloom.natvis
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2025 Joaquin M Lopez Munoz.
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
See https://www.boost.org/libs/bloom for library home page.
|
||||
-->
|
||||
|
||||
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
|
||||
|
||||
<Type Name="boost::bloom::filter<*>" Inheritable="false">
|
||||
<Intrinsic Name="core" Expression="*static_cast<super*>(this)" />
|
||||
<Intrinsic Name="has_array" Expression="core().ar.data!=nullptr" />
|
||||
<Intrinsic Name="data" Expression="has_array()?core().ar.buckets:nullptr" />
|
||||
<Intrinsic
|
||||
Name="array_size"
|
||||
Expression="
|
||||
has_array()?
|
||||
core().hs.rng*super::bucket_size+(super::used_value_size-super::bucket_size):
|
||||
0"
|
||||
/>
|
||||
<Intrinsic Name="capacity" Expression="array_size()*8" />
|
||||
|
||||
<DisplayString>{{ capacity={capacity()} }}</DisplayString>
|
||||
<Expand>
|
||||
<Item Name="[hash_function]">
|
||||
*reinterpret_cast<hasher*>(static_cast<hash_base*>(this))
|
||||
</Item>
|
||||
<Item Name="[allocator]">
|
||||
*reinterpret_cast<super::allocator_type*>(static_cast<super::allocator_base*>(this))
|
||||
</Item>
|
||||
<Item Name="[capacity]">
|
||||
capacity()
|
||||
</Item>
|
||||
<Synthetic Name="[array]">
|
||||
<DisplayString>{{ data={(void*)data()} size={array_size()} }}</DisplayString>
|
||||
<Expand>
|
||||
<ArrayItems>
|
||||
<Size>array_size()</Size>
|
||||
<ValuePointer>data()</ValuePointer>
|
||||
</ArrayItems>
|
||||
</Expand>
|
||||
</Synthetic>
|
||||
</Expand>
|
||||
</Type>
|
||||
|
||||
</AutoVisualizer>
|
||||
Reference in New Issue
Block a user