STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Types | Private Attributes | List of all members
__gnu_pbds::detail::rc< _Node, _Alloc > Class Template Reference

Redundant binary counter. More...

#include <ext/pb_ds/detail/rc_binomial_heap_/rc.hpp>

Public Types

typedef node_pointer entry
 
typedef entry_const_pointer const_iterator
 

Public Member Functions

 rc ()
 
 rc (const rc &)
 
void swap (rc &)
 
void push (entry)
 
node_pointer top () const
 
void pop ()
 
bool empty () const
 
size_type size () const
 
void clear ()
 
const const_iterator begin () const
 
const const_iterator end () const
 

Private Types

enum  { max_entries = sizeof(size_type) << 3 }
 
typedef _Alloc allocator_type
 
typedef allocator_type::size_type size_type
 
typedef _Node node
 
typedef _Alloc::template
rebind< node
__rebind_n
 
typedef __rebind_n::other::pointer node_pointer
 
typedef _Alloc::template
rebind< node_pointer
__rebind_np
 
typedef __rebind_np::other::pointer entry_pointer
 
typedef
__rebind_np::other::const_pointer 
entry_const_pointer
 

Private Attributes

node_pointer m_a_entries [max_entries]
 
size_type m_over_top
 

Detailed Description

template<typename _Node, typename _Alloc>
class __gnu_pbds::detail::rc< _Node, _Alloc >

Redundant binary counter.

Member Typedef Documentation

template<typename _Node, typename _Alloc>
typedef _Alloc::template rebind<node> __gnu_pbds::detail::rc< _Node, _Alloc >::__rebind_n
private
template<typename _Node, typename _Alloc>
typedef _Alloc::template rebind<node_pointer> __gnu_pbds::detail::rc< _Node, _Alloc >::__rebind_np
private
template<typename _Node, typename _Alloc>
typedef _Alloc __gnu_pbds::detail::rc< _Node, _Alloc >::allocator_type
private
template<typename _Node, typename _Alloc>
typedef entry_const_pointer __gnu_pbds::detail::rc< _Node, _Alloc >::const_iterator
template<typename _Node, typename _Alloc>
typedef node_pointer __gnu_pbds::detail::rc< _Node, _Alloc >::entry
template<typename _Node, typename _Alloc>
typedef __rebind_np::other::const_pointer __gnu_pbds::detail::rc< _Node, _Alloc >::entry_const_pointer
private
template<typename _Node, typename _Alloc>
typedef __rebind_np::other::pointer __gnu_pbds::detail::rc< _Node, _Alloc >::entry_pointer
private
template<typename _Node, typename _Alloc>
typedef _Node __gnu_pbds::detail::rc< _Node, _Alloc >::node
private
template<typename _Node, typename _Alloc>
typedef __rebind_n::other::pointer __gnu_pbds::detail::rc< _Node, _Alloc >::node_pointer
private
template<typename _Node, typename _Alloc>
typedef allocator_type::size_type __gnu_pbds::detail::rc< _Node, _Alloc >::size_type
private

Member Enumeration Documentation

template<typename _Node, typename _Alloc>
anonymous enum
private
Enumerator
max_entries 
66  {
67  max_entries = sizeof(size_type) << 3
68  };
allocator_type::size_type size_type
Definition: rc.hpp:54

Constructor & Destructor Documentation

template<typename _Node , typename _Alloc >
__gnu_pbds::detail::rc< _Node, _Alloc >::rc ( )
122  : m_over_top(0)
123  { PB_DS_ASSERT_VALID((*this)) }
size_type m_over_top
Definition: rc.hpp:117
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
template<typename _Node , typename _Alloc >
__gnu_pbds::detail::rc< _Node, _Alloc >::rc ( const rc< _Node, _Alloc > &  other)
127  : m_over_top(0)
128  { PB_DS_ASSERT_VALID((*this)) }
size_type m_over_top
Definition: rc.hpp:117
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324

Member Function Documentation

template<typename _Node , typename _Alloc >
const rc< _Node, _Alloc >::const_iterator __gnu_pbds::detail::rc< _Node, _Alloc >::begin ( ) const
209  { return& m_a_entries[0]; }
node_pointer m_a_entries[max_entries]
Definition: rc.hpp:116
template<typename _Node , typename _Alloc >
void __gnu_pbds::detail::rc< _Node, _Alloc >::clear ( )
199  {
200  PB_DS_ASSERT_VALID((*this))
201  m_over_top = 0;
202  PB_DS_ASSERT_VALID((*this))
203  }
size_type m_over_top
Definition: rc.hpp:117
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
template<typename _Node , typename _Alloc >
bool __gnu_pbds::detail::rc< _Node, _Alloc >::empty ( ) const
inline
184  {
185  PB_DS_ASSERT_VALID((*this))
186  return m_over_top == 0;
187  }
size_type m_over_top
Definition: rc.hpp:117
return(unsigned int) __res
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
template<typename _Node , typename _Alloc >
const rc< _Node, _Alloc >::const_iterator __gnu_pbds::detail::rc< _Node, _Alloc >::end ( ) const
215  { return& m_a_entries[m_over_top]; }
size_type m_over_top
Definition: rc.hpp:117
node_pointer m_a_entries[max_entries]
Definition: rc.hpp:116
template<typename _Node , typename _Alloc >
void __gnu_pbds::detail::rc< _Node, _Alloc >::pop ( )
inline
163  {
164  PB_DS_ASSERT_VALID((*this))
166  --m_over_top;
167  PB_DS_ASSERT_VALID((*this))
168  }
size_type m_over_top
Definition: rc.hpp:117
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
bool empty() const
Definition: rc.hpp:183
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
template<typename _Node , typename _Alloc >
void __gnu_pbds::detail::rc< _Node, _Alloc >::push ( entry  p_nd)
inline
152  {
153  PB_DS_ASSERT_VALID((*this))
155  m_a_entries[m_over_top++] = p_nd;
156  PB_DS_ASSERT_VALID((*this))
157  }
size_type m_over_top
Definition: rc.hpp:117
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
node_pointer m_a_entries[max_entries]
Definition: rc.hpp:116
template<typename _Node , typename _Alloc >
rc< _Node, _Alloc >::size_type __gnu_pbds::detail::rc< _Node, _Alloc >::size ( ) const
inline
193  { return m_over_top; }
size_type m_over_top
Definition: rc.hpp:117
template<typename _Node , typename _Alloc >
void __gnu_pbds::detail::rc< _Node, _Alloc >::swap ( rc< _Node, _Alloc > &  other)
inline
134  {
135  PB_DS_ASSERT_VALID((*this))
136  PB_DS_ASSERT_VALID(other)
137 
138  const size_type over_top = std::max(m_over_top, other.m_over_top);
139 
140  for (size_type i = 0; i < over_top; ++i)
141  std::swap(m_a_entries[i], other.m_a_entries[i]);
142 
143  std::swap(m_over_top, other.m_over_top);
144  PB_DS_ASSERT_VALID((*this))
145  PB_DS_ASSERT_VALID(other)
146  }
size_type m_over_top
Definition: rc.hpp:117
allocator_type::size_type size_type
Definition: rc.hpp:54
void swap(rc &)
Definition: rc.hpp:133
const _Tp & max(const _Tp &__a, const _Tp &__b)
Equivalent to std::max.
Definition: base.h:150
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
node_pointer m_a_entries[max_entries]
Definition: rc.hpp:116
template<typename _Node , typename _Alloc >
rc< _Node, _Alloc >::node_pointer __gnu_pbds::detail::rc< _Node, _Alloc >::top ( ) const
inline
174  {
175  PB_DS_ASSERT_VALID((*this))
177  return *(m_a_entries + m_over_top - 1);
178  }
size_type m_over_top
Definition: rc.hpp:117
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
bool empty() const
Definition: rc.hpp:183
return(unsigned int) __res
#define PB_DS_ASSERT_VALID(X)
Definition: binary_heap_.hpp:324
node_pointer m_a_entries[max_entries]
Definition: rc.hpp:116

Member Data Documentation

template<typename _Node, typename _Alloc>
node_pointer __gnu_pbds::detail::rc< _Node, _Alloc >::m_a_entries[max_entries]
private
template<typename _Node, typename _Alloc>
size_type __gnu_pbds::detail::rc< _Node, _Alloc >::m_over_top
private

The documentation for this class was generated from the following file: