Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

bracz::linmap< key, value > Class Template Reference

An associative container with map-like semantics using unsorted array. More...

Inheritance diagram for bracz::linmap< key, value >:

Inheritance graph
[legend]
List of all members.

Public Types

typedef key key_type
typedef value data_type
typedef std::pair< key_type,
data_type
value_type
typedef std::allocator< linmap<
key_type, value_type > > 
allocator

Public Member Functions

 linmap ()
void clear ()
data_type &DINLINE operator[] (key_type k)
template<class CmpFn>
void sort (CmpFn fn=CmpFn())
iterator DINLINE begin ()
iterator DINLINE end ()

Private Types

typedef arrayalloc< value_type, 1, 100000 > myallocator_t
 allocator for the blocks

Private Attributes

uint32_t size
 the actual length;
int logsize
 blocksize of the data space
value_typedata
 the actual data space

Static Private Attributes

static myallocator_t myallocator

Friends

class iterator

Classes

class  iterator

Detailed Description

template<class key, class value>
class bracz::linmap< key, value >

An associative container with map-like semantics using unsorted array.

All operations are linear time. However, the overhead is very small. It is very effective if you have only a few elements and only a few lookup/insert operations are performed.

An ordering on the key type is not required.

Iterators are not invalidated by operator[]

Definition at line 29 of file linmap.cpp.


Member Typedef Documentation

template<class key, class value>
typedef std::allocator<linmap<key_type,value_type> > bracz::linmap< key, value >::allocator
 

Definition at line 36 of file linmap.cpp.

template<class key, class value>
typedef value bracz::linmap< key, value >::data_type
 

Definition at line 32 of file linmap.cpp.

template<class key, class value>
typedef key bracz::linmap< key, value >::key_type
 

Definition at line 31 of file linmap.cpp.

template<class key, class value>
typedef arrayalloc<value_type,1,100000> bracz::linmap< key, value >::myallocator_t [private]
 

allocator for the blocks

Definition at line 141 of file linmap.cpp.

template<class key, class value>
typedef std::pair<key_type, data_type> bracz::linmap< key, value >::value_type
 

Definition at line 33 of file linmap.cpp.


Constructor & Destructor Documentation

template<class key, class value>
bracz::linmap< key, value >::linmap  )  [inline]
 

Definition at line 38 of file linmap.cpp.


Member Function Documentation

template<class key, class value>
iterator DINLINE bracz::linmap< key, value >::begin  )  [inline]
 

Definition at line 122 of file linmap.cpp.

template<class key, class value>
void bracz::linmap< key, value >::clear  )  [inline]
 

Definition at line 42 of file linmap.cpp.

Referenced by bracz::linmap< key_type, data_type >::linmap().

template<class key, class value>
iterator DINLINE bracz::linmap< key, value >::end  )  [inline]
 

Definition at line 126 of file linmap.cpp.

template<class key, class value>
data_type& DINLINE bracz::linmap< key, value >::operator[] key_type  k  )  [inline]
 

Definition at line 48 of file linmap.cpp.

template<class key, class value>
template<class CmpFn>
void bracz::linmap< key, value >::sort CmpFn  fn = CmpFn()  )  [inline]
 

Definition at line 79 of file linmap.cpp.


Friends And Related Function Documentation

template<class key, class value>
friend class iterator [friend]
 

Definition at line 120 of file linmap.cpp.

Referenced by bracz::linmap< key_type, data_type >::begin(), and bracz::linmap< key_type, data_type >::end().


Member Data Documentation

template<class key, class value>
value_type* bracz::linmap< key, value >::data [private]
 

the actual data space

Definition at line 138 of file linmap.cpp.

Referenced by bracz::linmap< key_type, data_type >::clear(), bracz::linmap< key, value >::iterator::operator *(), bracz::linmap< key, value >::iterator::operator->(), bracz::linmap< key_type, data_type >::operator[](), and bracz::linmap< key_type, data_type >::sort().

template<class key, class value>
int bracz::linmap< key, value >::logsize [private]
 

blocksize of the data space

Definition at line 135 of file linmap.cpp.

Referenced by bracz::linmap< key_type, data_type >::clear(), and bracz::linmap< key_type, data_type >::operator[]().

template<class key, class value>
TYPENAME linmap< key, value >::myallocator_t bracz::linmap< key, value >::myallocator [static, private]
 

Definition at line 143 of file linmap.cpp.

Referenced by bracz::linmap< key_type, data_type >::operator[]().

template<class key, class value>
uint32_t bracz::linmap< key, value >::size [private]
 

the actual length;

Definition at line 132 of file linmap.cpp.

Referenced by bracz::linmap< key_type, data_type >::clear(), bracz::linmap< key_type, data_type >::end(), bracz::linmap< key_type, data_type >::operator[](), and bracz::linmap< key_type, data_type >::sort().


The documentation for this class was generated from the following file:
Generated on Sun Sep 17 17:57:12 2006 for FIM environment by  doxygen 1.4.4