SEGMENTED_ARRAY< T, block_size > Class Template Reference

#include <segmented_array.h>

Collaboration diagram for SEGMENTED_ARRAY< T, block_size >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T base_type
typedef T value_type
typedef value_typepointer
typedef const value_typeconst_pointer
typedef value_typereference
typedef const value_typeconst_reference
typedef UINT size_type
typedef INT difference_type
typedef
SEGMENTED_ARRAY_ITERATOR< self
*, T, pointer, reference
iterator
typedef
SEGMENTED_ARRAY_ITERATOR
< const self *, T,
const_pointer, const_reference
const_iterator

Public Member Functions

 SEGMENTED_ARRAY (MEM_POOL *m=Malloc_Mem_Pool)
 ~SEGMENTED_ARRAY ()
UINT Block_size () const
UINT Size () const
UINT size () const
TEntry (UINT idx)
const TEntry (UINT idx) const
Toperator[] (UINT idx)
const Toperator[] (UINT idx) const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
TNew_entry (UINT &idx)
UINT Insert (const T &x)
void Delete_last ()
void Delete_last (UINT n)
void Delete_down_to (UINT idx)
UINT Insert (const T *x, UINT n_elemt)
UINT Transfer (T *x, UINT n_elemt)
void Reserve (UINT n_elemt)
UINT Get_block_size (UINT idx) const
UINT Block_index (UINT idx) const
UINT Block_index_end () const
TBlock_begin (UINT block_idx)
const TBlock_begin (UINT block_idx) const
TBlock_end (UINT block_idx)
const TBlock_end (UINT block_idx) const

Private Types

typedef SEGMENTED_ARRAY< T,
block_size > 
self

Private Member Functions

UINT Round_up (UINT s)
void Update_Map (T *marker, UINT new_size, BOOL own_memory)
void Pop_Map ()
void Allocate ()
TNew_entry ()
void Copy (const T *x, UINT n)
UINT next_block_idx (UINT block_idx) const

Private Attributes

std::vector< std::pair< T
*, BOOL >, mempool_allocator
< std::pair< T *, BOOL > > > 
map
MEM_POOLpool
UINT size_
UINT max_size_
INT block_base
UINT next_block_size
Tblock

Detailed Description

template<class T, UINT block_size = 128>
class SEGMENTED_ARRAY< T, block_size >

Definition at line 145 of file segmented_array.h.


Member Typedef Documentation

template<class T, UINT block_size = 128>
typedef T SEGMENTED_ARRAY< T, block_size >::base_type

Definition at line 163 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef SEGMENTED_ARRAY_ITERATOR<const self*, T, const_pointer, const_reference> SEGMENTED_ARRAY< T, block_size >::const_iterator

Definition at line 177 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef const value_type* SEGMENTED_ARRAY< T, block_size >::const_pointer

Definition at line 167 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef const value_type& SEGMENTED_ARRAY< T, block_size >::const_reference

Definition at line 169 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef INT SEGMENTED_ARRAY< T, block_size >::difference_type

Definition at line 171 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef SEGMENTED_ARRAY_ITERATOR<self*, T, pointer, reference> SEGMENTED_ARRAY< T, block_size >::iterator

Definition at line 174 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef value_type* SEGMENTED_ARRAY< T, block_size >::pointer

Definition at line 166 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef value_type& SEGMENTED_ARRAY< T, block_size >::reference

Definition at line 168 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef SEGMENTED_ARRAY<T, block_size> SEGMENTED_ARRAY< T, block_size >::self [private]

Definition at line 160 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef UINT SEGMENTED_ARRAY< T, block_size >::size_type

Definition at line 170 of file segmented_array.h.

template<class T, UINT block_size = 128>
typedef T SEGMENTED_ARRAY< T, block_size >::value_type

Definition at line 165 of file segmented_array.h.


Constructor & Destructor Documentation

template<class T, UINT block_size = 128>
SEGMENTED_ARRAY< T, block_size >::SEGMENTED_ARRAY ( MEM_POOL m = Malloc_Mem_Pool  )  [inline]
template<class T, UINT block_size = 128>
SEGMENTED_ARRAY< T, block_size >::~SEGMENTED_ARRAY (  )  [inline]

Member Function Documentation

template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Allocate (  )  [inline, private]
template<class T, UINT block_size = 128>
const_iterator SEGMENTED_ARRAY< T, block_size >::begin (  )  const [inline]

Definition at line 262 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Block_end(), and SEGMENTED_ARRAY< T, block_size >::map.

Here is the call graph for this function:

template<class T, UINT block_size = 128>
iterator SEGMENTED_ARRAY< T, block_size >::begin (  )  [inline]

Definition at line 253 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Block_end(), and SEGMENTED_ARRAY< T, block_size >::map.

Referenced by Make_Function_Type().

Here is the call graph for this function:

template<class T, UINT block_size = 128>
const T* SEGMENTED_ARRAY< T, block_size >::Block_begin ( UINT  block_idx  )  const [inline]

Definition at line 315 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::map.

template<class T, UINT block_size = 128>
T* SEGMENTED_ARRAY< T, block_size >::Block_begin ( UINT  block_idx  )  [inline]
template<class T, UINT block_size = 128>
const T* SEGMENTED_ARRAY< T, block_size >::Block_end ( UINT  block_idx  )  const [inline]

Definition at line 322 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Block_begin(), and SEGMENTED_ARRAY< T, block_size >::next_block_idx().

Here is the call graph for this function:

template<class T, UINT block_size = 128>
T* SEGMENTED_ARRAY< T, block_size >::Block_end ( UINT  block_idx  )  [inline]

Definition at line 317 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Block_begin(), and SEGMENTED_ARRAY< T, block_size >::next_block_idx().

Referenced by SEGMENTED_ARRAY< T, block_size >::begin().

Here is the call graph for this function:

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Block_index ( UINT  idx  )  const [inline]

Definition at line 309 of file segmented_array.h.

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Block_index_end (  )  const [inline]

Definition at line 312 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::map.

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Block_size (  )  const [inline]

Definition at line 236 of file segmented_array.h.

template<class T, UINT block_size = 128>
void SEGMENTED_ARRAY< T, block_size >::Copy ( const T x,
UINT  n 
) [inline, private]
template<class T, UINT block_size = 128>
void SEGMENTED_ARRAY< T, block_size >::Delete_down_to ( UINT  idx  )  [inline]

Definition at line 285 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Delete_last(), and SEGMENTED_ARRAY< T, block_size >::size_.

Here is the call graph for this function:

template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Delete_last ( UINT  n  )  [inline]
template<class T, UINT block_size = 128>
void SEGMENTED_ARRAY< T, block_size >::Delete_last ( void   )  [inline]
template<class T, UINT block_size = 128>
const_iterator SEGMENTED_ARRAY< T, block_size >::end (  )  const [inline]
template<class T, UINT block_size = 128>
iterator SEGMENTED_ARRAY< T, block_size >::end (  )  [inline]
template<class T, UINT block_size = 128>
const T& SEGMENTED_ARRAY< T, block_size >::Entry ( UINT  idx  )  const [inline]
template<class T, UINT block_size = 128>
T& SEGMENTED_ARRAY< T, block_size >::Entry ( UINT  idx  )  [inline]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Get_block_size ( UINT  idx  )  const [inline]

Definition at line 304 of file segmented_array.h.

References min, SEGMENTED_ARRAY< T, block_size >::next_block_idx(), and SEGMENTED_ARRAY< T, block_size >::size_.

Referenced by Copy_array_range(), Find_entry_if(), For_all_blocks(), and For_all_entries().

Here is the call graph for this function:

template<class T , UINT block_size>
UINT SEGMENTED_ARRAY< T, block_size >::Insert ( const T x,
UINT  n_elemt 
) [inline]
template<class T , UINT block_size>
UINT SEGMENTED_ARRAY< T, block_size >::Insert ( const T x  )  [inline]
template<class T, UINT block_size = 128>
T& SEGMENTED_ARRAY< T, block_size >::New_entry ( UINT idx  )  [inline]

Definition at line 272 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::New_entry(), and SEGMENTED_ARRAY< T, block_size >::size_.

Referenced by SEGMENTED_ARRAY< T, block_size >::New_entry().

Here is the call graph for this function:

template<class T, UINT block_size = 128>
T& SEGMENTED_ARRAY< T, block_size >::New_entry (  )  [inline, private]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::next_block_idx ( UINT  block_idx  )  const [inline, private]
template<class T, UINT block_size = 128>
const T& SEGMENTED_ARRAY< T, block_size >::operator[] ( UINT  idx  )  const [inline]

Definition at line 251 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Entry().

Here is the call graph for this function:

template<class T, UINT block_size = 128>
T& SEGMENTED_ARRAY< T, block_size >::operator[] ( UINT  idx  )  [inline]

Definition at line 250 of file segmented_array.h.

References SEGMENTED_ARRAY< T, block_size >::Entry().

Here is the call graph for this function:

template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Pop_Map (  )  [inline, private]
template<class T, UINT block_size = 128>
void SEGMENTED_ARRAY< T, block_size >::Reserve ( UINT  n_elemt  )  [inline]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Round_up ( UINT  s  )  [inline, private]

Definition at line 183 of file segmented_array.h.

Referenced by SEGMENTED_ARRAY< T, block_size >::Allocate().

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::size (  )  const [inline]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Size ( void   )  const [inline]
template<class T , UINT block_size>
UINT SEGMENTED_ARRAY< T, block_size >::Transfer ( T x,
UINT  n_elemt 
) [inline]
template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Update_Map ( T marker,
UINT  new_size,
BOOL  own_memory 
) [inline, private]

Member Data Documentation

template<class T, UINT block_size = 128>
T* SEGMENTED_ARRAY< T, block_size >::block [private]
template<class T, UINT block_size = 128>
INT SEGMENTED_ARRAY< T, block_size >::block_base [private]
template<class T, UINT block_size = 128>
std::vector<std::pair<T *, BOOL>, mempool_allocator<std::pair<T *,BOOL> > > SEGMENTED_ARRAY< T, block_size >::map [private]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::max_size_ [private]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::next_block_size [private]
template<class T, UINT block_size = 128>
MEM_POOL* SEGMENTED_ARRAY< T, block_size >::pool [private]
template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::size_ [private]

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

Generated on Tue Nov 17 06:41:33 2009 for Open64 (mfef90, whirl2f, and IR tools) by  doxygen 1.6.1