Public Types | Public Member Functions | Private Member Functions | Private Attributes

SORTED_MAP< KEY, RANGE > Struct Template Reference

#include <sorted_map.h>

Collaboration diagram for SORTED_MAP< KEY, RANGE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef pair< KEY, RANGE > MAP_ELEMENT
typedef vector< MAP_ELEMENTMAP_VECTOR
typedef MAP_VECTOR::size_type MAP_SIZE

Public Member Functions

 SORTED_MAP ()
 SORTED_MAP (MAP_SIZE chunksize)
 SORTED_MAP (const MAP_VECTOR &vector)
bool empty () const
MAP_SIZE size () const
MAP_SIZE capacity () const
void clear ()
void push_back (const MAP_ELEMENT &amap)
const RANGE & operator[] (KEY k) const
RANGE & operator[] (KEY k)

Private Member Functions

MAP_SIZE _binary_search (MAP_SIZE from, MAP_SIZE till, KEY k)
void _sort ()
BOOL _is_sorted () const

Private Attributes

BOOL _sorted
MAP_SIZE _chunksize
MAP_VECTOR _map

Detailed Description

template<class KEY, class RANGE>
struct SORTED_MAP< KEY, RANGE >

Definition at line 57 of file sorted_map.h.


Member Typedef Documentation

template<class KEY, class RANGE>
typedef pair<KEY, RANGE> SORTED_MAP< KEY, RANGE >::MAP_ELEMENT

Definition at line 61 of file sorted_map.h.

template<class KEY, class RANGE>
typedef MAP_VECTOR::size_type SORTED_MAP< KEY, RANGE >::MAP_SIZE

Definition at line 63 of file sorted_map.h.

template<class KEY, class RANGE>
typedef vector<MAP_ELEMENT> SORTED_MAP< KEY, RANGE >::MAP_VECTOR

Definition at line 62 of file sorted_map.h.


Constructor & Destructor Documentation

template<class KEY, class RANGE>
SORTED_MAP< KEY, RANGE >::SORTED_MAP (  )  [inline]

Definition at line 91 of file sorted_map.h.

template<class KEY, class RANGE>
SORTED_MAP< KEY, RANGE >::SORTED_MAP ( MAP_SIZE  chunksize  )  [inline]

Definition at line 93 of file sorted_map.h.

template<class KEY, class RANGE>
SORTED_MAP< KEY, RANGE >::SORTED_MAP ( const MAP_VECTOR vector  )  [inline]

Definition at line 96 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_is_sorted(), and SORTED_MAP< KEY, RANGE >::_sorted.

Here is the call graph for this function:


Member Function Documentation

template<class KEY , class RANGE >
SORTED_MAP< KEY, RANGE >::MAP_SIZE SORTED_MAP< KEY, RANGE >::_binary_search ( MAP_SIZE  from,
MAP_SIZE  till,
KEY  k 
) [private]

Definition at line 152 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_map, SORTED_MAP< KEY, RANGE >::_sort(), SORTED_MAP< KEY, RANGE >::_sorted, and idx.

Referenced by SORTED_MAP< KEY, RANGE >::operator[]().

Here is the call graph for this function:

template<class KEY, class RANGE>
BOOL SORTED_MAP< KEY, RANGE >::_is_sorted (  )  const [inline, private]

Definition at line 79 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_map, and SORTED_MAP< KEY, RANGE >::size().

Referenced by SORTED_MAP< KEY, RANGE >::SORTED_MAP().

Here is the call graph for this function:

template<class KEY, class RANGE>
void SORTED_MAP< KEY, RANGE >::_sort (  )  [inline, private]
template<class KEY, class RANGE>
MAP_SIZE SORTED_MAP< KEY, RANGE >::capacity (  )  const [inline]

Definition at line 111 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_map.

template<class KEY, class RANGE>
void SORTED_MAP< KEY, RANGE >::clear (  )  [inline]
template<class KEY, class RANGE>
bool SORTED_MAP< KEY, RANGE >::empty (  )  const [inline]

Definition at line 101 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_map.

Referenced by SORTED_MAP< KEY, RANGE >::push_back().

template<class KEY, class RANGE>
RANGE& SORTED_MAP< KEY, RANGE >::operator[] ( KEY  k  )  [inline]

Definition at line 139 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_binary_search(), SORTED_MAP< KEY, RANGE >::_map, idx, and Is_True.

Here is the call graph for this function:

template<class KEY, class RANGE>
const RANGE& SORTED_MAP< KEY, RANGE >::operator[] ( KEY  k  )  const [inline]

Definition at line 131 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_binary_search(), SORTED_MAP< KEY, RANGE >::_map, idx, and Is_True.

Here is the call graph for this function:

template<class KEY, class RANGE>
void SORTED_MAP< KEY, RANGE >::push_back ( const MAP_ELEMENT amap  )  [inline]
template<class KEY, class RANGE>
MAP_SIZE SORTED_MAP< KEY, RANGE >::size (  )  const [inline]

Definition at line 106 of file sorted_map.h.

References SORTED_MAP< KEY, RANGE >::_map.

Referenced by SORTED_MAP< KEY, RANGE >::_is_sorted().


Member Data Documentation

template<class KEY, class RANGE>
MAP_SIZE SORTED_MAP< KEY, RANGE >::_chunksize [private]

Definition at line 68 of file sorted_map.h.

Referenced by SORTED_MAP< KEY, RANGE >::push_back().

template<class KEY, class RANGE>
MAP_VECTOR SORTED_MAP< KEY, RANGE >::_map [private]
template<class KEY, class RANGE>
BOOL SORTED_MAP< KEY, RANGE >::_sorted [private]

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