summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-10 17:10:42 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-06-10 17:10:42 +0000
commit3f2eba6f19a1edad1aaf47f80ed29f9a7a0d7c76 (patch)
tree74446e56ccc71502be50a655826c2c14ac161381 /libstdc++-v3/include/ext/pb_ds/detail/pat_trie_
parenteae7682a77cf0722e7a0372407b1780e6c978eb0 (diff)
downloadgcc-3f2eba6f19a1edad1aaf47f80ed29f9a7a0d7c76.tar.gz
2011-06-10 Benjamin Kosnik <bkoz@redhat.com>
* include/ext/pb_ds/*: Doxygen markup redo. * include/Makefile.am: Fold in constructors_destructor_fn_imps.hpp. * include/Makefile.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@174917 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/ext/pb_ds/detail/pat_trie_')
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp17
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp26
-rw-r--r--libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/traits.hpp14
3 files changed, 38 insertions, 19 deletions
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
index 46bb016e25e..66272b3119e 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
@@ -90,11 +90,12 @@ namespace __gnu_pbds
/**
* @brief PATRICIA trie.
+ * @ingroup branch-detail
*
- * This implementation loosely borrows ideas from:
- * 1) Fast Mergeable Integer Maps, Okasaki, Gill 1998
- * 2) Ptset: Sets of integers implemented as Patricia trees,
- * Jean-Christophe Filliatr, 2000
+ * This implementation loosely borrows ideas from:
+ * 1) Fast Mergeable Integer Maps, Okasaki, Gill 1998
+ * 2) Ptset: Sets of integers implemented as Patricia trees,
+ * Jean-Christophe Filliatr, 2000
*/
template<typename Key, typename Mapped, typename Node_And_It_Traits,
typename _Alloc>
@@ -388,15 +389,23 @@ namespace __gnu_pbds
inline const_reverse_iterator
rend() const;
+ /// Returns a const node_iterator corresponding to the node at the
+ /// root of the tree.
inline node_const_iterator
node_begin() const;
+ /// Returns a node_iterator corresponding to the node at the
+ /// root of the tree.
inline node_iterator
node_begin();
+ /// Returns a const node_iterator corresponding to a node just
+ /// after a leaf of the tree.
inline node_const_iterator
node_end() const;
+ /// Returns a node_iterator corresponding to a node just
+ /// after a leaf of the tree.
inline node_iterator
node_end();
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp
index b3718b51ed2..f5326e944fb 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/pat_trie_base.hpp
@@ -858,10 +858,10 @@ namespace __gnu_pbds
typedef value_type reference;
typedef value_type const_reference;
- // Metadata type.
+ /// Metadata type.
typedef typename Node::metadata_type metadata_type;
- // Const metadata reference type.
+ /// Const metadata reference type.
typedef typename _Alloc::template rebind<metadata_type> __rebind_m;
typedef typename __rebind_m::other __rebind_ma;
typedef typename __rebind_ma::const_reference metadata_const_reference;
@@ -871,13 +871,13 @@ namespace __gnu_pbds
: m_p_nd(const_cast<node_pointer>(p_nd)), m_p_traits(p_traits)
{ }
- // Subtree valid prefix.
+ /// Subtree valid prefix.
std::pair<a_const_iterator, a_const_iterator>
valid_prefix() const
{ return std::make_pair(pref_begin(), pref_end()); }
- // Const access; returns the __const iterator* associated with
- // the current leaf.
+ /// Const access; returns the __const iterator* associated with
+ /// the current leaf.
const_reference
operator*() const
{
@@ -885,12 +885,12 @@ namespace __gnu_pbds
return _CIterator(m_p_nd);
}
- // Metadata access.
+ /// Metadata access.
metadata_const_reference
get_metadata() const
{ return m_p_nd->get_metadata(); }
- // Returns the number of children in the corresponding node.
+ /// Returns the number of children in the corresponding node.
size_type
num_children() const
{
@@ -901,8 +901,8 @@ namespace __gnu_pbds
return std::distance(inp->begin(), inp->end());
}
- // Returns a __const node __iterator to the corresponding node's
- // i-th child.
+ /// Returns a __const node __iterator to the corresponding node's
+ /// i-th child.
_Node_citer
get_child(size_type i) const
{
@@ -913,12 +913,12 @@ namespace __gnu_pbds
return _Node_citer(*it, m_p_traits);
}
- // Compares content to a different iterator object.
+ /// Compares content to a different iterator object.
bool
operator==(const _Node_citer& other) const
{ return m_p_nd == other.m_p_nd; }
- // Compares content (negatively) to a different iterator object.
+ /// Compares content (negatively) to a different iterator object.
bool
operator!=(const _Node_citer& other) const
{ return m_p_nd != other.m_p_nd; }
@@ -959,7 +959,7 @@ namespace __gnu_pbds
: base_type(p_nd, p_traits)
{ }
- // Access; returns the iterator* associated with the current leaf.
+ /// Access; returns the iterator* associated with the current leaf.
reference
operator*() const
{
@@ -967,7 +967,7 @@ namespace __gnu_pbds
return iterator(base_type::m_p_nd);
}
- // Returns a node __iterator to the corresponding node's i-th child.
+ /// Returns a node __iterator to the corresponding node's i-th child.
_Node_iter
get_child(size_type i) const
{
diff --git a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/traits.hpp b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/traits.hpp
index 2e64c52480f..6113393da0e 100644
--- a/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/traits.hpp
+++ b/libstdc++-v3/include/ext/pb_ds/detail/pat_trie_/traits.hpp
@@ -49,6 +49,7 @@ namespace __gnu_pbds
namespace detail
{
/// Specialization.
+ /// @ingroup traits
template<typename Key,
typename Mapped,
typename _ATraits,
@@ -69,6 +70,7 @@ namespace __gnu_pbds
typedef base_type::_Metadata<metadata_type, _Alloc> metadata;
typedef _ATraits access_traits;
+ /// Type for synthesized traits.
typedef __gnu_pbds::detail::synth_access_traits<type_traits, false, access_traits> synth_access_traits;
typedef base_type::_Node_base<synth_access_traits, metadata> node;
@@ -81,17 +83,21 @@ namespace __gnu_pbds
typedef base_type::_Iter<node, leaf, head, inode, false> reverse_iterator;
typedef base_type::_CIter<node, leaf, head, inode, false> const_reverse_iterator;
-
+ /// This is an iterator to an iterator: it iterates over nodes,
+ /// and de-referencing it returns one of the tree's iterators.
typedef base_type::_Node_citer<node, leaf, head, inode, const_iterator, iterator, _Alloc> node_const_iterator;
typedef base_type::_Node_iter<node, leaf, head, inode, const_iterator, iterator, _Alloc> node_iterator;
+ /// Type for node update.
typedef Node_Update<node_const_iterator, node_iterator, _ATraits, _Alloc> node_update;
typedef null_node_update<node_const_iterator, node_iterator, _ATraits, _Alloc>* null_node_update_pointer;
};
+
/// Specialization.
+ /// @ingroup traits
template<typename Key,
typename _ATraits,
template<typename Node_CItr,
@@ -110,6 +116,8 @@ namespace __gnu_pbds
typedef typename trie_node_metadata_dispatch<Key, null_type, _ATraits, Node_Update, _Alloc>::type metadata_type;
typedef base_type::_Metadata<metadata_type, _Alloc> metadata;
typedef _ATraits access_traits;
+
+ /// Type for synthesized traits.
typedef __gnu_pbds::detail::synth_access_traits<type_traits, true, access_traits> synth_access_traits;
typedef base_type::_Node_base<synth_access_traits, metadata> node;
@@ -122,11 +130,13 @@ namespace __gnu_pbds
typedef base_type::_CIter<node, leaf, head, inode, false> const_reverse_iterator;
typedef const_reverse_iterator reverse_iterator;
-
+ /// This is an iterator to an iterator: it iterates over nodes,
+ /// and de-referencing it returns one of the tree's iterators.
typedef base_type::_Node_citer<node, leaf, head, inode, const_iterator, iterator, _Alloc> node_const_iterator;
typedef node_const_iterator node_iterator;
+ /// Type for node update.
typedef Node_Update<node_const_iterator, node_iterator, _ATraits, _Alloc> node_update;
typedef null_node_update<node_const_iterator, node_const_iterator, _ATraits, _Alloc>* null_node_update_pointer;