MCPcopy Create free account
hub / github.com/1a1a11a/libCacheSim / sparsetable

Class sparsetable

libCacheSim/dataStructure/sparsepp/spp.h:1785–2473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1783// ---------------------------------------------------------------------------
1784template <class T, class Alloc>
1785class sparsetable
1786{
1787public:
1788 typedef T value_type;
1789 typedef Alloc allocator_type;
1790 typedef sparsegroup<value_type, allocator_type> group_type;
1791
1792private:
1793 typedef typename Alloc::template rebind<group_type>::other group_alloc_type;
1794 typedef typename group_alloc_type::size_type group_size_type;
1795
1796public:
1797 // Basic types
1798 // -----------
1799 typedef typename allocator_type::size_type size_type;
1800 typedef typename allocator_type::difference_type difference_type;
1801 typedef value_type& reference;
1802 typedef const value_type& const_reference;
1803 typedef value_type* pointer;
1804 typedef const value_type* const_pointer;
1805
1806 typedef group_type& GroupsReference;
1807 typedef const group_type& GroupsConstReference;
1808
1809 typedef typename group_type::ne_iterator ColIterator;
1810 typedef typename group_type::const_ne_iterator ColConstIterator;
1811
1812 typedef table_iterator<sparsetable<T, allocator_type> > iterator; // defined with index
1813 typedef const_table_iterator<sparsetable<T, allocator_type> > const_iterator; // defined with index
1814 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
1815 typedef std::reverse_iterator<iterator> reverse_iterator;
1816
1817 // These are our special iterators, that go over non-empty buckets in a
1818 // table. These aren't const only because you can change non-empty bcks.
1819 // ----------------------------------------------------------------------
1820 typedef Two_d_iterator<T,
1821 group_type *,
1822 ColIterator,
1823 std::bidirectional_iterator_tag> ne_iterator;
1824
1825 typedef Two_d_iterator<const T,
1826 const group_type *,
1827 ColConstIterator,
1828 std::bidirectional_iterator_tag> const_ne_iterator;
1829
1830 // Another special iterator: it frees memory as it iterates (used to resize).
1831 // Obviously, you can only iterate over it once, which is why it's an input iterator
1832 // ---------------------------------------------------------------------------------
1833 typedef Two_d_destructive_iterator<T,
1834 group_type *,
1835 ColIterator,
1836 std::input_iterator_tag,
1837 allocator_type> destructive_iterator;
1838
1839 typedef std::reverse_iterator<ne_iterator> reverse_ne_iterator;
1840 typedef std::reverse_iterator<const_ne_iterator> const_reverse_ne_iterator;
1841
1842

Callers

nothing calls this directly

Calls 1

swapMethod · 0.95

Tested by

no test coverage detected