NLMISC::CStaticMap< Key, Typ, Comp > Class Template Reference

Implemented with a std::vector Use it not like a map : begin by adding all your values with add()/del()/fromMap() and then call endAdd() that performs a slow sort on the vector and then call find() to find the element you want. More...

#include <static_map.h>

List of all members.

Classes

class  value_compare

Public Types

typedef Key key_type
typedef Typ data_type
typedef Typ mapped_type
typedef std::pair< Key, Typ > value_type
typedef Comp key_compare
typedef std::vector
< value_type >::reference 
reference
typedef std::vector
< value_type >
::const_reference 
const_reference
typedef std::vector
< value_type >::iterator 
iterator
typedef std::vector
< value_type >::const_iterator 
const_iterator
typedef std::vector
< value_type >
::reverse_iterator 
reverse_iterator
typedef std::vector
< value_type >
::const_reverse_iterator 
const_reverse_iterator
typedef std::vector
< value_type >::size_type 
size_type
typedef std::vector
< value_type >
::difference_type 
difference_type

Public Member Functions

 CStaticMap ()
 CStaticMap (const Comp &__comp)
 CStaticMap (const_iterator __first, const_iterator __last)
 CStaticMap (const_iterator __first, const_iterator __last, const Comp &__comp)
 CStaticMap (const CStaticMap< Key, Typ, Comp > &__x)
CStaticMap< Key, Typ, Comp > & operator= (const CStaticMap< Key, Typ, Comp > &__x)
key_compare key_comp () const
value_compare value_comp () const
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
reverse_iterator rbegin ()
const_reverse_iterator rbegin () const
reverse_iterator rend ()
const_reverse_iterator rend () const
bool empty () const
size_type size () const
size_type max_size () const
Typ & operator[] (const key_type &__k)
void swap (CStaticMap< Key, Typ, Comp > &__x)
void reserve (size_type n)
void add (const value_type &__v)
void fromMap (const std::map< Key, Typ, Comp > &m)
void endAdd ()
void del (iterator __position)
size_type del (const key_type &__x)
void del (iterator __first, iterator __last)
void clear ()
iterator find (const key_type &__x)
const_iterator find (const key_type &__x) const
size_type count (const key_type &__x) const

Private Attributes

std::vector< value_type_Data
bool _DataSorted
Comp _CompFunc

Detailed Description

template<class Key, class Typ, class Comp = std::less<Key>>
class NLMISC::CStaticMap< Key, Typ, Comp >

Implemented with a std::vector Use it not like a map : begin by adding all your values with add()/del()/fromMap() and then call endAdd() that performs a slow sort on the vector and then call find() to find the element you want.

If you have not called endAdd() its done in find(), but take care that endAdd() is slow.

Author:
Matthieu 'Trap' Besson
Nevrax France
Date:
October 2003

Definition at line 55 of file static_map.h.


Member Typedef Documentation

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::const_iterator NLMISC::CStaticMap< Key, Typ, Comp >::const_iterator

Definition at line 91 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::const_reference NLMISC::CStaticMap< Key, Typ, Comp >::const_reference

Definition at line 89 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::const_reverse_iterator NLMISC::CStaticMap< Key, Typ, Comp >::const_reverse_iterator

Definition at line 93 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef Typ NLMISC::CStaticMap< Key, Typ, Comp >::data_type

Definition at line 59 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::difference_type NLMISC::CStaticMap< Key, Typ, Comp >::difference_type

Definition at line 95 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::iterator NLMISC::CStaticMap< Key, Typ, Comp >::iterator

Definition at line 90 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef Comp NLMISC::CStaticMap< Key, Typ, Comp >::key_compare

Definition at line 62 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef Key NLMISC::CStaticMap< Key, Typ, Comp >::key_type

Definition at line 58 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef Typ NLMISC::CStaticMap< Key, Typ, Comp >::mapped_type

Definition at line 60 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::reference NLMISC::CStaticMap< Key, Typ, Comp >::reference

Definition at line 88 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::reverse_iterator NLMISC::CStaticMap< Key, Typ, Comp >::reverse_iterator

Definition at line 92 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::vector<value_type>::size_type NLMISC::CStaticMap< Key, Typ, Comp >::size_type

Definition at line 94 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
typedef std::pair<Key, Typ> NLMISC::CStaticMap< Key, Typ, Comp >::value_type

Definition at line 61 of file static_map.h.


Constructor & Destructor Documentation

template<class Key, class Typ, class Comp = std::less<Key>>
NLMISC::CStaticMap< Key, Typ, Comp >::CStaticMap (  )  [inline]

Definition at line 99 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
NLMISC::CStaticMap< Key, Typ, Comp >::CStaticMap ( const Comp &  __comp  )  [inline, explicit]

Definition at line 103 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
NLMISC::CStaticMap< Key, Typ, Comp >::CStaticMap ( const_iterator  __first,
const_iterator  __last 
) [inline]

Definition at line 107 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
NLMISC::CStaticMap< Key, Typ, Comp >::CStaticMap ( const_iterator  __first,
const_iterator  __last,
const Comp &  __comp 
) [inline]

Definition at line 114 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
NLMISC::CStaticMap< Key, Typ, Comp >::CStaticMap ( const CStaticMap< Key, Typ, Comp > &  __x  )  [inline]

Definition at line 122 of file static_map.h.


Member Function Documentation

template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::add ( const value_type __v  )  [inline]

Definition at line 171 of file static_map.h.

Referenced by NLMISC::CSheetId::loadSheetId().

template<class Key, class Typ, class Comp = std::less<Key>>
const_iterator NLMISC::CStaticMap< Key, Typ, Comp >::begin ( void   )  const [inline]

Definition at line 139 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
iterator NLMISC::CStaticMap< Key, Typ, Comp >::begin ( void   )  [inline]
template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::clear ( void   )  [inline]

Definition at line 214 of file static_map.h.

Referenced by NLMISC::CSheetId::loadSheetId().

template<class Key, class Typ, class Comp = std::less<Key>>
size_type NLMISC::CStaticMap< Key, Typ, Comp >::count ( const key_type __x  )  const [inline]

Definition at line 243 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::del ( iterator  __first,
iterator  __last 
) [inline]

Definition at line 208 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
size_type NLMISC::CStaticMap< Key, Typ, Comp >::del ( const key_type __x  )  [inline]

Definition at line 202 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::del ( iterator  __position  )  [inline]

Definition at line 196 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
bool NLMISC::CStaticMap< Key, Typ, Comp >::empty (  )  const [inline]

Definition at line 146 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
const_iterator NLMISC::CStaticMap< Key, Typ, Comp >::end ( void   )  const [inline]

Definition at line 141 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
iterator NLMISC::CStaticMap< Key, Typ, Comp >::end ( void   )  [inline]
template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::endAdd (  )  [inline]
template<class Key, class Typ, class Comp = std::less<Key>>
const_iterator NLMISC::CStaticMap< Key, Typ, Comp >::find ( const key_type __x  )  const [inline]

Definition at line 232 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
iterator NLMISC::CStaticMap< Key, Typ, Comp >::find ( const key_type __x  )  [inline]
template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::fromMap ( const std::map< Key, Typ, Comp > &  m  )  [inline]

Definition at line 177 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
key_compare NLMISC::CStaticMap< Key, Typ, Comp >::key_comp (  )  const [inline]

Definition at line 136 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
size_type NLMISC::CStaticMap< Key, Typ, Comp >::max_size (  )  const [inline]

Definition at line 148 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
CStaticMap<Key, Typ, Comp>& NLMISC::CStaticMap< Key, Typ, Comp >::operator= ( const CStaticMap< Key, Typ, Comp > &  __x  )  [inline]

Definition at line 127 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
Typ& NLMISC::CStaticMap< Key, Typ, Comp >::operator[] ( const key_type __k  )  [inline]

Definition at line 150 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
const_reverse_iterator NLMISC::CStaticMap< Key, Typ, Comp >::rbegin (  )  const [inline]

Definition at line 143 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
reverse_iterator NLMISC::CStaticMap< Key, Typ, Comp >::rbegin (  )  [inline]

Definition at line 142 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
const_reverse_iterator NLMISC::CStaticMap< Key, Typ, Comp >::rend (  )  const [inline]

Definition at line 145 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
reverse_iterator NLMISC::CStaticMap< Key, Typ, Comp >::rend (  )  [inline]

Definition at line 144 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::reserve ( size_type  n  )  [inline]

Definition at line 166 of file static_map.h.

Referenced by NLMISC::CSheetId::loadSheetId().

template<class Key, class Typ, class Comp = std::less<Key>>
size_type NLMISC::CStaticMap< Key, Typ, Comp >::size (  )  const [inline]

Definition at line 147 of file static_map.h.

Referenced by NLMISC::CSheetId::loadSheetId().

template<class Key, class Typ, class Comp = std::less<Key>>
void NLMISC::CStaticMap< Key, Typ, Comp >::swap ( CStaticMap< Key, Typ, Comp > &  __x  )  [inline]

Definition at line 158 of file static_map.h.

template<class Key, class Typ, class Comp = std::less<Key>>
value_compare NLMISC::CStaticMap< Key, Typ, Comp >::value_comp (  )  const [inline]

Member Data Documentation

template<class Key, class Typ, class Comp = std::less<Key>>
Comp NLMISC::CStaticMap< Key, Typ, Comp >::_CompFunc [private]

Definition at line 83 of file static_map.h.

Referenced by NLMISC::CStaticMap< uint32, CChar >::value_comp().

template<class Key, class Typ, class Comp = std::less<Key>>
std::vector<value_type> NLMISC::CStaticMap< Key, Typ, Comp >::_Data [private]
template<class Key, class Typ, class Comp = std::less<Key>>
bool NLMISC::CStaticMap< Key, Typ, Comp >::_DataSorted [private]

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

Generated on Thu Jan 7 08:30:19 2010 for NeL by  doxygen 1.6.1