OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SEGMENTED_ARRAY< T, block_size > Class Template Reference

#include <segmented_array.h>

Collaboration diagram for SEGMENTED_ARRAY< T, block_size >:
Collaboration graph

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
 
T & Entry (UINT idx)
 
const T & Entry (UINT idx) const
 
T & operator[] (UINT idx)
 
const T & operator[] (UINT idx) const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
T & New_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
 
T * Block_begin (UINT block_idx)
 
const T * Block_begin (UINT block_idx) const
 
T * Block_end (UINT block_idx)
 
const T * Block_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 ()
 
T & New_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
 
T * block
 

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

Definition at line 218 of file segmented_array.h.

template<class T, UINT block_size = 128>
SEGMENTED_ARRAY< T, block_size >::~SEGMENTED_ARRAY ( )
inline

Definition at line 224 of file segmented_array.h.

References MEM_POOL_FREE(), and pool.

Here is the call graph for this function:

Member Function Documentation

template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Allocate ( )
private

Definition at line 382 of file segmented_array.h.

References Is_True, MEM_POOL_Alloc, pool, and TRUE.

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

Definition at line 253 of file segmented_array.h.

Referenced by Make_Function_Type().

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.

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

Definition at line 314 of file segmented_array.h.

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.

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.

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.

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.

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 
)
inlineprivate

Definition at line 201 of file segmented_array.h.

References OA::n.

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.

template<class T, UINT block_size = 128>
void SEGMENTED_ARRAY< T, block_size >::Delete_last ( void  )
inline
template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Delete_last ( UINT  n)

Definition at line 406 of file segmented_array.h.

References OA::n.

template<class T, UINT block_size = 128>
iterator SEGMENTED_ARRAY< T, block_size >::end ( )
inline
template<class T, UINT block_size = 128>
const_iterator SEGMENTED_ARRAY< T, block_size >::end ( ) const
inline

Definition at line 266 of file segmented_array.h.

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

Definition at line 241 of file segmented_array.h.

References Is_True.

Referenced by ST_ATTR_TABLE::operator()(), and ST_ATTR_TABLE::operator[]().

template<class T, UINT block_size = 128>
const T& SEGMENTED_ARRAY< T, block_size >::Entry ( UINT  idx) const
inline

Definition at line 246 of file segmented_array.h.

References Is_True.

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 idx, and min.

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

template<class T , UINT block_size>
UINT SEGMENTED_ARRAY< T, block_size >::Insert ( const T &  x)
inline
template<class T , UINT block_size>
UINT SEGMENTED_ARRAY< T, block_size >::Insert ( const T *  x,
UINT  n_elemt 
)

Definition at line 432 of file segmented_array.h.

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().

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

Here is the call graph for this function:

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::next_block_idx ( UINT  block_idx) const
inlineprivate

Definition at line 208 of file segmented_array.h.

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.

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.

template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Pop_Map ( )
private

Definition at line 348 of file segmented_array.h.

References idx, Is_True, MEM_POOL_FREE(), NULL, and pool.

Here is the call graph for this function:

template<class T, UINT block_size = 128>
void SEGMENTED_ARRAY< T, block_size >::Reserve ( UINT  n_elemt)
inline

Definition at line 298 of file segmented_array.h.

Referenced by Copy_array_range().

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::Round_up ( UINT  s)
inlineprivate

Definition at line 183 of file segmented_array.h.

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::size ( ) const
inline
template<class T , UINT block_size>
UINT SEGMENTED_ARRAY< T, block_size >::Transfer ( T *  x,
UINT  n_elemt 
)

Definition at line 454 of file segmented_array.h.

References FALSE.

Referenced by WN_get_global_symtab(), and xlate_SYMTAB().

template<class T , UINT block_size>
void SEGMENTED_ARRAY< T, block_size >::Update_Map ( T *  marker,
UINT  new_size,
BOOL  own_memory 
)
inlineprivate

Definition at line 332 of file segmented_array.h.

Member Data Documentation

template<class T, UINT block_size = 128>
T* SEGMENTED_ARRAY< T, block_size >::block
private

Definition at line 158 of file segmented_array.h.

template<class T, UINT block_size = 128>
INT SEGMENTED_ARRAY< T, block_size >::block_base
private

Definition at line 154 of file segmented_array.h.

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

Definition at line 149 of file segmented_array.h.

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::max_size_
private

Definition at line 153 of file segmented_array.h.

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::next_block_size
private

Definition at line 157 of file segmented_array.h.

template<class T, UINT block_size = 128>
MEM_POOL* SEGMENTED_ARRAY< T, block_size >::pool
private

Definition at line 151 of file segmented_array.h.

template<class T, UINT block_size = 128>
UINT SEGMENTED_ARRAY< T, block_size >::size_
private

Definition at line 152 of file segmented_array.h.


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