libmoost
moost::container::index_translator< TFrom, TTo, TMap > Class Template Reference

#include <index_translator.hpp>

List of all members.

Public Types

typedef
policies::map_policy_selector
< TFrom, TTo, TMap >
::policy_type 
map_policy_t

Public Member Functions

 index_translator ()
 index_translator (const map_policy_t &mapInitPolicy)
int add (const TFrom &id)
TTo find_index (const TFrom &id) const
bool find_index (const TFrom &id, TTo &result_index) const
TFrom get_id (TTo index) const
TFrom safe_get_id (TTo index) const
size_t size () const
bool empty () const
bool operator() (const TFrom &id, TTo &result_index) const

Private Attributes

TMap m_item_index
std::vector< TFrom > m_ids

Detailed Description

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
class moost::container::index_translator< TFrom, TTo, TMap >

with std::map typedef moost::container::index_translator< int, int, std::map<int, int> > idx_trans_t; with google::sparse_hash typedef moost::container::index_translator< int, int, google::sparse_hash_map<int,int> > idx_trans_t;

Definition at line 48 of file index_translator.hpp.


Member Typedef Documentation

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
typedef policies::map_policy_selector<TFrom, TTo, TMap>::policy_type moost::container::index_translator< TFrom, TTo, TMap >::map_policy_t

Definition at line 52 of file index_translator.hpp.


Constructor & Destructor Documentation

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
moost::container::index_translator< TFrom, TTo, TMap >::index_translator ( ) [inline]

Definition at line 56 of file index_translator.hpp.

Here is the call graph for this function:

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
moost::container::index_translator< TFrom, TTo, TMap >::index_translator ( const map_policy_t mapInitPolicy) [inline]

Definition at line 62 of file index_translator.hpp.

Here is the call graph for this function:


Member Function Documentation

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
int moost::container::index_translator< TFrom, TTo, TMap >::add ( const TFrom &  id) [inline]

Definition at line 67 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
bool moost::container::index_translator< TFrom, TTo, TMap >::empty ( ) const [inline]

Definition at line 118 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
TTo moost::container::index_translator< TFrom, TTo, TMap >::find_index ( const TFrom &  id) const [inline]

Definition at line 81 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
bool moost::container::index_translator< TFrom, TTo, TMap >::find_index ( const TFrom &  id,
TTo &  result_index 
) const [inline]

Definition at line 90 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
TFrom moost::container::index_translator< TFrom, TTo, TMap >::get_id ( TTo  index) const [inline]

Definition at line 100 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
bool moost::container::index_translator< TFrom, TTo, TMap >::operator() ( const TFrom &  id,
TTo &  result_index 
) const [inline]

Definition at line 125 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
TFrom moost::container::index_translator< TFrom, TTo, TMap >::safe_get_id ( TTo  index) const [inline]

Definition at line 106 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
size_t moost::container::index_translator< TFrom, TTo, TMap >::size ( ) const [inline]

Definition at line 113 of file index_translator.hpp.


Member Data Documentation

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
std::vector<TFrom> moost::container::index_translator< TFrom, TTo, TMap >::m_ids [private]

Definition at line 131 of file index_translator.hpp.

template<typename TFrom = int, typename TTo = int, typename TMap = google::dense_hash_map<TFrom, TTo>>
TMap moost::container::index_translator< TFrom, TTo, TMap >::m_item_index [private]

Definition at line 130 of file index_translator.hpp.


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